4 * DirectX Error Library
6 * Copyright (C) Microsoft Corporation. All rights reserved.
8 * SPDX-License-Identifier: MIT
9 * See LICENSES/README.md for more information.
12 // This version only supports UNICODE.
16 #if !defined(NOMINMAX)
27 //--------------------------------------------------------------------------------------
29 //--------------------------------------------------------------------------------------
30 const WCHAR
* WINAPI
DXGetErrorStringW( _In_ HRESULT hr
);
32 #define DXGetErrorString DXGetErrorStringW
34 //--------------------------------------------------------------------------------------
35 // DXGetErrorDescription has to be modified to return a copy in a buffer rather than
36 // the original static string.
37 //--------------------------------------------------------------------------------------
38 void WINAPI
DXGetErrorDescriptionW( _In_ HRESULT hr
, _Out_cap_(count
) WCHAR
* desc
, _In_
size_t count
);
40 #define DXGetErrorDescription DXGetErrorDescriptionW
42 //--------------------------------------------------------------------------------------
45 // Desc: Outputs a formatted error message to the debug stream
47 // Args: WCHAR* strFile The current file, typically passed in using the
49 // DWORD dwLine The current line number, typically passed in using the
51 // HRESULT hr An HRESULT that will be traced to the debug stream.
52 // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
53 // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
55 // Return: The hr that was passed in.
56 //--------------------------------------------------------------------------------------
57 HRESULT WINAPI
DXTraceW( _In_z_
const WCHAR
* strFile
, _In_ DWORD dwLine
, _In_ HRESULT hr
, _In_opt_
const WCHAR
* strMsg
, _In_
bool bPopMsgBox
);
59 #define DXTrace DXTraceW
61 //--------------------------------------------------------------------------------------
65 //--------------------------------------------------------------------------------------
66 #if defined(DEBUG) || defined(_DEBUG)
67 #define DXTRACE_MSG(str) DXTrace( __FILEW__, (DWORD)__LINE__, 0, str, false )
68 #define DXTRACE_ERR(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, false )
69 #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, true )
71 #define DXTRACE_MSG(str) (0L)
72 #define DXTRACE_ERR(str,hr) (hr)
73 #define DXTRACE_ERR_MSGBOX(str,hr) (hr)