mirror of https://github.com/snes9xgit/snes9x.git
ANSI support for dxerr
Legacy implementration of dxerr for snes9x only had Unicode support. These changes add NASI support as well.
This commit is contained in:
parent
09df5e1406
commit
eea199b20c
3909
win32/dxerr.cpp
3909
win32/dxerr.cpp
File diff suppressed because it is too large
Load Diff
|
@ -11,8 +11,6 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// This version only supports UNICODE.
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(NOMINMAX)
|
#if !defined(NOMINMAX)
|
||||||
|
@ -29,17 +27,27 @@ extern "C" {
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// DXGetErrorString
|
// DXGetErrorString
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
const char* WINAPI DXGetErrorStringA(_In_ HRESULT hr);
|
||||||
const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
|
const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
#define DXGetErrorString DXGetErrorStringW
|
#define DXGetErrorString DXGetErrorStringW
|
||||||
|
#else
|
||||||
|
#define DXGetErrorString DXGetErrorStringA
|
||||||
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// DXGetErrorDescription has to be modified to return a copy in a buffer rather than
|
// DXGetErrorDescription has to be modified to return a copy in a buffer rather than
|
||||||
// the original static string.
|
// the original static string.
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
void WINAPI DXGetErrorDescriptionA(_In_ HRESULT hr, _Out_cap_(count) char* desc, _In_ size_t count);
|
||||||
void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count );
|
void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count );
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
#define DXGetErrorDescription DXGetErrorDescriptionW
|
#define DXGetErrorDescription DXGetErrorDescriptionW
|
||||||
|
#else
|
||||||
|
#define DXGetErrorDescription DXGetErrorDescriptionA
|
||||||
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// DXTrace
|
// DXTrace
|
||||||
|
@ -56,9 +64,14 @@ void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* des
|
||||||
//
|
//
|
||||||
// Return: The hr that was passed in.
|
// Return: The hr that was passed in.
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
HRESULT WINAPI DXTraceA(_In_z_ const char* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const char* strMsg, _In_ bool bPopMsgBox);
|
||||||
HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
|
HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
|
||||||
|
|
||||||
|
#ifdef UNICODE
|
||||||
#define DXTrace DXTraceW
|
#define DXTrace DXTraceW
|
||||||
|
#else
|
||||||
|
#define DXTrace DXTraceA
|
||||||
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
@ -66,10 +79,16 @@ HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HR
|
||||||
//
|
//
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
#if defined(DEBUG) || defined(_DEBUG)
|
#if defined(DEBUG) || defined(_DEBUG)
|
||||||
|
#ifdef UNICODE
|
||||||
#define DXTRACE_MSG(str) DXTrace( __FILEW__, (DWORD)__LINE__, 0, str, false )
|
#define DXTRACE_MSG(str) DXTrace( __FILEW__, (DWORD)__LINE__, 0, str, false )
|
||||||
#define DXTRACE_ERR(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, false )
|
#define DXTRACE_ERR(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, false )
|
||||||
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, true )
|
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, true )
|
||||||
#else
|
#else
|
||||||
|
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, false )
|
||||||
|
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, false )
|
||||||
|
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, true )
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
#define DXTRACE_MSG(str) (0L)
|
#define DXTRACE_MSG(str) (0L)
|
||||||
#define DXTRACE_ERR(str,hr) (hr)
|
#define DXTRACE_ERR(str,hr) (hr)
|
||||||
#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
|
#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
|
||||||
|
|
Loading…
Reference in New Issue