[pywin32-checkins] pywin32/com/win32com/src univgw.cpp,1.6,1.7
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-08-08 03:57:54
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv5838 Modified Files: univgw.cpp Log Message: Fix the vtable order (as per "[ 784643 ] A patch to fix a serious bug in univgw.cpp". Also fix the Python exposed CreateTearOff, which currently isn't used except by an old test, but would crash. Index: univgw.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/univgw.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** univgw.cpp 16 Jan 2003 23:40:46 -0000 1.6 --- univgw.cpp 8 Aug 2003 03:57:51 -0000 1.7 *************** *** 393,399 **** if (isDispatch) { ! vtbl->methods[3] = (pfnGWMethod)univgw_GetIDsOfNames; vtbl->methods[4] = (pfnGWMethod)univgw_GetTypeInfo; ! vtbl->methods[5] = (pfnGWMethod)univgw_GetTypeInfoCount; vtbl->methods[6] = (pfnGWMethod)univgw_Invoke; } --- 393,399 ---- if (isDispatch) { ! vtbl->methods[3] = (pfnGWMethod)univgw_GetTypeInfoCount; vtbl->methods[4] = (pfnGWMethod)univgw_GetTypeInfo; ! vtbl->methods[5] = (pfnGWMethod)univgw_GetIDsOfNames; vtbl->methods[6] = (pfnGWMethod)univgw_Invoke; } *************** *** 502,507 **** } // Do all of the grunt work. ! punk = CreateTearOff(obInstance, NULL, obVTable); if (!punk) { --- 502,524 ---- } + PyGatewayBase *base = NULL; + PY_INTERFACE_PRECALL; + HRESULT hr = PyCom_MakeRegisteredGatewayObject(IID_IUnknown, + obInstance, + NULL, + (void **)&base); + PY_INTERFACE_POSTCALL; + if (FAILED(hr)) { + PyCom_BuildPyException(hr); + return NULL; + } + // Do all of the grunt work. ! punk = CreateTearOff(obInstance, base, obVTable); ! if (base) { ! PY_INTERFACE_PRECALL; ! base->Release(); ! PY_INTERFACE_POSTCALL; ! } if (!punk) { |