Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9817/com/win32com/src
Modified Files:
ErrorUtils.cpp PyGatewayBase.cpp PyIDispatch.cpp
PyIUnknown.cpp PyStorage.cpp dllmain.cpp univgw_dataconv.cpp
Log Message:
Yet more TCHAR/64bit and other misc changes from py3k branch.
Index: PyGatewayBase.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyGatewayBase.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PyGatewayBase.cpp 4 Sep 2007 10:53:29 -0000 1.17
--- PyGatewayBase.cpp 13 Nov 2008 11:11:58 -0000 1.18
***************
*** 14,22 ****
extern PyObject *g_obMissing;
- extern void PyCom_LogF(const char *fmt, ...);
- #define LogF PyCom_LogF
-
#include <malloc.h>
! #if _MSC_VER < 1400
// _malloca is the new 'safe' one
#define _malloca _alloca
--- 14,22 ----
extern PyObject *g_obMissing;
#include <malloc.h>
! // When building with the 2003 Platform SDK 64-bit compiloer, _MSC_VER is 1400,
! // but _malloca is not defined
! // #if _MSC_VER < 1400
! #ifndef _malloca
// _malloca is the new 'safe' one
#define _malloca _alloca
***************
*** 97,101 ****
#ifdef DEBUG_FULL
! LogF("PyGatewayBase: created %s", m_pPyObject ? m_pPyObject->ob_type->tp_name : "<NULL>");
#endif
}
--- 97,101 ----
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase: created %s", m_pPyObject ? m_pPyObject->ob_type->tp_name : "<NULL>");
#endif
}
***************
*** 105,109 ****
InterlockedDecrement(&cGateways);
#ifdef DEBUG_FULL
! LogF("PyGatewayBase: deleted %s", m_pPyObject ? m_pPyObject->ob_type->tp_name : "<NULL>");
#endif
--- 105,109 ----
InterlockedDecrement(&cGateways);
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase: deleted %s", m_pPyObject ? m_pPyObject->ob_type->tp_name : "<NULL>");
#endif
***************
*** 136,140 ****
// Only for a special debug build, don't worry about error checking
WideCharToMultiByte(CP_ACP, 0, oleRes, -1, cRes, 256, NULL, NULL);
! LogF("PyGatewayBase::QueryInterface: %s", cRes);
}
#endif
--- 136,140 ----
// Only for a special debug build, don't worry about error checking
WideCharToMultiByte(CP_ACP, 0, oleRes, -1, cRes, 256, NULL, NULL);
! PyCom_LogF("PyGatewayBase::QueryInterface: %s", cRes);
}
#endif
***************
*** 388,392 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::GetIDsOfNames");
#endif
--- 388,392 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::GetIDsOfNames");
#endif
***************
*** 735,739 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::Invoke; dispid=%ld", dispid);
#endif
--- 735,739 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::Invoke; dispid=%ld", dispid);
#endif
***************
*** 775,779 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::GetDispID");
#endif
PY_GATEWAY_METHOD;
--- 775,779 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::GetDispID");
#endif
PY_GATEWAY_METHOD;
***************
*** 798,802 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::InvokeEx; dispid=%ld", id);
#endif
--- 798,802 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::InvokeEx; dispid=%ld", id);
#endif
***************
*** 840,844 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::DeleteMemberByName");
#endif
PY_GATEWAY_METHOD;
--- 840,844 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::DeleteMemberByName");
#endif
PY_GATEWAY_METHOD;
***************
*** 858,862 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::DeleteMemberByDispID");
#endif
PY_GATEWAY_METHOD;
--- 858,862 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::DeleteMemberByDispID");
#endif
PY_GATEWAY_METHOD;
***************
*** 872,876 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::GetMemberProperties");
#endif
PY_GATEWAY_METHOD;
--- 872,876 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::GetMemberProperties");
#endif
PY_GATEWAY_METHOD;
***************
*** 892,896 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::GetMemberName");
#endif
PY_GATEWAY_METHOD;
--- 892,896 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::GetMemberName");
#endif
PY_GATEWAY_METHOD;
***************
*** 909,913 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::GetNextDispID");
#endif
PY_GATEWAY_METHOD;
--- 909,913 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::GetNextDispID");
#endif
PY_GATEWAY_METHOD;
***************
*** 929,933 ****
{
#ifdef DEBUG_FULL
! LogF("PyGatewayBase::GetNameSpaceParent");
#endif
PY_GATEWAY_METHOD;
--- 929,933 ----
{
#ifdef DEBUG_FULL
! PyCom_LogF("PyGatewayBase::GetNameSpaceParent");
#endif
PY_GATEWAY_METHOD;
Index: PyIUnknown.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIUnknown.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PyIUnknown.cpp 4 Jul 2007 18:03:18 -0000 1.12
--- PyIUnknown.cpp 13 Nov 2008 11:11:58 -0000 1.13
***************
*** 6,12 ****
#include "PythonCOMServer.h"
- extern void PyCom_LogF(const char *fmt, ...);
- #define LogF PyCom_LogF
-
char *PyIUnknown::szErrMsgObjectReleased = "The COM object has been released.";
--- 6,9 ----
***************
*** 37,43 ****
{
// @comm The repr of this object displays both the object's address, and its attached IUnknown's address
! TCHAR buf[80];
! wsprintf(buf, _T("<%hs at 0x%0lp with obj at 0x%0lp>"),ob_type->tp_name, this, m_obj);
! return PyString_FromTCHAR(buf);
}
--- 34,44 ----
{
// @comm The repr of this object displays both the object's address, and its attached IUnknown's address
! char buf[256];
! _snprintf(buf, 256, "<%hs at 0x%0lp with obj at 0x%0lp>", ob_type->tp_name, this, m_obj);
! #if (PY_VERSION_HEX < 0x03000000)
! return PyString_FromString(buf);
! #else
! return PyUnicode_FromString(buf);
! #endif
}
***************
*** 46,50 ****
#ifdef _DEBUG
int numInMap = m_obTrackList ? PyMapping_Length(m_obTrackList) : 0;
! LogF("Cleaning up %d COM objects...", numInMap);
OLECHAR FAR *pythonOb = L"pythonObject";
#endif
--- 47,51 ----
#ifdef _DEBUG
int numInMap = m_obTrackList ? PyMapping_Length(m_obTrackList) : 0;
! PyCom_LogF("Cleaning up %d COM objects...", numInMap);
OLECHAR FAR *pythonOb = L"pythonObject";
#endif
***************
*** 60,64 ****
#ifdef NOPE_DEBUG
const char *relDesc = pLook->m_obj ? "NOT RELEASED" : "released";
! LogF(" object <%s> at 0x%0lx, m_obj at 0x%0lx, ob_refcnt=%d, %s", pLook->ob_type->tp_name, pLook, pLook->m_obj, pLook->ob_refcnt, relDesc);
if ( pLook->m_obj )
{
--- 61,65 ----
#ifdef NOPE_DEBUG
const char *relDesc = pLook->m_obj ? "NOT RELEASED" : "released";
! PyCom_LogF(" object <%s> at 0x%0lx, m_obj at 0x%0lx, ob_refcnt=%d, %s", pLook->ob_type->tp_name, pLook, pLook->m_obj, pLook->ob_refcnt, relDesc);
if ( pLook->m_obj )
{
***************
*** 80,88 ****
if ( PyInstance_Check(ob) )
{
! LogF(" object is a Python class instance of: %s", PyString_AsString(((PyInstanceObject *)ob)->in_class->cl_name));
}
else
{
! LogF(" object is a Python object of type: %s", ob->ob_type->tp_name);
}
}
--- 81,89 ----
if ( PyInstance_Check(ob) )
{
! PyCom_LogF(" object is a Python class instance of: %s", PyString_AsString(((PyInstanceObject *)ob)->in_class->cl_name));
}
else
{
! PyCom_LogF(" object is a Python object of type: %s", ob->ob_type->tp_name);
}
}
***************
*** 106,110 ****
}
#ifdef _DEBUG
! LogF("COM object cleanup complete.");
#endif
}
--- 107,111 ----
}
#ifdef _DEBUG
! PyCom_LogF("COM object cleanup complete.");
#endif
}
***************
*** 140,144 ****
#ifdef _DEBUG_LIFETIMES
! LogF(buf, " SafeRelease(%ld) -> %s at 0x%0lx, IUnknown at 0x%0lx - Release() returned %ld",GetCurrentThreadId(), ob->ob_type->tp_name,ob, ob->m_obj,rcnt);
#endif
ob->m_obj = NULL;
--- 141,145 ----
#ifdef _DEBUG_LIFETIMES
! PyCom_LogF(buf, " SafeRelease(%ld) -> %s at 0x%0lx, IUnknown at 0x%0lx - Release() returned %ld",GetCurrentThreadId(), ob->ob_type->tp_name,ob, ob->m_obj,rcnt);
#endif
ob->m_obj = NULL;
***************
*** 147,151 ****
{
PyEval_RestoreThread(_save);
! LogF(_T("Win32 exception occurred releasing IUnknown at 0x%08x"), ob->m_obj);
ob->m_obj = NULL;
#ifdef _DEBUG
--- 148,152 ----
{
PyEval_RestoreThread(_save);
! PyCom_LogF("Win32 exception occurred releasing IUnknown at 0x%08x", ob->m_obj);
ob->m_obj = NULL;
#ifdef _DEBUG
***************
*** 182,186 ****
{
PyObject *obiid;
! PyObject *obUseIID = NULL;
// @pyparm IID|iid||The IID requested.
// @pyparm IID|useIID|None|If provided and not None, will return an
--- 183,187 ----
{
PyObject *obiid;
! PyObject *obUseIID = Py_None;
// @pyparm IID|iid||The IID requested.
// @pyparm IID|useIID|None|If provided and not None, will return an
***************
*** 208,227 ****
return NULL;
! IID useIID; /* used if obUseIID != NULL */
! if ( obUseIID != NULL )
! {
! if ( obUseIID == Py_None )
! obUseIID = NULL;
! else if ( PyInt_Check(obUseIID) )
! {
! if ( PyInt_AS_LONG((PyIntObject *)obUseIID) )
! useIID = IID_IUnknown;
! else
! obUseIID = NULL;
! }
! else if ( !PyWinObject_AsIID(obUseIID, &useIID) )
return NULL;
- }
IUnknown *pMyUnknown = GetI(self);
--- 209,219 ----
return NULL;
! IID useIID; /* used if obUseIID != Py_None */
! // This used to allow an int, with 1 indicating IUnknown
! // Doesn't seem to be used anywhere, so it has been removed
! if (obUseIID != Py_None)
! if ( !PyWinObject_AsIID(obUseIID, &useIID) )
return NULL;
IUnknown *pMyUnknown = GetI(self);
***************
*** 244,248 ****
/* we may have been asked to use a different interface */
! if ( rc == NULL && obUseIID != NULL )
{
PyErr_Clear();
--- 236,243 ----
/* we may have been asked to use a different interface */
! /* ??? useIID will be ignored if interface successfully created ???
! Apparently true and relies on a final QI somewhere? :()
! */
! if ( rc == NULL && obUseIID != Py_None)
{
PyErr_Clear();
Index: PyStorage.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyStorage.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PyStorage.cpp 4 Jul 2007 18:40:46 -0000 1.12
--- PyStorage.cpp 13 Nov 2008 11:11:58 -0000 1.13
***************
*** 254,258 ****
myStgOpenStorageEx = (PFNStgOpenStorageEx)-1;
if (ole32==NULL)
! ole32=GetModuleHandle("Ole32.dll");
if (ole32!=NULL){
FARPROC fp = GetProcAddress(ole32,"StgOpenStorageEx");
--- 254,258 ----
myStgOpenStorageEx = (PFNStgOpenStorageEx)-1;
if (ole32==NULL)
! ole32=GetModuleHandle(_T("Ole32.dll"));
if (ole32!=NULL){
FARPROC fp = GetProcAddress(ole32,"StgOpenStorageEx");
***************
*** 315,319 ****
if (!pfnchecked){
if (ole32==NULL)
! ole32=GetModuleHandle("Ole32.dll");
if (ole32!=NULL)
pfnFmtIdToPropStgName = (PFNFmtIdToPropStgName)GetProcAddress(ole32, "FmtIdToPropStgName");
--- 315,319 ----
if (!pfnchecked){
if (ole32==NULL)
! ole32=GetModuleHandle(_T("Ole32.dll"));
if (ole32!=NULL)
pfnFmtIdToPropStgName = (PFNFmtIdToPropStgName)GetProcAddress(ole32, "FmtIdToPropStgName");
***************
*** 352,356 ****
if (!pfnchecked){
if (ole32==NULL)
! ole32=GetModuleHandle("Ole32.dll");
if (ole32!=NULL)
pfnPropStgNameToFmtId = (PFNPropStgNameToFmtId)GetProcAddress(ole32, "PropStgNameToFmtId");
--- 352,356 ----
if (!pfnchecked){
if (ole32==NULL)
! ole32=GetModuleHandle(_T("Ole32.dll"));
if (ole32!=NULL)
pfnPropStgNameToFmtId = (PFNPropStgNameToFmtId)GetProcAddress(ole32, "PropStgNameToFmtId");
Index: dllmain.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/dllmain.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** dllmain.cpp 23 Mar 2006 06:59:20 -0000 1.15
--- dllmain.cpp 13 Nov 2008 11:11:58 -0000 1.16
***************
*** 185,189 ****
// Do a LoadLibrary, as the Ex version may not always exist
// on Win95.
! HMODULE hMod = GetModuleHandle("ole32.dll");
if (hMod==0) return E_HANDLE;
FARPROC fp = GetProcAddress(hMod, "CoInitializeEx");
--- 185,189 ----
// Do a LoadLibrary, as the Ex version may not always exist
// on Win95.
! HMODULE hMod = GetModuleHandle(_T("ole32.dll"));
if (hMod==0) return E_HANDLE;
FARPROC fp = GetProcAddress(hMod, "CoInitializeEx");
Index: PyIDispatch.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIDispatch.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PyIDispatch.cpp 13 Feb 2006 01:17:01 -0000 1.11
--- PyIDispatch.cpp 13 Nov 2008 11:11:58 -0000 1.12
***************
*** 56,62 ****
// @pyparmalt1 [string, ...]|[name, ...]||A sequence of string names to query
// @comm Currently the LCID can not be specified, and LOCALE_SYSTEM_DEFAULT is used.
! int argc = PyObject_Length(args);
! if ( argc == -1 )
! return NULL;
if ( argc < 1 )
return PyErr_Format(PyExc_TypeError, "At least one argument must be supplied");
--- 56,60 ----
// @pyparmalt1 [string, ...]|[name, ...]||A sequence of string names to query
// @comm Currently the LCID can not be specified, and LOCALE_SYSTEM_DEFAULT is used.
! int argc = PyTuple_GET_SIZE(args);
if ( argc < 1 )
return PyErr_Format(PyExc_TypeError, "At least one argument must be supplied");
***************
*** 64,79 ****
LCID lcid = LOCALE_SYSTEM_DEFAULT;
UINT offset = 0;
! if ( argc > 1 )
! {
! PyObject *ob = PySequence_GetItem(args, 0);
! if ( !ob )
! return NULL;
! if ( PyInt_Check(ob) )
! {
! lcid = PyInt_AS_LONG((PyIntObject *)ob);
offset = 1;
}
- Py_DECREF(ob);
- }
UINT cNames = argc - offset;
--- 62,75 ----
LCID lcid = LOCALE_SYSTEM_DEFAULT;
UINT offset = 0;
! if ( argc > 1 ){
! PyObject *ob = PyTuple_GET_ITEM(args, 0);
! lcid=PyLong_AsLong(ob);
! if (lcid==-1 && PyErr_Occurred()){
! PyErr_Clear();
! lcid=LOCALE_SYSTEM_DEFAULT;
! }
! else
offset = 1;
}
UINT cNames = argc - offset;
Index: univgw_dataconv.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/univgw_dataconv.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** univgw_dataconv.cpp 13 Feb 2006 01:23:48 -0000 1.10
--- univgw_dataconv.cpp 13 Nov 2008 11:11:58 -0000 1.11
***************
*** 191,197 ****
BYTE *pbArgs;
BYTE *pbArg;
! UINT cArgs;
UINT uiIndirectionLevel = 0;
! UINT i;
if (!PyArg_ParseTuple(args, "OOO:WriteFromOutTuple", &obRetValues, &obArgTypes, &obPtr))
--- 191,197 ----
BYTE *pbArgs;
BYTE *pbArg;
! Py_ssize_t cArgs;
UINT uiIndirectionLevel = 0;
! Py_ssize_t i;
if (!PyArg_ParseTuple(args, "OOO:WriteFromOutTuple", &obRetValues, &obArgTypes, &obPtr))
***************
*** 615,619 ****
BYTE *pb;
BYTE *pbArg;
! UINT cArgs, i;
PyObject *obArgs = NULL;
PyObject *obArg;
--- 615,619 ----
BYTE *pb;
BYTE *pbArg;
! Py_ssize_t cArgs, i;
PyObject *obArgs = NULL;
PyObject *obArg;
Index: ErrorUtils.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/ErrorUtils.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** ErrorUtils.cpp 4 Sep 2007 10:32:03 -0000 1.30
--- ErrorUtils.cpp 13 Nov 2008 11:11:58 -0000 1.31
***************
*** 14,20 ****
void GetScodeString(SCODE sc, TCHAR *buf, int bufSize);
! LPCSTR GetScodeRangeString(SCODE sc);
! LPCSTR GetSeverityString(SCODE sc);
! LPCSTR GetFacilityString(SCODE sc);
static PyObject *PyCom_PyObjectFromIErrorInfo(IErrorInfo *, HRESULT errorhr);
--- 14,20 ----
void GetScodeString(SCODE sc, TCHAR *buf, int bufSize);
! LPCTSTR GetScodeRangeString(SCODE sc);
! LPCTSTR GetSeverityString(SCODE sc);
! LPCTSTR GetFacilityString(SCODE sc);
static PyObject *PyCom_PyObjectFromIErrorInfo(IErrorInfo *, HRESULT errorhr);
***************
*** 465,469 ****
{
#ifndef MS_WINCE
! OutputDebugString(pszMessageText);
#else
NKDbgPrintfW(pszMessageText);
--- 465,469 ----
{
#ifndef MS_WINCE
! OutputDebugStringA(pszMessageText);
#else
NKDbgPrintfW(pszMessageText);
***************
*** 481,494 ****
PyErr_Restore(typ, val, tb);
}
BOOL VLogF_Logger(PyObject *logger, const char *log_method,
! const TCHAR *prefix, const TCHAR *fmt, va_list argptr)
{
// Protected by Python lock
! static TCHAR buff[8196];
! int buf_len = sizeof(buff) / sizeof(buff[0]);
! int prefix_len = strlen(prefix);
! assert(prefix_len<100);
! strcpy(buff, prefix);
! wvsprintf(buff+prefix_len, fmt, argptr);
PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL;
--- 481,494 ----
PyErr_Restore(typ, val, tb);
}
+
BOOL VLogF_Logger(PyObject *logger, const char *log_method,
! const char *prefix, const char *fmt, va_list argptr)
{
// Protected by Python lock
! static char buff[8196];
! size_t buf_len = sizeof(buff) / sizeof(buff[0]);
! size_t prefix_len = strlen(prefix);
! strncpy(buff, prefix, buf_len);
! vsnprintf(buff+prefix_len, buf_len-prefix_len, fmt, argptr);
PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL;
***************
*** 525,538 ****
}
! void VLogF(const TCHAR *fmt, va_list argptr)
{
! static TCHAR buff[8196]; // protected by Python lock
! wvsprintf(buff, fmt, argptr);
PyCom_StreamMessage(buff);
}
! PYCOM_EXPORT void PyCom_LogF(const TCHAR *fmt, ...)
{
va_list marker;
--- 525,538 ----
}
! void VLogF(const char *fmt, va_list argptr)
{
! static char buff[8196]; // protected by Python lock
! vsnprintf(buff, 8196, fmt, argptr);
PyCom_StreamMessage(buff);
}
! void PyCom_LogF(const char *fmt, ...)
{
va_list marker;
***************
*** 705,709 ****
Py_INCREF(Py_None);
}
! PyObject *evalue = Py_BuildValue("isOO", errorhr, scodeStringBuf, obEI, Py_None);
Py_DECREF(obEI);
--- 705,709 ----
Py_INCREF(Py_None);
}
! PyObject *evalue = Py_BuildValue("iNOO", errorhr, PyWinObject_FromTCHAR(scodeStringBuf), obEI, Py_None);
Py_DECREF(obEI);
***************
*** 720,724 ****
TCHAR buf[512];
GetScodeString(hr, buf, sizeof(buf)/sizeof(TCHAR));
! PyObject *obScodeString = PyString_FromTCHAR(buf);
PyObject *evalue;
PyObject *obArg;
--- 720,724 ----
TCHAR buf[512];
GetScodeString(hr, buf, sizeof(buf)/sizeof(TCHAR));
! PyObject *obScodeString = PyWinObject_FromTCHAR(buf);
PyObject *evalue;
PyObject *obArg;
***************
*** 1181,1185 ****
return;
}
! // Next see if this particular error code is registerd as being supplied
// by a specific DLL.
HINSTANCE hi = PyWin_GetErrorMessageModule(hr);
--- 1181,1185 ----
return;
}
! // Next see if this particular error code is registered as being supplied
// by a specific DLL.
HINSTANCE hi = PyWin_GetErrorMessageModule(hr);
***************
*** 1208,1212 ****
}
! LPCSTR GetScodeRangeString(HRESULT hr)
{
struct RANGE_ENTRY
--- 1208,1212 ----
}
! LPCTSTR GetScodeRangeString(HRESULT hr)
{
struct RANGE_ENTRY
***************
*** 1214,1222 ****
HRESULT hrFirst;
HRESULT hrLast;
! LPCSTR lpszName;
};
#define MAKE_RANGE_ENTRY(hrRange) \
{ hrRange##_FIRST, hrRange##_LAST, \
! #hrRange "_FIRST..." #hrRange "_LAST" }
static const RANGE_ENTRY hrRangeTable[] =
--- 1214,1222 ----
HRESULT hrFirst;
HRESULT hrLast;
! LPCTSTR lpszName;
};
#define MAKE_RANGE_ENTRY(hrRange) \
{ hrRange##_FIRST, hrRange##_LAST, \
! _T(#hrRange) _T("_FIRST...") _T(#hrRange) _T("_LAST") }
static const RANGE_ENTRY hrRangeTable[] =
***************
*** 1269,1313 ****
}
! LPCSTR GetSeverityString(HRESULT hr)
{
! static LPCSTR rgszSEVERITY[] =
{
! "SEVERITY_SUCCESS",
! "SEVERITY_ERROR",
};
return rgszSEVERITY[HRESULT_SEVERITY(hr)];
}
! LPCSTR GetFacilityString(HRESULT hr)
{
! static LPCSTR rgszFACILITY[] =
{
! "FACILITY_NULL",
! "FACILITY_RPC",
! "FACILITY_DISPATCH",
! "FACILITY_STORAGE",
! "FACILITY_ITF",
! "FACILITY_ADSI",
! "FACILITY_0x06",
! "FACILITY_WIN32",
! "FACILITY_WINDOWS",
! "FACILITY_SSPI/FACILITY_MQ", // SSPI from ADSERR.H, MQ from mq.h
! "FACILITY_CONTROL",
! "FACILITY_EDK",
! "FACILITY_INTERNET",
! "FACILITY_MEDIASERVER",
! "FACILITY_MSMQ",
! "FACILITY_SETUPAPI",
};
if (HRESULT_FACILITY(hr) >= _countof(rgszFACILITY))
switch (HRESULT_FACILITY(hr)) {
case 0x7FF:
! return "FACILITY_BACKUP";
case 0x800:
! return "FACILITY_EDB";
case 0x900:
! return "FACILITY_MDSI";
default:
! return "<Unknown Facility>";
}
return rgszFACILITY[HRESULT_FACILITY(hr)];
--- 1269,1313 ----
}
! LPCTSTR GetSeverityString(HRESULT hr)
{
! static LPCTSTR rgszSEVERITY[] =
{
! _T("SEVERITY_SUCCESS"),
! _T("SEVERITY_ERROR"),
};
return rgszSEVERITY[HRESULT_SEVERITY(hr)];
}
! LPCTSTR GetFacilityString(HRESULT hr)
{
! static LPCTSTR rgszFACILITY[] =
{
! _T("FACILITY_NULL"),
! _T("FACILITY_RPC"),
! _T("FACILITY_DISPATCH"),
! _T("FACILITY_STORAGE"),
! _T("FACILITY_ITF"),
! _T("FACILITY_ADSI"),
! _T("FACILITY_0x06"),
! _T("FACILITY_WIN32"),
! _T("FACILITY_WINDOWS"),
! _T("FACILITY_SSPI/FACILITY_MQ"), // SSPI from ADSERR.H, MQ from mq.h
! _T("FACILITY_CONTROL"),
! _T("FACILITY_EDK"),
! _T("FACILITY_INTERNET"),
! _T("FACILITY_MEDIASERVER"),
! _T("FACILITY_MSMQ"),
! _T("FACILITY_SETUPAPI"),
};
if (HRESULT_FACILITY(hr) >= _countof(rgszFACILITY))
switch (HRESULT_FACILITY(hr)) {
case 0x7FF:
! return _T("FACILITY_BACKUP");
case 0x800:
! return _T("FACILITY_EDB");
case 0x900:
! return _T("FACILITY_MDSI");
default:
! return _T("<Unknown Facility>");
}
return rgszFACILITY[HRESULT_FACILITY(hr)];
|