pywin32-checkins Mailing List for Python for Windows Extensions (Page 66)
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-10-01 04:16:24
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11789 Modified Files: Tag: py3k win32netcon.py Log Message: merge changes from trunk. Index: win32netcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32netcon.py,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** win32netcon.py 29 Aug 2008 04:59:25 -0000 1.6.2.1 --- win32netcon.py 1 Oct 2008 04:16:13 -0000 1.6.2.2 *************** *** 651,652 **** --- 651,655 ---- NetSetupDomainName = 3 + NetValidateAuthentication = 1 + NetValidatePasswordChange = 2 + NetValidatePasswordReset = 3 |
From: Mark H. <mha...@us...> - 2008-10-01 04:15:57
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11756 Modified Files: Tag: py3k win32serviceutil.py Log Message: Correct single backslash in usage string. Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -C2 -d -r1.26 -r1.26.2.1 *** win32serviceutil.py 7 Feb 2008 03:33:15 -0000 1.26 --- win32serviceutil.py 1 Oct 2008 04:15:45 -0000 1.26.2.1 *************** *** 491,495 **** print "Usage: '%s [options] install|update|remove|start [...]|stop|restart [...]|debug [...]'" % fname print "Options for 'install' and 'update' commands only:" ! print " --username domain\username : The Username the service is to run under" print " --password password : The password for the username" print " --startup [manual|auto|disabled] : How the service starts, default = manual" --- 491,495 ---- print "Usage: '%s [options] install|update|remove|start [...]|stop|restart [...]|debug [...]'" % fname print "Options for 'install' and 'update' commands only:" ! print " --username domain\\username : The Username the service is to run under" print " --password password : The password for the username" print " --startup [manual|auto|disabled] : How the service starts, default = manual" |
From: Roger U. <ru...@us...> - 2008-10-01 04:10:41
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11594 Modified Files: win32evtlog.i Log Message: Fix stale exception in ReportEvent Index: win32evtlog.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32evtlog.i,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32evtlog.i 15 Aug 2007 09:39:48 -0000 1.6 --- win32evtlog.i 1 Oct 2008 04:10:29 -0000 1.7 *************** *** 248,252 **** return NULL; if (!PyWinObject_AsReadBuffer(obData, &pData, &dataSize, TRUE)) ! pData = NULL; if (!PyWinObject_AsWCHARArray(obStrings, &pStrings, &numStrings, TRUE)) return NULL; --- 248,252 ---- return NULL; if (!PyWinObject_AsReadBuffer(obData, &pData, &dataSize, TRUE)) ! return NULL; if (!PyWinObject_AsWCHARArray(obStrings, &pStrings, &numStrings, TRUE)) return NULL; |
From: Roger U. <ru...@us...> - 2008-10-01 03:59:24
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10710 Modified Files: Tag: py3k eventLogDemo.py Log Message: Use bytes for raw data passed to ReportEvent Add multiple string inserts and user sid to events that are written Index: eventLogDemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/eventLogDemo.py,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** eventLogDemo.py 29 Aug 2008 04:59:23 -0000 1.5.4.1 --- eventLogDemo.py 1 Oct 2008 03:59:13 -0000 1.5.4.2 *************** *** 3,7 **** import win32security # To translate NT Sids to account names. ! from win32evtlogutil import * def ReadLog(computer, logType="Application", dumpEachRecord = 0): --- 3,7 ---- import win32security # To translate NT Sids to account names. ! import win32evtlogutil def ReadLog(computer, logType="Application", dumpEachRecord = 0): *************** *** 18,22 **** for object in objects: # get it for testing purposes, but dont print it. ! msg = SafeFormatMessage(object, logType).encode("mbcs") if object.Sid is not None: try: --- 18,22 ---- for object in objects: # get it for testing purposes, but dont print it. ! msg = win32evtlogutil.SafeFormatMessage(object, logType) if object.Sid is not None: try: *************** *** 83,89 **** verbose = verbose + 1 if do_write: ! ReportEvent(logType, 2, strings=["The message text for event 2"], data = "Raw\0Data") ! ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_WARNING_TYPE, strings=["A warning"], data = "Raw\0Data") ! ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_INFORMATION_TYPE, strings=["An info"], data = "Raw\0Data") print("Successfully wrote 3 records to the log") --- 83,99 ---- verbose = verbose + 1 if do_write: ! ph=win32api.GetCurrentProcess() ! th = win32security.OpenProcessToken(ph,win32con.TOKEN_READ) ! my_sid = win32security.GetTokenInformation(th,win32security.TokenUser)[0] ! ! win32evtlogutil.ReportEvent(logType, 2, ! strings=["The message text for event 2","Another insert"], ! data = b"Raw\0Data", sid = my_sid) ! win32evtlogutil.ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_WARNING_TYPE, ! strings=["A warning","An even more dire warning"], ! data = b"Raw\0Data", sid = my_sid) ! win32evtlogutil.ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_INFORMATION_TYPE, ! strings=["An info","Too much info"], ! data = b"Raw\0Data", sid = my_sid) print("Successfully wrote 3 records to the log") |
From: Roger U. <ru...@us...> - 2008-10-01 03:56:02
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10469 Modified Files: Tag: py3k win32evtlog.i Log Message: Fix stale exception in ReportEvent Index: win32evtlog.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32evtlog.i,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** win32evtlog.i 29 Aug 2008 04:59:26 -0000 1.6.2.1 --- win32evtlog.i 1 Oct 2008 03:55:51 -0000 1.6.2.2 *************** *** 250,254 **** return NULL; if (!PyWinObject_AsReadBuffer(obData, &pData, &dataSize, TRUE)) ! pData = NULL; if (!PyWinObject_AsWCHARArray(obStrings, &pStrings, &numStrings, TRUE)) return NULL; --- 250,254 ---- return NULL; if (!PyWinObject_AsReadBuffer(obData, &pData, &dataSize, TRUE)) ! return NULL; if (!PyWinObject_AsWCHARArray(obStrings, &pStrings, &numStrings, TRUE)) return NULL; |
From: Mark H. <mha...@us...> - 2008-10-01 02:42:10
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2578 Modified Files: PyIMAPIAdviseSink.cpp Log Message: vc6 seems to choke on a reference initialized via a constructor, so move to using assignment. Index: PyIMAPIAdviseSink.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIMAPIAdviseSink.cpp 9 Aug 2008 01:51:39 -0000 1.1 --- PyIMAPIAdviseSink.cpp 1 Oct 2008 02:41:58 -0000 1.2 *************** *** 17,21 **** switch (n->ulEventType) { case fnevCriticalError: { ! ERROR_NOTIFICATION &err(n->info.err); ret = Py_BuildValue("k(s#iiN)", n->ulEventType, --- 17,21 ---- switch (n->ulEventType) { case fnevCriticalError: { ! ERROR_NOTIFICATION &err = n->info.err; ret = Py_BuildValue("k(s#iiN)", n->ulEventType, *************** *** 27,31 **** } case fnevExtended: { ! EXTENDED_NOTIFICATION &ext(n->info.ext); ret = Py_BuildValue("k(ks#)", n->ulEventType, ext.ulEvent, ext.pbEventParameters, ext.cb); --- 27,31 ---- } case fnevExtended: { ! EXTENDED_NOTIFICATION &ext = n->info.ext; ret = Py_BuildValue("k(ks#)", n->ulEventType, ext.ulEvent, ext.pbEventParameters, ext.cb); *************** *** 33,37 **** } case fnevNewMail: { ! NEWMAIL_NOTIFICATION &newmail(n->info.newmail); PyObject *msg_class = newmail.ulFlags&MAPI_UNICODE? PyWinObject_FromWCHAR((const WCHAR *)newmail.lpszMessageClass) : --- 33,37 ---- } case fnevNewMail: { ! NEWMAIL_NOTIFICATION &newmail = n->info.newmail; PyObject *msg_class = newmail.ulFlags&MAPI_UNICODE? PyWinObject_FromWCHAR((const WCHAR *)newmail.lpszMessageClass) : *************** *** 54,58 **** case fnevObjectMoved: case fnevSearchComplete: { ! OBJECT_NOTIFICATION &obj(n->info.obj); PyObject *obArray = PyMAPIObject_FromSPropTagArray(obj.lpPropTagArray); if (!obArray) --- 54,58 ---- case fnevObjectMoved: case fnevSearchComplete: { ! OBJECT_NOTIFICATION &obj = n->info.obj; PyObject *obArray = PyMAPIObject_FromSPropTagArray(obj.lpPropTagArray); if (!obArray) *************** *** 69,73 **** } case fnevTableModified: { ! TABLE_NOTIFICATION &tab(n->info.tab); ret = Py_BuildValue("k(kiNNN)", n->ulEventType, --- 69,73 ---- } case fnevTableModified: { ! TABLE_NOTIFICATION &tab = n->info.tab; ret = Py_BuildValue("k(kiNNN)", n->ulEventType, *************** *** 80,84 **** } case fnevStatusObjectModified: { ! STATUS_OBJECT_NOTIFICATION &statobj(n->info.statobj); ret = Py_BuildValue("k(s#N)", n->ulEventType, --- 80,84 ---- } case fnevStatusObjectModified: { ! STATUS_OBJECT_NOTIFICATION &statobj = n->info.statobj; ret = Py_BuildValue("k(s#N)", n->ulEventType, |
From: Mark H. <mha...@us...> - 2008-09-30 06:04:49
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25522 Modified Files: test_exceptions.py Log Message: More exception semantics before we get to adding attributes. Index: test_exceptions.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_exceptions.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_exceptions.py 29 Sep 2008 14:01:18 -0000 1.1 --- test_exceptions.py 30 Sep 2008 06:04:33 -0000 1.2 *************** *** 46,49 **** --- 46,68 ---- self.failUnlessEqual(msg, expected_msg) + def testAsStr(self): + exc = self._getInvalidHandleException() + err_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() + # early on the result actually *was* a tuple - it must always look like one + err_tuple = (winerror.ERROR_INVALID_HANDLE, 'CloseHandle', err_msg) + self.failUnlessEqual(str(exc), str(err_tuple)) + + def testAsTuple(self): + exc = self._getInvalidHandleException() + err_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() + # early on the result actually *was* a tuple - it must be able to be one + err_tuple = (winerror.ERROR_INVALID_HANDLE, 'CloseHandle', err_msg) + self.failUnlessEqual(tuple(exc), err_tuple) + + def testClassName(self): + exc = self._getInvalidHandleException() + # The error class has always been named 'error'. That's not ideal :( + self.failUnlessEqual(exc.__class__.__name__, "error") + class TestCOMSimple(TestBase): def _getException(self): *************** *** 69,72 **** --- 88,109 ---- self._testExceptionIndex(exc, 1, expected) + def testAsStr(self): + exc = self._getException() + err_msg = win32api.FormatMessage(winerror.STG_E_INVALIDFLAG).rstrip() + # early on the result actually *was* a tuple - it must always look like one + err_tuple = (winerror.STG_E_INVALIDFLAG, err_msg, None, None) + self.failUnlessEqual(str(exc), str(err_tuple)) + + def testAsTuple(self): + exc = self._getException() + err_msg = win32api.FormatMessage(winerror.STG_E_INVALIDFLAG).rstrip() + # early on the result actually *was* a tuple - it must be able to be one + err_tuple = (winerror.STG_E_INVALIDFLAG, err_msg, None, None) + self.failUnlessEqual(tuple(exc), err_tuple) + + def testClassName(self): + exc = self._getException() + self.failUnlessEqual(exc.__class__.__name__, "com_error") + if __name__ == '__main__': unittest.main() |
From: Roger U. <ru...@us...> - 2008-09-30 02:03:09
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25277 Modified Files: Tag: py3k win32pdhmodule.cpp Log Message: Support PDH_FMT_LARGE, and some more unicode fixes Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.17.2.4 retrieving revision 1.17.2.5 diff -C2 -d -r1.17.2.4 -r1.17.2.5 *** win32pdhmodule.cpp 29 Sep 2008 01:54:04 -0000 1.17.2.4 --- win32pdhmodule.cpp 30 Sep 2008 02:03:00 -0000 1.17.2.5 *************** *** 710,714 **** else if (format & PDH_FMT_LONG) rc = PyInt_FromLong(result.longValue); ! // XXX - need long int support else { PyErr_SetString(PyExc_ValueError, "Dont know how to convert the result"); --- 710,715 ---- else if (format & PDH_FMT_LONG) rc = PyInt_FromLong(result.longValue); ! else if (format & PDH_FMT_LARGE) ! rc = PyLong_FromLongLong(result.largeValue); else { PyErr_SetString(PyExc_ValueError, "Dont know how to convert the result"); *************** *** 845,855 **** rc = PyWin_SetAPIError("ParseCounterPath", pdhStatus); } else { ! rc = Py_BuildValue("zzzziz", ! pCPE->szMachineName, ! pCPE->szObjectName, ! pCPE->szInstanceName, ! pCPE->szParentInstance, pCPE->dwInstanceIndex, ! pCPE->szCounterName); } free(pBuf); --- 846,856 ---- rc = PyWin_SetAPIError("ParseCounterPath", pdhStatus); } else { ! rc = Py_BuildValue("NNNNkN", ! PyWinObject_FromTCHAR(pCPE->szMachineName), ! PyWinObject_FromTCHAR(pCPE->szObjectName), ! PyWinObject_FromTCHAR(pCPE->szInstanceName), ! PyWinObject_FromTCHAR(pCPE->szParentInstance), pCPE->dwInstanceIndex, ! PyWinObject_FromTCHAR(pCPE->szCounterName)); } free(pBuf); *************** *** 878,882 **** if (pdhStatus != 0) return PyWin_SetAPIError("ParseInstanceName", pdhStatus); ! return Py_BuildValue("ssi", szName, szParent, dwInstance); } --- 879,886 ---- if (pdhStatus != 0) return PyWin_SetAPIError("ParseInstanceName", pdhStatus); ! return Py_BuildValue("NNk", ! PyWinObject_FromTCHAR(szName), ! PyWinObject_FromTCHAR(szParent), ! dwInstance); } |
From: Mark H. <mha...@us...> - 2008-09-29 14:01:29
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24678 Added Files: test_exceptions.py Log Message: new test for basic exception semantics; getting ready to add attributes to our exceptions in anticipation of py3k. --- NEW FILE: test_exceptions.py --- """Test pywin32's error semantics""" import unittest import win32api, win32file, pywintypes import pythoncom import winerror class TestBase(unittest.TestCase): def _testExceptionIndex(self, exc, index, expected): # check the exception itself can be indexed. self.failUnlessEqual(exc[index], expected) # and that exception.args can is the same. self.failUnlessEqual(exc.args[index], expected) class TestAPISimple(TestBase): def _getInvalidHandleException(self): try: win32api.CloseHandle(1) except win32api.error, exc: return exc self.fail("Didn't get invalid-handle exception.") def testSimple(self): self.assertRaises(pywintypes.error, win32api.CloseHandle, 1) def testErrnoIndex(self): exc = self._getInvalidHandleException() self._testExceptionIndex(exc, 0, winerror.ERROR_INVALID_HANDLE) def testFuncIndex(self): exc = self._getInvalidHandleException() self._testExceptionIndex(exc, 1, "CloseHandle") def testMessageIndex(self): exc = self._getInvalidHandleException() expected = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() self._testExceptionIndex(exc, 2, expected) def testUnpack(self): try: win32api.CloseHandle(1) self.fail("expected exception!") except win32api.error, (werror, func, msg): self.failUnlessEqual(werror, winerror.ERROR_INVALID_HANDLE) self.failUnlessEqual(func, "CloseHandle") expected_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() self.failUnlessEqual(msg, expected_msg) class TestCOMSimple(TestBase): def _getException(self): try: pythoncom.StgOpenStorage("foo", None, 0) except pythoncom.com_error, exc: return exc self.fail("Didn't get storage exception.") def testIs(self): self.failUnless(pythoncom.com_error is pywintypes.com_error) def testSimple(self): self.assertRaises(pythoncom.com_error, pythoncom.StgOpenStorage, "foo", None, 0) def testErrnoIndex(self): exc = self._getException() self._testExceptionIndex(exc, 0, winerror.STG_E_INVALIDFLAG) def testMessageIndex(self): exc = self._getException() expected = win32api.FormatMessage(winerror.STG_E_INVALIDFLAG).rstrip() self._testExceptionIndex(exc, 1, expected) if __name__ == '__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2008-09-29 13:01:48
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv862 Modified Files: setup.py Log Message: Fix silly error locating vs2008 directory. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** setup.py 9 Aug 2008 01:53:01 -0000 1.81 --- setup.py 29 Sep 2008 13:01:40 -0000 1.82 *************** *** 803,807 **** vckey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", ! access) val, val_typ = _winreg.QueryValueEx(vckey, "ProductDir") mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") --- 803,807 ---- vckey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", ! 0, access) val, val_typ = _winreg.QueryValueEx(vckey, "ProductDir") mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") |
From: Mark H. <mha...@us...> - 2008-09-29 13:00:49
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv461/isapi/src Modified Files: PyExtensionObjects.cpp PyExtensionObjects.h Log Message: Add extension ExecURLInfo() method. Index: PyExtensionObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyExtensionObjects.h 15 May 2008 10:57:09 -0000 1.5 --- PyExtensionObjects.h 29 Sep 2008 13:00:37 -0000 1.6 *************** *** 101,104 **** --- 101,105 ---- static PyObject * IsKeepConn(PyObject *self, PyObject * args); // HSE_REQ_IS_KEEP_CONN static PyObject * SetFlushFlag(PyObject *self, PyObject * args); // HSE_REQ_SET_FLUSH_FLAG + static PyObject * ExecURLInfo(PyObject *self, PyObject * args); // HSE_REQ_EXEC_URL static PyObject * IsSessionActive(PyObject *self, PyObject * args); Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyExtensionObjects.cpp 3 Jul 2008 13:30:04 -0000 1.9 --- PyExtensionObjects.cpp 29 Sep 2008 13:00:37 -0000 1.10 *************** *** 158,161 **** --- 158,162 ---- {"GetImpersonationToken", PyECB::GetImpersonationToken, 1}, // @pymeth GetImpersonationToken| {"IsKeepConn", PyECB::IsKeepConn, 1}, // @pymeth IsKeepConn|Calls ServerSupportFunction with HSE_REQ_IS_KEEP_CONN + {"ExecURLInfo", PyECB::ExecURLInfo, 1}, // @pymeth ExecURLInfo|Calls ServerSupportFunction with HSE_REQ_EXEC_URL {NULL} }; *************** *** 575,578 **** --- 576,610 ---- } + // @pymethod int|EXTENSION_CONTROL_BLOCK|ExecURLInfo|Calls ServerSupportFunction with HSE_REQ_EXEC_URL + PyObject * PyECB::ExecURLInfo(PyObject *self, PyObject *args) + { + PyObject *obInfo, *obEntity; + HSE_EXEC_URL_INFO i; + if (!PyArg_ParseTuple(args, "zzzOOi:ExecURLInfo", + &i.pszUrl, // @pyparm string|url|| + &i.pszMethod, // @pyparm string|method|| + &i.pszChildHeaders, // @pyparm string|clientHeaders|| + &obInfo, // @pyparm object|info||Must be None + &obEntity, // @pyparm object|entity||Must be None + &i.dwExecUrlFlags)) // @pyparm int|flags|| + return NULL; + + if (obInfo != Py_None || obEntity != Py_None) + return PyErr_Format(PyExc_ValueError, "info and entity params must be None"); + + i.pUserInfo = NULL; + i.pEntity = NULL; + PyECB * pecb = (PyECB *) self; + EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); + if (!pecb || !pecb->Check()) return NULL; + BOOL bRes, bIs; + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_EXEC_URL, &i, NULL,NULL); + Py_END_ALLOW_THREADS + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_EXEC_URL)"); + return PyBool_FromLong(bIs); + } + class PyTFD { |
From: Mark H. <mha...@us...> - 2008-09-29 12:59:53
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32477/win32/Lib Modified Files: winnt.py Log Message: More PROCESSOR_ARCHITECTURE_* constants. Index: winnt.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/winnt.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** winnt.py 23 Jul 2007 05:11:08 -0000 1.7 --- winnt.py 29 Sep 2008 12:59:39 -0000 1.8 *************** *** 243,246 **** --- 243,251 ---- PROCESSOR_ARCHITECTURE_SH = 4 PROCESSOR_ARCHITECTURE_ARM = 5 + PROCESSOR_ARCHITECTURE_IA64 = 6 + PROCESSOR_ARCHITECTURE_ALPHA64 = 7 + PROCESSOR_ARCHITECTURE_MSIL = 8 + PROCESSOR_ARCHITECTURE_AMD64 = 9 + PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10 PROCESSOR_ARCHITECTURE_UNKNOWN = 65535 PF_FLOATING_POINT_PRECISION_ERRATA = 0 |
From: Mark H. <mha...@us...> - 2008-09-29 12:59:25
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32067/win32/src Modified Files: win32apimodule.cpp Log Message: Yet another go at GetConsoleTitle reliable! Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** win32apimodule.cpp 10 Aug 2008 13:13:21 -0000 1.89 --- win32apimodule.cpp 29 Sep 2008 12:59:13 -0000 1.90 *************** *** 895,898 **** --- 895,903 ---- // the title, the return value is zero and GetLastError returns // ERROR_SUCCESS." + // However, even on Vista, markh can observe this failing with an + // apparently stale error code - as if GetConsoleTitle assumes the + // error code is already 0 in that case. So we clear the error to + // solve that. + SetLastError(0); while (TRUE){ if (title!=NULL){ |
From: Roger U. <ru...@us...> - 2008-09-29 01:54:21
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26055 Modified Files: Tag: py3k win32pdhmodule.cpp Log Message: Fix PDH_COUNTER_INFO return Userdata for PdhAddCounter is now a DWORD_PTR Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -C2 -d -r1.17.2.3 -r1.17.2.4 *** win32pdhmodule.cpp 28 Sep 2008 23:38:08 -0000 1.17.2.3 --- win32pdhmodule.cpp 29 Sep 2008 01:54:04 -0000 1.17.2.4 *************** *** 73,77 **** HQUERY hQuery, // handle to the query LPCTSTR szFullCounterPath, // path of the counter ! DWORD dwUserData, // user-defined value HCOUNTER *phCounter // pointer to the counter handle buffer ); --- 73,77 ---- HQUERY hQuery, // handle to the query LPCTSTR szFullCounterPath, // path of the counter ! DWORD_PTR dwUserData, // user-defined value HCOUNTER *phCounter // pointer to the counter handle buffer ); *************** *** 429,445 **** PyObject *obhQuery; PyObject *obPath; ! DWORD userData = 0; ! if (!PyArg_ParseTuple(args, "OO|i:AddCounter", &obhQuery, // @pyparm int|hQuery||Handle to an open query. &obPath, // @pyparm string|path||Full path to the performance data ! &userData)) // @pyparm int|userData|0|User data associated with the counter. return NULL; if (!PyWinObject_AsHANDLE(obhQuery, &hQuery)) return NULL; TCHAR *szPath; if (!PyWinObject_AsTCHAR(obPath, &szPath, FALSE)) return NULL; HCOUNTER hCounter; ! CHECK_PDH_PTR(pPdhAddCounter); PyW32_BEGIN_ALLOW_THREADS PDH_STATUS pdhStatus = (*pPdhAddCounter) ( --- 429,450 ---- PyObject *obhQuery; PyObject *obPath; ! PyObject *obuserData = Py_None; // Might make more sense to use actual PyObject for userData ! DWORD_PTR userData = 0; ! CHECK_PDH_PTR(pPdhAddCounter); ! if (!PyArg_ParseTuple(args, "OO|O:AddCounter", &obhQuery, // @pyparm int|hQuery||Handle to an open query. &obPath, // @pyparm string|path||Full path to the performance data ! &obuserData)) // @pyparm int|userData|0|User data associated with the counter. return NULL; if (!PyWinObject_AsHANDLE(obhQuery, &hQuery)) return NULL; + if (obuserData != Py_None) + if (!PyWinLong_AsDWORD_PTR(obuserData, &userData)) + return NULL; TCHAR *szPath; if (!PyWinObject_AsTCHAR(obPath, &szPath, FALSE)) return NULL; HCOUNTER hCounter; ! PyW32_BEGIN_ALLOW_THREADS PDH_STATUS pdhStatus = (*pPdhAddCounter) ( *************** *** 646,671 **** PyObject *rc; if (pdhStatus != ERROR_SUCCESS) ! rc = PyWin_SetAPIError("GetCounterInfo for data", pdhStatus); else { ! if (!CheckCounterStatusOK(pInfo->CStatus)) ! rc = NULL; ! else ! rc = Py_BuildValue("iiiiiiz(zzzziz)z", ! pInfo->dwType, ! pInfo->CVersion, ! pInfo->lScale, ! pInfo->lDefaultScale, ! pInfo->dwUserData, ! pInfo->dwQueryUserData, ! pInfo->szFullPath, ! ! pInfo->szMachineName, ! pInfo->szObjectName, ! pInfo->szInstanceName, ! pInfo->szParentInstance, ! pInfo->dwInstanceIndex, ! pInfo->szCounterName, ! ! pInfo->szExplainText); } free(pInfo); --- 651,677 ---- PyObject *rc; if (pdhStatus != ERROR_SUCCESS) ! rc = PyWin_SetAPIError("GetCounterInfo for data", pdhStatus); else { ! if (!CheckCounterStatusOK(pInfo->CStatus)) ! rc = NULL; ! else ! rc = Py_BuildValue("iiiiNNN(NNNNiN)N", ! pInfo->dwType, ! pInfo->CVersion, ! // ??? CStatus is missing ??? ! pInfo->lScale, ! pInfo->lDefaultScale, ! PyWinObject_FromDWORD_PTR(pInfo->dwUserData), ! PyWinObject_FromDWORD_PTR(pInfo->dwQueryUserData), ! PyWinObject_FromTCHAR(pInfo->szFullPath), ! ! PyWinObject_FromTCHAR(pInfo->szMachineName), ! PyWinObject_FromTCHAR(pInfo->szObjectName), ! PyWinObject_FromTCHAR(pInfo->szInstanceName), ! PyWinObject_FromTCHAR(pInfo->szParentInstance), ! pInfo->dwInstanceIndex, ! PyWinObject_FromTCHAR(pInfo->szCounterName), ! ! PyWinObject_FromTCHAR(pInfo->szExplainText)); } free(pInfo); |
From: Roger U. <ru...@us...> - 2008-09-28 23:38:21
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7575 Modified Files: Tag: py3k win32pdhmodule.cpp Log Message: Load either ansi or wide character pdh functions Update parameters to PdhOpenQuery Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.17.2.2 retrieving revision 1.17.2.3 diff -C2 -d -r1.17.2.2 -r1.17.2.3 *** win32pdhmodule.cpp 28 Sep 2008 19:55:46 -0000 1.17.2.2 --- win32pdhmodule.cpp 28 Sep 2008 23:38:08 -0000 1.17.2.3 *************** *** 57,62 **** typedef PDH_STATUS (WINAPI * FuncPdhOpenQuery)( ! LPVOID pReserved, // DataSource ! DWORD dwUserData, // a value associated with this query HQUERY *phQuery // pointer to a buffer that will receive the query handle ) ; --- 57,62 ---- typedef PDH_STATUS (WINAPI * FuncPdhOpenQuery)( ! LPCTSTR szDataSource, // DataSource ! DWORD_PTR dwUserData, // a value associated with this query HQUERY *phQuery // pointer to a buffer that will receive the query handle ) ; *************** *** 184,190 **** static PyObject *win32pdh_counter_error; ! // ??? Loads all wide-character versions of the functions. Should either ! // have a way to switch between *A and *W functions as win32api does, or ! // change all TCHAR to explicit WCHAR ??? BOOL LoadPointers() { --- 184,194 ---- static PyObject *win32pdh_counter_error; ! // Select whether to load ansi or unicode API functions ! #ifdef UNICODE ! #define A_OR_W "W" ! #else ! #define A_OR_W "A" ! #endif ! BOOL LoadPointers() { *************** *** 194,216 **** return FALSE; } ! pPdhEnumObjects = (FuncPdhEnumObjects)GetProcAddress(handle, "PdhEnumObjectsW"); ! pPdhEnumObjectItems = (FuncPdhEnumObjectItems)GetProcAddress(handle, "PdhEnumObjectItemsW"); pPdhCloseQuery = (FuncPdhCloseQuery)GetProcAddress(handle, "PdhCloseQuery"); pPdhRemoveCounter = (FuncPdhRemoveCounter)GetProcAddress(handle, "PdhRemoveCounter"); ! pPdhOpenQuery = (FuncPdhOpenQuery)GetProcAddress(handle, "PdhOpenQuery"); ! pPdhAddCounter = (FuncPdhAddCounter)GetProcAddress(handle, "PdhAddCounterW"); ! pPdhMakeCounterPath = (FuncPdhMakeCounterPath)GetProcAddress(handle, "PdhMakeCounterPathW"); ! pPdhGetCounterInfo = (FuncPdhGetCounterInfo)GetProcAddress(handle, "PdhGetCounterInfoW"); pPdhGetFormattedCounterValue = (FuncPdhGetFormattedCounterValue)GetProcAddress(handle, "PdhGetFormattedCounterValue"); pPdhCollectQueryData = (FuncPdhCollectQueryData)GetProcAddress(handle, "PdhCollectQueryData"); ! pPdhValidatePath = (FuncPdhValidatePath)GetProcAddress(handle, "PdhValidatePathW"); ! pPdhExpandCounterPath = (FuncPdhExpandCounterPath)GetProcAddress(handle, "PdhExpandCounterPathW"); ! pPdhParseCounterPath = (FuncPdhParseCounterPath)GetProcAddress(handle, "PdhParseCounterPathW"); pPdhSetCounterScaleFactor = (FuncPdhSetCounterScaleFactor)GetProcAddress(handle, "PdhSetCounterScaleFactor"); ! pPdhParseInstanceName = (FuncPdhParseInstanceName)GetProcAddress(handle, "PdhParseInstanceNameW"); ! pPdhBrowseCounters = (FuncPdhBrowseCounters)GetProcAddress(handle, "PdhBrowseCountersW"); ! pPdhConnectMachine = (FuncPdhConnectMachine)GetProcAddress(handle, "PdhConnectMachineW"); ! pPdhLookupPerfNameByIndex = (FuncPdhLookupPerfNameByIndex)GetProcAddress(handle, "PdhLookupPerfNameByIndexW"); ! pPdhLookupPerfIndexByName = (FuncPdhLookupPerfIndexByName)GetProcAddress(handle, "PdhLookupPerfIndexByNameW"); // Pdh error codes are in 2 different ranges --- 198,220 ---- return FALSE; } ! pPdhEnumObjects = (FuncPdhEnumObjects)GetProcAddress(handle, "PdhEnumObjects" A_OR_W); ! pPdhEnumObjectItems = (FuncPdhEnumObjectItems)GetProcAddress(handle, "PdhEnumObjectItems" A_OR_W); pPdhCloseQuery = (FuncPdhCloseQuery)GetProcAddress(handle, "PdhCloseQuery"); pPdhRemoveCounter = (FuncPdhRemoveCounter)GetProcAddress(handle, "PdhRemoveCounter"); ! pPdhOpenQuery = (FuncPdhOpenQuery)GetProcAddress(handle, "PdhOpenQuery" A_OR_W); ! pPdhAddCounter = (FuncPdhAddCounter)GetProcAddress(handle, "PdhAddCounter" A_OR_W); ! pPdhMakeCounterPath = (FuncPdhMakeCounterPath)GetProcAddress(handle, "PdhMakeCounterPath" A_OR_W); ! pPdhGetCounterInfo = (FuncPdhGetCounterInfo)GetProcAddress(handle, "PdhGetCounterInfo" A_OR_W); pPdhGetFormattedCounterValue = (FuncPdhGetFormattedCounterValue)GetProcAddress(handle, "PdhGetFormattedCounterValue"); pPdhCollectQueryData = (FuncPdhCollectQueryData)GetProcAddress(handle, "PdhCollectQueryData"); ! pPdhValidatePath = (FuncPdhValidatePath)GetProcAddress(handle, "PdhValidatePath" A_OR_W); ! pPdhExpandCounterPath = (FuncPdhExpandCounterPath)GetProcAddress(handle, "PdhExpandCounterPath" A_OR_W); ! pPdhParseCounterPath = (FuncPdhParseCounterPath)GetProcAddress(handle, "PdhParseCounterPath" A_OR_W); pPdhSetCounterScaleFactor = (FuncPdhSetCounterScaleFactor)GetProcAddress(handle, "PdhSetCounterScaleFactor"); ! pPdhParseInstanceName = (FuncPdhParseInstanceName)GetProcAddress(handle, "PdhParseInstanceName" A_OR_W); ! pPdhBrowseCounters = (FuncPdhBrowseCounters)GetProcAddress(handle, "PdhBrowseCounters" A_OR_W); ! pPdhConnectMachine = (FuncPdhConnectMachine)GetProcAddress(handle, "PdhConnectMachine" A_OR_W); ! pPdhLookupPerfNameByIndex = (FuncPdhLookupPerfNameByIndex)GetProcAddress(handle, "PdhLookupPerfNameByIndex" A_OR_W); ! pPdhLookupPerfIndexByName = (FuncPdhLookupPerfIndexByName)GetProcAddress(handle, "PdhLookupPerfIndexByName" A_OR_W); // Pdh error codes are in 2 different ranges *************** *** 479,487 **** static PyObject *PyOpenQuery(PyObject *self, PyObject *args) { ! DWORD userData = 0; ! TCHAR *reserved = NULL; // DataSource (name of a performance log file) ! if (!PyArg_ParseTuple(args, "|zi:OpenQuery", ! &reserved, // @pyparm object|reserved|None|Must be None ! &userData)) // @pyparm int|userData|0|User data associated with the query. return NULL; --- 483,492 ---- static PyObject *PyOpenQuery(PyObject *self, PyObject *args) { ! DWORD_PTR userData = 0; ! TCHAR *DataSource = NULL; ! PyObject *obDataSource = Py_None, *obuserData = Py_None; ! if (!PyArg_ParseTuple(args, "|OO:OpenQuery", ! &obDataSource, // @pyparm str|DataSource|None|Name of a performaance log file, or None for live data ! &obuserData)) // @pyparm int|userData|0|User data associated with the query. return NULL; *************** *** 489,499 **** CHECK_PDH_PTR(pPdhOpenQuery); PDH_STATUS pdhStatus; Py_BEGIN_ALLOW_THREADS pdhStatus = (*pPdhOpenQuery) ( ! (void *)reserved, userData, &hQuery); Py_END_ALLOW_THREADS if (pdhStatus != ERROR_SUCCESS) return PyWin_SetAPIError("OpenQuery", pdhStatus); --- 494,511 ---- CHECK_PDH_PTR(pPdhOpenQuery); PDH_STATUS pdhStatus; + if (obuserData != Py_None) + if (!PyWinLong_AsDWORD_PTR(obuserData, &userData)) + return NULL; + if (!PyWinObject_AsTCHAR(obDataSource, &DataSource, TRUE)) + return NULL; + Py_BEGIN_ALLOW_THREADS pdhStatus = (*pPdhOpenQuery) ( ! DataSource, userData, &hQuery); Py_END_ALLOW_THREADS + PyWinObject_FreeTCHAR(DataSource); if (pdhStatus != ERROR_SUCCESS) return PyWin_SetAPIError("OpenQuery", pdhStatus); |
From: Roger U. <ru...@us...> - 2008-09-28 19:56:06
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16224 Modified Files: Tag: py3k win32pdhmodule.cpp Log Message: Load unicode function pointers Check return code for PyWinGlobals_Ensure Change string exception to real exception Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** win32pdhmodule.cpp 29 Aug 2008 04:59:27 -0000 1.17.2.1 --- win32pdhmodule.cpp 28 Sep 2008 19:55:46 -0000 1.17.2.2 *************** *** 184,187 **** --- 184,190 ---- static PyObject *win32pdh_counter_error; + // ??? Loads all wide-character versions of the functions. Should either + // have a way to switch between *A and *W functions as win32api does, or + // change all TCHAR to explicit WCHAR ??? BOOL LoadPointers() { *************** *** 191,213 **** return FALSE; } ! pPdhEnumObjects = (FuncPdhEnumObjects)GetProcAddress(handle, "PdhEnumObjectsA"); ! pPdhEnumObjectItems = (FuncPdhEnumObjectItems)GetProcAddress(handle, "PdhEnumObjectItemsA"); pPdhCloseQuery = (FuncPdhCloseQuery)GetProcAddress(handle, "PdhCloseQuery"); pPdhRemoveCounter = (FuncPdhRemoveCounter)GetProcAddress(handle, "PdhRemoveCounter"); pPdhOpenQuery = (FuncPdhOpenQuery)GetProcAddress(handle, "PdhOpenQuery"); ! pPdhAddCounter = (FuncPdhAddCounter)GetProcAddress(handle, "PdhAddCounterA"); ! pPdhMakeCounterPath = (FuncPdhMakeCounterPath)GetProcAddress(handle, "PdhMakeCounterPathA"); ! pPdhGetCounterInfo = (FuncPdhGetCounterInfo)GetProcAddress(handle, "PdhGetCounterInfoA"); pPdhGetFormattedCounterValue = (FuncPdhGetFormattedCounterValue)GetProcAddress(handle, "PdhGetFormattedCounterValue"); pPdhCollectQueryData = (FuncPdhCollectQueryData)GetProcAddress(handle, "PdhCollectQueryData"); ! pPdhValidatePath = (FuncPdhValidatePath)GetProcAddress(handle, "PdhValidatePathA"); ! pPdhExpandCounterPath = (FuncPdhExpandCounterPath)GetProcAddress(handle, "PdhExpandCounterPathA"); ! pPdhParseCounterPath = (FuncPdhParseCounterPath)GetProcAddress(handle, "PdhParseCounterPathA"); pPdhSetCounterScaleFactor = (FuncPdhSetCounterScaleFactor)GetProcAddress(handle, "PdhSetCounterScaleFactor"); ! pPdhParseInstanceName = (FuncPdhParseInstanceName)GetProcAddress(handle, "PdhParseInstanceNameA"); ! pPdhBrowseCounters = (FuncPdhBrowseCounters)GetProcAddress(handle, "PdhBrowseCountersA"); ! pPdhConnectMachine = (FuncPdhConnectMachine)GetProcAddress(handle, "PdhConnectMachineA"); ! pPdhLookupPerfNameByIndex = (FuncPdhLookupPerfNameByIndex)GetProcAddress(handle, "PdhLookupPerfNameByIndexA"); ! pPdhLookupPerfIndexByName = (FuncPdhLookupPerfIndexByName)GetProcAddress(handle, "PdhLookupPerfIndexByName"); // Pdh error codes are in 2 different ranges --- 194,216 ---- return FALSE; } ! pPdhEnumObjects = (FuncPdhEnumObjects)GetProcAddress(handle, "PdhEnumObjectsW"); ! pPdhEnumObjectItems = (FuncPdhEnumObjectItems)GetProcAddress(handle, "PdhEnumObjectItemsW"); pPdhCloseQuery = (FuncPdhCloseQuery)GetProcAddress(handle, "PdhCloseQuery"); pPdhRemoveCounter = (FuncPdhRemoveCounter)GetProcAddress(handle, "PdhRemoveCounter"); pPdhOpenQuery = (FuncPdhOpenQuery)GetProcAddress(handle, "PdhOpenQuery"); ! pPdhAddCounter = (FuncPdhAddCounter)GetProcAddress(handle, "PdhAddCounterW"); ! pPdhMakeCounterPath = (FuncPdhMakeCounterPath)GetProcAddress(handle, "PdhMakeCounterPathW"); ! pPdhGetCounterInfo = (FuncPdhGetCounterInfo)GetProcAddress(handle, "PdhGetCounterInfoW"); pPdhGetFormattedCounterValue = (FuncPdhGetFormattedCounterValue)GetProcAddress(handle, "PdhGetFormattedCounterValue"); pPdhCollectQueryData = (FuncPdhCollectQueryData)GetProcAddress(handle, "PdhCollectQueryData"); ! pPdhValidatePath = (FuncPdhValidatePath)GetProcAddress(handle, "PdhValidatePathW"); ! pPdhExpandCounterPath = (FuncPdhExpandCounterPath)GetProcAddress(handle, "PdhExpandCounterPathW"); ! pPdhParseCounterPath = (FuncPdhParseCounterPath)GetProcAddress(handle, "PdhParseCounterPathW"); pPdhSetCounterScaleFactor = (FuncPdhSetCounterScaleFactor)GetProcAddress(handle, "PdhSetCounterScaleFactor"); ! pPdhParseInstanceName = (FuncPdhParseInstanceName)GetProcAddress(handle, "PdhParseInstanceNameW"); ! pPdhBrowseCounters = (FuncPdhBrowseCounters)GetProcAddress(handle, "PdhBrowseCountersW"); ! pPdhConnectMachine = (FuncPdhConnectMachine)GetProcAddress(handle, "PdhConnectMachineW"); ! pPdhLookupPerfNameByIndex = (FuncPdhLookupPerfNameByIndex)GetProcAddress(handle, "PdhLookupPerfNameByIndexW"); ! pPdhLookupPerfIndexByName = (FuncPdhLookupPerfIndexByName)GetProcAddress(handle, "PdhLookupPerfIndexByNameW"); // Pdh error codes are in 2 different ranges *************** *** 893,897 **** DWORD rc = PDH_INVALID_DATA; CEnterLeavePython _celp; ! PyObject *args = Py_BuildValue("(s)", pMy->pcfg->szReturnPathBuffer); PyObject *result = PyEval_CallObject(pMy->func, args); Py_XDECREF(args); --- 896,903 ---- DWORD rc = PDH_INVALID_DATA; CEnterLeavePython _celp; ! /* ??? This does the wrong thing when multiple counters are selected. ! Should use PyWinObject_AsMultipleString, but will break code that expects a single string. ??? ! */ ! PyObject *args = Py_BuildValue("(N)", PyWinObject_FromTCHAR(pMy->pcfg->szReturnPathBuffer)); PyObject *result = PyEval_CallObject(pMy->func, args); Py_XDECREF(args); *************** *** 1100,1114 **** InitializeCriticalSection(&critSec); PyObject *dict, *module; - PyWinGlobals_Ensure(); #if (PY_VERSION_HEX < 0x03000000) module = Py_InitModule("win32pdh", win32pdh_functions); - if (!module) - return; - dict = PyModule_GetDict(module); - if (!dict) - return; #else static PyModuleDef win32pdh_def = { PyModuleDef_HEAD_INIT, --- 1106,1116 ---- InitializeCriticalSection(&critSec); PyObject *dict, *module; #if (PY_VERSION_HEX < 0x03000000) + #define RETURN_ERROR return; module = Py_InitModule("win32pdh", win32pdh_functions); #else + #define RETURN_ERROR return NULL; static PyModuleDef win32pdh_def = { PyModuleDef_HEAD_INIT, *************** *** 1119,1133 **** }; module = PyModule_Create(&win32pdh_def); if (!module) ! return NULL; dict = PyModule_GetDict(module); if (!dict) ! return NULL; ! #endif - Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); ! win32pdh_counter_error = PyString_FromString("win32pdh counter status error"); ! PyDict_SetItemString(dict, "counter status error", win32pdh_counter_error); LoadPointers(); // Setting an error in this function will cause Python to spew. --- 1121,1137 ---- }; module = PyModule_Create(&win32pdh_def); + #endif + if (!module) ! RETURN_ERROR; dict = PyModule_GetDict(module); if (!dict) ! RETURN_ERROR; ! if (PyWinGlobals_Ensure() == -1) ! RETURN_ERROR; PyDict_SetItemString(dict, "error", PyWinExc_ApiError); ! win32pdh_counter_error = PyErr_NewException("win32pdh.counter_status_error", NULL, NULL); ! PyDict_SetItemString(dict, "counter_status_error", win32pdh_counter_error); LoadPointers(); // Setting an error in this function will cause Python to spew. |
From: Roger U. <ru...@us...> - 2008-09-28 19:52:00
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14608 Modified Files: Tag: py3k win32pdhutil.py Log Message: Remove use of string module Various fixes for Py3k Index: win32pdhutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32pdhutil.py,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -C2 -d -r1.12 -r1.12.4.1 *** win32pdhutil.py 16 Jul 2006 09:38:57 -0000 1.12 --- win32pdhutil.py 28 Sep 2008 19:51:43 -0000 1.12.4.1 *************** *** 19,23 **** """ ! import win32pdh, string, time error = win32pdh.error --- 19,23 ---- """ ! import win32pdh, time error = win32pdh.error *************** *** 79,83 **** if bRefresh: # PDH docs say this is how you do a refresh. win32pdh.EnumObjects(None, machine, 0, 1) ! instanceName = string.lower(instanceName) items, instances = win32pdh.EnumObjectItems(None,None,object, -1) # Track multiple instances. --- 79,83 ---- if bRefresh: # PDH docs say this is how you do a refresh. win32pdh.EnumObjects(None, machine, 0, 1) ! instanceName = instanceName.lower() items, instances = win32pdh.EnumObjectItems(None,None,object, -1) # Track multiple instances. *************** *** 91,96 **** ret = [] for instance, max_instances in instance_dict.items(): ! for inum in xrange(max_instances+1): ! if string.lower(instance) == instanceName: ret.append(GetPerformanceAttributes(object, counter, instance, inum, format, --- 91,96 ---- ret = [] for instance, max_instances in instance_dict.items(): ! for inum in range(max_instances+1): ! if instance.lower() == instanceName: ret.append(GetPerformanceAttributes(object, counter, instance, inum, format, *************** *** 112,118 **** # Bit of a hack to get useful info. items = [find_pdh_counter_localized_name("ID Process")] + items[:5] ! print "Process Name", string.join(items,",") for instance, max_instances in instance_dict.items(): ! for inum in xrange(max_instances+1): hq = win32pdh.OpenQuery() hcs = [] --- 112,118 ---- # Bit of a hack to get useful info. items = [find_pdh_counter_localized_name("ID Process")] + items[:5] ! print ("Process Name", ",".join(items)) for instance, max_instances in instance_dict.items(): ! for inum in range(max_instances+1): hq = win32pdh.OpenQuery() hcs = [] *************** *** 126,133 **** time.sleep(0.01) win32pdh.CollectQueryData(hq) ! print "%-15s\t" % (instance[:15]), for hc in hcs: type, val = win32pdh.GetFormattedCounterValue(hc, win32pdh.PDH_FMT_LONG) ! print "%5d" % (val), win32pdh.RemoveCounter(hc) print --- 126,133 ---- time.sleep(0.01) win32pdh.CollectQueryData(hq) ! print ("%-15s\t" % (instance[:15]),) for hc in hcs: type, val = win32pdh.GetFormattedCounterValue(hc, win32pdh.PDH_FMT_LONG) ! print ("%5d" % (val),) win32pdh.RemoveCounter(hc) print *************** *** 140,146 **** result = GetPerformanceAttributes(object, counterName, instance, index, win32pdh.PDH_FMT_DOUBLE, machine) ! print "Value of '%s' is" % counter, result ! print "Added '%s' on object '%s' (machine %s), instance %s(%d)-parent of %s" \ ! % (counterName, object, machine, instance, index, parentInstance) def browse(callback = BrowseCallBackDemo, title="Python Browser", --- 140,146 ---- result = GetPerformanceAttributes(object, counterName, instance, index, win32pdh.PDH_FMT_DOUBLE, machine) ! print ("Value of '%s' is" % counter, result) ! print ("Added '%s' on object '%s' (machine %s), instance %s(%d)-parent of %s" \ ! % (counterName, object, machine, instance, index, parentInstance)) def browse(callback = BrowseCallBackDemo, title="Python Browser", *************** *** 152,161 **** # Show how to get a couple of attributes by name. counter = find_pdh_counter_localized_name("Virtual Bytes") ! print "Virtual Bytes = ", FindPerformanceAttributesByName("python", ! counter=counter) ! print "Available Bytes = ", GetPerformanceAttributes( find_pdh_counter_localized_name("Memory"), ! find_pdh_counter_localized_name("Available Bytes")) # And a browser. ! print "Browsing for counters..." browse() --- 152,161 ---- # Show how to get a couple of attributes by name. counter = find_pdh_counter_localized_name("Virtual Bytes") ! print ("Virtual Bytes = ", FindPerformanceAttributesByName("python", ! counter=counter)) ! print ("Available Bytes = ", GetPerformanceAttributes( find_pdh_counter_localized_name("Memory"), ! find_pdh_counter_localized_name("Available Bytes"))) # And a browser. ! print ("Browsing for counters...") browse() |
From: Roger U. <ru...@us...> - 2008-09-28 16:37:57
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1439 Modified Files: Tag: py3k odbc.cpp Log Message: PyObject_CheckReadBuffer crashes in 3.0rc1, use PyObject_CheckBuffer for now Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.20.2.7 retrieving revision 1.20.2.8 diff -C2 -d -r1.20.2.7 -r1.20.2.8 *** odbc.cpp 17 Sep 2008 03:17:42 -0000 1.20.2.7 --- odbc.cpp 28 Sep 2008 16:37:50 -0000 1.20.2.8 *************** *** 1120,1124 **** else if (PyBuffer_Check(item)) #else ! else if (PyObject_CheckReadBuffer(item)) #endif { --- 1120,1124 ---- else if (PyBuffer_Check(item)) #else ! else if (PyObject_CheckBuffer(item)) #endif { |
From: Roger U. <ru...@us...> - 2008-09-28 16:36:10
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv640 Modified Files: Tag: py3k _winxptheme.i Log Message: Don't treat HTHEME and HDC as longs Index: _winxptheme.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/_winxptheme.i,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** _winxptheme.i 3 Jun 2007 14:53:07 -0000 1.3 --- _winxptheme.i 28 Sep 2008 16:35:56 -0000 1.3.2.1 *************** *** 85,97 **** } ! %apply long {HTHEME}; ! typedef long HTHEME; ! ! ! %apply HWND {long}; ! typedef long HWND ! %apply HDC {long}; ! typedef long HDC %typemap(python,ignore) RECT *OUTPUT(RECT temp) --- 85,96 ---- } ! %apply HANDLE {HTHEME}; ! typedef HANDLE HTHEME; ! typedef float HDC; ! %typemap(python, in) HDC{ ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target)) ! return NULL; ! } %typemap(python,ignore) RECT *OUTPUT(RECT temp) |
From: Roger U. <ru...@us...> - 2008-09-27 18:18:22
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12930 Modified Files: Tag: py3k win32fileDemo.py Log Message: Don't need to import pywintypes first anymore Index: win32fileDemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32fileDemo.py,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** win32fileDemo.py 25 Sep 2008 22:36:44 -0000 1.6.4.2 --- win32fileDemo.py 27 Sep 2008 18:18:15 -0000 1.6.4.3 *************** *** 3,7 **** # Please contribute your favourite simple little demo. - import pywintypes ## This can go away when bug fixed import win32file, win32api, win32con import os --- 3,6 ---- |
From: Roger U. <ru...@us...> - 2008-09-27 18:07:56
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8523 Modified Files: Tag: py3k win32file.i win32file_comm.cpp Added Files: Tag: py3k win32file_comm.h Log Message: Move definitions for PyDCB and PyCOMSTAT into a header file Call PyType_Ready for above types --- NEW FILE: win32file_comm.h --- // The communications related functions. // The COMM port enhancements were added by Mark Hammond, and are // (c) 2000-2001, ActiveState Tools Corp. // The comms port helpers. extern PyObject *PyWinObject_FromCOMSTAT(const COMSTAT *pCOMSTAT); extern BOOL PyWinObject_AsCOMSTAT(PyObject *ob, COMSTAT **ppCOMSTAT, BOOL bNoneOK = TRUE); extern BOOL PyWinObject_AsDCB(PyObject *ob, DCB **ppDCB, BOOL bNoneOK = TRUE); extern PyObject *PyWinObject_FromDCB(const DCB *pDCB); extern PyObject *PyWinMethod_NewDCB(PyObject *self, PyObject *args); extern PyObject *PyWinObject_FromCOMMTIMEOUTS( COMMTIMEOUTS *p); extern BOOL PyWinObject_AsCOMMTIMEOUTS( PyObject *ob, COMMTIMEOUTS *p); class PyDCB : public PyObject { public: DCB *GetDCB() {return &m_DCB;} PyDCB(void); PyDCB(const DCB &); ~PyDCB(); /* Python support */ int compare(PyObject *ob); static void deallocFunc(PyObject *ob); static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *getattro(PyObject *self, PyObject *obname); static int setattro(PyObject *self, PyObject *obname, PyObject *v); static struct PyMemberDef members[]; static PyTypeObject type; protected: DCB m_DCB; }; #define PyDCB_Check(x) ((x)->ob_type==&PyDCB::type) //////////////////////////////////////////////////////////////// // // COMSTAT object. // //////////////////////////////////////////////////////////////// class PyCOMSTAT : public PyObject { public: COMSTAT *GetCOMSTAT() {return &m_COMSTAT;} PyCOMSTAT(void); PyCOMSTAT(const COMSTAT &); ~PyCOMSTAT(); /* Python support */ int compare(PyObject *ob); static void deallocFunc(PyObject *ob); static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *getattro(PyObject *self, PyObject *obname); static int setattro(PyObject *self, PyObject *obname, PyObject *v); static struct PyMemberDef members[]; static PyTypeObject type; protected: COMSTAT m_COMSTAT; }; #define PyCOMSTAT_Check(x) ((x)->ob_type==&PyCOMSTAT::type) Index: win32file_comm.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file_comm.cpp,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** win32file_comm.cpp 29 Aug 2008 04:59:26 -0000 1.5.4.1 --- win32file_comm.cpp 27 Sep 2008 18:07:41 -0000 1.5.4.2 *************** *** 9,12 **** --- 9,13 ---- #include "PyWinTypes.h" #include "PyWinObjects.h" + #include "win32file_comm.h" // Small enough we can use a tuple! *************** *** 19,23 **** PyObject *PyWinObject_FromCOMMTIMEOUTS( COMMTIMEOUTS *p) { ! return Py_BuildValue("iiiii", p->ReadIntervalTimeout, p->ReadTotalTimeoutMultiplier, --- 20,24 ---- PyObject *PyWinObject_FromCOMMTIMEOUTS( COMMTIMEOUTS *p) { ! return Py_BuildValue("kkkkk", p->ReadIntervalTimeout, p->ReadTotalTimeoutMultiplier, *************** *** 29,33 **** BOOL PyWinObject_AsCOMMTIMEOUTS( PyObject *ob, COMMTIMEOUTS *p) { ! return PyArg_ParseTuple(ob, "iiiii", &p->ReadIntervalTimeout, &p->ReadTotalTimeoutMultiplier, --- 30,34 ---- BOOL PyWinObject_AsCOMMTIMEOUTS( PyObject *ob, COMMTIMEOUTS *p) { ! return PyArg_ParseTuple(ob, "kkkkk", &p->ReadIntervalTimeout, &p->ReadTotalTimeoutMultiplier, *************** *** 39,68 **** static const char *szNeedIntAttr = "Attribute '%s' must be an integer"; - class PyDCB : public PyObject - { - public: - DCB *GetDCB() {return &m_DCB;} - - PyDCB(void); - PyDCB(const DCB &); - ~PyDCB(); - - /* Python support */ - int compare(PyObject *ob); - - static void deallocFunc(PyObject *ob); - static int compareFunc(PyObject *ob1, PyObject *ob2); - - static PyObject *getattro(PyObject *self, PyObject *obname); - static int setattro(PyObject *self, PyObject *obname, PyObject *v); - static struct PyMemberDef members[]; - static PyTypeObject type; - - protected: - DCB m_DCB; - }; - - #define PyDCB_Check(x) ((x)->ob_type==&PyDCB::type) - // @pymethod <o PyDCB>|win32file|DCB|Creates a new DCB object PyObject *PyWinMethod_NewDCB(PyObject *self, PyObject *args) --- 40,43 ---- *************** *** 120,125 **** 0, /* tp_call */ 0, /* tp_str */ ! PyDCB::getattro, /* tp_getattro */ ! PyDCB::setattro, /* tp_setattro */ }; --- 95,120 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyDCB::getattro, /* tp_getattro */ ! PyDCB::setattro, /* tp_setattro */ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! "Wraps a DCB struct", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyDCB::members, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! 0, /* tp_new */ }; *************** *** 260,289 **** // //////////////////////////////////////////////////////////////// - class PyCOMSTAT : public PyObject - { - public: - COMSTAT *GetCOMSTAT() {return &m_COMSTAT;} - - PyCOMSTAT(void); - PyCOMSTAT(const COMSTAT &); - ~PyCOMSTAT(); - - /* Python support */ - int compare(PyObject *ob); - - static void deallocFunc(PyObject *ob); - static int compareFunc(PyObject *ob1, PyObject *ob2); - - static PyObject *getattro(PyObject *self, PyObject *obname); - static int setattro(PyObject *self, PyObject *obname, PyObject *v); - static struct PyMemberDef members[]; - static PyTypeObject type; - - protected: - COMSTAT m_COMSTAT; - }; - - #define PyCOMSTAT_Check(x) ((x)->ob_type==&PyCOMSTAT::type) - // @pymethod <o PyCOMSTAT>|win32file|COMSTAT|Creates a new COMSTAT object PyObject *PyWinMethod_NewCOMSTAT(PyObject *self, PyObject *args) --- 255,258 ---- *************** *** 341,344 **** --- 310,333 ---- PyCOMSTAT::getattro, /* tp_getattr */ PyCOMSTAT::setattro, /* tp_setattr */ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "Wraps a COMMSTAT struct", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + PyCOMSTAT::members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.93.2.1 retrieving revision 1.93.2.2 diff -C2 -d -r1.93.2.1 -r1.93.2.2 *** win32file.i 29 Aug 2008 04:59:26 -0000 1.93.2.1 --- win32file.i 27 Sep 2008 18:07:41 -0000 1.93.2.2 *************** *** 46,49 **** --- 46,50 ---- #define NEED_PYWINOBJECTS_H + #include "win32file_comm.h" %} *************** *** 2397,2416 **** #endif // MS_WINCE - // The communications related functions. - // The COMM port enhancements were added by Mark Hammond, and are - // (c) 2000-2001, ActiveState Tools Corp. - - %{ - // The comms port helpers. - extern PyObject *PyWinObject_FromCOMSTAT(const COMSTAT *pCOMSTAT); - extern BOOL PyWinObject_AsCOMSTAT(PyObject *ob, COMSTAT **ppCOMSTAT, BOOL bNoneOK = TRUE); - extern BOOL PyWinObject_AsDCB(PyObject *ob, DCB **ppDCB, BOOL bNoneOK = TRUE); - extern PyObject *PyWinObject_FromDCB(const DCB *pDCB); - extern PyObject *PyWinMethod_NewDCB(PyObject *self, PyObject *args); - extern PyObject *PyWinObject_FromCOMMTIMEOUTS( COMMTIMEOUTS *p); - extern BOOL PyWinObject_AsCOMMTIMEOUTS( PyObject *ob, COMMTIMEOUTS *p); - - %} - %native (DCB) PyWinMethod_NewDCB; --- 2398,2401 ---- *************** *** 5223,5228 **** #endif ! if (PyType_Ready(&FindFileIterator_Type) == -1) RETURN_ERROR; if (PyDict_SetItemString(d, "error", PyWinExc_ApiError) == -1) RETURN_ERROR; --- 5208,5216 ---- #endif ! if (PyType_Ready(&FindFileIterator_Type) == -1 ! ||PyType_Ready(&PyDCB::type) == -1 ! ||PyType_Ready(&PyCOMSTAT::type) == -1) RETURN_ERROR; + if (PyDict_SetItemString(d, "error", PyWinExc_ApiError) == -1) RETURN_ERROR; |
From: Roger U. <ru...@us...> - 2008-09-27 15:56:11
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21533 Modified Files: Tag: py3k PyWinTypes.h PyWinTypesmodule.cpp Log Message: Call PyType_Ready in PyWinGlobals_Ensure Return error code from PyWinGlobals_Ensure Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.39.2.3 retrieving revision 1.39.2.4 diff -C2 -d -r1.39.2.3 -r1.39.2.4 *** PyWinTypesmodule.cpp 12 Sep 2008 07:04:46 -0000 1.39.2.3 --- PyWinTypesmodule.cpp 27 Sep 2008 15:56:00 -0000 1.39.2.4 *************** *** 836,840 **** }; ! void PyWinGlobals_Ensure() { PyEval_InitThreads(); --- 836,840 ---- }; ! int PyWinGlobals_Ensure() { PyEval_InitThreads(); *************** *** 842,847 **** if (PyWinExc_ApiError==NULL) { PyWinExc_ApiError = PyErr_NewException("pywintypes.error", NULL, NULL); PyWinExc_COMError = PyErr_NewException("pywintypes.com_error", NULL, NULL); ! } } --- 842,880 ---- if (PyWinExc_ApiError==NULL) { PyWinExc_ApiError = PyErr_NewException("pywintypes.error", NULL, NULL); + if (PyWinExc_ApiError==NULL) + return -1; + } + if (PyWinExc_COMError == NULL){ PyWinExc_COMError = PyErr_NewException("pywintypes.com_error", NULL, NULL); ! if (PyWinExc_COMError == NULL) ! return -1; ! } ! ! /* PyType_Ready needs to be called anytime pywintypesxx.dll is loaded, since ! other extension modules can use types defined here without pywintypes itself ! having been imported. ! ??? All extension modules that call this need to be changed to check the exit code ??? ! */ ! if (PyType_Ready(&PyHANDLEType) == -1 ! ||PyType_Ready(&PyOVERLAPPEDType) == -1 ! ||PyType_Ready(&PyDEVMODEType) == -1 ! ||PyType_Ready(&PyDEVMODEWType) == -1 ! ||PyType_Ready(&PyWAVEFORMATEXType) == -1 ! #ifndef NO_PYWINTYPES_TIME ! ||PyType_Ready(&PyTimeType) == -1 ! #endif // NO_PYWINTYPES_TIME ! #ifndef NO_PYWINTYPES_IID ! ||PyType_Ready(&PyIIDType) == -1 ! #endif // NO_PYWINTYPES_IID ! #ifndef NO_PYWINTYPES_SECURITY ! ||PyType_Ready(&PySECURITY_DESCRIPTORType) == -1 ! ||PyType_Ready(&PySECURITY_ATTRIBUTESType) == -1 ! ||PyType_Ready(&PySIDType) == -1 ! ||PyType_Ready(&PyACLType) == -1 ! #endif ! ) ! return -1; ! ! return 0; } Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.51.2.2 retrieving revision 1.51.2.3 diff -C2 -d -r1.51.2.2 -r1.51.2.3 *** PyWinTypes.h 31 Aug 2008 02:11:22 -0000 1.51.2.2 --- PyWinTypes.h 27 Sep 2008 15:56:00 -0000 1.51.2.3 *************** *** 672,676 **** extern PYWINTYPES_EXPORT void PyWinInterpreterLock_Release(); ! extern PYWINTYPES_EXPORT void PyWinGlobals_Ensure(); extern PYWINTYPES_EXPORT void PyWinGlobals_Free(); #else --- 672,676 ---- extern PYWINTYPES_EXPORT void PyWinInterpreterLock_Release(); ! extern PYWINTYPES_EXPORT int PyWinGlobals_Ensure(); extern PYWINTYPES_EXPORT void PyWinGlobals_Free(); #else |
From: Roger U. <ru...@us...> - 2008-09-18 17:03:48
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1841 Modified Files: Tag: py3k PythonService.cpp Log Message: Site bug fixed in 3.0rc1 Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.24.2.3 retrieving revision 1.24.2.4 diff -C2 -d -r1.24.2.3 -r1.24.2.4 *** PythonService.cpp 31 Aug 2008 02:11:22 -0000 1.24.2.3 --- PythonService.cpp 19 Sep 2008 00:03:58 -0000 1.24.2.4 *************** *** 1555,1559 **** Py_Initialize(); PyEval_InitThreads(); - module = PyImport_ImportModule("site"); // ??? remove when site bug is fixed ??? module = PyImport_ImportModule("servicemanager"); if (!module) goto failed; --- 1555,1558 ---- |
From: Roger U. <ru...@us...> - 2008-09-18 17:02:59
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1649 Modified Files: Tag: py3k win32uimodule.cpp Log Message: Site bug fixed in 3.0rc1 Index: win32uimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v retrieving revision 1.39.2.2 retrieving revision 1.39.2.3 diff -C2 -d -r1.39.2.2 -r1.39.2.3 *** win32uimodule.cpp 31 Aug 2008 02:10:51 -0000 1.39.2.2 --- win32uimodule.cpp 19 Sep 2008 00:03:09 -0000 1.39.2.3 *************** *** 2488,2494 **** Python_addpath(additionalPaths); - // ??? Site fails to import on Py3k ??? - if (Python_run_command_with_log("import site")) - return FALSE; if (cmd!=NULL) { USES_CONVERSION; --- 2488,2491 ---- |
From: Roger U. <ru...@us...> - 2008-09-17 08:40:46
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/propsys/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6852 Modified Files: Tag: py3k propsys.cpp Log Message: Convert module init for Py3k Index: propsys.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/propsys/src/propsys.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** propsys.cpp 22 Jan 2008 12:22:14 -0000 1.1 --- propsys.cpp 17 Sep 2008 08:40:55 -0000 1.1.2.1 *************** *** 60,64 **** /* List of module functions */ ! // @module propsys|A module, encapsulating the Vista propsys interfaces static struct PyMethodDef propsys_methods[]= { --- 60,64 ---- /* List of module functions */ ! // @module propsys|A module, encapsulating the Vista Property System interfaces static struct PyMethodDef propsys_methods[]= { *************** *** 74,90 **** /* Module initialisation */ ! extern "C" __declspec(dllexport) void initpropsys() { ! char *modName = "propsys"; ! PyObject *oModule; ! // Create the module and add the functions ! oModule = Py_InitModule(modName, propsys_methods); ! if (!oModule) /* Eeek - some serious error! */ ! return; ! PyObject *dict = PyModule_GetDict(oModule); ! if (!dict) return; /* Another serious error!*/ - PyDict_SetItemString(dict, "error", PyWinExc_COMError); // Register all of our interfaces, gateways and IIDs. //PyCom_RegisterExtensionSupport(dict, g_interfaceSupportData, sizeof(g_interfaceSupportData)/sizeof(PyCom_InterfaceSupportInfo)); } --- 74,116 ---- /* Module initialisation */ ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initpropsys(void) ! #else ! PyObject *PyInit_propsys(void) ! #endif { ! PyObject *dict, *module; ! ! #if (PY_VERSION_HEX < 0x03000000) ! #define RETURN_ERROR return; ! module = Py_InitModule("propsys", propsys_methods); ! ! #else ! #define RETURN_ERROR return NULL; ! static PyModuleDef propsys_def = { ! PyModuleDef_HEAD_INIT, ! "propsys", ! "A module, encapsulating the Vista Property System interfaces", ! -1, ! propsys_methods ! }; ! module = PyModule_Create(&propsys_def); ! #endif ! ! if (!module) ! RETURN_ERROR; ! dict = PyModule_GetDict(module); ! if (!dict) ! RETURN_ERROR; ! ! if (PyDict_SetItemString(dict, "error", PyWinExc_COMError) == -1) ! RETURN_ERROR; // Register all of our interfaces, gateways and IIDs. //PyCom_RegisterExtensionSupport(dict, g_interfaceSupportData, sizeof(g_interfaceSupportData)/sizeof(PyCom_InterfaceSupportInfo)); + + #if (PY_VERSION_HEX >= 0x03000000) + return module; + #endif } |