Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9382/com/win32comext/shell/src
Modified Files:
PyIQueryAssociations.cpp
Log Message:
Fix places where handles treated as longs
Index: PyIQueryAssociations.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIQueryAssociations.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PyIQueryAssociations.cpp 7 Mar 2006 05:25:33 -0000 1.4
--- PyIQueryAssociations.cpp 21 Jan 2007 13:34:42 -0000 1.5
***************
*** 31,48 ****
if ( pIQA == NULL )
return NULL;
! // @pyparm int|flags||
// @pyparm string|assoc||The string data (ie, extension, prog-id, etc)
! // @pyparm <o PyHANDLE>|hkeyProgId|0|
! // @pyparm int|hwnd|0|Must be 0
! int flags, hwnd=0, hkProgid = 0;
! PyObject *obAssoc;
WCHAR *pszAssoc = NULL;
! if (!PyArg_ParseTuple(args, "lO|ll:Init", &flags, &obAssoc, &hkProgid, &hwnd))
return NULL;
if (!PyWinObject_AsWCHAR(obAssoc, &pszAssoc, TRUE))
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pIQA->Init( flags, pszAssoc, (HKEY)hkProgid, (HWND)hwnd);
PyWinObject_FreeWCHAR(pszAssoc);
PY_INTERFACE_POSTCALL;
--- 31,54 ----
if ( pIQA == NULL )
return NULL;
! // @pyparm int|flags||One of shellcon.ASSOCF_* flags
// @pyparm string|assoc||The string data (ie, extension, prog-id, etc)
! // @pyparm <o PyHKEY>|hkeyProgId|None|Root registry key, can be None
! // @pyparm <o PyHANDLE>|hwnd|None|Reserved, must be 0 or None
! int flags;
! HWND hwnd;
! HKEY hkProgid;
! PyObject *obAssoc, *obhwnd=Py_None, *obhkProgid=Py_None;
WCHAR *pszAssoc = NULL;
! if (!PyArg_ParseTuple(args, "lO|OO:Init", &flags, &obAssoc, &obhkProgid, &obhwnd))
return NULL;
if (!PyWinObject_AsWCHAR(obAssoc, &pszAssoc, TRUE))
return NULL;
+ if (!PyWinObject_AsHKEY(obhkProgid, &hkProgid, TRUE))
+ return NULL;
+ if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE))
+ return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pIQA->Init( flags, pszAssoc, hkProgid, hwnd);
PyWinObject_FreeWCHAR(pszAssoc);
PY_INTERFACE_POSTCALL;
|