pywin32-checkins Mailing List for Python for Windows Extensions (Page 103)
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...> - 2006-03-15 04:26:32
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13722 Modified Files: setup.py Log Message: Add IMAPIStatus. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** setup.py 20 Feb 2006 01:33:15 -0000 1.36 --- setup.py 15 Mar 2006 04:26:29 -0000 1.37 *************** *** 1168,1171 **** --- 1168,1172 ---- %(mapi)s/PyIMAPIProp.i %(mapi)s/PyIMAPIProp.cpp %(mapi)s/PyIMAPISession.i %(mapi)s/PyIMAPISession.cpp + %(mapi)s/PyIMAPIStatus.i %(mapi)s/PyIMAPIStatus.cpp %(mapi)s/PyIMAPITable.i %(mapi)s/PyIMAPITable.cpp %(mapi)s/PyIMessage.i %(mapi)s/PyIMessage.cpp *************** *** 1274,1277 **** --- 1275,1279 ---- 'PyIMAPIProp': '', # '' == default base 'PyIMAPISession': '', + 'PyIMAPIStatus': 'IMAPIProp', 'PyIMAPITable': '', 'PyIMessage': 'IMAPIProp', |
From: Mark H. <mha...@us...> - 2006-03-15 04:05:54
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4270 Modified Files: MANIFEST.in Log Message: Ensure pywin32_postinstall.py and pywin32_preinstall.py are included in source distributions. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/pywin32/pywin32/MANIFEST.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MANIFEST.in 10 Jan 2006 06:53:36 -0000 1.10 --- MANIFEST.in 15 Mar 2006 04:05:37 -0000 1.11 *************** *** 10,13 **** --- 10,15 ---- include setup_win32all.py include setup.py + include pywin32_postinstall.py + include pywin32_preinstall.py # don't know how to include "Python and Extensions.dsw" - spaces upset things # Core win32 stuff |
From: Mark H. <mha...@us...> - 2006-03-15 04:04:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2954/com/win32comext/adsi/src Modified Files: adsi.i adsilib.i Log Message: Expose ADsGetLastError() and ensure we automatically call it in all SWIG generated cases rather than just some cases! Index: adsilib.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/src/adsilib.i,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** adsilib.i 26 May 2005 11:35:13 -0000 1.3 --- adsilib.i 15 Mar 2006 04:04:21 -0000 1.4 *************** *** 14,18 **** if (FAILED($source)) { $cleanup ! #ifndef SWIG_THIS_IID #error This interface must have SWIG_THIS_IID defined! --- 14,18 ---- if (FAILED($source)) { $cleanup ! #ifndef SWIG_THIS_IID #error This interface must have SWIG_THIS_IID defined! *************** *** 22,25 **** --- 22,35 ---- } + %typemap(python,except) HRESULT_KEEP_INFO { + Py_BEGIN_ALLOW_THREADS + $function + Py_END_ALLOW_THREADS + if (FAILED($source)) { + $cleanup + return OleSetADSIError($source, _swig_self, SWIG_THIS_IID); + } + } + %typemap(python,ignore) IDirectoryObject **OUTPUT(IDirectoryObject *temp) { Index: adsi.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/src/adsi.i,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** adsi.i 27 May 2005 07:09:36 -0000 1.6 --- adsi.i 15 Mar 2006 04:04:21 -0000 1.7 *************** *** 230,233 **** --- 230,251 ---- %native (ADsEnumerateNext) PyADsEnumerateNext; + %{ + // @pyswig (int, unicode, unicode)|ADsGetLastError| + static PyObject *PyADsGetLastError(PyObject *self, PyObject *args) + { + if ( !PyArg_ParseTuple(args, ":ADsGetLastError") ) + return NULL; + WCHAR szErrorBuf[MAX_PATH] = {0}; + WCHAR szNameBuf[MAX_PATH] = {0}; + DWORD dwErrCode = 0; + ADsGetLastError( &dwErrCode, + szErrorBuf, + MAX_PATH-1, + szNameBuf, + MAX_PATH-1); + return Py_BuildValue("iuu", dwErrCode, szErrorBuf, szNameBuf); + } + %} + %native (ADsGetLastError) PyADsGetLastError; %{ |
From: Mark H. <mha...@us...> - 2006-03-15 04:01:41
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2101/win32/src Modified Files: odbc.cpp Log Message: Add SQLDataSources and related constants, remove 'printf' on error. Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** odbc.cpp 27 Feb 2006 12:00:57 -0000 1.15 --- odbc.cpp 15 Mar 2006 04:01:35 -0000 1.16 *************** *** 192,196 **** if (conn && errorType && (errorType->connected == 0)) { ! printf("Disconnected\n"); SQLDisconnect(conn->hdbc); conn->connected = 0; --- 192,196 ---- if (conn && errorType && (errorType->connected == 0)) { ! // printf("Disconnected\n"); SQLDisconnect(conn->hdbc); conn->connected = 0; *************** *** 1779,1788 **** --- 1779,1837 ---- } + /* @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; + + PyObject *ret; + SQLCHAR svr[256]; + SQLCHAR desc[1024]; + SQLSMALLINT svr_size = sizeof(svr) / sizeof(svr[0]); + SQLSMALLINT desc_size = sizeof(desc) / sizeof(desc[0]); + RETCODE rc; + Py_BEGIN_ALLOW_THREADS + rc = SQLDataSources(Env, direction, + svr, svr_size, &svr_size, + desc, desc_size, &desc_size); + Py_END_ALLOW_THREADS + + if (rc == SQL_NO_DATA) { + ret = Py_None; + Py_INCREF(Py_None); + } else if (unsuccessful(rc)){ + connectionError(NULL, "SQLDataSources"); + ret = NULL; + } else + ret = Py_BuildValue("s#s#", svr, svr_size, desc, desc_size); + return ret; + } + /* @module odbc|A Python wrapper around the ODBC API. */ static PyMethodDef globalMethods[] = { { "odbc", odbcLogon, 1} , /* @pymeth odbc|Creates an <o connection> object. */ + { "SQLDataSources", odbcSQLDataSources, 1}, /* @pymeth SQLDataSources|Enumerates ODBC data sources. */ {0, 0} }; + int AddConstant(PyObject *dict, char *key, long value) + { + PyObject *okey = PyString_FromString(key); + PyObject *oval = PyInt_FromLong(value); + if (!okey || !oval) { + Py_XDECREF(okey); + Py_XDECREF(oval); + return 1; + } + int rc = PyDict_SetItem(dict,okey, oval); + Py_XDECREF(okey); + Py_XDECREF(oval); + return rc; + } + #define ADD_CONSTANT(tok) AddConstant(dict,#tok, tok) + extern "C" __declspec(dllexport) void initodbc() *************** *** 1801,1804 **** --- 1850,1854 ---- if (m) { + PyObject *dict = PyModule_GetDict (m); /* The indices go to indices in the ODBC error table */ dbiErrors[0] = DbiNoError; *************** *** 1808,1812 **** dbiErrors[4] = DbiDataError; dbiErrors[5] = DbiInternalError; ! PyDict_SetItemString(PyModule_GetDict (m), "error", odbcError); } } --- 1858,1870 ---- dbiErrors[4] = DbiDataError; dbiErrors[5] = DbiInternalError; ! PyDict_SetItemString(dict, "error", odbcError); ! ADD_CONSTANT(SQL_FETCH_NEXT); ! ADD_CONSTANT(SQL_FETCH_FIRST); ! ADD_CONSTANT(SQL_FETCH_LAST); ! ADD_CONSTANT(SQL_FETCH_PRIOR); ! ADD_CONSTANT(SQL_FETCH_ABSOLUTE); ! ADD_CONSTANT(SQL_FETCH_RELATIVE); ! ADD_CONSTANT(SQL_FETCH_FIRST_USER); ! ADD_CONSTANT(SQL_FETCH_FIRST_SYSTEM); } } |
From: Mark H. <mha...@us...> - 2006-03-15 04:00:48
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1503/win32/src Modified Files: win32apimodule.cpp Log Message: win32api.GetFileAttributes will call GetFileAttributesW if passed with a Unicode object (previously it would throw a type-error) Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** win32apimodule.cpp 10 Jan 2006 05:35:47 -0000 1.52 --- win32apimodule.cpp 15 Mar 2006 04:00:08 -0000 1.53 *************** *** 1171,1185 **** PyGetFileAttributes (PyObject *self, PyObject *args) { ! char *pathName; // @pyparm string|pathName||The name of the file whose attributes are to be returned. ! if (!PyArg_ParseTuple (args, "s:GetFileAttributes", &pathName)) return NULL; ! PyW32_BEGIN_ALLOW_THREADS ! DWORD rc = ::GetFileAttributes(pathName); ! PyW32_END_ALLOW_THREADS if (rc==(DWORD)0xFFFFFFFF) return ReturnAPIError("GetFileAttributes"); return Py_BuildValue("i", rc); // @pyseeapi GetFileAttributes // @rdesc The return value is a combination of the win32con.FILE_ATTRIBUTE_* constants. // <nl>An exception is raised on failure. --- 1171,1196 ---- PyGetFileAttributes (PyObject *self, PyObject *args) { ! PyObject *obPathName; // @pyparm string|pathName||The name of the file whose attributes are to be returned. ! // If this param is a unicode object, GetFileAttributesW is called. ! if (!PyArg_ParseTuple (args, "O:GetFileAttributes", &obPathName)) return NULL; ! DWORD rc; ! if (PyString_Check(obPathName)) { ! PyW32_BEGIN_ALLOW_THREADS ! rc = ::GetFileAttributes(PyString_AS_STRING(obPathName)); ! PyW32_END_ALLOW_THREADS ! } else if (PyUnicode_Check(obPathName)) { ! PyW32_BEGIN_ALLOW_THREADS ! rc = ::GetFileAttributesW(PyUnicode_AS_UNICODE(obPathName)); ! PyW32_END_ALLOW_THREADS ! } else ! return PyErr_Format(PyExc_TypeError, "pathName arg must be string or unicode"); ! if (rc==(DWORD)0xFFFFFFFF) return ReturnAPIError("GetFileAttributes"); return Py_BuildValue("i", rc); // @pyseeapi GetFileAttributes + // @pyseeapi GetFileAttributesW // @rdesc The return value is a combination of the win32con.FILE_ATTRIBUTE_* constants. // <nl>An exception is raised on failure. |
From: Mark H. <mha...@us...> - 2006-03-15 04:00:48
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1503/win32/test Modified Files: test_win32api.py Log Message: win32api.GetFileAttributes will call GetFileAttributesW if passed with a Unicode object (previously it would throw a type-error) Index: test_win32api.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_win32api.py 4 Mar 2005 11:50:32 -0000 1.8 --- test_win32api.py 15 Mar 2006 04:00:08 -0000 1.9 *************** *** 107,110 **** --- 107,121 ---- raise try: + # GetFileAttributes automatically calls GetFileAttributesW when + # passed unicode + try: + attr = win32api.GetFileAttributes(fname) + except win32api.error, details: + if details[0] != winerror.ERROR_FILENAME_EXCED_RANGE: + raise + + attr = win32api.GetFileAttributes(unicode(fname)) + self.failUnless(attr & win32con.FILE_ATTRIBUTE_DIRECTORY, attr) + long_name = win32api.GetLongPathNameW(fname) self.failUnlessEqual(long_name, fname) |
From: Mark H. <mha...@us...> - 2006-02-27 12:01:00
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23473/src Modified Files: odbc.cpp Log Message: Fix [ 1258840 ] odbc - select 'bit' type returns str, not int and add a few extra tests while there... Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** odbc.cpp 22 Feb 2006 08:07:13 -0000 1.14 --- odbc.cpp 27 Feb 2006 12:00:57 -0000 1.15 *************** *** 1089,1092 **** --- 1089,1093 ---- switch(vtype) { + case SQL_BIT: case SQL_SMALLINT: case SQL_INTEGER: |
From: Mark H. <mha...@us...> - 2006-02-27 12:01:00
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23473/test Modified Files: test_odbc.py Log Message: Fix [ 1258840 ] odbc - select 'bit' type returns str, not int and add a few extra tests while there... Index: test_odbc.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_odbc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_odbc.py 22 Feb 2006 08:07:13 -0000 1.1 --- test_odbc.py 27 Feb 2006 12:00:57 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- # odbc test suite kindly contributed by Frank Millman. + import sys import os import unittest *************** *** 9,14 **** from win32com.client import constants ! class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.db_filename = os.path.join(tempfile.gettempdir(), "test_odbc.mdb") if os.path.isfile(self.db_filename): --- 10,16 ---- from win32com.client import constants ! class TestStuff(unittest.TestCase): def setUp(self): + self.conn = self.cur = None self.db_filename = os.path.join(tempfile.gettempdir(), "test_odbc.mdb") if os.path.isfile(self.db_filename): *************** *** 38,53 **** # And we expect a 'users' table for these tests. self.cur = self.conn.cursor() ! self.assertEqual(self.cur.execute("create table users " ! "(userid varchar(5), username varchar(25))"),-1) def tearDown(self): ! self.cur.close() ! self.cur = None ! self.conn.close() ! self.conn = None os.unlink(self.db_filename) def test_insert_select(self, userid='Frank', username='Frank Millman'): ! self.assertEqual(self.cur.execute("insert into users \ values (?,?)", [userid, username]),1) self.assertEqual(self.cur.execute("select * from users \ --- 40,61 ---- # And we expect a 'users' table for these tests. self.cur = self.conn.cursor() ! self.assertEqual(self.cur.execute( ! """create table users ( ! userid varchar(5), username varchar(25), ! bitfield bit, intfield integer, ! floatfield float ! )"""),-1) def tearDown(self): ! if self.cur is not None: ! self.cur.close() ! self.cur = None ! if self.conn is not None: ! self.conn.close() ! self.conn = None os.unlink(self.db_filename) def test_insert_select(self, userid='Frank', username='Frank Millman'): ! self.assertEqual(self.cur.execute("insert into users (userid, username) \ values (?,?)", [userid, username]),1) self.assertEqual(self.cur.execute("select * from users \ *************** *** 61,65 **** def test_insert_select_unicode(self, userid=u'Frank', username=u"Frank Millman"): ! self.assertEqual(self.cur.execute("insert into users \ values (?,?)", [userid, username]),1) self.assertEqual(self.cur.execute("select * from users \ --- 69,73 ---- def test_insert_select_unicode(self, userid=u'Frank', username=u"Frank Millman"): ! self.assertEqual(self.cur.execute("insert into users (userid, username)\ values (?,?)", [userid, username]),1) self.assertEqual(self.cur.execute("select * from users \ *************** *** 73,76 **** --- 81,112 ---- self.test_insert_select_unicode(userid, username) + def _test_val(self, fieldName, value): + self.cur.execute("delete from users where userid='Frank'") + self.assertEqual(self.cur.execute( + "insert into users (userid, %s) values (?,?)" % fieldName, + ["Frank", value]), 1) + self.cur.execute("select %s from users where userid = ?" % fieldName, + ["Frank"]) + rows = self.cur.fetchmany() + self.failUnlessEqual(1, len(rows)) + row = rows[0] + self.failUnlessEqual(row[0], value) + + def testBit(self): + self._test_val('bitfield', 1) + self._test_val('bitfield', 0) + + def testInt(self): + self._test_val('intfield', 1) + self._test_val('intfield', 0) + self._test_val('intfield', sys.maxint) + + def testFloat(self): + self._test_val('floatfield', 1.01) + self._test_val('floatfield', 0) + + def testVarchar(self, ): + self._test_val('username', 'foo') + if __name__ == '__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2006-02-27 10:46:38
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14800 Modified Files: win32file.i Log Message: Fix [ 1408486 ] WSARecv exception states the error is from "WSASend" Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** win32file.i 14 Nov 2005 07:30:09 -0000 1.51 --- win32file.i 27 Feb 2006 10:46:35 -0000 1.52 *************** *** 581,585 **** if (::GetLastError()!=ERROR_FILE_NOT_FOUND) { // this is OK Py_DECREF(it); ! return PyWin_SetAPIError("FindNextFileW"); } it->empty = TRUE; --- 581,585 ---- if (::GetLastError()!=ERROR_FILE_NOT_FOUND) { // this is OK Py_DECREF(it); ! return PyWin_SetAPIError("FindFirstFileW"); } it->empty = TRUE; *************** *** 1848,1852 **** if (rc == SOCKET_ERROR) { ! PyWin_SetAPIError("AcceptEx", WSAGetLastError()); return NULL; } --- 1848,1852 ---- if (rc == SOCKET_ERROR) { ! PyWin_SetAPIError("getsockopt", WSAGetLastError()); return NULL; } *************** *** 2018,2022 **** if (rc == SOCKET_ERROR) { ! PyWin_SetAPIError("AcceptEx", WSAGetLastError()); return NULL; } --- 2018,2022 ---- if (rc == SOCKET_ERROR) { ! PyWin_SetAPIError("getsockopt", WSAGetLastError()); return NULL; } *************** *** 2353,2357 **** if (rc != ERROR_IO_PENDING) { ! PyWin_SetAPIError("WSASend", rc); goto Error; } --- 2353,2357 ---- if (rc != ERROR_IO_PENDING) { ! PyWin_SetAPIError("WSARecv", rc); goto Error; } *************** *** 2693,2697 **** DWORD rc = ok ? 0 : GetLastError(); if (rc!=0 && rc != ERROR_IO_PENDING) ! return PyWin_SetAPIError("WaitCommError", rc); return Py_BuildValue("ll", rc, *pmask); // @rdesc The result is a tuple of (rc, mask_val), where rc is zero for success, or --- 2693,2697 ---- DWORD rc = ok ? 0 : GetLastError(); if (rc!=0 && rc != ERROR_IO_PENDING) ! return PyWin_SetAPIError("WaitCommEvent", rc); return Py_BuildValue("ll", rc, *pmask); // @rdesc The result is a tuple of (rc, mask_val), where rc is zero for success, or |
From: Mark H. <mha...@us...> - 2006-02-20 01:33:21
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32395 Modified Files: setup.py Log Message: add job related functions - in a new module to avoid loadlib etc for each function as it is win2k only (where win32process still works on 9x) Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** setup.py 19 Feb 2006 12:56:45 -0000 1.35 --- setup.py 20 Feb 2006 01:33:15 -0000 1.36 *************** *** 1004,1007 **** --- 1004,1008 ---- ("win32evtlog", "advapi32 oleaut32", False), # win32gui handled below + ("win32job", "user32", False, 0x0500, 'win32/src/win32job.i win32/src/win32jobmodule.cpp'), ("win32lz", "lz32", False), ("win32net", "netapi32", True, None, """ |
From: Mark H. <mha...@us...> - 2006-02-20 01:33:20
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32395/win32/src Added Files: win32job.i Log Message: add job related functions - in a new module to avoid loadlib etc for each function as it is win2k only (where win32process still works on 9x) --- NEW FILE: win32job.i --- /* File : win32job.i */ %module win32job // An interface to the win32 Process and Thread API's, // available in Windows 2000 and later. %{ #define UNICODE #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x500 #endif #include "windows.h" #include "PyWinTypes.h" %} %include "typemaps.i" %include "pywin32.i" // @pyswig |AssignProcessToJobObject|Associates a process with an existing job object. BOOLAPI AssignProcessToJobObject( HANDLE hJob, // @pyparm <o PyHANDLE>|hJob|| HANDLE hProcess // @pyparm <o PyHANDLE>|hProcess|| ); // @pyswig |CreateJobObject|Creates or opens a job object. PyHANDLE CreateJobObject( SECURITY_ATTRIBUTES *lpJobAttributes, // @pyparm <o PySECURITY_ATTRIBUTES>|jobAttributes|| WCHAR *lpName); // @pyparm unicode|name|| // *sigh* - only XP and later!! // xxpyswig |IsProcessInJob|Determines if the process is running in the specified job. /* BOOLAPI IsProcessInJob( HANDLE ProcessHandle, // @pyparm <o PyHANDLE>|hProcess|| HANDLE JobHandle, // @pyparm <o PyHANDLE>|hJob|| BOOL *OUTPUT); */ // @pyswig |OpenJobObject|Opens an existing job object. PyHANDLE OpenJobObject( DWORD dwDesiredAccess, // @pyparm int|desiredAccess|| BOOL bInheritHandles, // @pyparm bool|inheritHandles|| WCHAR *lpName // @pyparm unicode|name|| ); // xxpyswig |QueryInformationJobObject|Retrieves limit and job state information from the job object. // xxpyswig |SetInformationJobObject|Set limits for a job object. // @pyswig |TerminateJobObject|Terminates all processes currently associated with the job. BOOLAPI TerminateJobObject( HANDLE hJob, // @pyparm <o PyHANDLE>|hJob|| unsigned int uExitCode // @pyparm int|exitCode|| ); // @pyswig |UserHandleGrantAccess|Grants or denies access to a handle to a User object to a job that has a user-interface restriction. BOOLAPI UserHandleGrantAccess( HANDLE hUserHandle, // @pyparm <o PyHANDLE>|hUserHandle|| HANDLE hJob, // @pyparm <o PyHANDLE>|hJob|| BOOL bGrant // @pyparm bool|grant|| ); |
From: Mark H. <mha...@us...> - 2006-02-19 12:56:57
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12676 Modified Files: setup.py Log Message: Add win32inet.WinHttpGetIEProxyConfigForCurrentUser (which sadly involves a new .cpp file - see comments there!), and remove old VC6 project file. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** setup.py 11 Feb 2006 03:47:01 -0000 1.34 --- setup.py 19 Feb 2006 12:56:45 -0000 1.35 *************** *** 1023,1027 **** ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), ! ("win32inet", "wininet", False, 0x500), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("_win32sysloader", "", False, 0x0501, "win32/src/_win32sysloader.cpp"), --- 1023,1030 ---- ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), ! ("win32inet", "wininet", False, 0x500, """ ! win32/src/win32inet.i win32/src/win32inetmodule.cpp ! win32/src/win32inet_winhttp.cpp""" ! ), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("_win32sysloader", "", False, 0x0501, "win32/src/_win32sysloader.cpp"), |
From: Roger U. <ru...@us...> - 2006-02-13 14:54:51
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/security/sspi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21599/win32/Demos/security/sspi Modified Files: simple_auth.py Log Message: Use more consistent naming conventions for SSPI type objects Index: simple_auth.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/sspi/simple_auth.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simple_auth.py 6 Mar 2005 23:27:00 -0000 1.1 --- simple_auth.py 13 Feb 2006 14:54:43 -0000 1.2 *************** *** 51,57 **** sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.SecBufferDescType() ! sigbuf.append(win32security.SecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.SecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=msg sspiclient.ctxt.MakeSignature(0,sigbuf,1) --- 51,57 ---- sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.PySecBufferDescType() ! sigbuf.append(win32security.PySecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.PySecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=msg sspiclient.ctxt.MakeSignature(0,sigbuf,1) *************** *** 60,66 **** # And finally encrypt some. trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.SecBufferDescType() ! encbuf.append(win32security.SecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.SecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=msg sspiclient.ctxt.EncryptMessage(0,encbuf,1) --- 60,66 ---- # And finally encrypt some. trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.PySecBufferDescType() ! encbuf.append(win32security.PySecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.PySecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=msg sspiclient.ctxt.EncryptMessage(0,encbuf,1) |
From: Roger U. <ru...@us...> - 2006-02-13 14:49:41
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20002/win32/test Modified Files: test_sspi.py Log Message: Use more consistent naming conventions for SSPI type objects Index: test_sspi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_sspi.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_sspi.py 7 Mar 2005 11:16:36 -0000 1.2 --- test_sspi.py 13 Feb 2006 14:49:31 -0000 1.3 *************** *** 45,51 **** trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.SecBufferDescType() ! encbuf.append(win32security.SecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.SecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=msg sspiclient.ctxt.EncryptMessage(0,encbuf,1) --- 45,51 ---- trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.PySecBufferDescType() ! encbuf.append(win32security.PySecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.PySecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=msg sspiclient.ctxt.EncryptMessage(0,encbuf,1) *************** *** 73,79 **** sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.SecBufferDescType() ! sigbuf.append(win32security.SecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.SecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=msg sspiclient.ctxt.MakeSignature(0,sigbuf,0) --- 73,79 ---- sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.PySecBufferDescType() ! sigbuf.append(win32security.PySecBufferType(len(msg), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.PySecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=msg sspiclient.ctxt.MakeSignature(0,sigbuf,0) |
From: Roger U. <ru...@us...> - 2006-02-13 14:47:31
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19357/win32/Lib Modified Files: sspi.py Log Message: Use more consistent naming conventions for SSPI type objects Index: sspi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspi.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sspi.py 7 Mar 2005 11:16:19 -0000 1.2 --- sspi.py 13 Feb 2006 14:47:20 -0000 1.3 *************** *** 50,56 **** trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.SecBufferDescType() ! encbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.SecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data self.ctxt.EncryptMessage(0,encbuf,self._get_next_seq_num()) --- 50,56 ---- trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.PySecBufferDescType() ! encbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.PySecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data self.ctxt.EncryptMessage(0,encbuf,self._get_next_seq_num()) *************** *** 59,65 **** def decrypt(self, data, trailer): """Decrypt a previously encrypted string, returning the orignal data""" ! encbuf=win32security.SecBufferDescType() ! encbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.SecBufferType(len(trailer), sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data encbuf[1].Buffer=trailer --- 59,65 ---- def decrypt(self, data, trailer): """Decrypt a previously encrypted string, returning the orignal data""" ! encbuf=win32security.PySecBufferDescType() ! encbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.PySecBufferType(len(trailer), sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data encbuf[1].Buffer=trailer *************** *** 74,80 **** pkg_size_info=self.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES) sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.SecBufferDescType() ! sigbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.SecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data --- 74,80 ---- pkg_size_info=self.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES) sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.PySecBufferDescType() ! sigbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.PySecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data *************** *** 86,92 **** will be raised. """ ! sigbuf=win32security.SecBufferDescType() ! sigbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.SecBufferType(len(sig), sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data --- 86,92 ---- will be raised. """ ! sigbuf=win32security.PySecBufferDescType() ! sigbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.PySecBufferType(len(sig), sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data *************** *** 120,138 **** # Perform *one* step of the client authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.SecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in sec_buffer_new.append(tokenbuf) sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle should be NULL on first call ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.CtxtHandleType() err, attr, exp=win32security.InitializeSecurityContext( self.credentials, --- 120,138 ---- # Perform *one* step of the client authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.PySecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in sec_buffer_new.append(tokenbuf) sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle should be NULL on first call ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.PyCtxtHandleType() err, attr, exp=win32security.InitializeSecurityContext( self.credentials, *************** *** 181,188 **** # Perform *one* step of the server authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.SecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in --- 181,188 ---- # Perform *one* step of the server authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.PySecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in *************** *** 190,200 **** sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle is None initially, then handle returned from last call thereafter ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.CtxtHandleType() err, attr, exp = win32security.AcceptSecurityContext(self.credentials, ctxtin, sec_buffer_in, self.scflags, --- 190,200 ---- sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle is None initially, then handle returned from last call thereafter ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.PyCtxtHandleType() err, attr, exp = win32security.AcceptSecurityContext(self.credentials, ctxtin, sec_buffer_in, self.scflags, |
From: Roger U. <ru...@us...> - 2006-02-13 14:42:45
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17839/win32/src Modified Files: win32security.i win32security_sspi.cpp Log Message: Use more consistent naming conventions for SSPI type objects Index: win32security_sspi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security_sspi.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32security_sspi.cpp 12 Feb 2006 09:35:06 -0000 1.5 --- win32security_sspi.cpp 13 Feb 2006 14:42:35 -0000 1.6 *************** *** 73,77 **** // @object PySecBufferDesc|Sequence-like object that contains a group of buffers to be used with SSPI functions. ! // @comm This object is created using win32security.SecBufferDescType(Version), where Version is an int that // defaults to SECBUFFER_VERSION if not passed in. struct PyMethodDef PySecBufferDesc::methods[] = { --- 73,77 ---- // @object PySecBufferDesc|Sequence-like object that contains a group of buffers to be used with SSPI functions. ! // @comm This object is created using win32security.PySecBufferDescType(Version), where Version is an int that // defaults to SECBUFFER_VERSION if not passed in. struct PyMethodDef PySecBufferDesc::methods[] = { *************** *** 292,296 **** // @object PySecBuffer|Python object wrapping a SecBuffer structure ! // Created using win32security.SecBufferType(type,size) where type is a SECBUFFER_* constant struct PyMethodDef PySecBuffer::methods[] = { {"Clear", PySecBuffer::Clear, 1}, // @pymeth Clear|Resets all members of the structure --- 292,296 ---- // @object PySecBuffer|Python object wrapping a SecBuffer structure ! // Created using win32security.PySecBufferType(type,size) where type is a SECBUFFER_* constant struct PyMethodDef PySecBuffer::methods[] = { {"Clear", PySecBuffer::Clear, 1}, // @pymeth Clear|Resets all members of the structure *************** *** 487,491 **** //////////////////////////////////////////////////////////////////////// // @object PyCtxtHandle|Security context handle, as used with sspi functions ! // @comm Create using win32security.CtxtHandleType(). The handle must be initialized by passing it to // <om win32security.InitializeSecurityContext> or <om win32security.AcceptSecurityContext> struct PyMethodDef PyCtxtHandle::methods[] = { --- 487,491 ---- //////////////////////////////////////////////////////////////////////// // @object PyCtxtHandle|Security context handle, as used with sspi functions ! // @comm Create using win32security.PyCtxtHandleType(). The handle must be initialized by passing it to // <om win32security.InitializeSecurityContext> or <om win32security.AcceptSecurityContext> struct PyMethodDef PyCtxtHandle::methods[] = { *************** *** 1051,1055 **** // @object PyCredHandle|Handle to a set of logon credentials, used with sspi authentication functions // @comm This object is usually created using <om win32security.AcquireCredentialsHandle>. ! // An uninitialized handle can also be created using win32security.CredHandleType() struct PyMethodDef PyCredHandle::methods[] = { {"Detach", PyCredHandle::Detach, 1}, // @pymeth Detach|Disassociates object from handle and returns integer value of handle (prevents automatic freeing of credentials when object is deallocated), --- 1051,1055 ---- // @object PyCredHandle|Handle to a set of logon credentials, used with sspi authentication functions // @comm This object is usually created using <om win32security.AcquireCredentialsHandle>. ! // An uninitialized handle can also be created using win32security.PyCredHandleType() struct PyMethodDef PyCredHandle::methods[] = { {"Detach", PyCredHandle::Detach, 1}, // @pymeth Detach|Disassociates object from handle and returns integer value of handle (prevents automatic freeing of credentials when object is deallocated), Index: win32security.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** win32security.i 12 Feb 2006 09:47:43 -0000 1.30 --- win32security.i 13 Feb 2006 14:42:35 -0000 1.31 *************** *** 671,679 **** pfnDsGetDcName=(DsGetDcNamefunc)loadapifunc("DsGetDcNameW", netapi32_dll); PyDict_SetItemString(d, "SecBufferType", (PyObject *)&PySecBufferType); PyDict_SetItemString(d, "SecBufferDescType", (PyObject *)&PySecBufferDescType); PyDict_SetItemString(d, "CtxtHandleType", (PyObject *)&PyCtxtHandleType); PyDict_SetItemString(d, "CredHandleType", (PyObject *)&PyCredHandleType); ! // Patch up any kwarg functions - SWIG doesn't like them. for (PyMethodDef *pmd = win32securityMethods;pmd->ml_name;pmd++) --- 671,685 ---- pfnDsGetDcName=(DsGetDcNamefunc)loadapifunc("DsGetDcNameW", netapi32_dll); + // old names, these should not be used PyDict_SetItemString(d, "SecBufferType", (PyObject *)&PySecBufferType); PyDict_SetItemString(d, "SecBufferDescType", (PyObject *)&PySecBufferDescType); PyDict_SetItemString(d, "CtxtHandleType", (PyObject *)&PyCtxtHandleType); PyDict_SetItemString(d, "CredHandleType", (PyObject *)&PyCredHandleType); ! // aliases with correct naming conventions ! PyDict_SetItemString(d, "PySecBufferType", (PyObject *)&PySecBufferType); ! PyDict_SetItemString(d, "PySecBufferDescType", (PyObject *)&PySecBufferDescType); ! PyDict_SetItemString(d, "PyCtxtHandleType", (PyObject *)&PyCtxtHandleType); ! PyDict_SetItemString(d, "PyCredHandleType", (PyObject *)&PyCredHandleType); ! // Patch up any kwarg functions - SWIG doesn't like them. for (PyMethodDef *pmd = win32securityMethods;pmd->ml_name;pmd++) |
From: Mark H. <mha...@us...> - 2006-02-13 12:20:53
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28869 Modified Files: AXControl.cpp PyIOleCommandTarget.cpp Log Message: Complete support for OLECMD in IOleCommandTarget, and add some relevant constants. Thanks to Leonard Ritter and Robert Förtsch for their example/test code for this. Index: PyIOleCommandTarget.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/PyIOleCommandTarget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIOleCommandTarget.cpp 3 Dec 2005 03:46:15 -0000 1.1 --- PyIOleCommandTarget.cpp 13 Feb 2006 12:20:40 -0000 1.2 *************** *** 5,8 **** --- 5,25 ---- #include "PyIOleCommandTarget.h" + static BOOL FillOLECMDsWithSequence(OLECMD *pCmds, UINT ncmds, PyObject *obCmds) + { + for (UINT i=0;i<ncmds;i++) { + OLECMD *pThis = pCmds + i; + PyObject *sub = PySequence_GetItem(obCmds, i); + if (!sub) + return FALSE; + if (!PyArg_ParseTuple(sub, "ii", &pThis->cmdID, &pThis->cmdf)) { + PyErr_Format(PyExc_TypeError, "Element %d of command buffer was not a tuple of 2 integers", i); + Py_DECREF(sub); + return FALSE; + } + Py_DECREF(sub); + } + return TRUE; + } + // @doc - This file contains autoduck documentation // --------------------------------------------------- *************** *** 51,55 **** int ncmds = PySequence_Length(obCmds); - int i; HRESULT hr; // From here, exit via 'goto done' --- 68,71 ---- *************** *** 67,82 **** goto done; } ! for (i=0;i<ncmds;i++) { ! OLECMD *pThis = pCmds + i; ! PyObject *sub = PySequence_GetItem(obCmds, i); ! if (!sub) ! goto done; ! if (!PyArg_ParseTuple(sub, "ii", &pThis->cmdID, &pThis->cmdf)) { ! PyErr_Format(PyExc_TypeError, "Element %d of command buffer was not a tuple of 2 integers", i); ! Py_DECREF(sub); ! goto done; ! } ! Py_DECREF(sub); ! } { // scope to prevent goto warning. PY_INTERFACE_PRECALL; --- 83,88 ---- goto done; } ! if (!FillOLECMDsWithSequence(pCmds, ncmds, obCmds)) ! goto done; { // scope to prevent goto warning. PY_INTERFACE_PRECALL; *************** *** 183,191 **** Py_BuildValue("ll", prgCmds[i].cmdID, prgCmds[i].cmdf)); } ! PyObject *obTest = Py_None; // tbd PyObject *result; ! HRESULT hr=InvokeViaPolicy("QueryStatus", &result, "NNO", obGUID, cmds, obTest); if (FAILED(hr)) return hr; Py_DECREF(result); return hr; } --- 189,239 ---- Py_BuildValue("ll", prgCmds[i].cmdID, prgCmds[i].cmdf)); } ! PyObject *obText; ! if (!pCmdText) { ! obText = Py_None; ! Py_INCREF(Py_None); ! } else ! obText = PyInt_FromLong(pCmdText->cmdtextf); PyObject *result; ! HRESULT hr=InvokeViaPolicy("QueryStatus", &result, "NNN", obGUID, cmds, obText); if (FAILED(hr)) return hr; + + BOOL ok = PyArg_ParseTuple(result, "OO", &cmds, &obText); + if (ok) { + if (pCmdText == NULL) { + if (obText != Py_None) { + PyErr_SetString(PyExc_ValueError, + "String value returned but caller didn't request it (check the 3rd param!)"); + ok = FALSE; + } + } else { + PyWin_AutoFreeBstr tempString; + ok = PyWinObject_AsAutoFreeBstr(obText, &tempString); + if (ok) { + UINT strLen = SysStringLen(tempString); + UINT nwrite = min(strLen, pCmdText->cwBuf); + wcsncpy(pCmdText->rgwz, (WCHAR *)(BSTR)tempString, + nwrite); + pCmdText->cwActual = nwrite; + } + } + } + if (ok) { + if (!PySequence_Check(cmds)) { + PyErr_SetString(PyExc_TypeError, "OLECMD objects must be a sequence"); + ok = FALSE; + } + if (ok && (UINT)PySequence_Length(cmds) != cCmds) { + PyErr_Format(PyExc_ValueError, "Sequence must have %d items (got %d)", + cCmds, PySequence_Length(cmds)); + ok = FALSE; + + } + if (ok) + ok = FillOLECMDsWithSequence(prgCmds, cCmds, cmds); + } Py_DECREF(result); + if (!ok) + hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("QueryStatus"); return hr; } *************** *** 210,214 **** HRESULT hr=InvokeViaPolicy("Exec", &result, "NllN", obGUID, nCmdID, nCmdexecopt, obpvaIn); if (FAILED(hr)) return hr; ! hr = PyCom_VariantFromPyObject(result, pvaOut); Py_DECREF(result); return hr; --- 258,262 ---- HRESULT hr=InvokeViaPolicy("Exec", &result, "NllN", obGUID, nCmdID, nCmdexecopt, obpvaIn); if (FAILED(hr)) return hr; ! hr = pvaOut ? PyCom_VariantFromPyObject(result, pvaOut) : S_OK; Py_DECREF(result); return hr; Index: AXControl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/AXControl.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AXControl.cpp 3 Dec 2005 03:46:15 -0000 1.5 --- AXControl.cpp 13 Feb 2006 12:20:40 -0000 1.6 *************** *** 352,355 **** ADD_CONSTANT(OLECLOSE_SAVEIFDIRTY); // @const axcontrol|OLECLOSE_SAVEIFDIRTY|The object should be saved if it is dirty. ADD_CONSTANT(OLECLOSE_NOSAVE); // @const axcontrol|OLECLOSE_NOSAVE|The object should not be saved, even if it is dirty. This flag is typically used when an object is being deleted. ! ADD_CONSTANT(OLECLOSE_PROMPTSAVE); // @const axcontrol|OLECLOSE_PROMPTSAVE|If the object is dirty, the <om PyIOleObject.Close> implementation should display a dialog box to let the end user determine whether to save the object. However, if the object is in the running state but its user interface is invisible, the end user should not be prompted, and the close should be handled as if OLECLOSE_SAVEIFDIRTY had been specified. } --- 352,365 ---- ADD_CONSTANT(OLECLOSE_SAVEIFDIRTY); // @const axcontrol|OLECLOSE_SAVEIFDIRTY|The object should be saved if it is dirty. ADD_CONSTANT(OLECLOSE_NOSAVE); // @const axcontrol|OLECLOSE_NOSAVE|The object should not be saved, even if it is dirty. This flag is typically used when an object is being deleted. ! ADD_CONSTANT(OLECLOSE_PROMPTSAVE); // @const axcontrol|OLECLOSE_PROMPTSAVE|If the object is dirty, the <om PyIOleObject.Close> implementation should display a dialog box to let the end user determine whether to save the object. However, if the object is in the running state but its user interface is invisible, the end user should not be prompted, and the close should be handled as if OLECLOSE_SAVEIFDIRTY had been specified. ! ! ADD_CONSTANT(OLECMDTEXTF_NONE); // @const axcontrol|OLECMDTEXTF_NONE| ! ADD_CONSTANT(OLECMDTEXTF_NAME); // @const axcontrol|OLECMDTEXTF_NAME| ! ADD_CONSTANT(OLECMDTEXTF_STATUS); // @const axcontrol|OLECMDTEXTF_STATUS| ! ! ADD_CONSTANT(OLECMDF_SUPPORTED); // @const axcontrol|OLECMDF_SUPPORTED| ! ADD_CONSTANT(OLECMDF_ENABLED); // @const axcontrol|OLECMDF_ENABLED| ! ADD_CONSTANT(OLECMDF_LATCHED); // @const axcontrol|OLECMDF_LATCHED| ! ADD_CONSTANT(OLECMDF_NINCHED); // @const axcontrol|OLECMDF_NINCHED| ! } |
From: Mark H. <mha...@us...> - 2006-02-13 01:24:00
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16297/win32com/src Modified Files: oleargs.cpp univgw_dataconv.cpp Log Message: Fix some errors when attempting to use integer values > sys.maxint - both when the VT is unknown, and when the VT is explicitly VT_UI4. Also catch int conversion errors in the universal gateway. Index: univgw_dataconv.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/univgw_dataconv.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** univgw_dataconv.cpp 27 Jun 2005 11:02:41 -0000 1.9 --- univgw_dataconv.cpp 13 Feb 2006 01:23:48 -0000 1.10 *************** *** 392,395 **** --- 392,397 ---- } *pi = PyInt_AsLong(obUse); + if (*pi == (UINT)-1 && PyErr_Occurred()) + goto Error; break; } *************** *** 397,406 **** { UINT *pui = *(UINT **)pbArg; ! obUse = PyNumber_Int(obOutValue); ! if (obUse == NULL) ! { ! goto Error; } ! *pui = (UINT)PyInt_AsLong(obUse); break; } --- 399,419 ---- { UINT *pui = *(UINT **)pbArg; ! // special care here as we could be > sys.maxint, ! // in which case we must work with longs. ! // Avoiding PyInt_AsUnsignedLongMask as it doesn't ! // exist in 2.2. ! if (PyLong_Check(obOutValue)) { ! *pui = PyLong_AsUnsignedLong(obOutValue); ! } else { ! // just do the generic "number" thing. ! obUse = PyNumber_Int(obOutValue); ! if (obUse == NULL) ! { ! goto Error; ! } ! *pui = (UINT)PyInt_AsLong(obUse); } ! if (*pui == (UINT)-1 && PyErr_Occurred()) ! goto Error; break; } *************** *** 414,417 **** --- 427,432 ---- } *ps = (short)PyInt_AsLong(obUse); + if (*ps == (UINT)-1 && PyErr_Occurred()) + goto Error; break; } *************** *** 425,428 **** --- 440,445 ---- } *pus = (unsigned short)PyInt_AsLong(obUse); + if (*pus == (UINT)-1 && PyErr_Occurred()) + goto Error; break; } *************** *** 436,439 **** --- 453,458 ---- } *pb = (signed char)PyInt_AsLong(obUse); + if (*pb == (UINT)-1 && PyErr_Occurred()) + goto Error; break; } *************** *** 462,465 **** --- 481,486 ---- } *pb = (BYTE)PyInt_AsLong(obUse); + if (*pb == (UINT)-1 && PyErr_Occurred()) + goto Error; } break; *************** *** 474,477 **** --- 495,500 ---- } *pbool = PyInt_AsLong(obUse) ? VARIANT_TRUE : VARIANT_FALSE; + if (*pbool == (UINT)-1 && PyErr_Occurred()) + goto Error; break; } Index: oleargs.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** oleargs.cpp 5 Feb 2006 07:27:43 -0000 1.33 --- oleargs.cpp 13 Feb 2006 01:23:48 -0000 1.34 *************** *** 72,77 **** if ((double)dwval == dval) { ! V_VT(var) = VT_I4; ! V_I4(var) = dwval; isDword = TRUE; } --- 72,77 ---- if ((double)dwval == dval) { ! V_VT(var) = VT_UI4; ! V_UI4(var) = dwval; isDword = TRUE; } *************** *** 259,263 **** break; } ! result = PyInt_FromLong(V_UI4(&varValue)); break; --- 259,268 ---- break; } ! // The result may be too large for a simple "long". If so, ! // we must return a long. ! if (V_UI4(&varValue) <= LONG_MAX) ! result = PyInt_FromLong(V_UI4(&varValue)); ! else ! result = PyLong_FromUnsignedLong(V_UI4(&varValue)); break; |
From: Mark H. <mha...@us...> - 2006-02-13 01:23:59
|
Update of /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16297/TestSources/PyCOMTest Modified Files: PyCOMImpl.cpp PyCOMImpl.h PyCOMTest.idl Log Message: Fix some errors when attempting to use integer values > sys.maxint - both when the VT is unknown, and when the VT is explicitly VT_UI4. Also catch int conversion errors in the universal gateway. Index: PyCOMTest.idl =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMTest.idl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyCOMTest.idl 27 Jun 2005 11:02:41 -0000 1.11 --- PyCOMTest.idl 13 Feb 2006 01:23:49 -0000 1.12 *************** *** 220,223 **** --- 220,225 ---- [propget] HRESULT LongProp([out, retval] long* retval); [propput] HRESULT LongProp([in] long val); + [propget] HRESULT ULongProp([out, retval] unsigned long* retval); + [propput] HRESULT ULongProp([in] unsigned long val); [propget] HRESULT IntProp([out, retval] int* retval); [propput] HRESULT IntProp([in] int val); Index: PyCOMImpl.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMImpl.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyCOMImpl.h 27 Jun 2005 11:02:41 -0000 1.10 --- PyCOMImpl.h 13 Feb 2006 01:23:49 -0000 1.11 *************** *** 95,98 **** --- 95,100 ---- STDMETHOD(get_LongProp)(long *ret); STDMETHOD(put_LongProp)(long val); + STDMETHOD(get_ULongProp)(unsigned long *ret); + STDMETHOD(put_ULongProp)(unsigned long val); STDMETHOD(get_IntProp)(int *ret); STDMETHOD(put_IntProp)(int val); *************** *** 116,119 **** --- 118,122 ---- SAFEARRAY *pLastArray; long m_long; + unsigned long m_ulong; CY m_cy; }; Index: PyCOMImpl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMImpl.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyCOMImpl.cpp 27 Jun 2005 11:02:40 -0000 1.11 --- PyCOMImpl.cpp 13 Feb 2006 01:23:49 -0000 1.12 *************** *** 506,509 **** --- 506,518 ---- CHECK_HR(tester->get_LongProp(&lresult)); CHECK_TRUE(lresult==4); + CHECK_HR(tester->put_LongProp(-4)); + CHECK_HR(tester->get_LongProp(&lresult)); + CHECK_TRUE(lresult==-4); + unsigned long ulresult; + CHECK_HR(tester->put_ULongProp(0x80000001)); + CHECK_HR(tester->get_ULongProp(&ulresult)); + CHECK_TRUE(ulresult==0x80000001); + + CHECK_HR(tester->put_IntProp(4)); CHECK_HR(tester->get_IntProp(&result)); CHECK_TRUE(result==4); *************** *** 600,603 **** --- 609,626 ---- } + HRESULT CPyCOMTest::put_ULongProp(unsigned long val) + { + m_ulong = val; + return S_OK; + } + + HRESULT CPyCOMTest::get_ULongProp(unsigned long *ret) + { + if (!ret) + return E_POINTER; + *ret = m_ulong; + return S_OK; + } + HRESULT CPyCOMTest::put_IntProp(int val) { |
From: Mark H. <mha...@us...> - 2006-02-13 01:23:58
|
Update of /cvsroot/pywin32/pywin32/com/win32com/servers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16297/win32com/servers Modified Files: test_pycomtest.py Log Message: Fix some errors when attempting to use integer values > sys.maxint - both when the VT is unknown, and when the VT is explicitly VT_UI4. Also catch int conversion errors in the universal gateway. Index: test_pycomtest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/test_pycomtest.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_pycomtest.py 27 Jun 2005 11:02:41 -0000 1.10 --- test_pycomtest.py 13 Feb 2006 01:23:48 -0000 1.11 *************** *** 128,134 **** def LongProp(self): ! return self.intval def SetLongProp(self, val): ! self.intval = val def IntProp(self): return self.intval --- 128,138 ---- def LongProp(self): ! return self.longval def SetLongProp(self, val): ! self.longval = val ! def ULongProp(self): ! return self.ulongval ! def SetULongProp(self, val): ! self.ulongval = val def IntProp(self): return self.intval |
From: Mark H. <mha...@us...> - 2006-02-13 01:23:57
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16297/win32com/test Modified Files: testPyComTest.py Log Message: Fix some errors when attempting to use integer values > sys.maxint - both when the VT is unknown, and when the VT is explicitly VT_UI4. Also catch int conversion errors in the universal gateway. Index: testPyComTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** testPyComTest.py 27 Jun 2005 11:02:42 -0000 1.22 --- testPyComTest.py 13 Feb 2006 01:23:48 -0000 1.23 *************** *** 113,116 **** --- 113,126 ---- if o.LongProp != 3 or o.IntProp != 3: raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + o.LongProp = o.IntProp = -3 + if o.LongProp != -3 or o.IntProp != -3: + raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + # This number fits in an unsigned long. Attempting to set it to a normal + # long will involve overflow, which is to be expected. But we do + # expect it to work in a property explicitly a VT_UI4. + check = 3 *10 **9 + o.ULongProp = check + if o.ULongProp != check: + raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check) # currency. pythoncom.__future_currency__ = 1 *************** *** 229,232 **** --- 239,251 ---- raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + o.LongProp = o.IntProp = -3 + if o.LongProp != -3 or o.IntProp != -3: + raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + + check = 3 *10 **9 + o.ULongProp = check + if o.ULongProp != check: + raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check) + # currency. pythoncom.__future_currency__ = 1 |
From: Mark H. <mha...@us...> - 2006-02-13 01:22:16
|
Update of /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16003 Modified Files: SimpleCounter.h DSCArrayTest.cpp Log Message: For some bizarre reason the compile failed with reference to ::InlineIsEqualGUID() - just use normal '=='! Index: DSCArrayTest.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/DSCArrayTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DSCArrayTest.cpp 25 Apr 2004 04:10:48 -0000 1.1 --- DSCArrayTest.cpp 13 Feb 2006 01:21:55 -0000 1.2 *************** *** 29,33 **** for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++) { ! if (::InlineIsEqualGUID(*arr[i],riid)) return S_OK; } --- 29,33 ---- for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++) { ! if (*arr[i] == riid) return S_OK; } Index: SimpleCounter.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/SimpleCounter.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleCounter.h 25 Apr 2004 04:10:48 -0000 1.3 --- SimpleCounter.h 13 Feb 2006 01:21:55 -0000 1.4 *************** *** 35,39 **** STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) { ! return (::InlineIsEqualGUID(IID_ISimpleCounter,riid)) ? S_OK : S_FALSE; --- 35,39 ---- STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) { ! return (IID_ISimpleCounter == riid) ? S_OK : S_FALSE; |
From: Mark H. <mha...@us...> - 2006-02-13 01:17:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14139/win32com/src Modified Files: PyIDispatch.cpp Log Message: Replace trivial OleSetTypeError with PyErr_Format. Index: PyIDispatch.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIDispatch.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyIDispatch.cpp 10 Jan 2006 00:49:43 -0000 1.10 --- PyIDispatch.cpp 13 Feb 2006 01:17:01 -0000 1.11 *************** *** 5,15 **** #include "PythonCOM.h" - // A little helper just for this file - static PyObject* OleSetTypeError(char *msg) - { - PyErr_SetString(PyExc_TypeError, msg); - return NULL; - } - static BOOL HandledDispatchFailure(HRESULT hr, EXCEPINFO *einfo, UINT nArgErr, UINT cArgs) { --- 5,8 ---- *************** *** 67,71 **** return NULL; if ( argc < 1 ) ! return OleSetTypeError("At least one argument must be supplied"); LCID lcid = LOCALE_SYSTEM_DEFAULT; --- 60,64 ---- return NULL; if ( argc < 1 ) ! return PyErr_Format(PyExc_TypeError, "At least one argument must be supplied"); LCID lcid = LOCALE_SYSTEM_DEFAULT; *************** *** 171,175 **** { if ( !PyErr_Occurred() ) ! OleSetTypeError("Bad argument"); while ( i-- > 0 ) VariantClear(&pParm->rgvarg[i]); --- 164,168 ---- { if ( !PyErr_Occurred() ) ! PyErr_Format(PyExc_TypeError, "Bad argument"); while ( i-- > 0 ) VariantClear(&pParm->rgvarg[i]); *************** *** 215,219 **** return NULL; if ( argc < 4 ) ! return OleSetTypeError("not enough arguments (at least 4 needed)"); // @pyparm int|dispid||The dispid to use. Typically this value will come from <om PyIDispatch.GetIDsOfNames> or from a type library. --- 208,212 ---- return NULL; if ( argc < 4 ) ! return PyErr_Format(PyExc_TypeError, "not enough arguments (at least 4 needed)"); // @pyparm int|dispid||The dispid to use. Typically this value will come from <om PyIDispatch.GetIDsOfNames> or from a type library. *************** *** 289,293 **** return NULL; if ( argc < 5 ) ! return OleSetTypeError("not enough arguments (at least 5 needed)"); // @pyparm int|dispid||The dispid to use. Please see <om PyIDispatch.Invoke>. --- 282,286 ---- return NULL; if ( argc < 5 ) ! return PyErr_Format(PyExc_TypeError, "not enough arguments (at least 5 needed)"); // @pyparm int|dispid||The dispid to use. Please see <om PyIDispatch.Invoke>. *************** *** 310,314 **** int argTypesLen = PyObject_Length(argsElemDescArray); if (!PyTuple_Check(argsElemDescArray) || argTypesLen<argc-5) ! return OleSetTypeError("The array of argument types must be a tuple whose size is <= to the number of arguments."); // See how many _real_ entries - count until end or // first param marked as Missing. --- 303,307 ---- int argTypesLen = PyObject_Length(argsElemDescArray); if (!PyTuple_Check(argsElemDescArray) || argTypesLen<argc-5) ! return PyErr_Format(PyExc_TypeError, "The array of argument types must be a tuple whose size is <= to the number of arguments."); // See how many _real_ entries - count until end or // first param marked as Missing. |
From: Mark H. <mha...@us...> - 2006-02-13 01:14:42
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13377 Modified Files: dllmain.cpp Log Message: Prevent a situation where we would try to re-init Python as it was tearing down! Index: dllmain.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/dllmain.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dllmain.cpp 11 Nov 2005 02:37:38 -0000 1.12 --- dllmain.cpp 13 Feb 2006 01:14:33 -0000 1.13 *************** *** 39,42 **** --- 39,44 ---- } + static BOOL hasInitialized = FALSE; + void PyCom_DLLAddRef(void) { *************** *** 45,48 **** --- 47,62 ---- LONG cnt = InterlockedIncrement(&g_cLockCount); if (cnt==1) { // First call + // There is a situation where this code falls down. An IClassFactory destructor + // imcrements the DLL ref count, to make up for the decrement done by PyIUnknown + // (as we don't want class factories in the count). This works fine until the last + // reference is that IClassFactory - the g_cLockCount was zero, so transitions + // temporarily to 1 - leading us to this sad situation where we try and re-init + // Python as we tear down. + if (hasInitialized) { + return; + } + hasInitialized = TRUE; // must be set even if we didn't actually Py_Init. + + // the last COM object if (!Py_IsInitialized()) { Py_Initialize(); |
From: Roger U. <ru...@us...> - 2006-02-12 14:10:13
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11945/win32/Lib Modified Files: sspicon.py Log Message: Add SEC_E_OK Index: sspicon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspicon.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sspicon.py 2 Dec 2005 07:52:53 -0000 1.3 --- sspicon.py 12 Feb 2006 14:10:02 -0000 1.4 *************** *** 477,479 **** MsV1_0SetProcessOption = 12 ! --- 477,479 ---- MsV1_0SetProcessOption = 12 ! SEC_E_OK = 0 |