dsrc isn't necessary for this repo
[client-tools.git] / src / external / 3rd / library / directx9 / include / dxerr9.h
blob3fc6fba30784ba47f7d77e0ebe5b0eb0ceac9e39
1 /*==========================================================================;
4 * File: dxerr9.h
5 * Content: DirectX Error Library Include File
7 ****************************************************************************/
9 #ifndef _DXERR9_H_
10 #define _DXERR9_H_
12 #ifdef __cplusplus
13 extern "C" {
14 #endif //__cplusplus
17 // DXGetErrorString9
18 //
19 // Desc: Converts a DirectX 9 or earlier HRESULT to a string
21 // Args: HRESULT hr Can be any error code from
22 // D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
24 // Return: Converted string
26 const char* WINAPI DXGetErrorString9A(HRESULT hr);
27 const WCHAR* WINAPI DXGetErrorString9W(HRESULT hr);
29 #ifdef UNICODE
30 #define DXGetErrorString9 DXGetErrorString9W
31 #else
32 #define DXGetErrorString9 DXGetErrorString9A
33 #endif
37 // DXGetErrorDescription9
38 //
39 // Desc: Returns a string description of a DirectX 9 or earlier HRESULT
41 // Args: HRESULT hr Can be any error code from
42 // D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
44 // Return: String description
46 const char* WINAPI DXGetErrorDescription9A(HRESULT hr);
47 const WCHAR* WINAPI DXGetErrorDescription9W(HRESULT hr);
49 #ifdef UNICODE
50 #define DXGetErrorDescription9 DXGetErrorDescription9W
51 #else
52 #define DXGetErrorDescription9 DXGetErrorDescription9A
53 #endif
57 // DXTrace
59 // Desc: Outputs a formatted error message to the debug stream
61 // Args: CHAR* strFile The current file, typically passed in using the
62 // __FILE__ macro.
63 // DWORD dwLine The current line number, typically passed in using the
64 // __LINE__ macro.
65 // HRESULT hr An HRESULT that will be traced to the debug stream.
66 // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
67 // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
69 // Return: The hr that was passed in.
71 HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox );
72 HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox );
74 #ifdef UNICODE
75 #define DXTrace DXTraceW
76 #else
77 #define DXTrace DXTraceA
78 #endif
82 // Helper macros
84 #if defined(DEBUG) | defined(_DEBUG)
85 #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
86 #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
87 #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
88 #else
89 #define DXTRACE_MSG(str) (0L)
90 #define DXTRACE_ERR(str,hr) (hr)
91 #define DXTRACE_ERR_MSGBOX(str,hr) (hr)
92 #endif
95 #ifdef __cplusplus
97 #endif //__cplusplus
99 #endif // _DXERR9_H_