Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.2 KiB

  1. /*==========================================================================;
  2. *
  3. *
  4. * File: dxerr8.h
  5. * Content: DirectX Error Library Include File
  6. *
  7. ****************************************************************************/
  8. #ifndef _DXERR8_H_
  9. #define _DXERR8_H_
  10. //
  11. // DXGetErrorString8
  12. //
  13. // Desc: Converts an DirectX HRESULT to a string
  14. //
  15. // Args: HRESULT hr Can be any error code from
  16. // DPLAY D3D8 D3DX8 DMUSIC DSOUND
  17. //
  18. // Return: Converted string
  19. //
  20. const char* __stdcall DXGetErrorString8A(HRESULT hr);
  21. const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr);
  22. #ifdef UNICODE
  23. #define DXGetErrorString8 DXGetErrorString8W
  24. #else
  25. #define DXGetErrorString8 DXGetErrorString8A
  26. #endif
  27. //
  28. // DXTrace
  29. //
  30. // Desc: Outputs a formatted error message to the debug stream
  31. //
  32. // Args: CHAR* strFile The current file, typically passed in using the
  33. // __FILE__ macro.
  34. // DWORD dwLine The current line number, typically passed in using the
  35. // __LINE__ macro.
  36. // HRESULT hr An HRESULT that will be traced to the debug stream.
  37. // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
  38. // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
  39. //
  40. // Return: The hr that was passed in.
  41. //
  42. HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
  43. HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
  44. #ifdef UNICODE
  45. #define DXTrace DXTraceW
  46. #else
  47. #define DXTrace DXTraceA
  48. #endif
  49. //
  50. // Helper macros
  51. //
  52. #if defined(DEBUG) | defined(_DEBUG)
  53. #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
  54. #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
  55. #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
  56. #else
  57. #define DXTRACE_MSG(str) (0L)
  58. #define DXTRACE_ERR(str,hr) (hr)
  59. #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
  60. #endif
  61. #endif