pywin32-checkins Mailing List for Python for Windows Extensions (Page 84)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2008-01-08 00:41:00
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15187 Modified Files: setup.py Log Message: * New interfaces IExtractIconW, IExplorerBrowser, IExplorerBrowserEvents, IExplorerCommand, IShellItem and IShellItemArray * Fix leak of SHELLEXECUTEINFO struct each ShellExecuteEx call. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** setup.py 21 Aug 2007 05:32:26 -0000 1.63 --- setup.py 8 Jan 2008 00:41:03 -0000 1.64 *************** *** 1425,1431 **** %(shell)s/PyIDropTargetHelper.cpp %(shell)s/PyIEnumIDList.cpp - %(shell)s/PyIExtractIcon.cpp %(shell)s/PyIEmptyVolumeCache.cpp %(shell)s/PyIEmptyVolumeCacheCallBack.cpp %(shell)s/PyIExtractImage.cpp %(shell)s/PyIInputObject.cpp --- 1425,1435 ---- %(shell)s/PyIDropTargetHelper.cpp %(shell)s/PyIEnumIDList.cpp %(shell)s/PyIEmptyVolumeCache.cpp %(shell)s/PyIEmptyVolumeCacheCallBack.cpp + %(shell)s/PyIExplorerBrowser.cpp + %(shell)s/PyIExplorerBrowserEvents.cpp + %(shell)s/PyIExplorerCommand.cpp + %(shell)s/PyIExtractIcon.cpp + %(shell)s/PyIExtractIconW.cpp %(shell)s/PyIExtractImage.cpp %(shell)s/PyIInputObject.cpp *************** *** 1439,1442 **** --- 1443,1448 ---- %(shell)s/PyIShellIconOverlayIdentifier.cpp %(shell)s/PyIShellIconOverlayManager.cpp + %(shell)s/PyIShellItem.cpp + %(shell)s/PyIShellItemArray.cpp %(shell)s/PyIShellLink.cpp %(shell)s/PyIShellLinkDataList.cpp |
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15187/com/win32comext/shell/src Modified Files: shell.cpp shell_pch.h Added Files: PyIExplorerBrowser.cpp PyIExplorerBrowser.h PyIExplorerBrowserEvents.cpp PyIExplorerBrowserEvents.h PyIExplorerCommand.cpp PyIExplorerCommand.h PyIExplorerInterfaces.h PyIExtractIconW.cpp PyIExtractIconW.h PyIShellItem.cpp PyIShellItem.h PyIShellItemArray.cpp PyIShellItemArray.h Log Message: * New interfaces IExtractIconW, IExplorerBrowser, IExplorerBrowserEvents, IExplorerCommand, IShellItem and IShellItemArray * Fix leak of SHELLEXECUTEINFO struct each ShellExecuteEx call. --- NEW FILE: PyIShellItemArray.cpp --- // This file implements the IShellItemArray Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIShellItemArray.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation extern BOOL PyObject_AsSHCOLUMNID(PyObject *ob, SHCOLUMNID *p); extern PyObject *PyObject_FromSHCOLUMNID(LPCSHCOLUMNID p); PyIShellItemArray::PyIShellItemArray(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIShellItemArray::~PyIShellItemArray() { } /* static */ IShellItemArray *PyIShellItemArray::GetI(PyObject *self) { return (IShellItemArray *)PyIUnknown::GetI(self); } // @pymethod |PyIShellItemArray|BindToHandler|Description of BindToHandler. PyObject *PyIShellItemArray::BindToHandler(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; // @pyparm <o PyIBindCtx *>|pbc||Description for pbc // @pyparm <o PyIID>|rbhid||Description for rbhid // @pyparm <o PyIID>|riid||Description for riid PyObject *obpbc; PyObject *obrbhid; PyObject *obriid; IBindCtx *pbc; IID rbhid; IID riid; void *pvOut; if ( !PyArg_ParseTuple(args, "OOO:BindToHandler", &obpbc, &obrbhid, &obriid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpbc, IID_IBindCtx, (void **)&pbc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obrbhid, &rbhid)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISIA->BindToHandler( pbc, rbhid, riid, &pvOut ); if (pbc) pbc->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyCom_PyObjectFromIUnknown((IUnknown *)pvOut, riid, FALSE); } // @pymethod |PyIShellItemArray|GetPropertyStore|Description of GetPropertyStore. PyObject *PyIShellItemArray::GetPropertyStore(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; GETPROPERTYSTOREFLAGS flags; // @pyparm int|flags||Description for flags // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; IID riid; void *pv; if ( !PyArg_ParseTuple(args, "kO:GetPropertyStore", &flags, &obriid) ) return NULL; if (!PyWinObject_AsIID(obriid, &riid)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISIA->GetPropertyStore( flags, riid, &pv ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyCom_PyObjectFromIUnknown((IUnknown *)pv, riid, FALSE); } // @pymethod |PyIShellItemArray|GetPropertyDescriptionList|Description of GetPropertyDescriptionList. PyObject *PyIShellItemArray::GetPropertyDescriptionList(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; PROPERTYKEY keyType; PyObject *obkeyType; // @pyparm <o PyREFPROPERTYKEY>|keyType||Description for keyType // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; IID riid; void *pv; if ( !PyArg_ParseTuple(args, "OO:GetPropertyDescriptionList", &obkeyType, &obriid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsSHCOLUMNID(obkeyType, &keyType)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISIA->GetPropertyDescriptionList( &keyType, riid, &pv ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyCom_PyObjectFromIUnknown((IUnknown *)pv, riid, FALSE); } // @pymethod |PyIShellItemArray|GetAttributes|Description of GetAttributes. PyObject *PyIShellItemArray::GetAttributes(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; SIATTRIBFLAGS dwAttribFlags; // @pyparm <o PySIATTRIBFLAGS>|dwAttribFlags||Description for dwAttribFlags SFGAOF sfgaoMask; // @pyparm <o PySFGAOF>|sfgaoMask||Description for sfgaoMask if ( !PyArg_ParseTuple(args, "kk:GetAttributes", &dwAttribFlags, &sfgaoMask) ) return NULL; SFGAOF result; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISIA->GetAttributes( dwAttribFlags, sfgaoMask, &result ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyLong_FromUnsignedLong(result); } // @pymethod |PyIShellItemArray|GetCount|Description of GetCount. PyObject *PyIShellItemArray::GetCount(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":GetCount") ) return NULL; HRESULT hr; DWORD dwNumItems; PY_INTERFACE_PRECALL; hr = pISIA->GetCount( &dwNumItems ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyInt_FromLong(dwNumItems); } // @pymethod |PyIShellItemArray|GetItemAt|Description of GetItemAt. PyObject *PyIShellItemArray::GetItemAt(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; // @pyparm int|dwIndex||Description for dwIndex DWORD dwIndex; IShellItem *psi; if ( !PyArg_ParseTuple(args, "l:GetItemAt", &dwIndex) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISIA->GetItemAt( dwIndex, &psi ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyCom_PyObjectFromIUnknown(psi, IID_IShellItem, FALSE); } // @pymethod |PyIShellItemArray|EnumItems|Description of EnumItems. PyObject *PyIShellItemArray::EnumItems(PyObject *self, PyObject *args) { IShellItemArray *pISIA = GetI(self); if ( pISIA == NULL ) return NULL; IEnumShellItems *penumShellItems; if ( !PyArg_ParseTuple(args, ":EnumItems") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISIA->EnumItems( &penumShellItems ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray ); return PyCom_PyObjectFromIUnknown(penumShellItems, IID_IEnumShellItems, FALSE); } // @object PyIShellItemArray|Description of the interface static struct PyMethodDef PyIShellItemArray_methods[] = { { "BindToHandler", PyIShellItemArray::BindToHandler, 1 }, // @pymeth BindToHandler|Description of BindToHandler { "GetPropertyStore", PyIShellItemArray::GetPropertyStore, 1 }, // @pymeth GetPropertyStore|Description of GetPropertyStore { "GetPropertyDescriptionList", PyIShellItemArray::GetPropertyDescriptionList, 1 }, // @pymeth GetPropertyDescriptionList|Description of GetPropertyDescriptionList { "GetAttributes", PyIShellItemArray::GetAttributes, 1 }, // @pymeth GetAttributes|Description of GetAttributes { "GetCount", PyIShellItemArray::GetCount, 1 }, // @pymeth GetCount|Description of GetCount { "GetItemAt", PyIShellItemArray::GetItemAt, 1 }, // @pymeth GetItemAt|Description of GetItemAt { "EnumItems", PyIShellItemArray::EnumItems, 1 }, // @pymeth EnumItems|Description of EnumItems { NULL } }; PyComTypeObject PyIShellItemArray::type("PyIShellItemArray", &PyIUnknown::type, sizeof(PyIShellItemArray), PyIShellItemArray_methods, GET_PYCOM_CTOR(PyIShellItemArray)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellItemArray::BindToHandler( /* [unique][in] */ IBindCtx * pbc, /* [in] */ REFGUID rbhid, /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppvOut) { PY_GATEWAY_METHOD; PyObject *obpbc; PyObject *obrbhid; PyObject *obriid; obpbc = PyCom_PyObjectFromIUnknown(pbc, IID_IBindCtx, TRUE); obrbhid = PyWinObject_FromIID(rbhid); obriid = PyWinObject_FromIID(riid); PyObject *result; HRESULT hr=InvokeViaPolicy("BindToHandler", &result, "OOO", obpbc, obrbhid, obriid); Py_XDECREF(obpbc); Py_XDECREF(obrbhid); Py_XDECREF(obriid); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppvOut; if (!PyArg_Parse(result, "O" , &obppvOut)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("BindToHandler"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppvOut, riid, (void **)ppvOut, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("BindToHandler"); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItemArray::GetPropertyStore( /* [in] */ GETPROPERTYSTOREFLAGS flags, /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppv) { PY_GATEWAY_METHOD; PyObject *obriid; obriid = PyWinObject_FromIID(riid); PyObject *result; HRESULT hr=InvokeViaPolicy("GetPropertyStore", &result, "kO", flags, obriid); Py_XDECREF(obriid); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppv; if (!PyArg_Parse(result, "O" , &obppv)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetPropertyStore"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppv, riid, (void **)ppv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetPropertyStore"); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItemArray::GetPropertyDescriptionList( /* [in] */ REFPROPERTYKEY keyType, /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppv) { PY_GATEWAY_METHOD; // *** The input argument keyType of type "REFPROPERTYKEY" was not processed *** // - Please ensure this conversion function exists, and is appropriate // - The type 'REFPROPERTYKEY' (keyType) is unknown. PyObject *obkeyType = PyObject_FromSHCOLUMNID(keyType); if (obkeyType==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetPropertyDescriptionList"); PyObject *obriid; obriid = PyWinObject_FromIID(riid); PyObject *result; HRESULT hr=InvokeViaPolicy("GetPropertyDescriptionList", &result, "OO", obkeyType, obriid); Py_DECREF(obkeyType); Py_XDECREF(obriid); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppv; if (!PyArg_Parse(result, "O" , &obppv)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetPropertyDescriptionList"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppv, riid, (void **)ppv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetPropertyDescriptionList"); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItemArray::GetAttributes( /* [in] */ SIATTRIBFLAGS dwAttribFlags, /* [in] */ SFGAOF sfgaoMask, /* [out] */ SFGAOF * psfgaoAttribs) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetAttributes", &result, "kk", dwAttribFlags, sfgaoMask); if (FAILED(hr)) return hr; *psfgaoAttribs = PyLong_AsUnsignedLongMask(result); hr = PyCom_SetAndLogCOMErrorFromPyException("GetAttributes", IID_IShellItemArray); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItemArray::GetCount( /* [out] */ DWORD * pdwNumItems) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetCount", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params *pdwNumItems = PyLong_AsUnsignedLong(result); hr = PyCom_SetAndLogCOMErrorFromPyException("GetCount", IID_IShellItemArray); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItemArray::GetItemAt( /* [in] */ DWORD dwIndex, /* [out] */ IShellItem ** ppsi) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetItemAt", &result, "l", dwIndex); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppsi; if (!PyArg_Parse(result, "O" , &obppsi)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetItemAt"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppsi, IID_IShellItem, (void **)ppsi, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetItemAt"); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItemArray::EnumItems( /* [out] */ IEnumShellItems ** ppenumShellItems) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("EnumItems", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppenumShellItems; if (!PyArg_Parse(result, "O" , &obppenumShellItems)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("EnumItems"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumShellItems, IID_IEnumShellItems, (void **)ppenumShellItems, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("EnumItems"); Py_DECREF(result); return hr; } --- NEW FILE: PyIExplorerBrowserEvents.h --- // This file declares the IExplorerBrowserEvents Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIExplorerBrowserEvents : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIExplorerBrowserEvents); static IExplorerBrowserEvents *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *OnNavigationPending(PyObject *self, PyObject *args); static PyObject *OnViewCreated(PyObject *self, PyObject *args); static PyObject *OnNavigationComplete(PyObject *self, PyObject *args); static PyObject *OnNavigationFailed(PyObject *self, PyObject *args); protected: PyIExplorerBrowserEvents(IUnknown *pdisp); ~PyIExplorerBrowserEvents(); }; // --------------------------------------------------- // // Gateway Declaration class PyGExplorerBrowserEvents : public PyGatewayBase, public IExplorerBrowserEvents { protected: PyGExplorerBrowserEvents(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGExplorerBrowserEvents, IExplorerBrowserEvents, IID_IExplorerBrowserEvents, PyGatewayBase) // IExplorerBrowserEvents STDMETHOD(OnNavigationPending)( PCIDLIST_ABSOLUTE pidlFolder); STDMETHOD(OnViewCreated)( IShellView * psv); STDMETHOD(OnNavigationComplete)( PCIDLIST_ABSOLUTE pidlFolder); STDMETHOD(OnNavigationFailed)( PCIDLIST_ABSOLUTE pidlFolder); }; Index: shell_pch.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell_pch.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shell_pch.h 6 Apr 2006 10:37:07 -0000 1.7 --- shell_pch.h 8 Jan 2008 00:41:03 -0000 1.8 *************** *** 35,36 **** --- 35,71 ---- BOOL PyObject_AsRECT( PyObject *ob, RECT *r); PyObject *PyObject_FromRECT(const RECT *r); + + // For the Vista IExplorer* interfaces + #include "PyIExplorerInterfaces.h" + + BOOL PyObject_AsEXPLORER_BROWSER_OPTIONS(PyObject *, EXPLORER_BROWSER_OPTIONS *); + PyObject *PyObject_FromEXPLORER_BROWSER_OPTIONS(EXPLORER_BROWSER_OPTIONS); + + BOOL PyObject_AsEXPLORER_BROWSER_FILL_FLAGS(PyObject *, EXPLORER_BROWSER_FILL_FLAGS *); + PyObject *PyObject_FromEXPLORER_BROWSER_FILL_FLAGS(EXPLORER_BROWSER_FILL_FLAGS); + + extern void *PyShell_AllocMem(ULONG cb); + + // Vista has new spellings for PIDL. + inline BOOL PyObject_AsPCUIDLIST_RELATIVE(PyObject *ob, PCUIDLIST_RELATIVE *ppidl, BOOL bNoneOK = FALSE, UINT *pcb = NULL) + { + return PyObject_AsPIDL(ob, (LPITEMIDLIST *)ppidl, bNoneOK, pcb); + } + inline void PyObject_FreePCUIDLIST_RELATIVE(PCUIDLIST_RELATIVE pidl) + { + return PyObject_FreePIDL((LPCITEMIDLIST)pidl); + } + + inline BOOL PyObject_AsPCIDLIST_ABSOLUTE(PyObject *ob, PCUIDLIST_ABSOLUTE *ppidl, BOOL bNoneOK = FALSE, UINT *pcb = NULL) + { + return PyObject_AsPIDL(ob, (LPITEMIDLIST *)ppidl, bNoneOK, pcb); + } + inline void PyObject_FreePCIDLIST_ABSOLUTE(PCIDLIST_ABSOLUTE pidl) + { + return PyObject_FreePIDL((LPCITEMIDLIST)pidl); + } + + inline PyObject *PyObject_FromPCIDLIST_ABSOLUTE(PCUIDLIST_ABSOLUTE pidl, BOOL bFreeSystemPIDL) + { + return PyObject_FromPIDL((LPITEMIDLIST)pidl, bFreeSystemPIDL); + } Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** shell.cpp 18 Jul 2007 08:46:24 -0000 1.59 --- shell.cpp 8 Jan 2008 00:41:03 -0000 1.60 *************** *** 21,24 **** --- 21,25 ---- #include "PyIContextMenu.h" #include "PyIExtractIcon.h" + #include "PyIExtractIconW.h" #include "PyIShellExtInit.h" #include "PyIShellFolder.h" *************** *** 47,50 **** --- 48,56 ---- #include "PyIActiveDesktop.h" #include "PyIExtractImage.h" + #include "PyIExplorerBrowser.h" + #include "PyIExplorerBrowserEvents.h" + #include "PyIExplorerCommand.h" + #include "PyIShellItem.h" + #include "PyIShellItemArray.h" #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. *************** *** 53,56 **** --- 59,71 ---- #define OleSetOleError PyCom_BuildPyException + #if (WINVER < 0x600) + const IID IID_IExplorerBrowser = __uuidof(IExplorerBrowser); + const IID IID_IExplorerBrowserEvents = __uuidof(IExplorerBrowserEvents); + const IID IID_IExplorerCommand = __uuidof(IExplorerCommand); + const IID IID_IShellItemArray = __uuidof(IShellItemArray); + const IID IID_IEnumExplorerCommand = __uuidof(IEnumExplorerCommand); + const IID IID_IEnumShellItems = __uuidof(IEnumShellItems); + #endif + static HMODULE shell32 = NULL; static HMODULE shfolder = NULL; *************** *** 862,865 **** --- 877,901 ---- } + BOOL PyObject_AsEXPLORER_BROWSER_OPTIONS(PyObject *ob, EXPLORER_BROWSER_OPTIONS *ret) + { + *ret = PyLong_AsUnsignedLongMask(ob); + return *ret != -1 || !PyErr_Occurred(); + } + + PyObject *PyObject_FromEXPLORER_BROWSER_OPTIONS(EXPLORER_BROWSER_OPTIONS val) + { + return PyLong_FromUnsignedLong(val); + } + + BOOL PyObject_AsEXPLORER_BROWSER_FILL_FLAGS(PyObject *ob, EXPLORER_BROWSER_FILL_FLAGS *ret) + { + *ret = PyLong_AsUnsignedLongMask(ob); + return *ret != -1 || !PyErr_Occurred(); + } + PyObject *PyObject_FromEXPLORER_BROWSER_FILL_FLAGS(EXPLORER_BROWSER_FILL_FLAGS val) + { + return PyLong_FromUnsignedLong(val); + } + #if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ *************** *** 1433,1442 **** break; case SHCNF_DWORD: ! p1 = (void *)PyInt_AsLong(ob1); ! if (p1==(VOID *)-1 && PyErr_Occurred()) bsuccess=FALSE; else if (ob2!=Py_None){ ! p2 = (void *)PyInt_AsLong(ob2); ! if (p2==(void *)-1 && PyErr_Occurred()) bsuccess=FALSE; } --- 1469,1476 ---- break; case SHCNF_DWORD: ! if (!PyWinLong_AsVoidPtr(ob1, &p1)) bsuccess=FALSE; else if (ob2!=Py_None){ ! if (!PyWinLong_AsVoidPtr(ob2, &p2)) bsuccess=FALSE; } *************** *** 2077,2086 **** PyObject *ret = NULL; BOOL ok; ! SHELLEXECUTEINFO *p = (SHELLEXECUTEINFO *)malloc(sizeof(*p)); ! if (!p) ! return PyErr_NoMemory(); ! ! memset(p, 0, sizeof(*p)); ! p->cbSize = sizeof(*p); static char *kw_items[]= { --- 2111,2117 ---- PyObject *ret = NULL; BOOL ok; ! SHELLEXECUTEINFO info; ! memset(&info, 0, sizeof(info)); ! info.cbSize = sizeof(info); static char *kw_items[]= { *************** *** 2093,2101 **** PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhIcon = NULL; PyObject *obhMonitor = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOOO", kw_items, ! // @pyparm int|fMask|0|The default mask for the ! // structure. Other masks may be added based on ! // what paramaters are supplied. ! &p->fMask, &obhwnd, // @pyparm <o PyHANDLE>|hwnd|0| &obVerb, // @pyparm string|lpVerb|| --- 2124,2131 ---- PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhIcon = NULL; PyObject *obhMonitor = NULL; + // @pyparm int|fMask|0|The default mask for the structure. Other + // masks may be added based on what paramaters are supplied. if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOOO", kw_items, ! &info.fMask, &obhwnd, // @pyparm <o PyHANDLE>|hwnd|0| &obVerb, // @pyparm string|lpVerb|| *************** *** 2103,2107 **** &obParams, // @pyparm string|lpParams|| &obDirectory, // @pyparm string|lpDirectory|| ! &p->nShow, // @pyparm int|nShow|0| &obIDList, // @pyparm <o PyIDL>|lpIDList|| &obClass, // @pyparm string|obClass|| --- 2133,2137 ---- &obParams, // @pyparm string|lpParams|| &obDirectory, // @pyparm string|lpDirectory|| ! &info.nShow, // @pyparm int|nShow|0| &obIDList, // @pyparm <o PyIDL>|lpIDList|| &obClass, // @pyparm string|obClass|| *************** *** 2111,2142 **** &obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor|| goto done; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd)) goto done; ! if (obVerb && !PyWinObject_AsString(obVerb, (char **)&p->lpVerb)) goto done; ! if (obFile && !PyWinObject_AsString(obFile, (char **)&p->lpFile)) goto done; ! if (obParams && !PyWinObject_AsString(obParams, (char **)&p->lpParameters)) goto done; ! if (obDirectory && !PyWinObject_AsString(obDirectory, (char **)&p->lpDirectory)) goto done; if (obIDList) { ! p->fMask |= SEE_MASK_IDLIST; ! if (!PyObject_AsPIDL(obIDList, (ITEMIDLIST **)&p->lpIDList)) goto done; } if (obClass) { ! p->fMask |= SEE_MASK_CLASSNAME; ! if (!PyWinObject_AsString(obClass, (char **)&p->lpClass)) goto done; } if (obhkeyClass) { ! p->fMask |= SEE_MASK_CLASSKEY; ! if (!PyWinObject_AsHKEY(obhkeyClass, &p->hkeyClass)) goto done; } if (obHotKey) { ! p->fMask |= SEE_MASK_HOTKEY; ! p->dwHotKey = PyInt_AsLong(obHotKey); if (PyErr_Occurred()) goto done; --- 2141,2172 ---- &obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor|| goto done; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&info.hwnd)) goto done; ! if (obVerb && !PyWinObject_AsString(obVerb, (char **)&info.lpVerb)) goto done; ! if (obFile && !PyWinObject_AsString(obFile, (char **)&info.lpFile)) goto done; ! if (obParams && !PyWinObject_AsString(obParams, (char **)&info.lpParameters)) goto done; ! if (obDirectory && !PyWinObject_AsString(obDirectory, (char **)&info.lpDirectory)) goto done; if (obIDList) { ! info.fMask |= SEE_MASK_IDLIST; ! if (!PyObject_AsPIDL(obIDList, (ITEMIDLIST **)&info.lpIDList)) goto done; } if (obClass) { ! info.fMask |= SEE_MASK_CLASSNAME; ! if (!PyWinObject_AsString(obClass, (char **)&info.lpClass)) goto done; } if (obhkeyClass) { ! info.fMask |= SEE_MASK_CLASSKEY; ! if (!PyWinObject_AsHKEY(obhkeyClass, &info.hkeyClass)) goto done; } if (obHotKey) { ! info.fMask |= SEE_MASK_HOTKEY; ! info.dwHotKey = PyInt_AsLong(obHotKey); if (PyErr_Occurred()) goto done; *************** *** 2148,2170 **** goto done; #else ! p->fMask |= SEE_MASK_ICON; ! if (!PyWinObject_AsHANDLE(obhIcon, &p->hIcon)) goto done; #endif } if (obhMonitor) { ! p->fMask |= SEE_MASK_HMONITOR; ! if (!PyWinObject_AsHANDLE(obhMonitor, &p->hMonitor)) goto done; } { // new scope to avoid warnings about the goto PY_INTERFACE_PRECALL; ! ok = ShellExecuteEx(p); PY_INTERFACE_POSTCALL; } if (ok) { ret = Py_BuildValue("{s:l,s:N}", ! "hInstApp", p->hInstApp, ! "hProcess", PyWinObject_FromHANDLE(p->hProcess)); // @rdesc The result is a dictionary based on documented result values // in the structure. Currently this is "hInstApp" and "hProcess" --- 2178,2200 ---- goto done; #else ! info.fMask |= SEE_MASK_ICON; ! if (!PyWinObject_AsHANDLE(obhIcon, &info.hIcon)) goto done; #endif } if (obhMonitor) { ! info.fMask |= SEE_MASK_HMONITOR; ! if (!PyWinObject_AsHANDLE(obhMonitor, &info.hMonitor)) goto done; } { // new scope to avoid warnings about the goto PY_INTERFACE_PRECALL; ! ok = ShellExecuteEx(&info); PY_INTERFACE_POSTCALL; } if (ok) { ret = Py_BuildValue("{s:l,s:N}", ! "hInstApp", info.hInstApp, ! "hProcess", PyWinObject_FromHANDLE(info.hProcess)); // @rdesc The result is a dictionary based on documented result values // in the structure. Currently this is "hInstApp" and "hProcess" *************** *** 2173,2182 **** done: ! PyWinObject_FreeString((char *)p->lpVerb); ! PyWinObject_FreeString((char *)p->lpFile); ! PyWinObject_FreeString((char *)p->lpParameters); ! PyWinObject_FreeString((char *)p->lpDirectory); ! PyWinObject_FreeString((char *)p->lpClass); ! PyObject_FreePIDL((ITEMIDLIST *)p->lpIDList); return ret; } --- 2203,2212 ---- done: ! PyWinObject_FreeString((char *)info.lpVerb); ! PyWinObject_FreeString((char *)info.lpFile); ! PyWinObject_FreeString((char *)info.lpParameters); ! PyWinObject_FreeString((char *)info.lpDirectory); ! PyWinObject_FreeString((char *)info.lpClass); ! PyObject_FreePIDL((ITEMIDLIST *)info.lpIDList); return ret; } *************** *** 2338,2343 **** PYCOM_INTERFACE_FULL(ContextMenu), PYCOM_INTERFACE_FULL(ExtractIcon), PYCOM_INTERFACE_CLIENT_ONLY (ExtractImage), - PYCOM_INTERFACE_IID_ONLY (ExtractIconW), PYCOM_INTERFACE_FULL(ShellExtInit), PYCOM_INTERFACE_FULL(ShellFolder), --- 2368,2373 ---- PYCOM_INTERFACE_FULL(ContextMenu), PYCOM_INTERFACE_FULL(ExtractIcon), + PYCOM_INTERFACE_FULL(ExtractIconW), PYCOM_INTERFACE_CLIENT_ONLY (ExtractImage), PYCOM_INTERFACE_FULL(ShellExtInit), PYCOM_INTERFACE_FULL(ShellFolder), *************** *** 2359,2365 **** --- 2389,2400 ---- PYCOM_INTERFACE_SERVER_ONLY(EmptyVolumeCache), PYCOM_INTERFACE_SERVER_ONLY(EmptyVolumeCache2), + PYCOM_INTERFACE_CLIENT_ONLY(ExplorerBrowser), + PYCOM_INTERFACE_FULL(ExplorerBrowserEvents), + PYCOM_INTERFACE_FULL(ExplorerCommand), // IID_ICopyHook doesn't exist - hack it up { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) }, { &IID_IShellCopyHook, "ICopyHook", "IID_ICopyHook", NULL, NULL }, + PYCOM_INTERFACE_FULL(ShellItem), + PYCOM_INTERFACE_FULL(ShellItemArray), PYCOM_INTERFACE_CLIENT_ONLY(ShellLinkDataList), PYCOM_INTERFACE_CLIENT_ONLY(UniformResourceLocator), *************** *** 2457,2460 **** --- 2492,2496 ---- ADD_CONSTANT(HOTKEYF_EXT); ADD_CONSTANT(HOTKEYF_SHIFT); + ADD_IID(CLSID_ShellLink); ADD_IID(CLSID_ShellDesktop); *************** *** 2509,2513 **** ADD_IID(FMTID_MediaFileSummaryInformation); ADD_IID(FMTID_ImageSummaryInformation); ! #else # pragma message("Please update your SDK headers - IE5 features missing!") --- 2545,2549 ---- ADD_IID(FMTID_MediaFileSummaryInformation); ADD_IID(FMTID_ImageSummaryInformation); ! ADD_IID(IID_CDefView); #else # pragma message("Please update your SDK headers - IE5 features missing!") --- NEW FILE: PyIShellItem.cpp --- // This file implements the IShellItem Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIShellItem.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIShellItem::PyIShellItem(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIShellItem::~PyIShellItem() { } /* static */ IShellItem *PyIShellItem::GetI(PyObject *self) { return (IShellItem *)PyIUnknown::GetI(self); } // @pymethod |PyIShellItem|BindToHandler|Description of BindToHandler. PyObject *PyIShellItem::BindToHandler(PyObject *self, PyObject *args) { IShellItem *pISI = GetI(self); if ( pISI == NULL ) return NULL; // @pyparm <o PyIBindCtx *>|pbc||Description for pbc // @pyparm <o PyIID>|bhid||Description for bhid // @pyparm <o PyIID>|riid||Description for riid PyObject *obpbc; PyObject *obbhid; PyObject *obriid; IBindCtx *pbc; IID bhid; IID riid; void *pv; if ( !PyArg_ParseTuple(args, "OOO:BindToHandler", &obpbc, &obbhid, &obriid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpbc, IID_IBindCtx, (void **)&pbc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obbhid, &bhid)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISI->BindToHandler( pbc, bhid, riid, &pv ); if (pbc) pbc->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISI, IID_IShellItem ); return PyCom_PyObjectFromIUnknown((IUnknown *)pv, riid, FALSE); } // @pymethod |PyIShellItem|GetParent|Description of GetParent. PyObject *PyIShellItem::GetParent(PyObject *self, PyObject *args) { IShellItem *pISI = GetI(self); if ( pISI == NULL ) return NULL; IShellItem *psi; if ( !PyArg_ParseTuple(args, ":GetParent") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISI->GetParent( &psi ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISI, IID_IShellItem ); return PyCom_PyObjectFromIUnknown(psi, IID_IShellItem, FALSE); } // @pymethod |PyIShellItem|GetDisplayName|Description of GetDisplayName. PyObject *PyIShellItem::GetDisplayName(PyObject *self, PyObject *args) { IShellItem *pISI = GetI(self); if ( pISI == NULL ) return NULL; SIGDN sigdnName; // @pyparm int|sigdnName||Description for sigdnName if ( !PyArg_ParseTuple(args, "k:GetDisplayName", &sigdnName) ) return NULL; HRESULT hr; WCHAR *sz; PY_INTERFACE_PRECALL; hr = pISI->GetDisplayName( sigdnName, &sz ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISI, IID_IShellItem ); PyObject *ret = PyWinObject_FromWCHAR(sz); CoTaskMemFree(sz); return ret; } // @pymethod |PyIShellItem|GetAttributes|Description of GetAttributes. PyObject *PyIShellItem::GetAttributes(PyObject *self, PyObject *args) { IShellItem *pISI = GetI(self); if ( pISI == NULL ) return NULL; SFGAOF sfgaoMask; SFGAOF ret; // @pyparm <o PySFGAOF>|sfgaoMask||Description for sfgaoMask if ( !PyArg_ParseTuple(args, "k:GetAttributes", &sfgaoMask) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISI->GetAttributes( sfgaoMask, &ret); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISI, IID_IShellItem ); return PyLong_FromUnsignedLong(ret); } // @pymethod |PyIShellItem|Compare|Description of Compare. PyObject *PyIShellItem::Compare(PyObject *self, PyObject *args) { IShellItem *pISI = GetI(self); if ( pISI == NULL ) return NULL; // @pyparm <o PyIShellItem *>|psi||Description for psi SICHINTF hint; // @pyparm int|hint||Description for hint PyObject *obpsi; IShellItem *psi; if ( !PyArg_ParseTuple(args, "Oi:Compare", &obpsi, &hint) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsi, IID_IShellItem, (void **)&psi, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; int iOrder; PY_INTERFACE_PRECALL; hr = pISI->Compare( psi, hint, &iOrder ); if (psi) psi->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISI, IID_IShellItem ); return PyInt_FromLong(iOrder); } // @object PyIShellItem|Description of the interface static struct PyMethodDef PyIShellItem_methods[] = { { "BindToHandler", PyIShellItem::BindToHandler, 1 }, // @pymeth BindToHandler|Description of BindToHandler { "GetParent", PyIShellItem::GetParent, 1 }, // @pymeth GetParent|Description of GetParent { "GetDisplayName", PyIShellItem::GetDisplayName, 1 }, // @pymeth GetDisplayName|Description of GetDisplayName { "GetAttributes", PyIShellItem::GetAttributes, 1 }, // @pymeth GetAttributes|Description of GetAttributes { "Compare", PyIShellItem::Compare, 1 }, // @pymeth Compare|Description of Compare { NULL } }; PyComTypeObject PyIShellItem::type("PyIShellItem", &PyIUnknown::type, sizeof(PyIShellItem), PyIShellItem_methods, GET_PYCOM_CTOR(PyIShellItem)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGShellItem::BindToHandler( /* [unique][in] */ IBindCtx * pbc, /* [in] */ REFGUID bhid, /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppv) { PY_GATEWAY_METHOD; PyObject *obpbc; PyObject *obbhid; PyObject *obriid; obpbc = PyCom_PyObjectFromIUnknown(pbc, IID_IBindCtx, TRUE); obbhid = PyWinObject_FromIID(bhid); obriid = PyWinObject_FromIID(riid); PyObject *result; HRESULT hr=InvokeViaPolicy("BindToHandler", &result, "OOO", obpbc, obbhid, obriid); Py_XDECREF(obpbc); Py_XDECREF(obbhid); Py_XDECREF(obriid); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppv; if (!PyArg_Parse(result, "O" , &obppv)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("BindToHandler"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppv, riid, (void **)ppv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("BindToHandler"); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItem::GetParent( /* [out] */ IShellItem ** ppsi) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetParent", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppsi; if (!PyArg_Parse(result, "O" , &obppsi)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetParent"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppsi, IID_IShellItem, (void **)ppsi, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetParent"); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItem::GetDisplayName( /* [in] */ SIGDN sigdnName, /* [string][out] */ LPWSTR * ppszName) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetDisplayName", &result, "k", sigdnName); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (!PyWinObject_AsPfnAllocatedWCHAR(result, PyShell_AllocMem, ppszName)) hr = PyCom_SetAndLogCOMErrorFromPyException("GetDisplayName", IID_IShellItem); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItem::GetAttributes( /* [in] */ SFGAOF sfgaoMask, /* [out] */ SFGAOF * psfgaoAttribs) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetAttributes", &result, "k", sfgaoMask); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params *psfgaoAttribs = PyLong_AsUnsignedLongMask(result); hr = PyCom_SetAndLogCOMErrorFromPyException("GetAttributes", IID_IShellItem); Py_DECREF(result); return hr; } STDMETHODIMP PyGShellItem::Compare( /* [in] */ IShellItem * psi, /* [in] */ SICHINTF hint, /* [out] */ int * piOrder) { PY_GATEWAY_METHOD; PyObject *obpsi; obpsi = PyCom_PyObjectFromIUnknown(psi, IID_IShellItem, TRUE); PyObject *result; HRESULT hr=InvokeViaPolicy("Compare", &result, "Ok", obpsi, hint); Py_XDECREF(obpsi); if (FAILED(hr)) return hr; *piOrder = PyInt_AsLong(result); hr = PyCom_SetAndLogCOMErrorFromPyException("Compare", IID_IShellItem); Py_DECREF(result); return hr; } --- NEW FILE: PyIExplorerBrowser.cpp --- // This file implements the IExplorerBrowser Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIExplorerBrowser.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIExplorerBrowser::PyIExplorerBrowser(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIExplorerBrowser::~PyIExplorerBrowser() { } /* static */ IExplorerBrowser *PyIExplorerBrowser::GetI(PyObject *self) { return (IExplorerBrowser *)PyIUnknown::GetI(self); } // @pymethod |PyIExplorerBrowser|Initialize|Description of Initialize. PyObject *PyIExplorerBrowser::Initialize(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm HWND|hwndParent||Description for hwndParent RECT rc; PyObject *obprc; // @pyparm <o PyRECT>|prc||Description for prc FOLDERSETTINGS fs; PyObject *obpfs; // @pyparm <o PyFOLDERSETTINGS *>|pfs||Description for pfs HWND hwndParent; PyObject *obhwnd; if ( !PyArg_ParseTuple(args, "OOO:Initialize", &obhwnd, &obprc, &obpfs) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwndParent)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsRECT(obprc, &rc)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsFOLDERSETTINGS(obpfs, &fs)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->Initialize( hwndParent, &rc, &fs ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|Destroy|Description of Destroy. PyObject *PyIExplorerBrowser::Destroy(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":Destroy") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->Destroy( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod <o PyHANDLE>|PyIExplorerBrowser|SetRect|Description of SetRect. PyObject *PyIExplorerBrowser::SetRect(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; HDWP hdwp; PyObject *obphdwp; // @pyparm <o PyHDWP *>|phdwp||Description for phdwp RECT rcBrowser; PyObject *obrcBrowser; // @pyparm <o PyRECT>|rcBrowser||Description for rcBrowser if ( !PyArg_ParseTuple(args, "OO:SetRect", &obphdwp, &obrcBrowser) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsHANDLE( obphdwp, &hdwp )) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyWinObject_AsRECT( obrcBrowser, &rcBrowser )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->SetRect( &hdwp, rcBrowser ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); return PyWinLong_FromHANDLE(hdwp); } // @pymethod |PyIExplorerBrowser|SetPropertyBag|Description of SetPropertyBag. PyObject *PyIExplorerBrowser::SetPropertyBag(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm <o unicode>|pszPropertyBag||Description for pszPropertyBag PyObject *obpszPropertyBag; LPWSTR pszPropertyBag; if ( !PyArg_ParseTuple(args, "O:SetPropertyBag", &obpszPropertyBag) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszPropertyBag, &pszPropertyBag)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->SetPropertyBag( pszPropertyBag ); SysFreeString(pszPropertyBag); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|SetEmptyText|Description of SetEmptyText. PyObject *PyIExplorerBrowser::SetEmptyText(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm <o unicode>|pszEmptyText||Description for pszEmptyText PyObject *obpszEmptyText; LPWSTR pszEmptyText; if ( !PyArg_ParseTuple(args, "O:SetEmptyText", &obpszEmptyText) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyWinObject_AsBstr(obpszEmptyText, &pszEmptyText)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->SetEmptyText( pszEmptyText ); SysFreeString(pszEmptyText); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|SetFolderSettings|Description of SetFolderSettings. PyObject *PyIExplorerBrowser::SetFolderSettings(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; FOLDERSETTINGS fs; PyObject *obpfs; // @pyparm <o PyFOLDERSETTINGS *>|pfs||Description for pfs if ( !PyArg_ParseTuple(args, "O:SetFolderSettings", &obpfs) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsFOLDERSETTINGS( obpfs, &fs )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->SetFolderSettings( &fs ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod int|PyIExplorerBrowser|Advise|Description of Advise. PyObject *PyIExplorerBrowser::Advise(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm <o PyIExplorerBrowserEvents *>|psbe||Description for psbe // @pyparm <o PyDWORD *>|pdwCookie||Description for pdwCookie PyObject *obpsbe; IExplorerBrowserEvents *psbe; if ( !PyArg_ParseTuple(args, "O:Advise", &obpsbe) ) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obpsbe, IID_IExplorerBrowserEvents, (void **)&psbe, TRUE /* bNoneOK */)) return NULL; HRESULT hr; DWORD dwCookie; PY_INTERFACE_PRECALL; hr = pIEB->Advise( psbe, &dwCookie ); if (psbe) psbe->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); return PyInt_FromLong(dwCookie); } // @pymethod |PyIExplorerBrowser|Unadvise|Description of Unadvise. PyObject *PyIExplorerBrowser::Unadvise(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm int|dwCookie||Description for dwCookie DWORD dwCookie; if ( !PyArg_ParseTuple(args, "l:Unadvise", &dwCookie) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->Unadvise( dwCookie ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|SetOptions|Description of SetOptions. PyObject *PyIExplorerBrowser::SetOptions(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; EXPLORER_BROWSER_OPTIONS dwFlag; PyObject *obdwFlag; // @pyparm <o PyEXPLORER_BROWSER_OPTIONS>|dwFlag||Description for dwFlag if ( !PyArg_ParseTuple(args, "O:SetOptions", &obdwFlag) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsEXPLORER_BROWSER_OPTIONS( obdwFlag, &dwFlag )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->SetOptions( dwFlag ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod int|PyIExplorerBrowser|GetOptions|Description of GetOptions. PyObject *PyIExplorerBrowser::GetOptions(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; EXPLORER_BROWSER_OPTIONS dwFlag; PyObject *obpdwFlag; // @pyparm <o PyEXPLORER_BROWSER_OPTIONS *>|pdwFlag||Description for pdwFlag if ( !PyArg_ParseTuple(args, "O:GetOptions", &obpdwFlag) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsEXPLORER_BROWSER_OPTIONS( obpdwFlag, &dwFlag )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->GetOptions( &dwFlag ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); return PyInt_FromLong(dwFlag); } // @pymethod |PyIExplorerBrowser|BrowseToIDList|Description of BrowseToIDList. PyObject *PyIExplorerBrowser::BrowseToIDList(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; PCUIDLIST_RELATIVE pidl; PyObject *obpidl; // @pyparm <o PyPCUIDLIST_RELATIVE>|pidl||Description for pidl // @pyparm int|uFlags||Description for uFlags UINT uFlags; if ( !PyArg_ParseTuple(args, "Oi:BrowseToIDList", &obpidl, &uFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsPCUIDLIST_RELATIVE( obpidl, &pidl, TRUE )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->BrowseToIDList( pidl, uFlags ); PY_INTERFACE_POSTCALL; PyObject_FreePCUIDLIST_RELATIVE(pidl); if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|BrowseToObject|Description of BrowseToObject. PyObject *PyIExplorerBrowser::BrowseToObject(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm <o PyIUnknown *>|punk||Description for punk // @pyparm int|uFlags||Description for uFlags PyObject *obpunk; IUnknown *punk; UINT uFlags; if ( !PyArg_ParseTuple(args, "Oi:BrowseToObject", &obpunk, &uFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpunk, IID_IUnknown, (void **)&punk, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->BrowseToObject( punk, uFlags ); if (punk) punk->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|FillFromObject|Description of FillFromObject. PyObject *PyIExplorerBrowser::FillFromObject(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm <o PyIUnknown *>|punk||Description for punk EXPLORER_BROWSER_FILL_FLAGS dwFlags; PyObject *obdwFlags; // @pyparm <o PyEXPLORER_BROWSER_FILL_FLAGS>|dwFlags||Description for dwFlags PyObject *obpunk; IUnknown * punk; if ( !PyArg_ParseTuple(args, "OO:FillFromObject", &obpunk, &obdwFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpunk, IID_IUnknown, (void **)&punk, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyObject_AsEXPLORER_BROWSER_FILL_FLAGS( obdwFlags, &dwFlags )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->FillFromObject( punk, dwFlags ); if (punk) punk->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIExplorerBrowser|RemoveAll|Description of RemoveAll. PyObject *PyIExplorerBrowser::RemoveAll(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":RemoveAll") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->RemoveAll( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); Py_INCREF(Py_None); return Py_None; } // @pymethod <o PyIUnknown>|PyIExplorerBrowser|GetCurrentView|Description of GetCurrentView. PyObject *PyIExplorerBrowser::GetCurrentView(PyObject *self, PyObject *args) { IExplorerBrowser *pIEB = GetI(self); if ( pIEB == NULL ) return NULL; // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; IID riid; void *ppv; if ( !PyArg_ParseTuple(args, "O:GetCurrentView", &obriid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEB->GetCurrentView( riid, &ppv ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEB, IID_IExplorerBrowser ); return PyCom_PyObjectFromIUnknown((IUnknown *)ppv, riid, FALSE); } // @object PyIExplorerBrowser|Description of the interface static struct PyMethodDef PyIExplorerBrowser_methods[] = { { "Initialize", PyIExplorerBrowser::Initialize, 1 }, // @pymeth Initialize|Description of Initialize { "Destroy", PyIExplorerBrowser::Destroy, 1 }, // @pymeth Destroy|Description of Destroy { "SetRect", PyIExplorerBrowser::SetRect, 1 }, // @pymeth SetRect|Description of SetRect { "SetPropertyBag", PyIExplorerBrowser::SetPropertyBag, 1 }, // @pymeth SetPropertyBag|Description of SetPropertyBag { "SetEmptyText", PyIExplorerBrowser::SetEmptyText, 1 }, // @pymeth SetEmptyText|Description of SetEmptyText { "SetFolderSettings", PyIExplorerBrowser::SetFolderSettings, 1 }, // @pymeth SetFolderSettings|Description of SetFolderSettings { "Advise", PyIExplorerBrowser::Advise, 1 }, // @pymeth Advise|Description of Advise { "Unadvise", PyIExplorerBrowser::Unadvise, 1 }, // @pymeth Unadvise|Description of Unadvise { "SetOptions", PyIExplorerBrowser::SetOptions, 1 }, // @pymeth SetOptions|Description of SetOptions { "GetOptions", PyIExplorerBrowser::GetOptions, 1 }, // @pymeth GetOptions|Description of GetOptions { "BrowseToIDList", PyIExplorerBrowser::BrowseToIDList, 1 }, // @pymeth BrowseToIDList|Description of BrowseToIDList { "BrowseToObject", PyIExplorerBrowser::BrowseToObject, 1 }, // @pymeth BrowseToObject|Description of BrowseToObject { "FillFromObject", PyIExplorerBrowser::FillFromObject, 1 }, // @pymeth FillFromObject|Description of FillFromObject { "RemoveAll", PyIExplorerBrowser::RemoveAll, 1 }, // @pymeth RemoveAll|Description of RemoveAll { "GetCurrentView", PyIExplorerBrowser::GetCurrentView, 1 }, // @pymeth GetCurrentView|Description of GetCurrentView { NULL } }; PyComTypeObject PyIExplorerBrowser::type("PyIExplorerBrowser", &PyIUnknown::type, sizeof(PyIExplorerBrowser), PyIExplorerBrowser_methods, GET_PYCOM_CTOR(PyIExplorerBrowser)); --- NEW FILE: PyIExplorerCommand.h --- // This file declares the IExplorerCommand Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIExplorerCommand : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIExplorerCommand); static IExplorerCommand *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *GetTitle(PyObject *self, PyObject *args); static PyObject *GetIcon(PyObject *self, PyObject *args); static PyObject *GetToolTip(PyObject *self, PyObject *args); static PyObject *GetCanonicalName(PyObject *self, PyObject *args); static PyObject *GetState(PyObject *self, PyObject *args); static PyObject *Invoke(PyObject *self, PyObject *args); static PyObject *GetFlags(PyObject *self, PyObject *args); static PyObject *EnumSubCommands(PyObject *self, PyObject *args); protected: PyIExplorerCommand(IUnknown *pdisp); ~PyIExplorerCommand(); }; // --------------------------------------------------- // // Gateway Declaration class PyGExplorerCommand : public PyGatewayBase, public IExplorerCommand { protected: PyGExplorerCommand(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGExplorerCommand, IExplorerCommand, IID_IExplorerCommand, PyGatewayBase) // IExplorerCommand STDMETHOD(GetTitle)( IShellItemArray * psiItemArray, LPWSTR * ppszName); STDMETHOD(GetIcon)( IShellItemArray * psiItemArray, LPWSTR * ppszIcon); STDMETHOD(GetToolTip)( IShellItemArray * psiItemArray, LPWSTR * ppszInfotip); STDMETHOD(GetCanonicalName)( GUID * pguidCommandName); STDMETHOD(GetState)( IShellItemArray * psiItemArray, BOOL fOkToBeSlow, EXPCMDSTATE * pCmdState); STDMETHOD(Invoke)( IShellItemArray * psiItemArray, IBindCtx * pbc); STDMETHOD(GetFlags)( EXPCMDFLAGS * pFlags); STDMETHOD(EnumSubCommands)( IEnumExplorerCommand ** ppEnum); }; --- NEW FILE: PyIExplorerCommand.cpp --- // This file implements the IExplorerCommand Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIExplorerCommand.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIExplorerCommand::PyIExplorerCommand(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIExplorerCommand::~PyIExplorerCommand() { } /* static */ IExplorerCommand *PyIExplorerCommand::GetI(PyObject *self) { return (IExplorerCommand *)PyIUnknown::GetI(self); } // @pymethod unicode|PyIExplorerCommand|GetTitle|Description of GetTitle. PyObject *PyIExplorerCommand::GetTitle(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; // @pyparm <o PyIShellItemArray *>|psiItemArray||Description for psiItemArray PyObject *obpsiItemArray; IShellItemArray * psiItemArray; if ( !PyArg_ParseTuple(args, "O:GetTitle", &obpsiItemArray) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsiItemArray, IID_IShellItemArray, (void **)&psiItemArray, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; WCHAR *pszName = 0; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEC->GetTitle( psiItemArray, &pszName ); if (psiItemArray) psiItemArray->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); PyObject *ret = PyWinObject_FromWCHAR(pszName); CoTaskMemFree(pszName); return ret; } // @pymethod unicode|PyIExplorerCommand|GetIcon|Description of GetIcon. PyObject *PyIExplorerCommand::GetIcon(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; // @pyparm <o PyIShellItemArray *>|psiItemArray||Description for psiItemArray PyObject *obpsiItemArray; IShellItemArray * psiItemArray; if ( !PyArg_ParseTuple(args, "O:GetIcon", &obpsiItemArray) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsiItemArray, IID_IShellItemArray, (void **)&psiItemArray, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; WCHAR *pszIcon = 0; PY_INTERFACE_PRECALL; hr = pIEC->GetIcon( psiItemArray, &pszIcon ); if (psiItemArray) psiItemArray->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); PyObject *ret = PyWinObject_FromWCHAR(pszIcon); CoTaskMemFree(pszIcon); return ret; } // @pymethod unicode|PyIExplorerCommand|GetToolTip|Description of GetToolTip. PyObject *PyIExplorerCommand::GetToolTip(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; // @pyparm <o PyIShellItemArray *>|psiItemArray||Description for psiItemArray PyObject *obpsiItemArray; IShellItemArray * psiItemArray; if ( !PyArg_ParseTuple(args, "O:GetToolTip", &obpsiItemArray) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsiItemArray, IID_IShellItemArray, (void **)&psiItemArray, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; WCHAR *psz = 0; PY_INTERFACE_PRECALL; hr = pIEC->GetToolTip(psiItemArray, &psz); if (psiItemArray) psiItemArray->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); PyObject *ret = PyWinObject_FromWCHAR(psz); CoTaskMemFree(psz); return ret; } // @pymethod <o PyIID>|PyIExplorerCommand|GetCanonicalName|Description of GetCanonicalName. PyObject *PyIExplorerCommand::GetCanonicalName(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":GetCanonicalName") ) return NULL; BOOL bPythonIsHappy = TRUE; GUID guid; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEC->GetCanonicalName( &guid ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); return PyWinObject_FromIID(guid); } // @pymethod int|PyIExplorerCommand|GetState|Description of GetState. PyObject *PyIExplorerCommand::GetState(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; // @pyparm <o PyIShellItemArray *>|psiItemArray||Description for psiItemArray // @pyparm int|fOkToBeSlow||Description for fOkToBeSlow PyObject *obpsiItemArray; IShellItemArray* psiItemArray; BOOL fOkToBeSlow; if ( !PyArg_ParseTuple(args, "Oi:GetState", &obpsiItemArray, &fOkToBeSlow) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsiItemArray, IID_IShellItemArray, (void **)&psiItemArray, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; DWORD cmdState; PY_INTERFACE_PRECALL; hr = pIEC->GetState(psiItemArray, fOkToBeSlow, &cmdState ); if (psiItemArray) psiItemArray->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); return PyLong_FromUnsignedLong(cmdState); } // @pymethod |PyIExplorerCommand|Invoke|Description of Invoke. PyObject *PyIExplorerCommand::Invoke(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; // @pyparm <o PyIShellItemArray *>|psiItemArray||Description for psiItemArray // @pyparm <o PyIBindCtx *>|pbc||Description for pbc PyObject *obpsiItemArray; PyObject *obpbc; IShellItemArray *psiItemArray; IBindCtx *pbc; if ( !PyArg_ParseTuple(args, "OO:Invoke", &obpsiItemArray, &obpbc) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpsiItemArray, IID_IShellItemArray, (void **)&psiItemArray, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpbc, IID_IBindCtx, (void **)&pbc, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEC->Invoke( psiItemArray, pbc ); if (psiItemArray) psiItemArray->Release(); if (pbc) pbc->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); Py_INCREF(Py_None); return Py_None; } // @pymethod int|PyIExplorerCommand|GetFlags|Description of GetFlags. PyObject *PyIExplorerCommand::GetFlags(PyObject *self, PyObject *args) { IExplorerCommand *pIEC = GetI(self); if ( pIEC == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":GetFlags") ) return NULL; HRESULT hr; DWORD flags; PY_INTERFACE_PRECALL; hr = pIEC->GetFlags( &flags ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIEC, IID_IExplorerCommand ); return PyLong_FromUnsignedLong(flags); } // @pymethod <o PyIEnumExplorerCommand>|PyIExplorerCommand|EnumSubCommands|Description of EnumSubCommands. PyObject *PyIExplorerCommand::EnumSubCommands(PyObject *self, PyObject *args) { ... [truncated message content] |
From: Mark H. <mha...@us...> - 2008-01-08 00:37:46
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14425/com/win32comext/shell/src Modified Files: PyIShellView.cpp Log Message: autoduck corrections Index: PyIShellView.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellView.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyIShellView.cpp 3 Jun 2007 14:53:07 -0000 1.7 --- PyIShellView.cpp 8 Jan 2008 00:37:49 -0000 1.8 *************** *** 26,30 **** } ! // @pymethod |PyIShellView|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIShellView::TranslateAccelerator(PyObject *self, PyObject *args) { --- 26,30 ---- } ! // @pymethod int|PyIShellView|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIShellView::TranslateAccelerator(PyObject *self, PyObject *args) { *************** *** 46,49 **** --- 46,50 ---- if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); + // @rdesc The result is the HRESULT from the underlying TranslateAccelerator call return PyInt_FromLong(hr); } *************** *** 107,111 **** } ! // @pymethod |PyIShellView|CreateViewWindow|Description of CreateViewWindow. PyObject *PyIShellView::CreateViewWindow(PyObject *self, PyObject *args) { --- 108,112 ---- } ! // @pymethod int|PyIShellView|CreateViewWindow|Description of CreateViewWindow. PyObject *PyIShellView::CreateViewWindow(PyObject *self, PyObject *args) { *************** *** 144,147 **** --- 145,149 ---- if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IShellView ); + // @rdesc The result is an integer handle to the new window. return PyWinLong_FromHANDLE(hWnd); } *************** *** 165,169 **** } ! // @pymethod |PyIShellView|GetCurrentInfo|Description of GetCurrentInfo. PyObject *PyIShellView::GetCurrentInfo(PyObject *self, PyObject *args) { --- 167,171 ---- } ! // @pymethod <o PyFOLDERSETTINGS>|PyIShellView|GetCurrentInfo|Description of GetCurrentInfo. PyObject *PyIShellView::GetCurrentInfo(PyObject *self, PyObject *args) { *************** *** 265,269 **** } ! // @pymethod |PyIShellView|GetItemObject|Description of GetItemObject. PyObject *PyIShellView::GetItemObject(PyObject *self, PyObject *args) { --- 267,271 ---- } ! // @pymethod <o PyIUnknown>|PyIShellView|GetItemObject|Description of GetItemObject. PyObject *PyIShellView::GetItemObject(PyObject *self, PyObject *args) { |
From: Mark H. <mha...@us...> - 2008-01-07 22:56:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10280 Modified Files: shell_view.py Log Message: * Fix IID handling so we can catch requests for unsupported IIDs. * Failed attempt to make ShellExecuteEx with Folders work as expected. Index: shell_view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/shell_view.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shell_view.py 30 Oct 2007 09:56:42 -0000 1.9 --- shell_view.py 7 Jan 2008 22:56:38 -0000 1.10 *************** *** 62,65 **** --- 62,67 ---- # version will spew output to win32traceutil. debug=0 + if debug: + import win32traceutil # markh is toying with an implementation that allows auto reload of a module *************** *** 270,275 **** def CreateViewObject(self, hwnd, iid): ! return wrap(ScintillaShellView(hwnd, self.path), useDispatcher=debug>0) ! # A ShellFolder for our Python objects class ShellFolderObject(ShellFolderBase): --- 272,276 ---- def CreateViewObject(self, hwnd, iid): ! return wrap(ScintillaShellView(hwnd, self.path), iid, useDispatcher=debug>0) # A ShellFolder for our Python objects class ShellFolderObject(ShellFolderBase): *************** *** 288,293 **** else: lineno = object.methods[self.method_name] ! return wrap(ScintillaShellView(hwnd, self.path, lineno), ! useDispatcher=debug>0) def EnumObjects(self, hwndOwner, flags): assert self.method_name is None, "Should not be enuming methods!" --- 289,295 ---- else: lineno = object.methods[self.method_name] ! return wrap(ScintillaShellView(hwnd, self.path, lineno), ! iid, useDispatcher=debug>0) ! def EnumObjects(self, hwndOwner, flags): assert self.method_name is None, "Should not be enuming methods!" *************** *** 337,341 **** self.pidl = pidl def CreateViewObject(self, hwnd, iid): ! return wrap(FileSystemView(self, hwnd), useDispatcher=debug>0) def EnumObjects(self, hwndOwner, flags): --- 339,343 ---- self.pidl = pidl def CreateViewObject(self, hwnd, iid): ! return wrap(FileSystemView(self, hwnd), iid, useDispatcher=debug>0) def EnumObjects(self, hwndOwner, flags): *************** *** 377,386 **** # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print "CreateViewWindow", prev, settings, browser, rect self.cur_foldersettings = settings self.browser = browser self._CreateMainWindow(prev, settings, browser, rect) self._CreateChildWindow(prev) - return self.hwnd def _CreateMainWindow(self, prev, settings, browser, rect): --- 379,387 ---- # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print "FileSystemView.CreateViewWindow", prev, settings, browser, rect self.cur_foldersettings = settings self.browser = browser self._CreateMainWindow(prev, settings, browser, rect) self._CreateChildWindow(prev) def _CreateMainWindow(self, prev, settings, browser, rect): *************** *** 527,531 **** # Enumerate and store the child PIDLs for cid in self.folder.EnumObjects(self.hwnd, 0): - print "Have CID" self.children.append(cid) --- 528,531 ---- *************** *** 584,588 **** def OnNotify(self, hwnd, msg, wparam, lparam): hwndFrom, idFrom, code = win32gui_struct.UnpackWMNOTIFY(lparam) ! print "OnNotify code=0x%x (0x%x, 0x%x)" % (code, wparam, lparam) if code == commctrl.NM_SETFOCUS: # Control got focus - Explorer may not know - tell it --- 584,588 ---- def OnNotify(self, hwnd, msg, wparam, lparam): hwndFrom, idFrom, code = win32gui_struct.UnpackWMNOTIFY(lparam) ! #print "OnNotify code=0x%x (0x%x, 0x%x)" % (code, wparam, lparam) if code == commctrl.NM_SETFOCUS: # Control got focus - Explorer may not know - tell it *************** *** 613,621 **** sel.append(self.children[n][-1:]) print "Selection is", sel - # Get the IContextMenu for the items. - inout, cm = self.folder.GetUIObjectOf(self.hwnd_parent, sel, - shell.IID_IContextMenu, 0) hmenu = win32gui.CreateMenu() try: # As per 'Q179911', we need to determine if the default operation # should be 'open' or 'explore' --- 613,622 ---- sel.append(self.children[n][-1:]) print "Selection is", sel hmenu = win32gui.CreateMenu() try: + # Get the IContextMenu for the items. + inout, cm = self.folder.GetUIObjectOf(self.hwnd_parent, sel, + shell.IID_IContextMenu, 0) + # As per 'Q179911', we need to determine if the default operation # should be 'open' or 'explore' *************** *** 626,638 **** except pythoncom.com_error: pass ! id_cmd_first = 1 # TrackPopupMenu makes it hard to use 0 ! cm.QueryContextMenu(hmenu, 0, id_cmd_first, -1, flags) ! # Find the default item in the returned menu. ! cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0) ! if cmd == -1: ! print "Oops: _doDefaultActionFor found no default menu" else: ! ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0 ! cm.InvokeCommand(ci) finally: win32gui.DestroyMenu(hmenu) --- 627,659 ---- except pythoncom.com_error: pass ! # *sob* - delegating to the shell does work - but lands us ! # in the original location. Q179911 also shows that ! # ShellExecuteEx should work - but I can't make it work as ! # described (XP: function call succeeds, but another thread ! # shows a dialog with text of E_INVALID_PARAM, and new ! # Explorer window opens with desktop view. Vista: function ! # call succeeds, but no window created at all. ! # On Vista, I'd love to get an IExplorerBrowser interface ! # from the shell, but a QI fails, and although the ! # IShellBrowser does appear to support IServiceProvider, I ! # still can't get it ! if 0: ! id_cmd_first = 1 # TrackPopupMenu makes it hard to use 0 ! cm.QueryContextMenu(hmenu, 0, id_cmd_first, -1, flags) ! # Find the default item in the returned menu. ! cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0) ! if cmd == -1: ! print "Oops: _doDefaultActionFor found no default menu" ! else: ! ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0 ! cm.InvokeCommand(ci) else: ! rv = shell.ShellExecuteEx( ! hwnd = self.hwnd_parent, ! nShow=win32con.SW_NORMAL, ! lpClass="folder", ! lpVerb="explore", ! lpIDList=sel[0]) ! print "ShellExecuteEx returned", rv finally: win32gui.DestroyMenu(hmenu) *************** *** 684,690 **** def OnSize(self, hwnd, msg, wparam, lparam): - # hrm - this doesn't seem to be called on XP, but is on Vista - # (and is *necessary* on Vista, as it seems to create windows with - # a zero client-rect, then moves it) #print "OnSize", self.hwnd_child, win32api.LOWORD(lparam), win32api.HIWORD(lparam) if self.hwnd_child is not None: --- 705,708 ---- *************** *** 707,717 **** def _SendSci(self, msg, wparam=0, lparam=0): return win32gui.SendMessage(self.hwnd, msg, wparam, lparam) - - def GetWindow(self): - return self.hwnd - # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print "CreateViewWindow", prev, settings, browser, rect # Make sure scintilla.dll is loaded. If not, find it on sys.path # (which it generally is for Pythonwin) --- 725,731 ---- def _SendSci(self, msg, wparam=0, lparam=0): return win32gui.SendMessage(self.hwnd, msg, wparam, lparam) # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print "ScintillaShellView.CreateViewWindow", prev, settings, browser, rect # Make sure scintilla.dll is loaded. If not, find it on sys.path # (which it generally is for Pythonwin) *************** *** 739,748 **** win32con.WM_SIZE: self.OnSize, } ! win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) file_data = file(self.filename, "U").read() self._SetupLexer() ! self._SendSci(scintillacon.SCI_SETTEXT, 0, file_data) if self.lineno != None: self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno) --- 753,762 ---- win32con.WM_SIZE: self.OnSize, } ! # win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) file_data = file(self.filename, "U").read() self._SetupLexer() ! self._SendSci(scintillacon.SCI_ADDTEXT, len(file_data), file_data) if self.lineno != None: self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno) *************** *** 782,785 **** --- 796,806 ---- self._SendSci(scintillacon.SCI_STYLESETEOLFILLED, stylenum, 1) # Only needed for unclosed strings. + # IOleWindow + def GetWindow(self): + return self.hwnd + + def UIActivate(self, activate_state): + print "OnActivate" + def DestroyViewWindow(self): win32gui.DestroyWindow(self.hwnd) *************** *** 790,796 **** return winerror.S_FALSE - def UIActivate(self, activate_state): - print "Scintilla OnActivate" - def OnSize(self, hwnd, msg, wparam, lparam): x = win32api.LOWORD(lparam) --- 811,814 ---- |
From: Roger U. <ru...@us...> - 2008-01-07 03:10:53
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24981 Modified Files: win32clipboardmodule.cpp Log Message: Allow to build with UNICODE defined Index: win32clipboardmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** win32clipboardmodule.cpp 25 Aug 2007 05:14:55 -0000 1.22 --- win32clipboardmodule.cpp 7 Jan 2008 03:10:53 -0000 1.23 *************** *** 18,21 **** --- 18,23 ---- #define PY_SSIZE_T_CLEAN // this should be Py_ssize_t clean! + // #define UNICODE + // #define _UNICODE // CRT function (_tcs*) switch based on this #include "windows.h" #include "Python.h" *************** *** 311,316 **** // @pyparm int|format|CF_TEXT|Specifies a clipboard format. For a description of // the standard clipboard formats, see Standard Clipboard Formats. ! int format = CF_TEXT; if (!PyArg_ParseTuple(args, "|i:GetClipboardData:", &format)) { --- 313,321 ---- // @pyparm int|format|CF_TEXT|Specifies a clipboard format. For a description of // the standard clipboard formats, see Standard Clipboard Formats. ! #ifdef UNICODE ! int format = CF_UNICODETEXT; ! #else int format = CF_TEXT; + #endif if (!PyArg_ParseTuple(args, "|i:GetClipboardData:", &format)) { *************** *** 507,511 **** } ! char buf[256]; int rc; Py_BEGIN_ALLOW_THREADS; --- 512,516 ---- } ! TCHAR buf[256]; int rc; Py_BEGIN_ALLOW_THREADS; *************** *** 516,521 **** return ReturnAPIError("GetClipboardFormatName"); } ! ! return Py_BuildValue("s", buf); // @pyseeapi GetClipboardFormatName --- 521,525 ---- return ReturnAPIError("GetClipboardFormatName"); } ! return PyWinObject_FromTCHAR(buf); // @pyseeapi GetClipboardFormatName *************** *** 580,584 **** // @comm This method is not available on some early Windows (eg 95) machines. ! HMODULE hmod = LoadLibrary("user32.dll"); PFNGetClipboardSequenceNumber pfnGetClipboardSequenceNumber = NULL; if (hmod) pfnGetClipboardSequenceNumber=(PFNGetClipboardSequenceNumber)GetProcAddress(hmod, "GetClipboardSequenceNumber"); --- 584,588 ---- // @comm This method is not available on some early Windows (eg 95) machines. ! HMODULE hmod = LoadLibrary(TEXT("user32.dll")); PFNGetClipboardSequenceNumber pfnGetClipboardSequenceNumber = NULL; if (hmod) pfnGetClipboardSequenceNumber=(PFNGetClipboardSequenceNumber)GetProcAddress(hmod, "GetClipboardSequenceNumber"); *************** *** 815,837 **** py_register_clipboard_format(PyObject* self, PyObject* args) { ! ! // @pyparm string|name||String that names the new format. ! ! char *name; ! if (!PyArg_ParseTuple(args, "s:RegisterClipboardFormat", ! &name)) { ! return NULL; ! } ! ! UINT rc; ! Py_BEGIN_ALLOW_THREADS; ! rc = RegisterClipboardFormat(name); ! Py_END_ALLOW_THREADS; ! ! if (!rc) { ! return ReturnAPIError("RegisterClipboardFormat"); ! } ! ! return (Py_BuildValue("i", (int)rc)); // @comm If a registered format with the specified name already exists, a --- 819,837 ---- py_register_clipboard_format(PyObject* self, PyObject* args) { ! TCHAR *name; ! PyObject *obname; ! if (!PyArg_ParseTuple(args, "O:RegisterClipboardFormat", ! &obname)) // @pyparm string|name||String that names the new format. ! return NULL; ! if (!PyWinObject_AsTCHAR(obname, &name, FALSE)) ! return NULL; ! UINT rc; ! Py_BEGIN_ALLOW_THREADS; ! rc = RegisterClipboardFormat(name); ! Py_END_ALLOW_THREADS; ! PyWinObject_FreeTCHAR(name); ! if (!rc) ! return ReturnAPIError("RegisterClipboardFormat"); ! return PyInt_FromLong(rc); // @comm If a registered format with the specified name already exists, a *************** *** 949,990 **** py_set_clipboard_text(PyObject* self, PyObject* args) { ! // @pyparm string|text||The text to place on the clipboard. ! ! int format = CF_TEXT; ! char *text; ! Py_ssize_t size; ! if (!PyArg_ParseTuple(args, "s#:SetClipboardText", ! &text, &size)) { ! return NULL; ! } ! ! HGLOBAL hMem; ! LPTSTR pszDst; ! ! hMem = GlobalAlloc(GHND, size+1); ! if (hMem == NULL) { ! return ReturnAPIError("GlobalAlloc"); ! } ! pszDst = (char*)GlobalLock(hMem); ! lstrcpy(pszDst, text); ! pszDst[size] = 0; ! GlobalUnlock(hMem); ! ! HANDLE data; ! Py_BEGIN_ALLOW_THREADS; ! data = SetClipboardData((UINT)format, hMem); ! Py_END_ALLOW_THREADS; ! ! if (!data) ! return ReturnAPIError("SetClipboardText"); ! return PyWinLong_FromHANDLE(data); ! // @pyseeapi SetClipboardData ! // @rdesc If the function succeeds, the return value is integer handle ! // of the data.<nl> ! // If the function fails, win32api.error is raised with the GetLastError ! // info. } --- 949,994 ---- py_set_clipboard_text(PyObject* self, PyObject* args) { + #ifdef UNICODE + int format = CF_UNICODETEXT; + #else + int format = CF_TEXT; + #endif + TCHAR *text; + PyObject *obtext, *ret=NULL; + DWORD size; + if (!PyArg_ParseTuple(args, "O:SetClipboardText", + &obtext)) // @pyparm str/unicode|text||The text to place on the clipboard. + return NULL; ! if (!PyWinObject_AsTCHAR(obtext, &text, FALSE, &size)) ! return NULL; ! HGLOBAL hMem; ! LPTSTR pszDst=NULL; ! hMem = GlobalAlloc(GHND, (size+1) * sizeof(TCHAR)); ! if (hMem == NULL) ! PyWin_SetAPIError("GlobalAlloc"); ! else{ ! pszDst = (TCHAR *)GlobalLock(hMem); ! _tcscpy(pszDst, text); ! pszDst[size] = 0; ! GlobalUnlock(hMem); ! HANDLE data; ! Py_BEGIN_ALLOW_THREADS; ! data = SetClipboardData((UINT)format, hMem); ! Py_END_ALLOW_THREADS; ! if (!data) ! PyWin_SetAPIError("SetClipboardText"); ! else ! ret = PyWinLong_FromHANDLE(data); ! } ! PyWinObject_FreeTCHAR(text); ! return ret; ! // @pyseeapi SetClipboardData ! // @rdesc If the function succeeds, the return value is integer handle ! // of the data.<nl> ! // If the function fails, win32api.error is raised with the GetLastError ! // info. } |
From: Roger U. <ru...@us...> - 2008-01-04 04:53:41
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364 Modified Files: test_win32api.py Log Message: Add tests for registry values Index: test_win32api.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_win32api.py 1 Jun 2007 14:57:19 -0000 1.12 --- test_win32api.py 4 Jan 2008 04:53:29 -0000 1.13 *************** *** 56,59 **** --- 56,82 ---- except ZeroDivisionError: pass + + def testValues(self): + key_name = r'PythonTestHarness\win32api' + ## tuples containing value name, value type, data + values=( + (None, win32con.REG_SZ, 'This is default unnamed value'), + ('REG_SZ', win32con.REG_SZ,'REG_SZ text data'), + ('REG_EXPAND_SZ', win32con.REG_EXPAND_SZ, '%systemdir%'), + ## REG_MULTI_SZ value needs to be a list since strings are returned as a list + ('REG_MULTI_SZ', win32con.REG_MULTI_SZ, ['string 1','string 2','string 3','string 4']), + ('REG_DWORD', win32con.REG_DWORD, 666), + ('REG_BINARY', win32con.REG_BINARY, '\x00\x01\x02\x03\x04\x05\x06\x07\x08\x01\x00'), + ) + + hkey = win32api.RegCreateKey(win32con.HKEY_CURRENT_USER, key_name) + for value_name, reg_type, data in values: + win32api.RegSetValueEx(hkey, value_name, None, reg_type, data) + + for value_name, orig_type, orig_data in values: + data, typ=win32api.RegQueryValueEx(hkey, value_name) + self.assertEqual(typ, orig_type) + self.assertEqual(data, orig_data) + def testNotifyChange(self): def change(): |
From: Roger U. <ru...@us...> - 2007-12-26 18:09:13
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12287 Modified Files: win32file.i Log Message: Allow to build with UNICODE defined Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** win32file.i 10 Dec 2007 23:24:34 -0000 1.87 --- win32file.i 26 Dec 2007 18:09:16 -0000 1.88 *************** *** 279,283 **** // @pyseeapi CreateMailslot PyHANDLE CreateMailslot( ! LPCTSTR Name, // @pyparm str|Name||Name of the mailslot, of the form \\.\mailslot\[path]name DWORD MaxMessageSize, // @pyparm int|MaxMessageSize||Largest message size. Use 0 for unlimited. DWORD ReadTimeout, // @pyparm int|ReadTimeout||Timeout in milliseconds. Use -1 for no timeout. --- 279,283 ---- // @pyseeapi CreateMailslot PyHANDLE CreateMailslot( ! TCHAR *Name, // @pyparm str|Name||Name of the mailslot, of the form \\.\mailslot\[path]name DWORD MaxMessageSize, // @pyparm int|MaxMessageSize||Largest message size. Use 0 for unlimited. DWORD ReadTimeout, // @pyparm int|ReadTimeout||Timeout in milliseconds. Use -1 for no timeout. *************** *** 1218,1228 **** static PyObject *MyQueryDosDevice(PyObject *self, PyObject *args) { ! PyObject *ret=NULL; ! char *devicename, *targetpath=NULL; DWORD retlen, buflen, err; // @pyparm string|DeviceName||Name of device to query, or None to return all defined devices // @rdesc Returns a string containing substrings separated by NULLs with 2 terminating NULLs ! if (!PyArg_ParseTuple(args, "z:QueryDosDevice", &devicename)) return NULL; if (devicename==NULL) // this returns a huge string buflen=8192; --- 1218,1231 ---- static PyObject *MyQueryDosDevice(PyObject *self, PyObject *args) { ! PyObject *obdevicename, *ret=NULL; ! TCHAR *devicename, *targetpath=NULL; DWORD retlen, buflen, err; // @pyparm string|DeviceName||Name of device to query, or None to return all defined devices // @rdesc Returns a string containing substrings separated by NULLs with 2 terminating NULLs ! if (!PyArg_ParseTuple(args, "O:QueryDosDevice", &obdevicename)) return NULL; + if (!PyWinObject_AsTCHAR(obdevicename, &devicename, TRUE)) + return NULL; + if (devicename==NULL) // this returns a huge string buflen=8192; *************** *** 1235,1244 **** buflen*=2; } ! targetpath=(char *)malloc(buflen); ! if (targetpath==NULL) ! return PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", buflen); retlen=QueryDosDevice(devicename, targetpath, buflen); if (retlen!=0){ ! ret=PyString_FromStringAndSize(targetpath, retlen); break; } --- 1238,1249 ---- buflen*=2; } ! targetpath=(TCHAR *)malloc(buflen *sizeof(TCHAR)); ! if (targetpath==NULL){ ! PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", buflen); ! break; ! } retlen=QueryDosDevice(devicename, targetpath, buflen); if (retlen!=0){ ! ret=PyWinObject_FromTCHAR(targetpath, retlen); break; } *************** *** 1249,1252 **** --- 1254,1258 ---- } } + PyWinObject_FreeTCHAR(devicename); if (targetpath) free(targetpath); *************** *** 3034,3037 **** --- 3040,3044 ---- PyWinObject_FromSID((*user_item)->pUserSid), PyString_FromStringAndSize((char *)(*user_item)->pCertBlob->pbData, (*user_item)->pCertBlob->cbData)); + // ??? This doesn't return EFS_CERTIFICATE_BLOB.dwCertEncodingType ??? if (!ret_item){ Py_DECREF(ret); *************** *** 4258,4262 **** } PyCFunction pfnpy_GetFileAttributesExW=(PyCFunction)py_GetFileAttributesExW; ! PyCFunction pfnpy_GetFileAttributesExA=(PyCFunction)py_GetFileAttributesExA; // @pyswig |SetFileAttributesW|Sets a file's attributes --- 4265,4273 ---- } PyCFunction pfnpy_GetFileAttributesExW=(PyCFunction)py_GetFileAttributesExW; ! #ifdef UNICODE ! PyCFunction pfnpy_GetFileAttributesEx=(PyCFunction)py_GetFileAttributesExW; ! #else ! PyCFunction pfnpy_GetFileAttributesEx=(PyCFunction)py_GetFileAttributesExA; ! #endif // @pyswig |SetFileAttributesW|Sets a file's attributes *************** *** 4974,4978 **** %native (CreateFileW) pfnpy_CreateFileW; %native (DeleteFileW) pfnpy_DeleteFileW; ! %native (GetFileAttributesEx) pfnpy_GetFileAttributesExA; %native (GetFileAttributesExW) pfnpy_GetFileAttributesExW; %native (SetFileAttributesW) pfnpy_SetFileAttributesW; --- 4985,4989 ---- %native (CreateFileW) pfnpy_CreateFileW; %native (DeleteFileW) pfnpy_DeleteFileW; ! %native (GetFileAttributesEx) pfnpy_GetFileAttributesEx; %native (GetFileAttributesExW) pfnpy_GetFileAttributesExW; %native (SetFileAttributesW) pfnpy_SetFileAttributesW; *************** *** 5024,5030 **** HMODULE hmodule; ! hmodule=GetModuleHandle("AdvAPI32.dll"); if (hmodule==NULL) ! hmodule=LoadLibrary("AdvAPI32.dll"); if (hmodule){ pfnEncryptFile=(EncryptFilefunc)GetProcAddress(hmodule, "EncryptFileW"); --- 5035,5041 ---- HMODULE hmodule; ! hmodule=GetModuleHandle(TEXT("AdvAPI32.dll")); if (hmodule==NULL) ! hmodule=LoadLibrary(TEXT("AdvAPI32.dll")); if (hmodule){ pfnEncryptFile=(EncryptFilefunc)GetProcAddress(hmodule, "EncryptFileW"); *************** *** 5045,5051 **** } ! hmodule=GetModuleHandle("kernel32.dll"); if (hmodule==NULL) ! hmodule=LoadLibrary("kernel32.dll"); if (hmodule){ pfnSetVolumeMountPoint=(SetVolumeMountPointfunc)GetProcAddress(hmodule, "SetVolumeMountPointW"); --- 5056,5062 ---- } ! hmodule=GetModuleHandle(TEXT("kernel32.dll")); if (hmodule==NULL) ! hmodule=LoadLibrary(TEXT("kernel32.dll")); if (hmodule){ pfnSetVolumeMountPoint=(SetVolumeMountPointfunc)GetProcAddress(hmodule, "SetVolumeMountPointW"); *************** *** 5090,5096 **** } ! hmodule=GetModuleHandle("sfc.dll"); if (hmodule==NULL) ! hmodule=LoadLibrary("sfc.dll"); if (hmodule){ pfnSfcGetNextProtectedFile=(SfcGetNextProtectedFilefunc)GetProcAddress(hmodule, "SfcGetNextProtectedFile"); --- 5101,5107 ---- } ! hmodule=GetModuleHandle(TEXT("sfc.dll")); if (hmodule==NULL) ! hmodule=LoadLibrary(TEXT("sfc.dll")); if (hmodule){ pfnSfcGetNextProtectedFile=(SfcGetNextProtectedFilefunc)GetProcAddress(hmodule, "SfcGetNextProtectedFile"); |
From: Roger U. <ru...@us...> - 2007-12-17 04:08:33
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9732 Modified Files: CHANGES.txt Log Message: Make note of some more new functions in win32api and win32file Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CHANGES.txt 22 Oct 2007 04:36:29 -0000 1.12 --- CHANGES.txt 17 Dec 2007 04:08:37 -0000 1.13 *************** *** 60,65 **** - New functions RegCopyTree, RegDeleteTree, RegSaveKeyEx, RegRestoreKey, RegCreateKeyEx, RegQueryInfoKeyW, ! RegEnumKeyExWGet/SetSystemFileCacheSize, GlobalMemoryStatus, ! GlobalMemoryStatusEx - Fix memory leak in GetShortPathName - Fix VkKeyScan arg handling --- 60,66 ---- - New functions RegCopyTree, RegDeleteTree, RegSaveKeyEx, RegRestoreKey, RegCreateKeyEx, RegQueryInfoKeyW, ! RegEnumKeyExW, Get/SetSystemFileCacheSize, GlobalMemoryStatus, ! GlobalMemoryStatusEx, GetDllDirectory, SetDllDirectory ! - Fix memory leak in GetShortPathName - Fix VkKeyScan arg handling *************** *** 71,75 **** Vista API functions, System file checker (Sfc) functions, DuplicateEncryptionInfoFile, GetVolumePathNamesForVolumeName, ! GetFinalPathNameByHandle - FindFiles and FindFilesIterator now accept an optional transaction handle to perform a transacted search --- 72,78 ---- Vista API functions, System file checker (Sfc) functions, DuplicateEncryptionInfoFile, GetVolumePathNamesForVolumeName, ! GetFinalPathNameByHandle, ! CreateMailslot, GetMailslotInfo, SetMailslotInfo ! - FindFiles and FindFilesIterator now accept an optional transaction handle to perform a transacted search |
From: Roger U. <ru...@us...> - 2007-12-17 03:57:30
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5713 Modified Files: win32apimodule.cpp Log Message: Add GetDllDirectory and SetDllDirectory Fix buffer overflow in GetModuleFilename for paths longer than MAX_PATH Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** win32apimodule.cpp 18 Jun 2007 15:44:21 -0000 1.78 --- win32apimodule.cpp 17 Dec 2007 03:57:33 -0000 1.79 *************** *** 52,55 **** --- 52,59 ---- typedef BOOL (WINAPI *SetSystemFileCacheSizefunc)(SIZE_T,SIZE_T,DWORD); static SetSystemFileCacheSizefunc pfnSetSystemFileCacheSize = NULL; + typedef DWORD (WINAPI *GetDllDirectoryfunc)(DWORD,LPWSTR); + static GetDllDirectoryfunc pfnGetDllDirectory = NULL; + typedef BOOL (WINAPI *SetDllDirectoryfunc)(LPCWSTR); + static SetDllDirectoryfunc pfnSetDllDirectory = NULL; // from secur32.dll *************** *** 1415,1420 **** { HMODULE hMod; ! PyObject *obhMod; ! char buf[_MAX_PATH]; // @pyparm <o PyHANDLE>|hModule||Specifies the handle to the module. if (!PyArg_ParseTuple(args, "O:GetModuleFileName", &obhMod)) --- 1419,1425 ---- { HMODULE hMod; ! PyObject *obhMod, *ret=NULL; ! char *buf=NULL; ! DWORD bufsize, reqdsize=MAX_PATH; // @pyparm <o PyHANDLE>|hModule||Specifies the handle to the module. if (!PyArg_ParseTuple(args, "O:GetModuleFileName", &obhMod)) *************** *** 1423,1441 **** return NULL; // @pyseeapi GetModuleFileName ! PyW32_BEGIN_ALLOW_THREADS ! long rc = ::GetModuleFileName(hMod, buf, sizeof(buf)); ! PyW32_END_ALLOW_THREADS ! if (rc==0) ! return ReturnAPIError("GetModuleFileName"); ! return PyString_FromString(buf); } ! // @pymethod unicode|win32api|GetModuleFileNameW|Retrieves the unicode filename of the specified module. static PyObject * PyGetModuleFileNameW(PyObject * self, PyObject * args) { HMODULE hMod; ! PyObject *obhMod; ! wchar_t buf[_MAX_PATH]; // @pyparm <o PyHANDLE>|hModule||Specifies the handle to the module. if (!PyArg_ParseTuple(args, "O:GetModuleFileNameW", &obhMod)) --- 1428,1468 ---- return NULL; // @pyseeapi GetModuleFileName ! while (true){ ! if (buf) ! free(buf); ! buf=(char *)malloc(reqdsize); ! if (buf==NULL){ ! PyErr_NoMemory(); ! break; ! } ! ! bufsize=reqdsize; ! PyW32_BEGIN_ALLOW_THREADS ! reqdsize=GetModuleFileName(hMod, buf, bufsize); ! PyW32_END_ALLOW_THREADS ! ! if (reqdsize==0){ ! PyWin_SetAPIError("GetModuleFileName"); ! break; ! } ! if (reqdsize < bufsize){ ! ret=PyString_FromString(buf); ! break; ! } ! reqdsize++; ! } ! if (buf) ! free(buf); ! return ret; } ! // @pymethod <o PyUnicode>|win32api|GetModuleFileNameW|Retrieves the unicode filename of the specified module. static PyObject * PyGetModuleFileNameW(PyObject * self, PyObject * args) { HMODULE hMod; ! PyObject *obhMod, *ret=NULL; ! WCHAR *buf=NULL; ! DWORD bufsize, reqdsize=MAX_PATH; // @pyparm <o PyHANDLE>|hModule||Specifies the handle to the module. if (!PyArg_ParseTuple(args, "O:GetModuleFileNameW", &obhMod)) *************** *** 1444,1453 **** return NULL; // @pyseeapi GetModuleFileName ! PyW32_BEGIN_ALLOW_THREADS ! long rc = ::GetModuleFileNameW(hMod, buf, sizeof(buf)); ! PyW32_END_ALLOW_THREADS ! if (rc==0) ! return ReturnAPIError("GetModuleFileNameW"); ! return PyUnicode_FromUnicode(buf, wcslen(buf)); } --- 1471,1501 ---- return NULL; // @pyseeapi GetModuleFileName ! while (true){ ! if (buf) ! free(buf); ! buf=(WCHAR *)malloc(reqdsize * sizeof(WCHAR)); ! if (buf==NULL){ ! PyErr_NoMemory(); ! break; ! } ! ! bufsize=reqdsize; ! PyW32_BEGIN_ALLOW_THREADS ! reqdsize=GetModuleFileNameW(hMod, buf, bufsize); ! PyW32_END_ALLOW_THREADS ! ! if (reqdsize==0){ ! PyWin_SetAPIError("GetModuleFileNameW"); ! break; ! } ! if (reqdsize < bufsize){ ! ret=PyUnicode_FromUnicode(buf, reqdsize); ! break; ! } ! reqdsize++; ! } ! if (buf) ! free(buf); ! return ret; } *************** *** 1689,1692 **** --- 1737,1793 ---- } + // @pymethod <o PyUnicode>|win32api|GetDllDirectory|Returns the DLL search path + // @pyseeapi GetDllDirectory + static PyObject *PyGetDllDirectory(PyObject * self, PyObject * args) + { + CHECK_PFN(GetDllDirectory); + WCHAR *dirs=NULL; + DWORD bufsize=0, reqdsize=256; + PyObject *ret=NULL; + while (true){ + if (dirs) + free(dirs); + dirs=(WCHAR *)malloc(reqdsize * sizeof(WCHAR)); + if (dirs==NULL){ + PyErr_NoMemory(); + break; + } + bufsize=reqdsize; + reqdsize=(*pfnGetDllDirectory)(bufsize, dirs); + if (reqdsize==0){ + PyWin_SetAPIError("GetDllDirectory"); + break; + } + if (reqdsize <= bufsize){ + ret=PyWinObject_FromWCHAR(dirs, reqdsize); + break; + } + } + if (dirs) + free(dirs); + return ret; + } + + // @pymethod |win32api|SetDllDirectory|Modifies the application-specific DLL search path + // @pyseeapi SetDllDirectory + static PyObject *PySetDllDirectory(PyObject * self, PyObject * args) + { + CHECK_PFN(SetDllDirectory); + PyObject *obdirname; + WCHAR *dirname; + + // @pyparm <o PyUnicode>|PathName||Directory to be added to search path, can be None to restore defaults + if (!PyArg_ParseTuple(args, "O:SetDllDirectory", &obdirname)) + return NULL; + if (!PyWinObject_AsWCHAR(obdirname, &dirname, TRUE)) + return NULL; + BOOL bsuccess=(*pfnSetDllDirectory)(dirname); + PyWinObject_FreeWCHAR(dirname); + if (!bsuccess) + return PyWin_SetAPIError("SetDllDirectory"); + Py_INCREF(Py_None); + return Py_None; + } + // @pymethod int/string|win32api|GetProfileVal|Retrieves entries from a windows INI file. This method encapsulates GetProfileString, GetProfileInt, GetPrivateProfileString and GetPrivateProfileInt. static PyObject * *************** *** 5544,5547 **** --- 5645,5649 ---- {"GetDiskFreeSpace", PyGetDiskFreeSpace, 1}, // @pymeth GetDiskFreeSpace|Retrieves information about a disk. {"GetDiskFreeSpaceEx", PyGetDiskFreeSpaceEx, 1}, // @pymeth GetDiskFreeSpaceEx|Retrieves information about a disk. + {"GetDllDirectory", PyGetDllDirectory, METH_NOARGS}, // @pymeth GetDllDirectory|Retrieves the DLL search path {"GetDomainName", PyGetDomainName, 1}, // @pymeth GetDomainName|Returns the current domain name {"GetEnvironmentVariable", PyGetEnvironmentVariable, 1}, // @pymeth GetEnvironmentVariable|Retrieves the value of an environment variable. *************** *** 5651,5654 **** --- 5753,5757 ---- {"SetConsoleTitle", PySetConsoleTitle, 1}, // @pymeth SetConsoleTitle|Sets the title for the current console. {"SetCursorPos", PySetCursorPos,1}, // @pymeth SetCursorPos|The SetCursorPos function moves the cursor to the specified screen coordinates. + {"SetDllDirectory", PySetDllDirectory, 1}, // @pymeth SetDllDirectory|Modifies the application-specific DLL search path {"SetErrorMode", PySetErrorMode, 1}, // @pymeth SetErrorMode|Controls whether the system will handle the specified types of serious errors, or whether the process will handle them. {"SetFileAttributes", PySetFileAttributes,1}, // @pymeth SetFileAttributes|Sets the named file's attributes. *************** *** 5777,5780 **** --- 5880,5885 ---- pfnGetSystemFileCacheSize=(GetSystemFileCacheSizefunc)GetProcAddress(hmodule,"GetSystemFileCacheSize"); pfnSetSystemFileCacheSize=(SetSystemFileCacheSizefunc)GetProcAddress(hmodule,"SetSystemFileCacheSize"); + pfnGetDllDirectory=(GetDllDirectoryfunc)GetProcAddress(hmodule,"GetDllDirectoryW"); + pfnSetDllDirectory=(SetDllDirectoryfunc)GetProcAddress(hmodule,"SetDllDirectoryW"); } |
From: Roger U. <ru...@us...> - 2007-12-10 23:24:31
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3888 Modified Files: win32file.i Log Message: Add mailslot functions Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** win32file.i 8 Nov 2007 06:25:30 -0000 1.86 --- win32file.i 10 Dec 2007 23:24:34 -0000 1.87 *************** *** 276,279 **** --- 276,304 ---- %native (CreateIoCompletionPort) MyCreateIoCompletionPort; + // @pyswig <o PyHANDLE>|CreateMailslot|Creates a mailslot on the local machine + // @pyseeapi CreateMailslot + PyHANDLE CreateMailslot( + LPCTSTR Name, // @pyparm str|Name||Name of the mailslot, of the form \\.\mailslot\[path]name + DWORD MaxMessageSize, // @pyparm int|MaxMessageSize||Largest message size. Use 0 for unlimited. + DWORD ReadTimeout, // @pyparm int|ReadTimeout||Timeout in milliseconds. Use -1 for no timeout. + SECURITY_ATTRIBUTES *INPUT_NULLOK // @pyparm <o PySECURITY_ATTRIBUTES>|SecurityAttributes||Determines if returned handle is inheritable, can be None + ); + + // @pyswig (int,int,int,int)|GetMailslotInfo|Retrieves information about a mailslot + // @rdesc Returns (maximum message size, next message size, message count, timeout) + // @pyseeapi GetMailslotInfo + BOOLAPI GetMailslotInfo( + HANDLE Mailslot, // @pyparm <o PyHANDLE>|Mailslot||Handle to a mailslot + DWORD *OUTPUT, + DWORD *OUTPUT, + DWORD *OUTPUT, + DWORD *OUTPUT); + + // @pyswig |SetMailslotInfo|Sets a mailslot's timeout + // @pyseeapi SetMailslotInfo + BOOLAPI SetMailslotInfo( + HANDLE Mailslot, // @pyparm <o PyHANDLE>|Mailslot||Handle to a mailslot + DWORD ReadTimeout); // @pyparm int|ReadTimeout||Timeout in milliseconds, use -1 for no timeout + // @pyswig |DefineDosDevice|Lets an application define, redefine, or delete MS-DOS device names. BOOLAPI DefineDosDevice( |
From: Mark H. <mha...@us...> - 2007-11-29 06:46:09
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23541/win32/src Modified Files: win32security.i Log Message: We go the trouble of loading pfnLogonUserEx, we may as well use it to make the call (and allow things to keep loading on win2k :) Index: win32security.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** win32security.i 5 Sep 2007 01:24:08 -0000 1.46 --- win32security.i 29 Nov 2007 06:46:12 -0000 1.47 *************** *** 1083,1087 **** &&PyWinObject_AsWCHAR(obdomain, &domain, TRUE) &&PyWinObject_AsWCHAR(obpassword, &password, FALSE)){ ! if (!LogonUserEx(username, domain, password, logontype, logonprovider, &htoken, &psid, &profile, &profilelen, "a_limits)) PyWin_SetAPIError("LogonUserEx"); --- 1083,1087 ---- &&PyWinObject_AsWCHAR(obdomain, &domain, TRUE) &&PyWinObject_AsWCHAR(obpassword, &password, FALSE)){ ! if (!(*pfnLogonUserEx)(username, domain, password, logontype, logonprovider, &htoken, &psid, &profile, &profilelen, "a_limits)) PyWin_SetAPIError("LogonUserEx"); |
From: Roger U. <ru...@us...> - 2007-11-24 09:11:56
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20619 Modified Files: win32ui.rc Log Message: Add .pys and .pyw extensions to Pythonwin's Open dialogue Index: win32ui.rc =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ui.rc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32ui.rc 7 Feb 2004 01:02:58 -0000 1.12 --- win32ui.rc 24 Nov 2007 09:11:58 -0000 1.13 *************** *** 1118,1123 **** BEGIN IDR_MAINFRAME "Pythonwin" ! IDR_PYTHONTYPE "\nScript\nPython Script\nPython scripts (*.py)\n.py\nPythonScript\nPython Script" ! IDR_TEXTTYPE "\nScript\nPython Script\nPython Script (*.py)\n.py\nTEXT Document\nText Files (*.txt)\n.txt\nTextFileType\nTEXT File Type" IDR_DEBUGGER "Pythonwin Debugger" END --- 1118,1123 ---- BEGIN IDR_MAINFRAME "Pythonwin" ! IDR_PYTHONTYPE "\nScript\nPython Script\nPython scripts (*.py, *.pyw, *.pys)\n.py;*.pyw;*.pys\nPythonScript\nPython Script" ! IDR_TEXTTYPE "\nScript\nPython Script\nPython Scripts (*.py, *.pyw, *.pys)\n.py;*.pyw;*.pys\nTEXT Document\nText Files (*.txt)\n.txt\nTextFileType\nTEXT File Type" IDR_DEBUGGER "Pythonwin Debugger" END |
From: Roger U. <ru...@us...> - 2007-11-08 20:02:27
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19015/win32/Demos Modified Files: CopyFileEx.py CreateFileTransacted_MiniVersion.py Log Message: Update demos for combined transacted operations Index: CreateFileTransacted_MiniVersion.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/CreateFileTransacted_MiniVersion.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreateFileTransacted_MiniVersion.py 8 May 2007 20:42:39 -0000 1.1 --- CreateFileTransacted_MiniVersion.py 8 Nov 2007 20:02:30 -0000 1.2 *************** *** 28,32 **** trans=win32transaction.CreateTransaction(Description='Test creating miniversions of a file') ! hfile=win32file.CreateFileTransacted(tempfile, win32con.GENERIC_READ|win32con.GENERIC_WRITE, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans) --- 28,32 ---- trans=win32transaction.CreateTransaction(Description='Test creating miniversions of a file') ! hfile=win32file.CreateFileW(tempfile, win32con.GENERIC_READ|win32con.GENERIC_WRITE, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans) *************** *** 43,47 **** ## miniversions can't be opened with write access ! hfile_0=win32file.CreateFileTransacted(tempfile, win32con.GENERIC_READ, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans, MiniVersion=base_ver) --- 43,47 ---- ## miniversions can't be opened with write access ! hfile_0=win32file.CreateFileW(tempfile, win32con.GENERIC_READ, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans, MiniVersion=base_ver) *************** *** 49,53 **** hfile_0.Close() ! hfile_1=win32file.CreateFileTransacted(tempfile, win32con.GENERIC_READ, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans, MiniVersion=ver_1) --- 49,53 ---- hfile_0.Close() ! hfile_1=win32file.CreateFileW(tempfile, win32con.GENERIC_READ, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans, MiniVersion=ver_1) *************** *** 55,59 **** hfile_1.Close() ! hfile_2=win32file.CreateFileTransacted(tempfile, win32con.GENERIC_READ, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans, MiniVersion=ver_2) --- 55,59 ---- hfile_1.Close() ! hfile_2=win32file.CreateFileW(tempfile, win32con.GENERIC_READ, win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE, None, win32con.OPEN_EXISTING, 0 , None, Transaction=trans, MiniVersion=ver_2) Index: CopyFileEx.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/CopyFileEx.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CopyFileEx.py 12 Aug 2006 01:38:23 -0000 1.1 --- CopyFileEx.py 8 Nov 2007 20:02:29 -0000 1.2 *************** *** 28,30 **** operation_desc='Copying '+fsrc+' to '+fdst ! win32file.CopyFileEx(fsrc, fdst, ProgressRoutine, operation_desc, False, win32file.COPY_FILE_RESTARTABLE) --- 28,30 ---- operation_desc='Copying '+fsrc+' to '+fdst ! win32file.CopyFileEx(fsrc, fdst, ProgressRoutine, Data=operation_desc, Cancel=False, CopyFlags=win32file.COPY_FILE_RESTARTABLE, Transaction=None) |
From: Roger U. <ru...@us...> - 2007-11-08 06:25:32
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14503/win32/src Modified Files: win32file.i Log Message: Combine rest of transacted functios with regular API functions Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** win32file.i 6 Jun 2007 04:26:46 -0000 1.85 --- win32file.i 8 Nov 2007 06:25:30 -0000 1.86 *************** *** 3,6 **** --- 3,24 ---- %module win32file // An interface to the win32 File API's + // <nl>This module includes the tranactional NTFS operations introduced with + // Vista. The transacted functions are not wrapped separately, but are invoked by + // passing a transaction handle to the corresponding Unicode API function. + // This makes it simple to convert a set of file operations into a transaction by + // simply adding Transaction=<o PyHANDLE> to the passed arguments. + // If Transaction is None, 0, or not specified, the non-transacted API function will + // be called. [...1230 lines suppressed...] pfnCreateFileTransacted=(CreateFileTransactedfunc)GetProcAddress(hmodule, "CreateFileTransactedW"); pfnDeleteFileTransacted=(DeleteFileTransactedfunc)GetProcAddress(hmodule, "DeleteFileTransactedW"); ! pfnGetFileAttributesTransacted=(GetFileAttributesTransactedfunc)GetProcAddress(hmodule, "GetFileAttributesTransactedW"); pfnSetFileAttributesTransacted=(SetFileAttributesTransactedfunc)GetProcAddress(hmodule, "SetFileAttributesTransactedW"); pfnCreateDirectoryTransacted=(CreateDirectoryTransactedfunc)GetProcAddress(hmodule, "CreateDirectoryTransactedW"); --- 5045,5050 ---- pfnCreateFileTransacted=(CreateFileTransactedfunc)GetProcAddress(hmodule, "CreateFileTransactedW"); pfnDeleteFileTransacted=(DeleteFileTransactedfunc)GetProcAddress(hmodule, "DeleteFileTransactedW"); ! pfnGetFileAttributesTransactedA=(GetFileAttributesTransactedAfunc)GetProcAddress(hmodule, "GetFileAttributesTransactedA"); ! pfnGetFileAttributesTransactedW=(GetFileAttributesTransactedWfunc)GetProcAddress(hmodule, "GetFileAttributesTransactedW"); pfnSetFileAttributesTransacted=(SetFileAttributesTransactedfunc)GetProcAddress(hmodule, "SetFileAttributesTransactedW"); pfnCreateDirectoryTransacted=(CreateDirectoryTransactedfunc)GetProcAddress(hmodule, "CreateDirectoryTransactedW"); *************** *** 5217,5220 **** --- 5142,5146 ---- #define COPY_FILE_RESTARTABLE COPY_FILE_RESTARTABLE #define COPY_FILE_OPEN_SOURCE_FOR_WRITE COPY_FILE_OPEN_SOURCE_FOR_WRITE + #define COPY_FILE_COPY_SYMLINK // return codes from CopyFileEx progress routine |
From: Mark H. <mha...@us...> - 2007-10-30 09:56:39
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17815/com/win32comext/shell/demos/servers Modified Files: shell_view.py Log Message: Add a WM_SIZE handler to resize all the windows and implement a couple of missing methods. Index: shell_view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/shell_view.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shell_view.py 19 Feb 2007 20:29:18 -0000 1.8 --- shell_view.py 30 Oct 2007 09:56:42 -0000 1.9 *************** *** 382,385 **** --- 382,386 ---- self._CreateMainWindow(prev, settings, browser, rect) self._CreateChildWindow(prev) + return self.hwnd def _CreateMainWindow(self, prev, settings, browser, rect): *************** *** 387,391 **** # gets the control notifications etc sent from the child. style = win32con.WS_CHILD | win32con.WS_VISIBLE # ! wclass_name = "EnfoldDesktop_DefView" # Register the Window class. wc = win32gui.WNDCLASS() --- 388,392 ---- # gets the control notifications etc sent from the child. style = win32con.WS_CHILD | win32con.WS_VISIBLE # ! wclass_name = "ShellViewDemo_DefView" # Register the Window class. wc = win32gui.WNDCLASS() *************** *** 405,410 **** win32con.WM_NOTIFY: self.OnNotify, win32con.WM_CONTEXTMENU: self.OnContextMenu, } ! self.hwnd = win32gui.CreateWindow( wclass_name, "", style, \ rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1], --- 406,412 ---- win32con.WM_NOTIFY: self.OnNotify, win32con.WM_CONTEXTMENU: self.OnContextMenu, + win32con.WM_SIZE: self.OnSize, } ! self.hwnd = win32gui.CreateWindow( wclass_name, "", style, \ rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1], *************** *** 416,420 **** def _CreateChildWindow(self, prev): # Creates the list view window. - print "_CreateChildWindow" assert self.hwnd_child is None, "already have a window" assert self.cur_foldersettings is not None, "no settings" --- 418,421 ---- *************** *** 682,685 **** --- 683,695 ---- cm.InvokeCommand(ci) + def OnSize(self, hwnd, msg, wparam, lparam): + # hrm - this doesn't seem to be called on XP, but is on Vista + # (and is *necessary* on Vista, as it seems to create windows with + # a zero client-rect, then moves it) + #print "OnSize", self.hwnd_child, win32api.LOWORD(lparam), win32api.HIWORD(lparam) + if self.hwnd_child is not None: + x = win32api.LOWORD(lparam) + y = win32api.HIWORD(lparam) + win32gui.MoveWindow(self.hwnd_child, 0, 0, x, y, False) # This uses scintilla to display a filename, and optionally jump to a line *************** *** 697,700 **** --- 707,714 ---- def _SendSci(self, msg, wparam=0, lparam=0): return win32gui.SendMessage(self.hwnd, msg, wparam, lparam) + + def GetWindow(self): + return self.hwnd + # IShellView def CreateViewWindow(self, prev, settings, browser, rect): *************** *** 721,724 **** --- 735,744 ---- rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1], self.hwnd_parent, 1000, 0, None) + + message_map = { + win32con.WM_SIZE: self.OnSize, + } + win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) + file_data = file(self.filename, "U").read() *************** *** 770,773 **** --- 790,801 ---- return winerror.S_FALSE + def UIActivate(self, activate_state): + print "Scintilla OnActivate" + + def OnSize(self, hwnd, msg, wparam, lparam): + x = win32api.LOWORD(lparam) + y = win32api.HIWORD(lparam) + win32gui.MoveWindow(self.hwnd, 0, 0, x, y, False) + def DllRegisterServer(): import _winreg |
From: Mark H. <mha...@us...> - 2007-10-30 09:53:29
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16738/test Modified Files: handles.py Log Message: ensure longs that can fit in 32 unsigned bits can be used as a handle Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** handles.py 23 Oct 2003 04:09:56 -0000 1.3 --- handles.py 30 Oct 2007 09:53:32 -0000 1.4 *************** *** 1,2 **** --- 1,3 ---- + import sys import unittest import pywintypes *************** *** 68,71 **** --- 69,93 ---- self.assertRaises(win32api.error, h.Close) + def testOtherHandle(self): + h=pywintypes.HANDLE(1) + h2=pywintypes.HANDLE(h) + self.failUnlessEqual(h, h2) + # but the above doesn't really test everything - we want a way to + # pass the handle directly into PyWinLong_AsVoidPtr. One way to + # to that is to abuse win32api.GetProcAddress() - the 2nd param + # is passed to PyWinLong_AsVoidPtr() if its not a string. + # passing a handle value of '1' should work - there is something + # at that ordinal + win32api.GetProcAddress(sys.dllhandle, h) + + def testLong(self): + # sys.maxint+1 should always be a 'valid' handle, treated as an + # unsigned int, even though it is a long. Although pywin32 should not + # directly create such longs, using struct.unpack() with a P format + # may well return them. eg: + # >>> struct.unpack("P", struct.pack("P", -1)) + # (4294967295L,) + pywintypes.HANDLE(sys.maxint+1) + def testGC(self): # This used to provoke: |
From: Mark H. <mha...@us...> - 2007-10-30 09:53:29
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16738/src Modified Files: PyWinTypesmodule.cpp Log Message: ensure longs that can fit in 32 unsigned bits can be used as a handle Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** PyWinTypesmodule.cpp 17 Oct 2007 04:16:16 -0000 1.35 --- PyWinTypesmodule.cpp 30 Oct 2007 09:53:32 -0000 1.36 *************** *** 545,557 **** { assert(!PyErr_Occurred()); // lingering exception? #ifdef _WIN64 ! *pptr=(void *)PyLong_AsLongLong(ob); #else ! *pptr=(void *)PyInt_AsLong(ob); #endif ! if (*pptr==(void *)-1 && PyErr_Occurred()){ ! PyErr_Format(PyExc_TypeError,"Unable to convert %s to pointer-sized value", ob->ob_type->tp_name); ! return FALSE; } return TRUE; } --- 545,570 ---- { assert(!PyErr_Occurred()); // lingering exception? + // PyInt_AsLong (and PyLong_AsLongLong on x64) handle objects + // with tp_number slots, and longs that fit in 32bits - but *not* + // longs that fit in 32bits if they are treated as unsigned - eg, + // eg, the result of: + // struct.unpack("P", struct.pack("P", -1)) -> (4294967295L,) + // So, we do the PyInt_AsLong thing first, then fall back to the + // *_AsUnsignedLong[Long] versions. #ifdef _WIN64 ! # define SIGNED_CONVERTER PyLong_AsLongLong ! # define UNSIGNED_CONVERTER PyLong_AsUnsignedLongLong #else ! # define SIGNED_CONVERTER PyInt_AsLong ! # define UNSIGNED_CONVERTER PyLong_AsUnsignedLong #endif ! *pptr=(void *)SIGNED_CONVERTER(ob); ! if (*pptr==(void *)-1 && PyErr_Occurred()) { ! *pptr=(void *)UNSIGNED_CONVERTER(ob); ! if (*pptr==(void *)-1 && PyErr_Occurred()) { ! PyErr_Format(PyExc_TypeError,"Unable to convert %s to pointer-sized value", ob->ob_type->tp_name); ! return FALSE; } + } return TRUE; } |
From: Mark H. <mha...@us...> - 2007-10-30 09:27:10
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6046/Demos Modified Files: win32gui_menu.py win32gui_taskbar.py Log Message: .ico files have changed location in python 2.5 binaries. Index: win32gui_taskbar.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_taskbar.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32gui_taskbar.py 10 Jan 2006 00:30:00 -0000 1.8 --- win32gui_taskbar.py 30 Oct 2007 09:27:13 -0000 1.9 *************** *** 36,39 **** --- 36,42 ---- iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "pyc.ico" )) if not os.path.isfile(iconPathName): + # Look in DLLs dir, a-la py 2.5 + iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "DLLs", "pyc.ico" )) + if not os.path.isfile(iconPathName): # Look in the source tree. iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "..\\PC\\pyc.ico" )) Index: win32gui_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32gui_menu.py 6 Sep 2007 06:44:54 -0000 1.5 --- win32gui_menu.py 30 Oct 2007 09:27:13 -0000 1.6 *************** *** 46,49 **** --- 46,52 ---- UpdateWindow(self.hwnd) iconPathName = os.path.abspath(os.path.join( sys.prefix, "pyc.ico" )) + # py2.5 includes the .ico files in the DLLs dir for some reason. + if not os.path.isfile(iconPathName): + iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "DLLs", "pyc.ico" )) if not os.path.isfile(iconPathName): # Look in the source tree. |
From: Mark H. <mha...@us...> - 2007-10-22 04:36:28
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26725 Modified Files: CHANGES.txt Log Message: Add CoInternetIsFeatureEnabled and CoInternetSetFeatureEnabled Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CHANGES.txt 22 Oct 2007 04:34:34 -0000 1.11 --- CHANGES.txt 22 Oct 2007 04:36:29 -0000 1.12 *************** *** 30,33 **** --- 30,36 ---- inside a win32gui window. + - win32com.internet: + * Add CoInternetIsFeatureEnabled and CoInternetSetFeatureEnabled + - pythoncom: * event handlers implemented in Python that were called with named params |
From: Mark H. <mha...@us...> - 2007-10-22 04:35:21
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/internet/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26226/com/win32comext/internet/src Modified Files: internet.cpp Log Message: autoduck Index: internet.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/internet.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** internet.cpp 16 Oct 2007 11:34:09 -0000 1.3 --- internet.cpp 22 Oct 2007 04:35:24 -0000 1.4 *************** *** 150,154 **** // The methods // ! // @pyswig bool|CoInternetIsFeatureEnabled| // @rdesc Returns true for S_OK, False for other non-error hresults, or // raises a com_error. --- 150,154 ---- // The methods // ! // @pymethod bool|internet|CoInternetIsFeatureEnabled| // @rdesc Returns true for S_OK, False for other non-error hresults, or // raises a com_error. *************** *** 169,172 **** --- 169,173 ---- } + // @pymethod int|internet|CoInternetSetFeatureEnabled| static PyObject *PyCoInternetSetFeatureEnabled(PyObject *self, PyObject *args) { *************** *** 189,194 **** static struct PyMethodDef internet_methods[]= { ! { "CoInternetIsFeatureEnabled", PyCoInternetIsFeatureEnabled}, ! { "CoInternetSetFeatureEnabled", PyCoInternetSetFeatureEnabled}, { NULL, NULL }, }; --- 190,195 ---- static struct PyMethodDef internet_methods[]= { ! { "CoInternetIsFeatureEnabled", PyCoInternetIsFeatureEnabled}, // @pymeth CoInternetIsFeatureEnabled| ! { "CoInternetSetFeatureEnabled", PyCoInternetSetFeatureEnabled}, // @pymeth CoInternetSetFeatureEnabled| { NULL, NULL }, }; |
From: Mark H. <mha...@us...> - 2007-10-22 04:34:32
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25985 Modified Files: CHANGES.txt Log Message: Few more changes and minor reformatting Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CHANGES.txt 9 Sep 2007 05:35:50 -0000 1.10 --- CHANGES.txt 22 Oct 2007 04:34:34 -0000 1.11 *************** *** 2,88 **** Generally created by hand after running: ! cvs -z5 log -rb20x: > log.out ! {py_dir}\Tools\scripts\logmerge.py -t < log.out > log.out2 However contributors are encouraged to add their own entries for their work. Since build 210: ---------------- - * makepy accepts a program id to process its typelib ! * pythoncom: ! CoMarshalInterface/CoUnmarshalInterface/CoReleaseMarshalData ! ReadClassStm/WriteClassStm ! CreateStreamOnHGlobal ! CreateILockBytesOnHGlobal ! * win32com.shell: ! PyIExtractImage ! PyIEmptyVolumecache ! IsUserAnAdmin ! * win32transaction: New module containing Kernel Transaction Manager (KTM) functions ! as used with transacted NTFS and transacted registry functions * win32api: ! Transacted registry functions added ! RegCopyTree and RegDeleteTree ! RegSaveKeyEx and RegRestoreKey ! Get/SetSystemFileCacheSize ! GlobalMemoryStatus and GlobalMemoryStatusEx ! RegCreateKeyEx, RegQueryInfoKeyW, and RegEnumKeyExW * win32file: ! Fixed bug in ReadDirectoryChanges that ignored 1 char filenames. ! (from Niki Spahiev) ! Transactional NTFS functions added ! FindFiles and FindFilesIterator now accept an optional transaction handle to ! perform a transacted search ! FindStreams function that calls FindFirstStream and FindNextStream to enumerate ! a file's data streams ! CreateSymbolicLink and other new Vista API functions ! System file checker (Sfc) functions ! DuplicateEncryptionInfoFile ! GetVolumePathNamesForVolumeName ! GetFinalPathNameByHandle ! FindFileNames using FindFirstFileName, FindFirstFileNameTransacted, and FindNextFileName * win32service: ! Service and service control manager handles are now returned ! as self-closing PySC_HANDLEs instead of plain int handles ! Service dependencies are returned as list of Unicode strings instead ! of a single string, which lost multiple dependencies (could break ! code) * win32gui: ! GDI object handles (bitmaps, fonts, regions, pens, brushes) are returned ! as another PyHANDLE subclass (PyGdiHandle) ! A large number of new text drawing, line and curve drawing, region, path, ! and coordinate space functions ! Window class name can now be used interchangeably with class atom ! (fixes bug #1267366) ! Add DrawTextW (feature request #1173716) ! PtInRect * win32process: ! Get/SetThreadPriorityBoost and Get/SetProcessPriorityBoost ! GetGuiResources ! GetProcessId ! IsWow64Process * win32print: ! Printer handles are now returned as self-closing PyHANDLE subclass ! FlushPrinter, GetDefaultPrinterW, and SetDefaultPrinterW * win32security: ! Added DuplicateTokenEx ! GetTokenInformation and SetTokenInformation support new Vista information classes ! Add IsTokenRestricted ! Add LogonUserEx * mmapfile: ! Fix crash caused by reopening named mapping with excess size ! Accept offset and view size parameters, enabling use of files larger ! than physical memory ! Document use in help file, and a demo script * win32pipe: --- 2,137 ---- Generally created by hand after running: ! cvs -z5 log -rb2xx: > log.out ! {py_dir}\Tools\scripts\logmerge.py -t < log.out > log2.out However contributors are encouraged to add their own entries for their work. Since build 210: ---------------- ! * Available for AMD64 versions of Windows. Note that this requires the ! x86-64 version of Python 2.5.2, which was not yet available as build 211 ! was released, but was expected shortly. Lots of help from Roger, Steve Yin, ! and Sidnei da Silva. ! * com related changes: ! - makepy accepts a program id to process its typelib and generates long ! integer literals for constants > sys.maxint. The way typelibs are generated ! also changes slightly, fixing a bug with certain hex version numbers in ! the registry. Fix a bug [1548903] that could cause incomplete generated ! files when a typelib was missing ! ! - win32com.client: Fix a bug [1587023] that prevented Get and Set properties ! working for ITypeComp implementing objects. Add automatic "cast" to an ! interface when using iterators [1707700] ! ! - win32com.axcontrol: Module for using ActiveX controls independently of ! pythonwin/win32ui/MFC. Includes a demo of embedding Internet Explorer ! inside a win32gui window. ! ! - pythoncom: ! * event handlers implemented in Python that were called with named params ! may have presented the arguments to Python in the incorrect order - this ! has been fixed. ! * Always return -1 (VARIANT_TRUE), rather than 1, when a VARIANT_BOOL is ! requested. ! * When passing a Python integer, always use VT_I4 when possible, VT_UI4 ! otherwise (previous versions did VT_I4 only, 209 did VT_UI4 only) ! * New functions CoMarshalInterface, CoUnmarshalInterface, ! CoReleaseMarshalData, ReadClassStm, WriteClassStm, CreateStreamOnHGlobal, ! CreateILockBytesOnHGlobal. ! * Fix possible buffer overflow using IStream. ! ! - win32com.shell: ! * PyIExtractImage by Steven James. ! * PyIEmptyVolumecache, IEmptyVolumeCache2, IEmptyVolumeCacheCallBack by ! Sidnei da Silva from Enfold. ! * IsUserAnAdmin ! * More coverage of the shell interfaces and demos. ! ! * win32transaction: New module containing Kernel Transaction Manager (KTM) ! functions as used with transacted NTFS and transacted registry functions * win32api: ! - Transacted registry functions and demos from Roger ! - New functions RegCopyTree, RegDeleteTree, RegSaveKeyEx, ! RegRestoreKey, RegCreateKeyEx, RegQueryInfoKeyW, ! RegEnumKeyExWGet/SetSystemFileCacheSize, GlobalMemoryStatus, ! GlobalMemoryStatusEx ! - Fix memory leak in GetShortPathName ! - Fix VkKeyScan arg handling * win32file: ! - Fixed bug in ReadDirectoryChanges that ignored 1 char filenames. ! (from Niki Spahiev) ! Added Transactional NTFS functions, CreateSymbolicLink and other new ! Vista API functions, System file checker (Sfc) functions, ! DuplicateEncryptionInfoFile, GetVolumePathNamesForVolumeName, ! GetFinalPathNameByHandle ! - FindFiles and FindFilesIterator now accept an optional transaction handle ! to perform a transacted search ! - FindStreams function that calls FindFirstStream and FindNextStream to ! enumerate a file's data streams. ! - FindFileNames using FindFirstFileName, FindFirstFileNameTransacted, and FindNextFileName * win32service: ! - Service and service control manager handles are now returned as ! self-closing PySC_HANDLEs instead of plain int handles ! - Service dependencies are returned as list of Unicode strings instead ! of a single string, which lost multiple dependencies (could break ! code, but old handling was insane) * win32gui: ! - GDI object handles (bitmaps, fonts, regions, pens, brushes) are returned ! as another PyHANDLE subclass (PyGdiHandle) ! - A large number of new text drawing, line and curve drawing, region, path, ! and coordinate space functions ! - Window class name can now be used interchangeably with class atom ! (fixes bug #1267366) ! - Add DrawTextW (feature request #1173716), PtInRect, EnumPropsEx, ! DrawTextW, SetMenuInfo, GetMenuInfo, ExtCreatePen, CreateBrushIndirect, ! lots of other GDI functions. ! ! * win32pipe: ! Add GetNamedPipeClientSessionId, GetNamedPipeServerSessionId, ! GetNamedPipeInfo, GetNamedPipeClientProcessId, GetNamedPipeServerProcessId * win32process: ! New functions Get/SetThreadPriorityBoost, Get/SetProcessPriorityBoost, ! GetGuiResources, GetProcessId, IsWow64Process * win32print: ! - Printer handles are now returned as self-closing PyHANDLE subclass ! - FlushPrinter, GetDefaultPrinterW, and SetDefaultPrinterW * win32security: ! - Added DuplicateTokenEx, AddMandatoryAce, IsTokenRestricted, LogonUserEx ! - GetTokenInformation and SetTokenInformation support new Vista ! information classes ! ! * win32trace works better on Vista * mmapfile: ! - Fix crash caused by reopening named mapping with excess size ! - Accept offset and view size parameters, enabling use of files larger ! than physical memory ! - Document use in help file, and a demo script ! ! * win32timezone: support Vista and 2007 timezones. ! ! * pythonwin: ! - Refcounting / GIL problems fixed by kxroberto. ! - Background pychecker plugin by kxroberto ! - Fix COM browser ! ! * isapi: ! - Handle server variables > 8k in length and also handle IIS6 'UNICODE_' ! variables. ! - TransmitFile, MapURLToPath, IsKeepConn, DisableNotifications ! - New FilterContext attribute can be used to store arbitrary Python ! objects in an ECB. ! - Filter and Extension errors that happen during initialization are ! written to the Windows Event Log to help diagnose them. A couple ! of potential deadlocks during init errors also fixed. * win32pipe: |
From: Mark H. <mha...@us...> - 2007-10-20 05:24:55
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12718/com/win32com/test Modified Files: testPyComTest.py Log Message: whitespace Index: testPyComTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** testPyComTest.py 4 Sep 2007 10:53:29 -0000 1.28 --- testPyComTest.py 20 Oct 2007 05:24:52 -0000 1.29 *************** *** 70,76 **** # This test exists mainly to help with an old bug, where named # params would come in reverse. - # We know our impl called 'OnFire' with the same ID Missing = pythoncom.Missing if no is not Missing: assert no in self.fireds assert no+1==out1, "expecting 'out1' param to be ID+1" --- 70,76 ---- # This test exists mainly to help with an old bug, where named # params would come in reverse. Missing = pythoncom.Missing if no is not Missing: + # We know our impl called 'OnFire' with the same ID assert no in self.fireds assert no+1==out1, "expecting 'out1' param to be ID+1" |
From: Mark H. <mha...@us...> - 2007-10-20 05:23:13
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12008/Pythonwin Modified Files: win32util.cpp Log Message: avoid warning as strlen returns size_t, not ssize_t Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32util.cpp 13 Jul 2007 03:03:27 -0000 1.11 --- win32util.cpp 20 Oct 2007 05:23:14 -0000 1.12 *************** *** 422,426 **** pItem->mask |= LVIF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, ssize_t, int); } if (len<6) return TRUE; --- 422,426 ---- pItem->mask |= LVIF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, size_t, int); } if (len<6) return TRUE; *************** *** 522,526 **** pItem->mask |= LVCF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, ssize_t, int); } // 3 - subitem --- 522,526 ---- pItem->mask |= LVCF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, size_t, int); } // 3 - subitem *************** *** 656,660 **** pItem->mask |= TVIF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, ssize_t, int); } // 4 - image --- 656,660 ---- pItem->mask |= TVIF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, size_t, int); } // 4 - image *************** *** 801,805 **** pItem->pszText = PyString_AsString(ob); if (PyErr_Occurred()) return FALSE; ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, ssize_t, int); pItem->mask |= HDI_TEXT; } --- 801,805 ---- pItem->pszText = PyString_AsString(ob); if (PyErr_Occurred()) return FALSE; ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, size_t, int); pItem->mask |= HDI_TEXT; } |
From: Mark H. <mha...@us...> - 2007-10-17 04:16:14
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2982 Modified Files: PyWinTypesmodule.cpp Log Message: Add missing 'const' to PyWinObject_FromMSG Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** PyWinTypesmodule.cpp 12 Oct 2007 00:35:09 -0000 1.34 --- PyWinTypesmodule.cpp 17 Oct 2007 04:16:16 -0000 1.35 *************** *** 760,764 **** } ! PyObject *PyWinObject_FromMSG(MSG *pMsg) { return Py_BuildValue("Niiii(ii)", --- 760,764 ---- } ! PyObject *PyWinObject_FromMSG(const MSG *pMsg) { return Py_BuildValue("Niiii(ii)", |
From: Mark H. <mha...@us...> - 2007-10-17 03:51:54
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26805/com/win32com/client Modified Files: selecttlb.py Log Message: Fallout from the change of .major and .minor in a tlbspec to be strings instead of integers. The code populating the dialog now must make an assumption about the radix Index: selecttlb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/selecttlb.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** selecttlb.py 25 Aug 2007 05:09:21 -0000 1.9 --- selecttlb.py 17 Oct 2007 03:51:57 -0000 1.10 *************** *** 144,147 **** --- 144,151 ---- import pywin.dialogs.list items = EnumTlbs(excludeFlags) + # fixup versions - we assume hex (see __init__ above) + for i in items: + i.major = int(i.major, 16) + i.minor = int(i.minor, 16) items.sort() rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"]) |