' ########################################################################################
' Microsoft Windows
' File: Errors.inc
' Contents: ActiveMovie error defines.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_errors_PBI)
#DEFINE PBX_errors_PBI
%EQUATE `ERRORS_INC = 1
'// codes 0-01ff are reserved for OLE
%EQUATE `VFW_FIRST_CODE = &H200
%EQUATE `MAX_ERROR_TEXT_LEN = 160
#INCLUDE ONCE "Legacy/Media/vfwmsgs.inc" ' // includes all message definitions
'typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD);
'typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD);
'FUNCTION AMGETERRORTEXTPROCA ( ' BYVAL hr AS LONG ' [in] HRESULT hr
' , BYREF pBuffer AS ASCIIZ ' [in] CHAR* pBuffer
' , BYVAL MaxLen AS DWORD ' [in] DWORD MaxLen
' ) AS LONG
'FUNCTION AMGETERRORTEXTPROCW ( ' BYVAL hr AS LONG ' [in] HRESULT hr
' , BYVAL pBuffer AS DWORD ' [in] CHAR* pBuffer
' , BYVAL MaxLen AS DWORD ' [in] DWORD MaxLen
' ) AS LONG
'AMOVIEAPI DWORD WINAPI AMGetErrorTextA( HRESULT hr , char *pbuffer , DWORD MaxLen);
'AMOVIEAPI DWORD WINAPI AMGetErrorTextW( HRESULT hr , WCHAR *pbuffer , DWORD MaxLen);
DECLARE FUNCTION AMGetErrorTextA LIB "quartz.dll" ALIAS "AMGetErrorTextA" ( BYVAL hr AS LONG , BYREF pBuffer AS ASCIIZ , BYVAL MaxLen AS QUAD ) AS QUAD
DECLARE FUNCTION AMGetErrorTextW LIB "quartz.dll" ALIAS "AMGetErrorTextW" ( BYVAL hr AS LONG
 , BYREF pBuffer AS WSTRINGZ
 , BYVAL MaxLen AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO AMGetErrorText = AMGetErrorTextW
#ELSE
 MACRO AMGetErrorText = AMGetErrorTextA
#ENDIF
#ENDIF
