From ddcdb3604cc8c4602b45b199b30cc4f29465933c Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Tue, 14 Mar 2006 12:06:42 +0000 Subject: [PATCH] Yet another go at the documented behaviour: coInitializeEx raises all exceptions, CoInitialize masks RPC_E_CHANGED_MODE. --- com/win32com/src/dllmain.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com/win32com/src/dllmain.cpp b/com/win32com/src/dllmain.cpp index 26e6f1d5d..7b61a7414 100644 --- a/com/win32com/src/dllmain.cpp +++ b/com/win32com/src/dllmain.cpp @@ -197,7 +197,9 @@ HRESULT PyCom_CoInitializeEx(LPVOID reserved, DWORD dwInit) HRESULT hr = CoInitializeEx(reserved, dwInit); #endif // MS_WINCE - if ( (hr != RPC_E_CHANGED_MODE) && FAILED(hr) ) + // Unlike PyCom_CoInitialize, we return _all_ errors including + // RPC_E_CHANGED_MODE + if ( FAILED(hr) ) { PyCom_LoggerException(NULL, "OLE initialization failed! (0x%08lx)", hr); return hr;