pywin32-checkins Mailing List for Python for Windows Extensions (Page 88)
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...> - 2007-07-13 02:59:32
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8553 Modified Files: PyWinTypes.h PyTime.cpp Log Message: * Add PyWinObject_Astime_t * Disable the block which assumes wchar_t != ushort when using cl ver 14 Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PyTime.cpp 24 May 2007 06:01:05 -0000 1.18 --- PyTime.cpp 13 Jul 2007 02:59:33 -0000 1.19 *************** *** 799,802 **** } - #endif // NO_PYWINTYPES_TIME --- 799,810 ---- } #endif // NO_PYWINTYPES_TIME + + PYWINTYPES_EXPORT BOOL PyWinObject_Astime_t(PyObject *ob, time_t *t) + { + // We need to get smarter about 64bit time_t values... + *t = (time_t)PyInt_AsLong(ob); + if (*t == -1 && PyErr_Occurred()) + return FALSE; + return TRUE; + } Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** PyWinTypes.h 5 Jun 2007 05:46:48 -0000 1.45 --- PyWinTypes.h 13 Jul 2007 02:59:33 -0000 1.46 *************** *** 164,168 **** // win32 structures that still use 'unsigned short' now fail from C++ with // VS8 so we provide a couple of helpers. ! #if _MSC_VER >= 1400 inline BOOL PyWinObject_AsWCHAR(PyObject *stringObject, unsigned short **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL) { --- 164,172 ---- // win32 structures that still use 'unsigned short' now fail from C++ with // VS8 so we provide a couple of helpers. ! // XXX - but, when trying to use VC2003 with x64, the SDK x64 compiler ! // reports itself as 14.00.40310.41 - so this breaks under that compiler ! // Its not clear how to resolve this, but while VS2003 is the default ! // compiler, that is what must work. ! #if 0 and _MSC_VER >= 1400 inline BOOL PyWinObject_AsWCHAR(PyObject *stringObject, unsigned short **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL) { *************** *** 382,385 **** --- 386,392 ---- #endif // NO_PYWINTYPES_TIME + // Convert a time object to a time_t value. + PYWINTYPES_EXPORT BOOL PyWinObject_Astime_t(PyObject *ob, time_t *t); + // functions to return WIN32_FIND_DATA tuples, used in shell, win32api, and win32file PYWINTYPES_EXPORT PyObject *PyObject_FromWIN32_FIND_DATAA(WIN32_FIND_DATAA *pData); |
From: Mark H. <mha...@us...> - 2007-07-12 07:54:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17773/Pythonwin/pywin/tools Modified Files: browser.py Log Message: Have the pythonwin 'browser' insist on strings already encoded - easier than fixing all the uses, and this code isn't being used much these days Index: browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browser.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** browser.py 7 Oct 2004 08:51:36 -0000 1.7 --- browser.py 12 Jul 2007 07:54:34 -0000 1.8 *************** *** 25,28 **** --- 25,29 ---- self.knownExpandable = None if name: + assert type(name)==str, repr(name) # encode to mbcs if necessary self.name=name else: |
From: Mark H. <mha...@us...> - 2007-07-12 07:53:03
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17344/com/win32com/client Modified Files: combrowse.py Log Message: Get the COM browser working again by encoding Unicode as MBCS Index: combrowse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/combrowse.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** combrowse.py 22 Apr 2004 00:26:44 -0000 1.6 --- combrowse.py 12 Jul 2007 07:53:04 -0000 1.7 *************** *** 50,54 **** if name is None: try: ! name = pythoncom.ProgIDFromCLSID(myobject) except pythoncom.com_error: name = str(myobject) --- 50,54 ---- if name is None: try: ! name = pythoncom.ProgIDFromCLSID(myobject).encode('mbcs') except pythoncom.com_error: name = str(myobject) *************** *** 263,267 **** typeinfo = typelib.GetTypeInfo(index) self.id = typeinfo.GetVarDesc(index)[0] ! name = typeinfo.GetNames(self.id)[0] HLITypeLibEntry.__init__(self, myitem, name) def GetText(self): --- 263,267 ---- typeinfo = typelib.GetTypeInfo(index) self.id = typeinfo.GetVarDesc(index)[0] ! name = typeinfo.GetNames(self.id)[0].encode('mbcs') HLITypeLibEntry.__init__(self, myitem, name) def GetText(self): *************** *** 274,278 **** for j in range(attr[7]): vdesc = typeinfo.GetVarDesc(j) ! name = typeinfo.GetNames(vdesc[0])[0] ret.append(browser.MakeHLI(vdesc[1], name)) return ret --- 274,278 ---- for j in range(attr[7]): vdesc = typeinfo.GetVarDesc(j) ! name = typeinfo.GetNames(vdesc[0])[0].encode('mbcs') ret.append(browser.MakeHLI(vdesc[1], name)) return ret *************** *** 282,286 **** typeinfo, index = myitem self.id = typeinfo.GetVarDesc(index)[0] ! name = typeinfo.GetNames(self.id)[0] HLICOM.__init__(self, myitem, name) def GetText(self): --- 282,286 ---- typeinfo, index = myitem self.id = typeinfo.GetVarDesc(index)[0] ! name = typeinfo.GetNames(self.id)[0].encode('mbcs') HLICOM.__init__(self, myitem, name) def GetText(self): *************** *** 372,376 **** typeinfo, index = myitem self.id = typeinfo.GetFuncDesc(index)[0] ! name = typeinfo.GetNames(self.id)[0] HLICOM.__init__(self, myitem, name) def GetText(self): --- 372,376 ---- typeinfo, index = myitem self.id = typeinfo.GetFuncDesc(index)[0] ! name = typeinfo.GetNames(self.id)[0].encode('mbcs') HLICOM.__init__(self, myitem, name) def GetText(self): *************** *** 402,406 **** ret.append(browser.MakeHLI(self.id, "Dispatch ID")) if len(names)>1: ! ret.append(browser.MakeHLI(string.join(names[1:], ", "), "Named Params")) fd = typeinfo.GetFuncDesc(index) if fd[1]: --- 402,406 ---- ret.append(browser.MakeHLI(self.id, "Dispatch ID")) if len(names)>1: ! ret.append(browser.MakeHLI(", ".join(names[1:]).encode('mbcs'), "Named Params")) fd = typeinfo.GetFuncDesc(index) if fd[1]: |
From: Mark H. <mha...@us...> - 2007-07-12 07:51:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16922/Pythonwin Modified Files: Win32app.h Log Message: Allow things to build with early Vista x64 SDK Index: Win32app.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/Win32app.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Win32app.h 10 Jan 2006 04:39:43 -0000 1.4 --- Win32app.h 12 Jul 2007 07:51:30 -0000 1.5 *************** *** 56,60 **** --- 56,63 ---- // warning C4996: 'xxx' was declared deprecated #pragma warning( disable : 4996 ) + #ifndef _AFX_NO_CTL3D_SUPPORT + // Not available on early SDK _Win64 builds. BOOL Enable3dControls() {return CWinApp::Enable3dControls();} + #endif void SetDialogBkColor(COLORREF clrCtlBk, COLORREF clrCtlText) { CWinApp::SetDialogBkColor(clrCtlBk, clrCtlText);} #pragma warning( default : 4996 ) |
From: Mark H. <mha...@us...> - 2007-07-12 07:40:26
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12498/win32/src Modified Files: win32rasmodule.cpp Log Message: 64bit changes Index: win32rasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32rasmodule.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32rasmodule.cpp 24 May 2007 06:01:06 -0000 1.9 --- win32rasmodule.cpp 12 Jul 2007 07:40:26 -0000 1.10 *************** *** 64,68 **** strcpy(buf,"No error message is available"); /* strip trailing cr/lf */ ! int end = strlen(buf)-1; if (end>1 && (buf[end-1]=='\n' || buf[end-1]=='\r')) buf[end-1] = '\0'; --- 64,68 ---- strcpy(buf,"No error message is available"); /* strip trailing cr/lf */ ! size_t end = strlen(buf)-1; if (end>1 && (buf[end-1]=='\n' || buf[end-1]=='\r')) buf[end-1] = '\0'; *************** *** 202,210 **** // @prop integer|reserved| else if (strcmp(name, "reserved")==0) ! return PyInt_FromLong(py->m_ext.reserved); #if (WINVER >= 0x500) // @prop integer|reserved1| else if (strcmp(name, "reserved1")==0) ! return PyInt_FromLong( py->m_ext.reserved1); // @prop <o RASEAPINFO>|RasEapInfo| else if (strcmp(name, "RasEapInfo")==0) { --- 202,210 ---- // @prop integer|reserved| else if (strcmp(name, "reserved")==0) ! return PyWinObject_FromULONG_PTR(py->m_ext.reserved); #if (WINVER >= 0x500) // @prop integer|reserved1| else if (strcmp(name, "reserved1")==0) ! return PyWinObject_FromULONG_PTR(py->m_ext.reserved1); // @prop <o RASEAPINFO>|RasEapInfo| else if (strcmp(name, "RasEapInfo")==0) { *************** *** 300,306 **** } char *dest; ! int size = PyObject_Length(ob); int dest_size; ! for (int num=0;num<size;num++) { switch (num) { #define GET_BUF_AND_SIZE(name) dest=p->name;dest_size=sizeof(p->name)/sizeof(p->name[0]) --- 300,306 ---- } char *dest; ! size_t size = PyObject_Length(ob); int dest_size; ! for (size_t num=0;num<size;num++) { switch (num) { #define GET_BUF_AND_SIZE(name) dest=p->name;dest_size=sizeof(p->name)/sizeof(p->name[0]) *************** *** 356,360 **** if (obHandleMap) { // NOTE: As we hold the thread lock, assume noone else can mod this dict. ! PyObject *key = PyInt_FromLong((long)hrasconn); if (key==NULL) return; handler = PyDict_GetItem( obHandleMap, key ); --- 356,360 ---- if (obHandleMap) { // NOTE: As we hold the thread lock, assume noone else can mod this dict. ! PyObject *key = PyWinLong_FromVoidPtr(hrasconn); if (key==NULL) return; handler = PyDict_GetItem( obHandleMap, key ); *************** *** 397,410 **** PyRasCreatePhonebookEntry( PyObject *self, PyObject *args ) { - int hwnd; DWORD rc; LPTSTR fileName = NULL; ! if (!PyArg_ParseTuple(args, "i|s:CreatePhoneBookEntry", ! &hwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName )) // @pyparm string|fileName|None|Specifies the filename of the phonebook entry. Currently this is ignored. return NULL; ! if (hwnd != 0 && !IsWindow((HWND)hwnd)) return ReturnError("The first parameter must be a valid window handle", "<CreatePhonebookEntry param conversion>"); ! if ((rc=RasCreatePhonebookEntry((HWND)hwnd, fileName ))) return ReturnRasError("RasCreatePhonebookEntry",rc); // @pyseeapi RasCreatePhonebookEntry Py_INCREF(Py_None); --- 397,413 ---- PyRasCreatePhonebookEntry( PyObject *self, PyObject *args ) { DWORD rc; LPTSTR fileName = NULL; ! PyObject *obhwnd; ! if (!PyArg_ParseTuple(args, "O|s:CreatePhoneBookEntry", ! &obhwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName )) // @pyparm string|fileName|None|Specifies the filename of the phonebook entry. Currently this is ignored. return NULL; ! HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) ! return NULL; ! if (hwnd != 0 && !IsWindow(hwnd)) return ReturnError("The first parameter must be a valid window handle", "<CreatePhonebookEntry param conversion>"); ! if ((rc=RasCreatePhonebookEntry(hwnd, fileName ))) return ReturnRasError("RasCreatePhonebookEntry",rc); // @pyseeapi RasCreatePhonebookEntry Py_INCREF(Py_None); *************** *** 445,449 **** notType = 1; } else if (PyInt_Check(obCallback)) { ! pNotification = (LPVOID)PyInt_AsLong(obCallback); notType = 0xFFFFFFFF; } else --- 448,453 ---- notType = 1; } else if (PyInt_Check(obCallback)) { ! if (!PyWinLong_AsVoidPtr(obCallback, &pNotification)) ! return NULL; notType = 0xFFFFFFFF; } else *************** *** 486,502 **** PyRasEditPhonebookEntry( PyObject *self, PyObject *args ) { - int hwnd; DWORD rc; LPTSTR fileName; LPTSTR entryName; ! if (!PyArg_ParseTuple(args, "izs:EditPhoneBookEntry", ! &hwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName, // @pyparm string|fileName||Specifies the filename of the phonebook entry, or None. Currently this is ignored. &entryName )) // @pyparm string|entryName|None|Specifies the name of the phonebook entry to edit return NULL; ! if (hwnd != 0 && !IsWindow((HWND)hwnd)) return ReturnError("The first parameter must be a valid window handle", "<EditPhonebookEntry param parsing>"); Py_BEGIN_ALLOW_THREADS ! rc=RasEditPhonebookEntry((HWND)hwnd, fileName, entryName ); Py_END_ALLOW_THREADS if (rc) --- 490,509 ---- PyRasEditPhonebookEntry( PyObject *self, PyObject *args ) { DWORD rc; LPTSTR fileName; LPTSTR entryName; ! PyObject *obhwnd; ! if (!PyArg_ParseTuple(args, "Ozs:EditPhoneBookEntry", ! &obhwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName, // @pyparm string|fileName||Specifies the filename of the phonebook entry, or None. Currently this is ignored. &entryName )) // @pyparm string|entryName|None|Specifies the name of the phonebook entry to edit return NULL; ! HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) ! return NULL; ! if (hwnd != 0 && !IsWindow(hwnd)) return ReturnError("The first parameter must be a valid window handle", "<EditPhonebookEntry param parsing>"); Py_BEGIN_ALLOW_THREADS ! rc=RasEditPhonebookEntry(hwnd, fileName, entryName ); Py_END_ALLOW_THREADS if (rc) *************** *** 605,612 **** PyRasGetConnectStatus( PyObject *self, PyObject *args ) { - HRASCONN hras; DWORD rc; ! if (!PyArg_ParseTuple(args, "i:GetConnectStatus", ! &hras )) // @pyparm int|hrasconn||Handle to the RAS session. return NULL; RASCONNSTATUS cs; --- 612,622 ---- PyRasGetConnectStatus( PyObject *self, PyObject *args ) { DWORD rc; ! PyObject *obras; ! if (!PyArg_ParseTuple(args, "O:GetConnectStatus", ! &obras )) // @pyparm int|hrasconn||Handle to the RAS session. ! return NULL; ! HRASCONN hras; ! if (!PyWinObject_AsHANDLE(obras, (HANDLE *)&hras)) return NULL; RASCONNSTATUS cs; |
From: Mark H. <mha...@us...> - 2007-07-05 05:31:38
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4896 Modified Files: win32ui.h Log Message: Add reference to MFC assembly for vs2005 Index: win32ui.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ui.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32ui.h 3 Jun 2007 12:35:58 -0000 1.5 --- win32ui.h 5 Jul 2007 05:31:39 -0000 1.6 *************** *** 27,30 **** --- 27,36 ---- #include <afxext.h> // Also unusual - needed for CCreateContext. + // For MFC8 (VS2005), we need to nominate the MFC assembly - may as well do + // it here so its done once for all projects! + #if _MFC_VER >= 0x0800 + # pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.VC80.MFC' version='8.0.50727.762' processorArchitecture='*' publicKeyToken='fc8b3b9a1e18e3b' language='*'\"") + #endif + #define DOINCREF(o) Py_INCREF(o) #define DODECREF(o) Py_DECREF(o) |
From: Roger U. <ru...@us...> - 2007-07-04 18:40:52
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5433/com/win32com/src Modified Files: PyStorage.cpp PythonCOM.cpp Log Message: Add CreateILockBytesOnHGlobal Remove loading of function pointer for CoResumeClassObjects Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** PythonCOM.cpp 3 Jun 2007 14:53:06 -0000 1.46 --- PythonCOM.cpp 4 Jul 2007 18:40:46 -0000 1.47 *************** *** 51,54 **** --- 51,56 ---- extern PyObject *pythoncom_ReadClassStm(PyObject *self, PyObject *args); extern PyObject *pythoncom_CreateStreamOnHGlobal(PyObject *self, PyObject *args); + extern PyObject *pythoncom_CreateILockBytesOnHGlobal(PyObject *self, PyObject *args); + extern PyObject *pythoncom_GetRecordFromGuids(PyObject *self, PyObject *args); extern PyObject *pythoncom_GetRecordFromTypeInfo(PyObject *self, PyObject *args); *************** *** 170,175 **** IUnknown *punk = NULL; PyObject *result = NULL; ! int numIIDs = 0; ! int i; if (!PyArg_ParseTuple(args, "OOiOO:CoCreateInstanceEx", &obCLSID, // @pyparm <o PyIID>|clsid||Class identifier (CLSID) of the object --- 172,178 ---- IUnknown *punk = NULL; PyObject *result = NULL; ! ULONG numIIDs = 0; ! ULONG i; ! Py_ssize_t py_numIIDs; if (!PyArg_ParseTuple(args, "OOiOO:CoCreateInstanceEx", &obCLSID, // @pyparm <o PyIID>|clsid||Class identifier (CLSID) of the object *************** *** 206,211 **** goto done; } ! numIIDs = PySequence_Length(obrgiids); ! iids = new IID[numIIDs]; mqi = new MULTI_QI[numIIDs]; --- 209,218 ---- goto done; } ! py_numIIDs = PySequence_Length(obrgiids); ! if (py_numIIDs > ULONG_MAX){ ! PyErr_Format(PyExc_ValueError, "%u is maximum number of IIDs", ULONG_MAX); ! goto done; ! } ! numIIDs=(ULONG)py_numIIDs; iids = new IID[numIIDs]; mqi = new MULTI_QI[numIIDs]; *************** *** 390,412 **** } - // I cont understand this compiler :-( - #ifdef _MSC_VER - #pragma optimize ("", off) - #endif // _MSC_VER // @pymethod |pythoncom|CoResumeClassObjects|Called by a server that can register multiple class objects to inform the OLE SCM about all registered classes, and permits activation requests for those class objects. static PyObject *pythoncom_CoResumeClassObjects(PyObject *self, PyObject *args) { - // @comm This is not available on Window95. If it is called on that platform, - // a E_NOTIMPLEMENTED <o com_error> is raised. if (!PyArg_ParseTuple(args, ":CoResumeClassObjects")) return NULL; - // *** AARG - NOT ON 95! - HMODULE hMod = GetModuleHandle("ole32.dll"); - if (hMod==0) return PyWin_SetAPIError("GetModuleHandle(\"ole32.dll\")"); - FARPROC fp = GetProcAddress(hMod, "CoResumeClassObjects"); - if (fp==NULL) - return PyCom_BuildPyException(E_NOTIMPL); PY_INTERFACE_PRECALL; ! HRESULT hr = (*fp)(); PY_INTERFACE_POSTCALL; if (FAILED(hr)) --- 397,407 ---- } // @pymethod |pythoncom|CoResumeClassObjects|Called by a server that can register multiple class objects to inform the OLE SCM about all registered classes, and permits activation requests for those class objects. static PyObject *pythoncom_CoResumeClassObjects(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, ":CoResumeClassObjects")) return NULL; PY_INTERFACE_PRECALL; ! HRESULT hr = CoResumeClassObjects(); PY_INTERFACE_POSTCALL; if (FAILED(hr)) *************** *** 415,421 **** return Py_None; } - #ifdef _MSC_VER - #pragma optimize ("", on) - #endif // _MSC_VER // @pymethod |pythoncom|CoTreatAsClass|Establishes or removes an emulation, in which objects of one class are treated as objects of a different class. --- 410,413 ---- *************** *** 1795,1798 **** --- 1787,1792 ---- #endif // MS_WINCE { "CreateStreamOnHGlobal", pythoncom_CreateStreamOnHGlobal, 1 }, // @pymeth CreateStreamOnHGlobal|Creates an in-memory stream storage object + { "CreateILockBytesOnHGlobal", pythoncom_CreateILockBytesOnHGlobal, 1 }, // @pymeth CreateILockBytesOnHGlobal|Creates an ILockBytes interface based on global memory + { "EnableQuitMessage", pythoncom_EnableQuitMessage, 1 }, // @pymeth EnableQuitMessage|Indicates the thread PythonCOM should post a WM_QUIT message to. { "FUNCDESC", Py_NewFUNCDESC, 1}, // @pymeth FUNCDESC|Returns a new <o FUNCDESC> object. Index: PyStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyStorage.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyStorage.cpp 3 Jun 2007 14:53:06 -0000 1.11 --- PyStorage.cpp 4 Jul 2007 18:40:46 -0000 1.12 *************** *** 122,125 **** --- 122,146 ---- } + // @pymethod <o PyILockBytes>|pythoncom|CreateILockBytesOnHGlobal|Creates an ILockBytes interface based on global memory + PyObject *pythoncom_CreateILockBytesOnHGlobal(PyObject *self, PyObject *args) + { + PyObject *obhglobal=Py_None; + HGLOBAL hglobal=NULL; + BOOL bdelete=TRUE; + ILockBytes *pILockBytes=NULL; + if (!PyArg_ParseTuple(args, "|Ol:CreateILockBytesOnHGlobal", + &obhglobal, // @pyparm <o PyHANDLE>|hGlobal|None|Global memory handle. If None, a new global memory object is allocated. + &bdelete)) // @pyparm bool|DeleteOnRelease|True|Indicates if global memory should be freed when interface is released. + return NULL; + if (!PyWinObject_AsHANDLE(obhglobal, &hglobal)) + return NULL; + PY_INTERFACE_PRECALL; + HRESULT hr = CreateILockBytesOnHGlobal(hglobal, bdelete, &pILockBytes); + PY_INTERFACE_POSTCALL; + if (FAILED(hr)) + return PyCom_BuildPyException(hr); + return PyCom_PyObjectFromIUnknown(pILockBytes, IID_ILockBytes, FALSE); + } + // @pymethod <o PyIStorage>|pythoncom|StgCreateDocfile|Creates a new compound file storage object using the OLE-provided compound file implementation for the <o PyIStorage> interface. PyObject *pythoncom_StgCreateDocfile(PyObject *self, PyObject *args) |
From: Roger U. <ru...@us...> - 2007-07-04 18:34:55
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2773/com/win32com/src Modified Files: PyComHelpers.cpp Log Message: Remove obsolete #ifdef Index: PyComHelpers.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyComHelpers.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PyComHelpers.cpp 7 May 2007 02:33:00 -0000 1.13 --- PyComHelpers.cpp 4 Jul 2007 18:34:56 -0000 1.14 *************** *** 266,274 **** if ( valueObject ) { - #ifdef PYWIN_NO_PYTHON_LONG_LONG - pfnPyGatewayConstructor ctor = (pfnPyGatewayConstructor)PyInt_AsLong(valueObject); - #else pfnPyGatewayConstructor ctor = (pfnPyGatewayConstructor)PyLong_AsVoidPtr(valueObject); - #endif // ctor takes reference count to instance. hr = (*ctor)(instance, base, ppv, iid); --- 266,270 ---- |
From: Roger U. <ru...@us...> - 2007-07-04 18:03:17
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21664/com/win32com/src Modified Files: PyIUnknown.cpp Log Message: Fix a couple of 64-bit warnings Index: PyIUnknown.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIUnknown.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyIUnknown.cpp 19 Apr 2006 22:37:56 -0000 1.11 --- PyIUnknown.cpp 4 Jul 2007 18:03:18 -0000 1.12 *************** *** 38,42 **** // @comm The repr of this object displays both the object's address, and its attached IUnknown's address TCHAR buf[80]; ! wsprintf(buf, _T("<%hs at 0x%0lx with obj at 0x%0lx>"),ob_type->tp_name, (long)(PyObject *)this, (long)m_obj); return PyString_FromTCHAR(buf); } --- 38,42 ---- // @comm The repr of this object displays both the object's address, and its attached IUnknown's address TCHAR buf[80]; ! wsprintf(buf, _T("<%hs at 0x%0lp with obj at 0x%0lp>"),ob_type->tp_name, this, m_obj); return PyString_FromTCHAR(buf); } |
From: Roger U. <ru...@us...> - 2007-07-04 17:57:54
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19093/com/win32com/src Modified Files: Register.cpp Log Message: Remove some obsolete code Index: Register.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Register.cpp 16 May 2006 03:05:47 -0000 1.16 --- Register.cpp 4 Jul 2007 17:57:55 -0000 1.17 *************** *** 85,93 **** PyObject *keyObject = PyWinObject_FromIID(iid); if (!keyObject) return E_FAIL; ! #ifdef PYWIN_NO_PYTHON_LONG_LONG ! PyObject *valueObject = PyInt_FromLong((long)ctor); ! #else PyObject *valueObject = PyLong_FromVoidPtr((void *)ctor); ! #endif if (!valueObject) { Py_DECREF(keyObject); --- 85,91 ---- PyObject *keyObject = PyWinObject_FromIID(iid); if (!keyObject) return E_FAIL; ! PyObject *valueObject = PyLong_FromVoidPtr((void *)ctor); ! if (!valueObject) { Py_DECREF(keyObject); |
From: Roger U. <ru...@us...> - 2007-07-04 16:43:36
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19986/com/win32com/src/extensions Modified Files: PyILockBytes.cpp Log Message: Fix a memory leak and a buffer overflow Index: PyILockBytes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyILockBytes.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyILockBytes.cpp 2 Jul 2007 03:19:53 -0000 1.3 --- PyILockBytes.cpp 4 Jul 2007 16:43:37 -0000 1.4 *************** *** 35,56 **** // @pyparm <o ULARGE_INTEGER>|ulOffset||Offset to start reading // @pyparm int|cb||Number of bytes to read - PyObject *obulOffset; ULONG cb; - if ( !PyArg_ParseTuple(args, "Oi:ReadAt", &obulOffset, &cb) ) - return NULL; ULARGE_INTEGER ulOffset; ! BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsULARGE_INTEGER(obulOffset, &ulOffset)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; ! char *pv = (char *)malloc(cb); ! ULONG pcbRead; PY_INTERFACE_PRECALL; ! HRESULT hr = pILB->ReadAt( ulOffset, pv, cb, &pcbRead ); PY_INTERFACE_POSTCALL; ! if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pILB, IID_ILockBytes); ! // @comm The result is a binary buffer returned in a string. ! PyObject *pyretval = PyString_FromStringAndSize(pv, pcbRead); return pyretval; } --- 35,56 ---- // @pyparm <o ULARGE_INTEGER>|ulOffset||Offset to start reading // @pyparm int|cb||Number of bytes to read ULONG cb; ULARGE_INTEGER ulOffset; ! if ( !PyArg_ParseTuple(args, "Kk:ReadAt", &ulOffset.QuadPart, &cb) ) ! return NULL; ! ! PyObject *pyretval=PyString_FromStringAndSize(NULL, cb); ! if (pyretval==NULL) ! return NULL; ! ULONG cbRead; PY_INTERFACE_PRECALL; ! HRESULT hr = pILB->ReadAt( ulOffset, PyString_AS_STRING(pyretval), cb, &cbRead ); PY_INTERFACE_POSTCALL; ! if ( FAILED(hr) ){ ! Py_DECREF(pyretval); return PyCom_BuildPyException(hr, pILB, IID_ILockBytes); ! } // @comm The result is a binary buffer returned in a string. ! _PyString_Resize(&pyretval, cbRead); return pyretval; } *************** *** 249,267 **** Py_XDECREF(obulOffset); if (FAILED(hr)) return hr; - // Process the Python results, and convert back to the real params - hr = E_FAIL; - int len = PyObject_Length(result); - if ( len == -1 ) - return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); - const char *s = PyString_AsString(result); - if ( s == NULL ) - return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); ! memcpy(pv, s, len); ! if ( pcbRead != NULL ) ! *pcbRead = len; ! hr = S_OK; Py_DECREF(result); ! return PyCom_SetCOMErrorFromSimple(hr, GetIID()); } --- 249,269 ---- Py_XDECREF(obulOffset); if (FAILED(hr)) return hr; ! // Process the Python results, and convert back to the real params ! // Length of returned object must fit in buffer ! ! DWORD resultlen; ! VOID *buf; ! if (PyWinObject_AsReadBuffer(result, &buf, &resultlen, FALSE)){ ! if (resultlen > cb) ! PyErr_SetString(PyExc_ValueError,"Returned data longer than requested"); ! else{ ! memcpy(pv, buf, resultlen); ! if (pcbRead) ! *pcbRead = resultlen; ! hr = S_OK; ! } ! } Py_DECREF(result); ! return MAKE_PYCOM_GATEWAY_FAILURE_CODE("Read"); } |
From: Mark H. <mha...@us...> - 2007-07-04 01:47:16
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6286 Modified Files: shell.cpp Log Message: Add IsUserAnAdmin() Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** shell.cpp 3 Jun 2007 14:53:07 -0000 1.57 --- shell.cpp 4 Jul 2007 01:46:55 -0000 1.58 *************** *** 90,93 **** --- 90,96 ---- static PFNSHShellFolderView_Message pfnSHShellFolderView_Message = NULL; + typedef BOOL (WINAPI *PFNIsUserAnAdmin)(); + static PFNIsUserAnAdmin pfnIsUserAnAdmin = NULL; + void PyShell_FreeMem(void *p) { *************** *** 2264,2267 **** --- 2267,2286 ---- } + // @pymethod bool|shell|IsUserAnAdmin|Tests whether the current user is a member of the Administrator's group. + // @rdesc The result is true or false. + static PyObject *PyIsUserAnAdmin(PyObject *self, PyObject *args) + { + if(!PyArg_ParseTuple(args, ":IsUserAnAdmin")) + return NULL; + // @comm This method is only available with version 5 or later of the shell controls + if (pfnIsUserAnAdmin==NULL) + return OleSetOleError(E_NOTIMPL); + PY_INTERFACE_PRECALL; + BOOL r = (*pfnIsUserAnAdmin)(); + PY_INTERFACE_POSTCALL; + + return PyBool_FromLong(r); + } + /* List of module functions */ *************** *** 2273,2276 **** --- 2292,2296 ---- { "DragQueryFileW", PyDragQueryFileW, 1 }, // @pymeth DragQueryFileW|Retrieves the file names of dropped files that have resulted from a successful drag-and-drop operation. { "DragQueryPoint", PyDragQueryPoint, 1}, // @pymeth DragQueryPoint|Retrieves the position of the mouse pointer at the time a file was dropped during a drag-and-drop operation. + { "IsUserAnAdmin", PyIsUserAnAdmin, METH_VARARGS}, // @pymeth IsUserAnAdmin|Tests whether the current user is a member of the Administrator's group. { "SHGetPathFromIDList", PySHGetPathFromIDList, 1 }, // @pymeth SHGetPathFromIDList|Converts an <o PyIDL> to a path. { "SHGetPathFromIDListW", PySHGetPathFromIDListW, 1 }, // @pymeth SHGetPathFromIDListW|Converts an <o PyIDL> to a unicode path. *************** *** 2402,2405 **** --- 2422,2426 ---- pfnSHILCreateFromPath=(PFNSHILCreateFromPath)GetProcAddress(shell32, "SHILCreateFromPath"); pfnSHShellFolderView_Message=(PFNSHShellFolderView_Message)GetProcAddress(shell32, "SHShellFolderView_Message"); + pfnIsUserAnAdmin=(PFNIsUserAnAdmin)GetProcAddress(shell32, "IsUserAnAdmin"); } // SHGetFolderPath comes from shfolder.dll on older systems |
From: Roger U. <ru...@us...> - 2007-07-03 21:10:25
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30281/com/win32com/test Modified Files: testStreams.py Log Message: Add Seek, and test for a buffer overflow Index: testStreams.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testStreams.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testStreams.py 10 Nov 2003 00:49:29 -0000 1.4 --- testStreams.py 3 Jul 2007 21:10:26 -0000 1.5 *************** *** 30,34 **** class Stream: ! _public_methods_ = [ 'Read', 'Write' ] _com_interfaces_ = [ pythoncom.IID_IStream ] --- 30,34 ---- class Stream: ! _public_methods_ = [ 'Read', 'Write', 'Seek' ] _com_interfaces_ = [ pythoncom.IID_IStream ] *************** *** 47,50 **** --- 47,71 ---- return len(data) + def Seek(self, dist, origin): + if origin==pythoncom.STREAM_SEEK_SET: + self.index = dist + elif origin==pythoncom.STREAM_SEEK_CUR: + self.index = self.index + dist + elif origin==pythoncom.STREAM_SEEK_END: + self.index = len(self.data)+dist + else: + raise ValueError, 'Unknown Seek type: ' +str(origin) + if self.index < 0: + self.index = 0 + else: + self.index = min(self.index, len(self.data)) + return self.index + + class BadStream(Stream): + """ PyGStream::Read could formerly overflow buffer if the python implementation + returned more data than requested. + """ + def Read(self, amount): + return 'x'*(amount+1) class StreamTest(win32com.test.util.TestCase): *************** *** 52,57 **** --- 73,82 ---- if read_stream is None: read_stream = write_stream write_stream.Write(data) + read_stream.Seek(0, pythoncom.STREAM_SEEK_SET) got = read_stream.Read(len(data)) self.assertEqual(data, got) + read_stream.Seek(1, pythoncom.STREAM_SEEK_SET) + got = read_stream.Read(len(data)-2) + self.assertEqual(data[1:-1], got) def testit(self): *************** *** 83,86 **** --- 108,116 ---- self.assertEqual(s.data, mydata) + ## check for buffer overflow in Read method + badstream = BadStream('Check for buffer overflow') + badstream2 = win32com.server.util.wrap(badstream, pythoncom.IID_IStream) + self.assertRaises(pythoncom.com_error, badstream2.Read, 10) + if __name__=='__main__': unittest.main() |
From: Roger U. <ru...@us...> - 2007-07-03 21:00:49
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26516/com/win32com/src/extensions Modified Files: PyGStream.cpp Log Message: Fix a buffer overflow and possible crash Index: PyGStream.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyGStream.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyGStream.cpp 2 Jul 2007 01:29:51 -0000 1.4 --- PyGStream.cpp 3 Jul 2007 21:00:46 -0000 1.5 *************** *** 19,34 **** hr = E_FAIL; ! int len = PyObject_Length(result); ! if ( len != -1 ) ! { ! const char *s = PyString_AsString(result); ! if ( s != NULL ) ! { ! memcpy(pv, s, len); ! if ( pcbRead != NULL ) ! *pcbRead = len; hr = S_OK; } - } Py_DECREF(result); --- 19,34 ---- hr = E_FAIL; ! VOID *buf=NULL; ! DWORD resultlen; ! if (PyWinObject_AsReadBuffer(result, &buf, &resultlen, FALSE)){ ! if (resultlen > cb) ! PyErr_SetString(PyExc_ValueError,"Returned data longer than requested"); ! else{ ! memcpy(pv, buf, resultlen); ! if (pcbRead) ! *pcbRead = resultlen; hr = S_OK; + } } Py_DECREF(result); *************** *** 68,82 **** { PY_GATEWAY_METHOD; - PyObject *obdlibMove = PyWinObject_FromLARGE_INTEGER(dlibMove); PyObject *result; ! HRESULT hr=InvokeViaPolicy("Seek", &result, "Oi", obdlibMove, dwOrigin); ! Py_XDECREF(obdlibMove); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! PyObject *obplibNewPosition; ! if (!PyArg_Parse(result, "O" , &obplibNewPosition)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); ! BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsULARGE_INTEGER(obplibNewPosition, plibNewPosition)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("Seek"); Py_DECREF(result); return hr; --- 68,81 ---- { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("Seek", &result, "Lk", dlibMove.QuadPart, dwOrigin); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! // Callers may pass NULL for result position if they don't require the result ! ULARGE_INTEGER new_pos; ! if (!PyWinObject_AsULARGE_INTEGER(result, &new_pos)) ! hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("Seek"); ! else if (plibNewPosition) ! *plibNewPosition=new_pos; Py_DECREF(result); return hr; |
From: Roger U. <ru...@us...> - 2007-07-02 03:19:53
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7542/com/win32com/src/extensions Modified Files: PyILockBytes.cpp Log Message: A couple 's#' fixes Index: PyILockBytes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyILockBytes.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyILockBytes.cpp 19 Nov 1999 04:03:23 -0000 1.2 --- PyILockBytes.cpp 2 Jul 2007 03:19:53 -0000 1.3 *************** *** 64,76 **** // @pyparm <o ULARGE_INTEGER>|ulOffset||Offset to write at. // @pyparm string|data||Data to write ! PyObject *obulOffset; ! char *pv; ULONG cb; ! if ( !PyArg_ParseTuple(args, "Os#:WriteAt", &obulOffset, &pv, &cb) ) return NULL; ULARGE_INTEGER ulOffset; ! BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsULARGE_INTEGER(obulOffset, &ulOffset)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; ULONG pcbWritten; PY_INTERFACE_PRECALL; --- 64,77 ---- // @pyparm <o ULARGE_INTEGER>|ulOffset||Offset to write at. // @pyparm string|data||Data to write ! PyObject *obulOffset, *obpv; ! void *pv; ULONG cb; ! if ( !PyArg_ParseTuple(args, "OO:WriteAt", &obulOffset, &obpv)) return NULL; ULARGE_INTEGER ulOffset; ! if (!PyWinObject_AsULARGE_INTEGER(obulOffset, &ulOffset)) ! return NULL; ! if (!PyWinObject_AsReadBuffer(obpv, &pv, &cb, FALSE)) ! return NULL; ULONG pcbWritten; PY_INTERFACE_PRECALL; *************** *** 81,86 **** // @rdesc The result is the number of bytes actually written. ! PyObject *pyretval = Py_BuildValue("i", pcbWritten); ! return pyretval; } --- 82,86 ---- // @rdesc The result is the number of bytes actually written. ! return PyLong_FromUnsignedLong(pcbWritten); } *************** *** 277,283 **** PY_GATEWAY_METHOD; PyObject *obulOffset = PyWinObject_FromULARGE_INTEGER(ulOffset); PyObject *result; ! HRESULT hr=InvokeViaPolicy("WriteAt", &result, "Os#", obulOffset, (char *)pv, cb); Py_XDECREF(obulOffset); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params --- 277,285 ---- PY_GATEWAY_METHOD; PyObject *obulOffset = PyWinObject_FromULARGE_INTEGER(ulOffset); + PyObject *obbuf = PyString_FromStringAndSize((char *)pv, cb); PyObject *result; ! HRESULT hr=InvokeViaPolicy("WriteAt", &result, "OO", obulOffset, obbuf); Py_XDECREF(obulOffset); + Py_XDECREF(obbuf); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params |
From: Roger U. <ru...@us...> - 2007-07-02 01:29:51
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30740/com/win32com/src/extensions Modified Files: PyGStream.cpp Log Message: Another 's#' 64-bit issue Index: PyGStream.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyGStream.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyGStream.cpp 25 Jan 2005 13:33:16 -0000 1.3 --- PyGStream.cpp 2 Jul 2007 01:29:51 -0000 1.4 *************** *** 46,50 **** PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr = InvokeViaPolicy("Write", &result, "s#", pv, (int)cb); if ( FAILED(hr) ) return hr; --- 46,52 ---- PY_GATEWAY_METHOD; PyObject *result; ! PyObject *obbuf=PyString_FromStringAndSize((char *)pv, cb); ! HRESULT hr = InvokeViaPolicy("Write", &result, "O", obbuf); ! Py_XDECREF(obbuf); if ( FAILED(hr) ) return hr; |
From: Roger U. <ru...@us...> - 2007-07-01 20:05:21
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1434 Modified Files: pywin32_postinstall.py Log Message: Create registry entries to add Pythonwin to context menu Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pywin32_postinstall.py 13 Feb 2005 12:28:29 -0000 1.18 --- pywin32_postinstall.py 1 Jul 2007 20:05:21 -0000 1.19 *************** *** 126,129 **** --- 126,155 ---- func(klass, **flags) + def RegisterPythonwin(): + """ Add Pythonwin to context menu for python scripts. + ??? Should probably also add Edit command for pys files also. + Also need to remove these keys on uninstall, but there's no function + like file_created to add registry entries to uninstall log ??? + """ + import _winreg, os, distutils.sysconfig + + lib_dir = distutils.sysconfig.get_python_lib(plat_specific=1) + classes_root=get_root_hkey() + ## Installer executable doesn't seem to pass anything to postinstall script indicating if it's a debug build, + pythonwin_exe = os.path.join(lib_dir, "Pythonwin", "Pythonwin.exe") + pythonwin_edit_command=pythonwin_exe + ' /edit "%1"' + + ## Since _winreg only uses the character Api functions, this can fail if Python + ## is installed to a path containing non-ascii characters + pw_key = _winreg.CreateKey(classes_root, 'Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Pythonwin.exe') + _winreg.SetValueEx(pw_key, None, 0, _winreg.REG_SZ, pythonwin_exe) + pw_key.Close() + pw_key = _winreg.CreateKey(classes_root, 'Software\\Classes\\Python.File\\shell\\Edit with Pythonwin\\command') + _winreg.SetValueEx(pw_key, None, 0, _winreg.REG_SZ, pythonwin_edit_command) + pw_key.Close() + pw_key = _winreg.CreateKey(classes_root, 'Software\\Classes\\Python.NoConFile\\shell\\Edit with Pythonwin\\command') + _winreg.SetValueEx(pw_key, None, 0, _winreg.REG_SZ, pythonwin_edit_command) + pw_key.Close() + def install(): import distutils.sysconfig *************** *** 234,237 **** --- 260,273 ---- print "NOTE: PyWin32.chm can not be located, so has not " \ "been registered" + + # Register Pythonwin in context menu + try: + RegisterPythonwin() + except: + print 'Failed to register pythonwin as editor' + traceback.print_exc() + else: + print 'Pythonwin has been registered in context menu' + # Create the win32com\gen_py directory. make_dir = os.path.join(lib_dir, "win32com", "gen_py") |
From: Roger U. <ru...@us...> - 2007-06-30 04:37:51
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22408/win32/Lib Modified Files: win32serviceutil.py Log Message: In SmartOpenService, use win32service.GetServiceKeyName in place of _GetServiceShortName Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** win32serviceutil.py 10 Jan 2006 00:18:24 -0000 1.24 --- win32serviceutil.py 30 Jun 2007 04:37:52 -0000 1.25 *************** *** 79,86 **** winerror.ERROR_INVALID_NAME]: raise ! name = _GetServiceShortName(name) ! if name is None: ! raise ! return win32service.OpenService(hscm, name, access) def LocateSpecificServiceExe(serviceName): --- 79,84 ---- winerror.ERROR_INVALID_NAME]: raise ! name = win32service.GetServiceKeyName(hscm, name) ! return win32service.OpenService(hscm, name, access) def LocateSpecificServiceExe(serviceName): |
From: Roger U. <ru...@us...> - 2007-06-29 16:21:31
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6659/win32/src Modified Files: odbc.cpp Log Message: Prevent a crash when attempting to reestablish a dropped database connection Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** odbc.cpp 30 May 2007 06:08:04 -0000 1.19 --- odbc.cpp 29 Jun 2007 16:21:32 -0000 1.20 *************** *** 195,199 **** if (conn && errorType && (errorType->connected == 0)) { - // printf("Disconnected\n"); SQLDisconnect(conn->hdbc); conn->connected = 0; --- 195,198 ---- *************** *** 250,257 **** { /* ie the cursor was made on an old connection */ ! ! printf("Attempting reconnect\n"); ! SQLFreeStmt(cur->hstmt, SQL_DROP); ! if (cur->my_conx->connected == 0) { --- 249,258 ---- { /* ie the cursor was made on an old connection */ ! /* Do not need to free HSTMT here, since any statements attached to the connection ! are automatically invalidated when SQLDisconnect is called in odbcPrintError. ! (only place where connected is set to 0) ! SQLFreeStmt(cur->hstmt, SQL_DROP); ! */ ! cur->hstmt=NULL; if (cur->my_conx->connected == 0) { *************** *** 376,384 **** cur->my_conx = 0; cur->bGetDataIsNeeded = false; if (unsuccessful(SQLAllocStmt(conn->hdbc, &cur->hstmt))) { connectionError(cur->my_conx, "OPEN"); ! PyObject_Del(cur); ! return 0; } cur->my_conx = conn; --- 377,387 ---- cur->my_conx = 0; cur->bGetDataIsNeeded = false; + cur->hstmt=NULL; + if (unsuccessful(SQLAllocStmt(conn->hdbc, &cur->hstmt))) { connectionError(cur->my_conx, "OPEN"); ! Py_DECREF(cur); ! return NULL; } cur->my_conx = conn; *************** *** 463,470 **** { cursorObject *cur = cursor(self); ! if (SQLFreeStmt(cur->hstmt, SQL_DROP)) ! { ! cursorError(cur, "CLOSE"); ! } deleteBinding(cur); if (cur->my_conx) --- 466,473 ---- { cursorObject *cur = cursor(self); ! /* Only free HSTMT if database connection hasn't been disconnected */ ! if (cur->my_conx && cur->my_conx->connected && cur->hstmt) ! SQLFreeHandle(SQL_HANDLE_STMT, cur->hstmt); ! deleteBinding(cur); if (cur->my_conx) *************** *** 866,870 **** strcpy(ib->bind_area, val); ! int sqlType = SQL_VARCHAR; // SQL_CHAR can cause padding in some drivers.. if (len > 255) { --- 869,873 ---- strcpy(ib->bind_area, val); ! int sqlType = SQL_VARCHAR; /* SQL_CHAR can cause padding in some drivers.. */ if (len > 255) { *************** *** 910,914 **** wcscpy((WCHAR *)ib->bind_area, wval); ! // See above re SQL_VARCHAR int sqlType = SQL_WVARCHAR; if (nbytes > 255) --- 913,917 ---- wcscpy((WCHAR *)ib->bind_area, wval); ! /* See above re SQL_VARCHAR */ int sqlType = SQL_WVARCHAR; if (nbytes > 255) *************** *** 1771,1776 **** { connectionError(conn, "ALLOCATION"); ! PyObject_Del(conn); ! return 0; } --- 1774,1779 ---- { connectionError(conn, "ALLOCATION"); ! Py_DECREF(conn); ! return NULL; } *************** *** 1779,1784 **** if (doConnect(conn)) { ! PyObject_Del(conn); ! return 0; } --- 1782,1787 ---- if (doConnect(conn)) { ! Py_DECREF(conn); ! return NULL; } *************** *** 1787,1795 **** /* @pymethod (name, desc)/None|odbc|SQLDataSources|Enumerates ODBC data sources */ ! // @rdesc The result is None when SQL_NO_DATA is returned from ODBC. static PyObject *odbcSQLDataSources(PyObject *self, PyObject *args) { int direction; ! // @pyparm int|direction|| if (!PyArg_ParseTuple(args, "i:SQLDataSources", &direction)) return NULL; --- 1790,1798 ---- /* @pymethod (name, desc)/None|odbc|SQLDataSources|Enumerates ODBC data sources */ ! /* @rdesc The result is None when SQL_NO_DATA is returned from ODBC. */ static PyObject *odbcSQLDataSources(PyObject *self, PyObject *args) { int direction; ! /* @pyparm int|direction||One of SQL_FETCH_* flags indicating how to retrieve data sources */ if (!PyArg_ParseTuple(args, "i:SQLDataSources", &direction)) return NULL; |
From: Roger U. <ru...@us...> - 2007-06-28 18:03:57
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23983 Modified Files: CHANGES.txt Log Message: Notes on some more recent changes Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CHANGES.txt 23 Apr 2007 00:21:04 -0000 1.8 --- CHANGES.txt 28 Jun 2007 18:00:13 -0000 1.9 *************** *** 10,13 **** --- 10,22 ---- * makepy accepts a program id to process its typelib + * pythoncom: + CoMarshalInterface/CoUnmarshalInterface/CoReleaseMarshalData + ReadClassStm/WriteClassStm + CreateStreamOnHGlobal + + * win32com.shell: + PyIExtractImage + PyIEmptyVolumecache + * win32transaction: New module containing Kernel Transaction Manager (KTM) functions as used with transacted NTFS and transacted registry functions *************** *** 64,67 **** --- 73,81 ---- Added DuplicateTokenEx + * 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 Build 210 - Sept. 23 2006 |
From: Roger U. <ru...@us...> - 2007-06-28 08:28:23
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1719/win32/Demos Added Files: mmapfile_demo.py Log Message: Test out mmapfile functions --- NEW FILE: mmapfile_demo.py --- import win32api, mmapfile import tempfile, os system_info=win32api.GetSystemInfo() page_size=system_info[1] alloc_size=system_info[7] fname=tempfile.mktemp() mapping_name=os.path.split(fname)[1] fsize=8*page_size print fname, fsize, mapping_name m1=mmapfile.mmapfile(File=fname, Name=mapping_name, MaximumSize=fsize) m1.seek(100) m1.write_byte('?') m1.seek(-1,1) assert m1.read_byte()=='?' ## A reopened named mapping should have exact same size as original mapping m2=mmapfile.mmapfile(Name=mapping_name, File=None, MaximumSize=fsize*2) assert m2.size()==m1.size() m1.seek(0,0) m1.write(fsize*'s') assert m2.read(fsize)==fsize*'s' move_src=100 move_dest=500 move_size=150 m2.seek(move_src,0) assert m2.tell()==move_src m2.write('m'*move_size) m2.move(move_dest, move_src, move_size) m2.seek(move_dest, 0) assert m2.read(move_size) == 'm' * move_size ## m2.write('x'* (fsize+1)) m2.close() m1.resize(fsize*2) assert m1.size()==fsize * 2 m1.seek(fsize) m1.write('w' * fsize) m1.flush() m1.close() os.remove(fname) ## Test a file with size larger than 32 bits ## need 10 GB free on drive where your temp folder lives fname_large=tempfile.mktemp() mapping_name='Pywin32_large_mmap' offsetdata='This is start of offset' ## Deliberately use odd numbers to test rounding logic fsize = (1024*1024*1024*10) + 333 offset = (1024*1024*32) + 42 view_size = (1024*1024*16) + 111 ## round mapping size and view size up to multiple of system page size if fsize%page_size: fsize += page_size - (fsize%page_size) if view_size%page_size: view_size += page_size - (view_size%page_size) ## round offset down to multiple of allocation granularity offset -= offset%alloc_size m1=None m2=None try: m1=mmapfile.mmapfile(fname_large, mapping_name, fsize, 0, offset*2) m1.seek(offset) m1.write(offsetdata) ## When reopening an existing mapping without passing a file handle, you have ## to specify a positive size even though it's ignored m2=mmapfile.mmapfile(File=None, Name=mapping_name, MaximumSize=1, FileOffset=offset, NumberOfBytesToMap=view_size) assert m2.read(len(offsetdata))==offsetdata finally: if m1 is not None: m1.close() if m2 is not None: m2.close() if os.path.exists(fname_large): os.remove(fname_large) |
From: Roger U. <ru...@us...> - 2007-06-28 08:23:15
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32291/win32/src Modified Files: mmapfilemodule.cpp Log Message: Fix various 64-bit issues Fix a couple of crashes Add Autoduck comments Enable support for files > 4GB Add parameters for offset and view size Index: mmapfilemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/mmapfilemodule.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mmapfilemodule.cpp 18 Apr 2002 02:12:36 -0000 1.3 --- mmapfilemodule.cpp 28 Jun 2007 08:23:14 -0000 1.4 *************** *** 6,42 **** // // todo: need permission flags, perhaps a 'chsize' analog - // not all functions check range yet!!! - // - // - // Note: This module currently only deals with 32-bit file - // sizes. // // The latest version of mmapfile is maintained by Sam at // ftp://squirl.nightmare.com/pub/python/python-ext [...1026 lines suppressed...] --- 632,636 ---- { PyObject *dict, *module; + PyWinGlobals_Ensure(); module = Py_InitModule ("mmapfile", mmapfile_functions); if (!module) /* Eeek - some serious error! */ *************** *** 472,476 **** dict = PyModule_GetDict (module); if (!dict) return; /* Another serious error!*/ ! mmapfile_module_error = PyString_FromString ("mmapfile error"); ! PyDict_SetItemString (dict, "error", mmapfile_module_error); } --- 638,643 ---- dict = PyModule_GetDict (module); if (!dict) return; /* Another serious error!*/ ! ! Py_INCREF(PyWinExc_ApiError); ! PyDict_SetItemString(dict, "error", PyWinExc_ApiError); } |
From: Roger U. <ru...@us...> - 2007-06-25 05:15:36
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4251/com/win32com/src/extensions Modified Files: PyIOleWindow.cpp Log Message: Fix a couple of places where HWND treated as an int Index: PyIOleWindow.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIOleWindow.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIOleWindow.cpp 9 Oct 2003 00:26:23 -0000 1.1 --- PyIOleWindow.cpp 25 Jun 2007 05:15:36 -0000 1.2 *************** *** 33,49 **** if ( pIOW == NULL ) return NULL; ! HWND phwnd; if ( !PyArg_ParseTuple(args, ":GetWindow") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIOW->GetWindow( &phwnd ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOW, IID_IOleWindow); ! ! PyObject *pyretval = Py_BuildValue("i", phwnd); ! return pyretval; } --- 33,47 ---- if ( pIOW == NULL ) return NULL; ! HWND hwnd; if ( !PyArg_ParseTuple(args, ":GetWindow") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIOW->GetWindow( &hwnd ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOW, IID_IOleWindow); ! return PyWinLong_FromHANDLE(hwnd); } *************** *** 94,98 **** if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (!PyArg_Parse(result, "i" , phwnd)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 92,97 ---- if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd)) ! hr=PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; |
From: Roger U. <ru...@us...> - 2007-06-18 15:44:23
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22741/win32/src Modified Files: win32apimodule.cpp Log Message: Use 'H' format code for WORD values in SYSTEM_INFO struct Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** win32apimodule.cpp 3 Jun 2007 14:53:07 -0000 1.77 --- win32apimodule.cpp 18 Jun 2007 15:44:21 -0000 1.78 *************** *** 1816,1820 **** SYSTEM_INFO info; GetSystemInfo( &info ); ! return Py_BuildValue("iiNNNiii(ii)", #if !defined(MAINWIN) info.dwOemId, --- 1816,1820 ---- SYSTEM_INFO info; GetSystemInfo( &info ); ! return Py_BuildValue("iiNNNiii(HH)", #if !defined(MAINWIN) info.dwOemId, *************** *** 1831,1835 **** // @rdesc The return value is a tuple of 9 values, which corresponds // to the Win32 SYSTEM_INFO structure. The element names are: ! // <nl>dwOemId<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl>, // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) --- 1831,1835 ---- // @rdesc The return value is a tuple of 9 values, which corresponds // to the Win32 SYSTEM_INFO structure. The element names are: ! // <nl>dwOemId<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) |
From: Mark H. <mha...@us...> - 2007-06-08 07:20:10
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19055/Pythonwin Modified Files: win32notify.cpp win32cmd.cpp Log Message: replace ssize_t with SSIZE_T so things still build with vc6 Index: win32notify.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32notify.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32notify.cpp 3 Jun 2007 12:35:58 -0000 1.2 --- win32notify.cpp 8 Jun 2007 07:20:09 -0000 1.3 *************** *** 171,176 **** if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *val = PyString_AsString(ob); ! ssize_t slen = strlen(val); ! ssize_t copylen = max(bufSize-1, slen); strncpy( pUse, val, copylen); pUse[copylen] = '\0'; --- 171,176 ---- if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *val = PyString_AsString(ob); ! SSIZE_T slen = strlen(val); ! SSIZE_T copylen = max(bufSize-1, slen); strncpy( pUse, val, copylen); pUse[copylen] = '\0'; *************** *** 190,194 **** if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *szVal = PyString_AsString(ob); ! ssize_t slen = strlen(szVal); mbstowcs( (wchar_t *)pUse, szVal, bufSize ); } --- 190,194 ---- if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *szVal = PyString_AsString(ob); ! SSIZE_T slen = strlen(szVal); mbstowcs( (wchar_t *)pUse, szVal, bufSize ); } Index: win32cmd.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32cmd.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32cmd.cpp 3 Jun 2007 12:35:57 -0000 1.3 --- win32cmd.cpp 8 Jun 2007 07:20:09 -0000 1.4 *************** *** 189,196 **** CString csRet; char *buf = csRet.GetBuffer(64); ! ssize_t numCmd = pCommandHookList ? pCommandHookList->GetCount() : 0; ! ssize_t numNotify = pNotifyHookList ? pNotifyHookList->GetCount() : 0; ! ssize_t numCmdUpdate = pCommandUpdateHookList ? pCommandUpdateHookList->GetCount() : 0; ! ssize_t numOle = pOleEventHookList ? pOleEventHookList->GetCount() : 0; sprintf(buf, ", notify=%I,ch/u=%I/%I", numNotify, numCmd, numCmdUpdate); csRet.ReleaseBuffer(); --- 189,196 ---- CString csRet; char *buf = csRet.GetBuffer(64); ! SSIZE_T numCmd = pCommandHookList ? pCommandHookList->GetCount() : 0; ! SSIZE_T numNotify = pNotifyHookList ? pNotifyHookList->GetCount() : 0; ! SSIZE_T numCmdUpdate = pCommandUpdateHookList ? pCommandUpdateHookList->GetCount() : 0; ! SSIZE_T numOle = pOleEventHookList ? pOleEventHookList->GetCount() : 0; sprintf(buf, ", notify=%I,ch/u=%I/%I", numNotify, numCmd, numCmdUpdate); csRet.ReleaseBuffer(); |