pywin32-checkins Mailing List for Python for Windows Extensions (Page 46)
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-12-04 00:06:07
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12034/win32/src Modified Files: Tag: py3k odbc.cpp Log Message: Merge SQLLEN and other improvements from the trunk. Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.20.2.10 retrieving revision 1.20.2.11 diff -C2 -d -r1.20.2.10 -r1.20.2.11 *** odbc.cpp 11 Oct 2008 03:04:22 -0000 1.20.2.10 --- odbc.cpp 4 Dec 2008 00:06:02 -0000 1.20.2.11 *************** *** 64,73 **** } ! typedef PyObject * (* CopyFcn)(const void *, int); typedef struct _out { struct _out *next; ! long rcode; void *bind_area; CopyFcn copy_fcn; --- 64,73 ---- } ! typedef PyObject * (* CopyFcn)(const void *, SQLLEN); typedef struct _out { struct _out *next; ! SQLLEN rcode; void *bind_area; CopyFcn copy_fcn; *************** *** 75,79 **** short vtype; int pos; ! long vsize; } OutputBinding; --- 75,79 ---- short vtype; int pos; ! SQLLEN vsize; } OutputBinding; *************** *** 98,102 **** PyObject *cursorError; int n_columns; - bool bGetDataIsNeeded; } cursorObject; --- 98,101 ---- *************** *** 437,441 **** cur->max_width = 65536L; cur->my_conx = 0; - cur->bGetDataIsNeeded = false; cur->hstmt=NULL; cur->cursorError=odbcError; --- 436,439 ---- *************** *** 545,554 **** } ! static void bindOutputVar ( cursorObject *cur, CopyFcn fcn, short vtype, ! long vsize, int pos, bool bUseGet --- 543,552 ---- } ! static BOOL bindOutputVar ( cursorObject *cur, CopyFcn fcn, short vtype, ! SQLLEN vsize, int pos, bool bUseGet *************** *** 556,559 **** --- 554,561 ---- { OutputBinding *ob = (OutputBinding *) malloc(sizeof(OutputBinding)); + if (ob==NULL){ + PyErr_NoMemory(); + return FALSE; + } OutputBinding *current = NULL; *************** *** 584,587 **** --- 586,593 ---- ob->copy_fcn = fcn; ob->bind_area = malloc(vsize); + if (ob->bind_area == NULL){ + PyErr_NoMemory(); + return FALSE; + } ob->rcode = vsize; if (ob->bGetData == false) *************** *** 593,619 **** ob->bind_area, vsize, ! (SQLLEN *)&ob->rcode))) { cursorError(cur, _T("BIND")); } } } ! static PyObject *wcharCopy(const void *v, int sz) { return PyWinObject_FromWCHAR((WCHAR *)v, sz/sizeof(WCHAR)); } ! static PyObject *stringCopy(const void *v, int sz) { return PyString_FromStringAndSize((char *)v, sz); } ! static PyObject *longCopy(const void *v, int sz) { return PyInt_FromLong(*(unsigned long *)v); } ! static PyObject *doubleCopy(const void *v, int sz) { double d = *(double *)v; --- 599,627 ---- ob->bind_area, vsize, ! &ob->rcode))) { cursorError(cur, _T("BIND")); + return FALSE; } } + return TRUE; } ! static PyObject *wcharCopy(const void *v, SQLLEN sz) { return PyWinObject_FromWCHAR((WCHAR *)v, sz/sizeof(WCHAR)); } ! static PyObject *stringCopy(const void *v, SQLLEN sz) { return PyString_FromStringAndSize((char *)v, sz); } ! static PyObject *longCopy(const void *v, SQLLEN sz) { return PyInt_FromLong(*(unsigned long *)v); } ! static PyObject *doubleCopy(const void *v, SQLLEN sz) { double d = *(double *)v; *************** *** 622,626 **** } ! static PyObject *dateCopy(const void *v, int sz) { const TIMESTAMP_STRUCT *dt = (const TIMESTAMP_STRUCT *) v; --- 630,634 ---- } ! static PyObject *dateCopy(const void *v, SQLLEN sz) { const TIMESTAMP_STRUCT *dt = (const TIMESTAMP_STRUCT *) v; *************** *** 632,636 **** } ! static PyObject *rawCopy(const void *v, int sz) { PyObject *ret = PyBuffer_New(sz); --- 640,644 ---- } ! static PyObject *rawCopy(const void *v, SQLLEN sz) { PyObject *ret = PyBuffer_New(sz); *************** *** 838,862 **** } - // Class to hold a temporary reference that decrements itself - class TmpPyObject - { - public: - PyObject *tmp; - TmpPyObject() { tmp=NULL; } - TmpPyObject(PyObject *ob) { tmp=ob; } - PyObject * operator= (PyObject *ob){ - Py_XDECREF(tmp); - tmp=ob; - return tmp; - } - - boolean operator== (PyObject *ob) { return tmp==ob; } - operator PyObject *() { return tmp; } - ~TmpPyObject() { Py_XDECREF(tmp); } - }; - static int ibindDate(cursorObject*cur, int column, PyObject *item) { ! int len = sizeof(TIMESTAMP_STRUCT); InputBinding *ib = initInputBinding(cur, len); if (!ib) --- 846,864 ---- } static int ibindDate(cursorObject*cur, int column, PyObject *item) { ! /* Sql server apparently determines the precision and type of date based ! on length of input, according to the character size required for column ! storage. This is completely bogus when passing a TIMESTAMP_STRUCT, whose ! length is always 16. This apparently causes Sql Server to treat it as a ! SMALLDATETIME, and truncates seconds as well as fraction of second, and ! also limits the range of acceptable dates. ! Tell it we have enough room for 3 decimals, since this is all that ! SYSTEMTIME affords, and all that Sql Server 2005 will accept. ! Sql Server 2008 has a datetime2 with up to 7 decimals. ! Might need to use SqlDescribeCol to get length and precision to support this. ! */ ! SQLLEN len = 23; // length of character storage for yyyy-mm-dd hh:mm:ss.ddd ! assert(len >= sizeof(TIMESTAMP_STRUCT)); InputBinding *ib = initInputBinding(cur, len); if (!ib) *************** *** 919,923 **** SQL_TIMESTAMP, len, ! 9, // Decimal digits of precision, appears to be ignored for datetime ib->bind_area, len, --- 921,925 ---- SQL_TIMESTAMP, len, ! 3, // Decimal digits of precision, appears to be ignored for datetime ib->bind_area, len, *************** *** 1006,1010 **** strcpy(ib->bind_area, val); int sqlType = SQL_VARCHAR; /* SQL_CHAR can cause padding in some drivers.. */ ! if (len > 255) { ib->sqlBytesAvailable = SQL_LEN_DATA_AT_EXEC(ib->len); --- 1008,1012 ---- strcpy(ib->bind_area, val); int sqlType = SQL_VARCHAR; /* SQL_CHAR can cause padding in some drivers.. */ ! if (len > 255) /* should remove hardcoded value and actually implement setinputsize method */ { ib->sqlBytesAvailable = SQL_LEN_DATA_AT_EXEC(ib->len); *************** *** 1215,1219 **** ! static int bindOutput(cursorObject *cur) { short vtype; --- 1217,1221 ---- ! static BOOL bindOutput(cursorObject *cur) { short vtype; *************** *** 1226,1230 **** for (pos = 1; pos <= cur->n_columns; pos++) { - PyObject *new_tuple; PyObject *typeOf; long dsize; --- 1228,1231 ---- *************** *** 1252,1256 **** case SQL_INTEGER: case SQL_TINYINT: ! bindOutputVar( cur, longCopy, --- 1253,1257 ---- case SQL_INTEGER: case SQL_TINYINT: ! if (!bindOutputVar( cur, longCopy, *************** *** 1258,1262 **** sizeof(unsigned long), pos, ! false); typeOf = DbiNumber; break; --- 1259,1264 ---- sizeof(unsigned long), pos, ! false)) ! return FALSE; typeOf = DbiNumber; break; *************** *** 1267,1271 **** case SQL_REAL: case SQL_BIGINT: ! bindOutputVar( cur, doubleCopy, --- 1269,1273 ---- case SQL_REAL: case SQL_BIGINT: ! if (!bindOutputVar( cur, doubleCopy, *************** *** 1273,1277 **** sizeof(double), pos, ! false); typeOf = DbiNumber; prec = vsize; --- 1275,1280 ---- sizeof(double), pos, ! false)) ! return FALSE; typeOf = DbiNumber; prec = vsize; *************** *** 1279,1283 **** case SQL_DATE: case SQL_TIMESTAMP: ! bindOutputVar( cur, dateCopy, --- 1282,1286 ---- case SQL_DATE: case SQL_TIMESTAMP: ! if (!bindOutputVar( cur, dateCopy, *************** *** 1285,1294 **** vsize, pos, ! false); typeOf = DbiDate; break; case SQL_LONGVARBINARY: ! cur->bGetDataIsNeeded = true; ! bindOutputVar( cur, rawCopy, --- 1288,1297 ---- vsize, pos, ! false)) ! return FALSE; typeOf = DbiDate; break; case SQL_LONGVARBINARY: ! if (!bindOutputVar( cur, rawCopy, *************** *** 1296,1348 **** cur->max_width, pos, ! true); typeOf = DbiRaw; break; case SQL_BINARY: case SQL_VARBINARY: ! bindOutputVar( ! cur, ! rawCopy, ! SQL_C_BINARY, ! cur->max_width, ! pos, ! false); typeOf = DbiRaw; break; case SQL_VARCHAR: case SQL_WVARCHAR: ! bindOutputVar(cur, wcharCopy, SQL_C_WCHAR, (vsize+1)*sizeof(WCHAR), pos, false); typeOf = DbiString; break; case SQL_LONGVARCHAR: case SQL_WLONGVARCHAR: ! bindOutputVar(cur, wcharCopy, SQL_C_WCHAR, cur->max_width, pos, true); typeOf = DbiString; break; default: ! bindOutputVar(cur, stringCopy, SQL_C_CHAR, vsize+1, pos, false); typeOf = DbiString; break; } ! if (PyErr_Occurred()) ! { ! return 0; ! } ! new_tuple = Py_BuildValue( "(NOiiiii)", PyWinObject_FromTCHAR(name), typeOf, dsize, (int)vsize, prec, scale, nullok); ! if (!new_tuple) ! { ! return 0; ! } ! ! PyList_Append(cur->description, new_tuple); ! Py_DECREF(new_tuple); } /* success */ ! return 1; } --- 1299,1343 ---- cur->max_width, pos, ! true)) ! return FALSE; typeOf = DbiRaw; break; case SQL_BINARY: case SQL_VARBINARY: ! if (!bindOutputVar(cur, rawCopy, SQL_C_BINARY, cur->max_width, pos, false)) ! return FALSE; typeOf = DbiRaw; break; case SQL_VARCHAR: case SQL_WVARCHAR: ! if (!bindOutputVar(cur, wcharCopy, SQL_C_WCHAR, (vsize+1)*sizeof(WCHAR), pos, false)) ! return FALSE; typeOf = DbiString; break; case SQL_LONGVARCHAR: case SQL_WLONGVARCHAR: ! if (!bindOutputVar(cur, wcharCopy, SQL_C_WCHAR, cur->max_width, pos, true)) ! return FALSE; typeOf = DbiString; break; default: ! if (!bindOutputVar(cur, stringCopy, SQL_C_CHAR, vsize+1, pos, false)) ! return FALSE; typeOf = DbiString; break; } ! ! TmpPyObject new_tuple = Py_BuildValue( "(NOiiiii)", PyWinObject_FromTCHAR(name), typeOf, dsize, (int)vsize, prec, scale, nullok); ! if ((new_tuple == NULL) ! || PyList_Append(cur->description, new_tuple) == -1) ! return FALSE; } /* success */ ! return TRUE; } *************** *** 1412,1416 **** { cursorObject *cur = cursor(self); - PyObject *temp = NULL; TCHAR *sql=NULL; PyObject *obsql; --- 1407,1410 ---- *************** *** 1430,1457 **** /* @pyparm string|sql||The SQL to execute */ /* @pyparm sequence|[var, ...]|[]|Input variables. */ ! if (!PyArg_ParseTuple(args, "O|O", &obsql, &inputvars)) { return NULL; } - if (!PyWinObject_AsTCHAR(obsql, &sql, FALSE)) - return NULL; ! if (inputvars && !PySequence_Check(inputvars)) ! { ! PyWinObject_FreeTCHAR(sql); ! PyErr_SetString(odbcError, "expected sequence as second parameter"); ! return NULL; ! } ! else if (inputvars && PySequence_Length(inputvars) > 0) ! { ! temp = PySequence_GetItem(inputvars, 0); ! /* Strings don't count as a list in this case. */ ! if (PySequence_Check(temp) && !PyString_Check(temp) && !PyUnicode_Check(temp)) ! { ! rows = inputvars; ! inputvars = NULL; } ! Py_DECREF(temp); ! } deleteBinding(cur); --- 1424,1453 ---- /* @pyparm string|sql||The SQL to execute */ /* @pyparm sequence|[var, ...]|[]|Input variables. */ ! /* If the first element is itself a sequence (other than a string) ! the input will be interpreted as a sequence of sequences to be ! used to execute the statement multiple times. ! */ ! if (!PyArg_ParseTuple(args, "O|O:execute", &obsql, &inputvars)) { return NULL; } ! if (inputvars){ ! if (PyString_Check(inputvars) || PyUnicode_Check(inputvars) || !PySequence_Check(inputvars)) ! return PyErr_Format(odbcError, "Values must be a sequence, not %s", inputvars->ob_type->tp_name); ! if (PySequence_Length(inputvars) > 0){ ! PyObject *temp = PySequence_GetItem(inputvars, 0); ! if (temp==NULL) ! return NULL; ! /* Strings don't count as a list in this case. */ ! if (PySequence_Check(temp) && !PyString_Check(temp) && !PyUnicode_Check(temp)){ ! rows = inputvars; ! inputvars = NULL; ! } ! Py_DECREF(temp); ! } } ! if (!PyWinObject_AsTCHAR(obsql, &sql, FALSE)) ! return NULL; deleteBinding(cur); *************** *** 1595,1601 **** while (ob) { ! long cbRequired; RETCODE rc; ! long cbRead = 0; /* Use SQLGetData to retrieve data for blob (or long varchar) type columns. */ if (ob->bGetData) --- 1591,1597 ---- while (ob) { ! SQLLEN cbRequired; RETCODE rc; ! SQLLEN cbRead = 0; /* Use SQLGetData to retrieve data for blob (or long varchar) type columns. */ if (ob->bGetData) *************** *** 1617,1634 **** if (cbRequired > ob->vsize) { ! void *pTemp; /* Some BLOBs can be huge, be paranoid about allowing other threads to run. */ Py_BEGIN_ALLOW_THREADS ! pTemp = malloc (cbRequired); ! memcpy(pTemp, ob->bind_area, ob->vsize); ! free (ob->bind_area); Py_END_ALLOW_THREADS ! ob->bind_area = pTemp; ob->vsize = cbRequired; } /* rc = GetData( ... , bind_area + offset, vsize - offset, &rcode ) */ - SQLLEN rcode; Py_BEGIN_ALLOW_THREADS rc = SQLGetData(cur->hstmt, --- 1613,1632 ---- if (cbRequired > ob->vsize) { ! void *pTemp = ob->bind_area; /* Some BLOBs can be huge, be paranoid about allowing other threads to run. */ Py_BEGIN_ALLOW_THREADS ! ob->bind_area = realloc (ob->bind_area, cbRequired); Py_END_ALLOW_THREADS ! if (ob->bind_area == NULL){ ! PyErr_NoMemory(); ! ob->bind_area = pTemp; ! Py_DECREF(row); ! return NULL; ! } ob->vsize = cbRequired; } /* rc = GetData( ... , bind_area + offset, vsize - offset, &rcode ) */ Py_BEGIN_ALLOW_THREADS rc = SQLGetData(cur->hstmt, *************** *** 1637,1676 **** (char *)ob->bind_area + cbRead, ob->vsize - cbRead, ! &rcode); ! ob->rcode = PyWin_SAFE_DOWNCAST(rcode, SQLLEN, long); Py_END_ALLOW_THREADS if (unsuccessful(rc)) { Py_DECREF(row); ! cursorError(cur, _T("FETCH")); return NULL; } ! ! if ((ob->rcode != SQL_NO_TOTAL) && (ob->rcode <= ob->vsize - cbRead)) { ! /* If we get here, then this should be the last iteration ! through the loop. */ cbRead += ob->rcode; } else { ! /* Grow buffer by (32k minus 1 byte) each for each chunk. ! If not for the SQL Anywhere 5.0 problem (driver version ! 5.05.041867), we could probably grow by 50% each time ! or the remaining size (as determined by ob->rcode). */ ! ! /*cbRequired += ob->rcode - ob->vsize; */ ! cbRequired += 32767; /* Fix that works for SQL Anywhere 5.0 driver. */ ! if (ob->vtype == SQL_C_CHAR) ! { ! /* We want to ignore the intermediate ! NULL characters SQLGetData() gives us. (silly, silly) */ cbRead = ob->vsize - 1; ! } else - { cbRead = ob->vsize; - } } --- 1635,1671 ---- (char *)ob->bind_area + cbRead, ob->vsize - cbRead, ! &ob->rcode); Py_END_ALLOW_THREADS if (unsuccessful(rc)) { Py_DECREF(row); ! cursorError(cur, _T("SQLGetData")); return NULL; } ! /* Returned length is total length remaining including current read. ! If length is not known, returns SQL_NO_TOTAL */ ! if ((ob->rcode != SQL_NO_TOTAL) && (ob->rcode <= cur->max_width)) { ! /* If we get here, then this should be the last iteration through the loop. */ cbRead += ob->rcode; } else { ! /* Grow buffer by cursor chunk size for each read. ! If not for the SQL Anywhere 5.0 problem (driver version ! 5.05.041867), we could probably grow by 50% each time ! or the remaining size (as determined by ob->rcode). ! Regarding above note, caller can now use cursor.setoutputsize ! to work around any such bug in a driver */ ! cbRequired += cur->max_width; ! /* We want to ignore the intermediate ! NULL characters SQLGetData() gives us. (silly, silly) */ + if (ob->vtype == SQL_C_CHAR) cbRead = ob->vsize - 1; ! else if (ob->vtype == SQL_C_WCHAR) ! cbRead = ob->vsize - sizeof(WCHAR); else cbRead = ob->vsize; } |
From: Mark H. <mha...@us...> - 2008-12-03 23:46:40
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9907/win32/src Modified Files: Tag: py3k win32helpmodule.cpp Log Message: merge whitespace changes from trunk Index: win32helpmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32helpmodule.cpp,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -C2 -d -r1.4.2.2 -r1.4.2.3 *** win32helpmodule.cpp 6 Sep 2008 23:27:36 -0000 1.4.2.2 --- win32helpmodule.cpp 3 Dec 2008 23:46:36 -0000 1.4.2.3 *************** *** 142,183 **** PyTypeObject PyHH_AKLINKType = { ! PYWIN_OBJECT_HEAD ! "PyHH_AKLINK", /* tp_name */ ! sizeof(PyHH_AKLINK), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_AKLINK::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyHH_AKLINK::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_AKLINK structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_AKLINK::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 */ }; --- 142,183 ---- PyTypeObject PyHH_AKLINKType = { ! PYWIN_OBJECT_HEAD ! "PyHH_AKLINK", /* tp_name */ ! sizeof(PyHH_AKLINK), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_AKLINK::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyHH_AKLINK::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_AKLINK structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_AKLINK::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 */ }; *************** *** 287,291 **** char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) ! return -1; PyHH_AKLINK *pO = (PyHH_AKLINK *)self; --- 287,291 ---- char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) ! return -1; PyHH_AKLINK *pO = (PyHH_AKLINK *)self; *************** *** 423,465 **** //Use this structure for full-text search. ! PyTypeObject PyHH_FTS_QUERYType = { ! PYWIN_OBJECT_HEAD ! "PyHH_FTS_QUERY", /* tp_name */ ! sizeof(PyHH_FTS_QUERY), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_FTS_QUERY::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyHH_FTS_QUERY::getattro, /* tp_getattro */ ! PyHH_FTS_QUERY::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_FTS_QUERY struct", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_FTS_QUERY::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 */ }; --- 423,465 ---- //Use this structure for full-text search. ! PyTypeObject PyHH_FTS_QUERYType = { ! PYWIN_OBJECT_HEAD ! "PyHH_FTS_QUERY", /* tp_name */ ! sizeof(PyHH_FTS_QUERY), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_FTS_QUERY::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyHH_FTS_QUERY::getattro, /* tp_getattro */ ! PyHH_FTS_QUERY::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_FTS_QUERY struct", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_FTS_QUERY::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 */ }; *************** *** 528,532 **** Py_XDECREF(m_pszSearchQuery); } ! PyObject *PyHH_FTS_QUERY::getattro(PyObject *self, PyObject *obname) { --- 528,532 ---- Py_XDECREF(m_pszSearchQuery); } ! PyObject *PyHH_FTS_QUERY::getattro(PyObject *self, PyObject *obname) { *************** *** 534,548 **** if (name==NULL) return NULL; ! PyHH_FTS_QUERY *pO = (PyHH_FTS_QUERY *)self; ! ! if (strcmp("searchQuery", name)==0) { ! PyObject *rc = pO->m_pszSearchQuery ? pO->m_pszSearchQuery : Py_None; ! Py_INCREF(rc); ! return rc; ! } return PyObject_GenericGetAttr(self, obname); } ! int PyHH_FTS_QUERY::setattro(PyObject *self, PyObject *obname, PyObject *v) { --- 534,548 ---- if (name==NULL) return NULL; ! PyHH_FTS_QUERY *pO = (PyHH_FTS_QUERY *)self; ! ! if (strcmp("searchQuery", name)==0) { ! PyObject *rc = pO->m_pszSearchQuery ? pO->m_pszSearchQuery : Py_None; ! Py_INCREF(rc); ! return rc; ! } return PyObject_GenericGetAttr(self, obname); } ! int PyHH_FTS_QUERY::setattro(PyObject *self, PyObject *obname, PyObject *v) { *************** *** 590,594 **** return TRUE; } ! PyObject *PyWinObject_FromHH_FTS_QUERY(const HH_FTS_QUERY *pFTS_QUERY) { --- 590,594 ---- return TRUE; } ! PyObject *PyWinObject_FromHH_FTS_QUERY(const HH_FTS_QUERY *pFTS_QUERY) { *************** *** 663,704 **** PyTypeObject PyHH_POPUPType = { ! PYWIN_OBJECT_HEAD ! "PyHH_POPUP", /* tp_name */ ! sizeof(PyHH_POPUP), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_POPUP::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyHH_POPUP::getattro, /* tp_getattro */ ! PyHH_POPUP::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_POPUP structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_POPUP::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 */ }; --- 663,704 ---- PyTypeObject PyHH_POPUPType = { ! PYWIN_OBJECT_HEAD ! "PyHH_POPUP", /* tp_name */ ! sizeof(PyHH_POPUP), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_POPUP::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyHH_POPUP::getattro, /* tp_getattro */ ! PyHH_POPUP::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_POPUP structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_POPUP::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 */ }; *************** *** 807,811 **** Py_XDECREF(m_pszFont); } ! PyObject *PyHH_POPUP::getattro(PyObject *self, PyObject *obname) { --- 807,811 ---- Py_XDECREF(m_pszFont); } ! PyObject *PyHH_POPUP::getattro(PyObject *self, PyObject *obname) { *************** *** 815,819 **** PyHH_POPUP *pO = (PyHH_POPUP *)self; ! if (strcmp("text", name)==0) { PyObject *rc = pO->m_pszText ? pO->m_pszText : Py_None; --- 815,819 ---- PyHH_POPUP *pO = (PyHH_POPUP *)self; ! if (strcmp("text", name)==0) { PyObject *rc = pO->m_pszText ? pO->m_pszText : Py_None; *************** *** 839,843 **** return PyObject_GenericGetAttr(self, obname); } ! int PyHH_POPUP::setattro(PyObject *self, PyObject *obname, PyObject *v) { --- 839,843 ---- return PyObject_GenericGetAttr(self, obname); } ! int PyHH_POPUP::setattro(PyObject *self, PyObject *obname, PyObject *v) { *************** *** 900,904 **** return PyObject_GenericSetAttr(self, obname, v); } ! /*static*/ void PyHH_POPUP::deallocFunc(PyObject *ob) { --- 900,904 ---- return PyObject_GenericSetAttr(self, obname, v); } ! /*static*/ void PyHH_POPUP::deallocFunc(PyObject *ob) { *************** *** 993,1034 **** PyTypeObject PyHH_WINTYPEType = { ! PYWIN_OBJECT_HEAD ! "PyHH_WINTYPE", /* tp_name */ ! sizeof(PyHH_WINTYPE), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_WINTYPE::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyHH_WINTYPE::getattro, /* tp_getattro */ ! PyHH_WINTYPE::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_WINTYPE structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_WINTYPE::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 */ }; --- 993,1034 ---- PyTypeObject PyHH_WINTYPEType = { ! PYWIN_OBJECT_HEAD ! "PyHH_WINTYPE", /* tp_name */ ! sizeof(PyHH_WINTYPE), /* tp_basicsize */ ! 0, /* tp_itemsize */ ! PyHH_WINTYPE::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyHH_WINTYPE::getattro, /* tp_getattro */ ! PyHH_WINTYPE::setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! 0, /* tp_flags */ ! "A Python object, representing an HH_WINTYPE structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHH_WINTYPE::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 */ }; *************** *** 1507,1527 **** 0, /* tp_flags */ "A Python object, representing an NMHDR structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyNMHDR::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 */ }; --- 1507,1527 ---- 0, /* tp_flags */ "A Python object, representing an NMHDR structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyNMHDR::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 */ }; *************** *** 1683,1704 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HHN_NOTIFY structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHHN_NOTIFY::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 */ }; --- 1683,1704 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HHN_NOTIFY structure", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHHN_NOTIFY::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 */ }; *************** *** 1921,1941 **** 0, /* tp_flags */ "A Python object, representing an HHNTRACK structure.", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHHNTRACK::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 */ }; --- 1921,1941 ---- 0, /* tp_flags */ "A Python object, representing an HHNTRACK structure.", /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! PyHHNTRACK::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 */ }; *************** *** 2012,2017 **** return NULL; ! PyHHNTRACK *pO = (PyHHNTRACK *)self; ! if (strcmp("hdr", name)==0) { PyObject *rc = pO->m_hdr ? pO->m_hdr : Py_None; --- 2012,2016 ---- return NULL; ! PyHHNTRACK *pO = (PyHHNTRACK *)self; if (strcmp("hdr", name)==0) { PyObject *rc = pO->m_hdr ? pO->m_hdr : Py_None; *************** *** 2043,2047 **** if (name==NULL) return -1; ! PyHHNTRACK *pO = (PyHHNTRACK *)self; if (strcmp("hdr", name)==0) { --- 2042,2046 ---- if (name==NULL) return -1; ! PyHHNTRACK *pO = (PyHHNTRACK *)self; if (strcmp("hdr", name)==0) { |
From: Mark H. <mha...@us...> - 2008-12-03 22:34:27
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/com/win32comext/taskscheduler/src Modified Files: PyITaskTrigger.cpp PyITaskTrigger.h Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: PyITaskTrigger.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src/PyITaskTrigger.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyITaskTrigger.cpp 28 Apr 2004 05:21:44 -0000 1.2 --- PyITaskTrigger.cpp 3 Dec 2008 22:34:21 -0000 1.3 *************** *** 143,150 **** // @object PyTASK_TRIGGER|Python object representing a TASK_TRIGGER structure via the structmember Api ! static PyTypeObject PyTASK_TRIGGERType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyTASK_TRIGGER", sizeof(PyTASK_TRIGGER), --- 143,149 ---- // @object PyTASK_TRIGGER|Python object representing a TASK_TRIGGER structure via the structmember Api ! PyTypeObject PyTASK_TRIGGERType = { ! PYWIN_OBJECT_HEAD "PyTASK_TRIGGER", sizeof(PyTASK_TRIGGER), *************** *** 165,169 **** PyObject_GenericSetAttr, // PyTASK_TRIGGER::setattro, 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags; 0, // tp_doc; /* Documentation string */ 0, // traverseproc tp_traverse; --- 164,168 ---- PyObject_GenericSetAttr, // PyTASK_TRIGGER::setattro, 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; 0, // tp_doc; /* Documentation string */ 0, // traverseproc tp_traverse; Index: PyITaskTrigger.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src/PyITaskTrigger.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyITaskTrigger.h 10 Apr 2004 05:18:41 -0000 1.1 --- PyITaskTrigger.h 3 Dec 2008 22:34:21 -0000 1.2 *************** *** 10,13 **** --- 10,15 ---- BOOL PyTASK_TRIGGER_check(PyObject *ob); + extern __declspec(dllexport) PyTypeObject PyTASK_TRIGGERType; + class PyITaskTrigger : public PyIUnknown { |
From: Mark H. <mha...@us...> - 2008-12-03 22:34:27
|
Update of /cvsroot/pywin32/pywin32/win32/src/PerfMon In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/win32/src/PerfMon Modified Files: MappingManager.cpp PerfCounterDefn.cpp PerfObjectType.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: PerfCounterDefn.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/PerfCounterDefn.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PerfCounterDefn.cpp 2 Sep 1999 00:24:54 -0000 1.1 --- PerfCounterDefn.cpp 3 Dec 2008 22:34:21 -0000 1.2 *************** *** 108,128 **** PyTypeObject PyPERF_COUNTER_DEFINITION::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyPERF_COUNTER_DEFINITION", sizeof(PyPERF_COUNTER_DEFINITION), 0, PyPERF_COUNTER_DEFINITION::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyPERF_COUNTER_DEFINITION::getattr, /* tp_getattr */ PyPERF_COUNTER_DEFINITION::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 108,127 ---- PyTypeObject PyPERF_COUNTER_DEFINITION::type = { ! PYWIN_OBJECT_HEAD "PyPERF_COUNTER_DEFINITION", sizeof(PyPERF_COUNTER_DEFINITION), 0, PyPERF_COUNTER_DEFINITION::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyPERF_COUNTER_DEFINITION::getattr, /* tp_getattr */ PyPERF_COUNTER_DEFINITION::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: MappingManager.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/MappingManager.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MappingManager.cpp 13 Nov 2008 11:11:58 -0000 1.4 --- MappingManager.cpp 3 Dec 2008 22:34:21 -0000 1.5 *************** *** 186,209 **** PyTypeObject PyPerfMonManager::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyPerfMonManager", sizeof(PyPerfMonManager), 0, PyPerfMonManager::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyPerfMonManager::getattr, /* tp_getattr */ PyPerfMonManager::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; - #define OFF(e) offsetof(PyPerfMonManager, e) --- 186,207 ---- PyTypeObject PyPerfMonManager::type = { ! PYWIN_OBJECT_HEAD "PyPerfMonManager", sizeof(PyPerfMonManager), 0, PyPerfMonManager::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyPerfMonManager::getattr, /* tp_getattr */ PyPerfMonManager::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; #define OFF(e) offsetof(PyPerfMonManager, e) Index: PerfObjectType.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/PerfObjectType.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PerfObjectType.cpp 2 Sep 1999 00:24:54 -0000 1.1 --- PerfObjectType.cpp 3 Dec 2008 22:34:21 -0000 1.2 *************** *** 65,85 **** PyTypeObject PyPERF_OBJECT_TYPE::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyPERF_OBJECT_TYPE", sizeof(PyPERF_OBJECT_TYPE), 0, ! PyPERF_OBJECT_TYPE::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyPERF_OBJECT_TYPE::getattr, /* tp_getattr */ PyPERF_OBJECT_TYPE::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 65,84 ---- PyTypeObject PyPERF_OBJECT_TYPE::type = { ! PYWIN_OBJECT_HEAD "PyPERF_OBJECT_TYPE", sizeof(PyPERF_OBJECT_TYPE), 0, ! PyPERF_OBJECT_TYPE::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyPERF_OBJECT_TYPE::getattr, /* tp_getattr */ PyPERF_OBJECT_TYPE::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; *************** *** 91,95 **** {"ObjectHelpTitleIndex", T_LONG, OFF(m_ObjectHelpTitleIndex)}, // @prop integer|ObjectHelpTitleIndex| {"DefaultCounterIndex", T_LONG, OFF(m_DefaultCounter)}, // @prop integer|DefaultCounterIndex| ! {NULL} /* Sentinel */ }; --- 90,94 ---- {"ObjectHelpTitleIndex", T_LONG, OFF(m_ObjectHelpTitleIndex)}, // @prop integer|ObjectHelpTitleIndex| {"DefaultCounterIndex", T_LONG, OFF(m_DefaultCounter)}, // @prop integer|DefaultCounterIndex| ! {NULL} }; |
From: Mark H. <mha...@us...> - 2008-12-03 22:34:26
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/com/win32com/src Modified Files: MiscTypes.cpp PyRecord.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: PyRecord.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyRecord.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyRecord.cpp 13 Nov 2008 04:04:51 -0000 1.12 --- PyRecord.cpp 3 Dec 2008 22:34:20 -0000 1.13 *************** *** 298,308 **** PyTypeObject PyRecord::Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "com_record", sizeof(PyRecord), 0, ! PyRecord::tp_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ PyRecord::tp_getattr, /* tp_getattr */ PyRecord::tp_setattr, /* tp_setattr */ --- 298,307 ---- PyTypeObject PyRecord::Type = { ! PYWIN_OBJECT_HEAD "com_record", sizeof(PyRecord), 0, ! PyRecord::tp_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ PyRecord::tp_getattr, /* tp_getattr */ PyRecord::tp_setattr, /* tp_setattr */ *************** *** 312,318 **** 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 311,317 ---- 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; *************** *** 420,424 **** ULONG i; PyRecord *pyrec = (PyRecord *)self; - ULONG num_names; PyObject *s = PyString_FromString("com_struct{"); --- 419,422 ---- *************** *** 453,457 **** PyObject *res; PyRecord *pyrec = (PyRecord *)self; - if (strcmp(name, "__members__")==0) { ULONG cnames = 0; --- 451,454 ---- *************** *** 467,486 **** return PyCom_BuildPyException(hr, pyrec->pri, g_IID_IRecordInfo); } ! PyObject *ret = PyList_New(cnames); ! for (ULONG i=0;i<cnames && ret != NULL;i++) { PyObject *item = PyString_FromUnicode(strs[i]); SysFreeString(strs[i]); if (item==NULL) { ! Py_DECREF(ret); ! ret = NULL; } else ! PyList_SET_ITEM(ret, i, item); // ref count swallowed. } free(strs); ! return ret; } res = Py_FindMethod(PyRecord_methods, self, name); if (res != NULL) return res; PyErr_Clear(); WCHAR *wname; --- 464,484 ---- return PyCom_BuildPyException(hr, pyrec->pri, g_IID_IRecordInfo); } ! res = PyList_New(cnames); ! for (ULONG i=0;i<cnames && res != NULL;i++) { PyObject *item = PyString_FromUnicode(strs[i]); SysFreeString(strs[i]); if (item==NULL) { ! Py_DECREF(res); ! res = NULL; } else ! PyList_SET_ITEM(res, i, item); // ref count swallowed. } free(strs); ! return res; } res = Py_FindMethod(PyRecord_methods, self, name); if (res != NULL) return res; + PyErr_Clear(); WCHAR *wname; Index: MiscTypes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/MiscTypes.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MiscTypes.cpp 2 Nov 2008 12:42:58 -0000 1.9 --- MiscTypes.cpp 3 Dec 2008 22:34:20 -0000 1.10 *************** *** 11,16 **** // ### an object). static PyTypeObject PyInterfaceType_Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, /* Number of items for varobject */ "interface-type", /* Name of this type */ sizeof(PyTypeObject), /* Basic object size */ --- 11,15 ---- // ### an object). static PyTypeObject PyInterfaceType_Type = { ! PYWIN_OBJECT_HEAD "interface-type", /* Name of this type */ sizeof(PyTypeObject), /* Basic object size */ *************** *** 38,42 **** { // originally, this copied the typeobject of the parent, but as it is impossible ! // to gurantee order of static object construction, I went this way. This is // probably better, as is forces _all_ python objects have the same type sig. static const PyTypeObject type_template = { --- 37,41 ---- { // originally, this copied the typeobject of the parent, but as it is impossible ! // to guarantee order of static object construction, I went this way. This is // probably better, as is forces _all_ python objects have the same type sig. static const PyTypeObject type_template = { *************** *** 53,57 **** (destructor) PyIBase::dealloc, /*tp_dealloc*/ 0, /*tp_print*/ ! 0, /*tp_getattr*/ (setattrfunc) PyIBase::setattr, /*tp_setattr*/ PyIBase::cmp, /*tp_compare*/ --- 52,56 ---- (destructor) PyIBase::dealloc, /*tp_dealloc*/ 0, /*tp_print*/ ! 0, /*tp_getattr*/ (setattrfunc) PyIBase::setattr, /*tp_setattr*/ PyIBase::cmp, /*tp_compare*/ *************** *** 63,70 **** 0, /*tp_call*/ 0, /*tp_str*/ ! PyIBase::getattro, /* tp_getattro */ 0, /*tp_setattro */ 0, /* tp_as_buffer */ ! 0, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ --- 62,69 ---- 0, /*tp_call*/ 0, /*tp_str*/ ! PyIBase::getattro, /* tp_getattro */ 0, /*tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ *************** *** 96,99 **** --- 95,99 ---- tp_basicsize = typeSize; } + PyComTypeObject::~PyComTypeObject() { *************** *** 217,222 **** PyTypeObject PyOleEmptyType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyOleEmpty", sizeof(PyOleEmpty), --- 217,221 ---- PyTypeObject PyOleEmptyType = { ! PYWIN_OBJECT_HEAD "PyOleEmpty", sizeof(PyOleEmpty), *************** *** 248,253 **** PYCOM_EXPORT PyTypeObject PyOleMissingType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyOleMissing", sizeof(PyOleMissing), --- 247,251 ---- PYCOM_EXPORT PyTypeObject PyOleMissingType = { ! PYWIN_OBJECT_HEAD "PyOleMissing", sizeof(PyOleMissing), *************** *** 278,283 **** PyTypeObject PyOleArgNotFoundType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "ArgNotFound", sizeof(PyOleArgNotFound), --- 276,280 ---- PyTypeObject PyOleArgNotFoundType = { ! PYWIN_OBJECT_HEAD "ArgNotFound", sizeof(PyOleArgNotFound), |
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/win32/src Modified Files: PyACL.cpp PyDEVMODE.cpp PyHANDLE.cpp PyIID.cpp PyOVERLAPPED.cpp PySECURITY_ATTRIBUTES.cpp PySECURITY_DESCRIPTOR.cpp PySID.cpp PyTime.cpp PyWAVEFORMATEX.cpp PyWinTypes.h mmapfilemodule.cpp odbc.cpp win2krasmodule.cpp win32api_display.cpp win32consolemodule.cpp win32file_comm.cpp win32gui.i win32helpmodule.cpp win32process.i win32security_sspi.cpp win32service.i win32trace.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** win32process.i 13 Nov 2008 11:11:58 -0000 1.35 --- win32process.i 3 Dec 2008 22:34:21 -0000 1.36 *************** *** 103,113 **** PyTypeObject PySTARTUPINFOType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySTARTUPINFO", sizeof(PySTARTUPINFO), 0, PySTARTUPINFO::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySTARTUPINFO::getattr, /* tp_getattr */ PySTARTUPINFO::setattr, /* tp_setattr */ --- 103,112 ---- PyTypeObject PySTARTUPINFOType = { ! PYWIN_OBJECT_HEAD "PySTARTUPINFO", sizeof(PySTARTUPINFO), 0, PySTARTUPINFO::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySTARTUPINFO::getattr, /* tp_getattr */ PySTARTUPINFO::setattr, /* tp_setattr */ *************** *** 115,123 **** 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 114,122 ---- 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** win32trace.cpp 13 Nov 2008 11:11:58 -0000 1.16 --- win32trace.cpp 3 Dec 2008 22:34:21 -0000 1.17 *************** *** 192,197 **** static PyTypeObject PyTraceObjectType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyTraceObject", sizeof(PyTraceObject), --- 192,196 ---- static PyTypeObject PyTraceObjectType = { ! PYWIN_OBJECT_HEAD "PyTraceObject", sizeof(PyTraceObject), Index: PySECURITY_DESCRIPTOR.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PySECURITY_DESCRIPTOR.cpp 13 Nov 2008 11:11:58 -0000 1.20 --- PySECURITY_DESCRIPTOR.cpp 3 Dec 2008 22:34:21 -0000 1.21 *************** *** 706,726 **** PYWINTYPES_EXPORT PyTypeObject PySECURITY_DESCRIPTORType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySECURITY_DESCRIPTOR", sizeof(PySECURITY_DESCRIPTOR), 0, PySECURITY_DESCRIPTOR::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySECURITY_DESCRIPTOR::getattr, /* tp_getattr */ PySECURITY_DESCRIPTOR::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ 0, /*tp_getattro*/ 0, /*tp_setattro*/ --- 706,725 ---- PYWINTYPES_EXPORT PyTypeObject PySECURITY_DESCRIPTORType = { ! PYWIN_OBJECT_HEAD "PySECURITY_DESCRIPTOR", sizeof(PySECURITY_DESCRIPTOR), 0, PySECURITY_DESCRIPTOR::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySECURITY_DESCRIPTOR::getattr, /* tp_getattr */ PySECURITY_DESCRIPTOR::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ 0, /*tp_getattro*/ 0, /*tp_setattro*/ Index: win32api_display.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32api_display.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32api_display.cpp 6 Feb 2008 18:42:51 -0000 1.7 --- win32api_display.cpp 3 Dec 2008 22:34:21 -0000 1.8 *************** *** 1,4 **** // @doc - This file contains autoduck documentation - // #define UNICODE #include "PyWinTypes.h" #include "structmember.h" --- 1,3 ---- *************** *** 47,52 **** PyTypeObject PyDISPLAY_DEVICEType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyDISPLAY_DEVICE", sizeof(PyDISPLAY_DEVICE), --- 46,50 ---- PyTypeObject PyDISPLAY_DEVICEType = { ! PYWIN_OBJECT_HEAD "PyDISPLAY_DEVICE", sizeof(PyDISPLAY_DEVICE), *************** *** 143,149 **** { PDISPLAY_DEVICE pdisplay_device=&((PyDISPLAY_DEVICE *)self)->display_device; ! char *name=PyString_AsString(obname); if (name==NULL) return NULL; if (strcmp(name,"DeviceName")==0) if (pdisplay_device->DeviceName[31]==0) // in case DeviceName fills space and has no trailing NULL --- 141,148 ---- { PDISPLAY_DEVICE pdisplay_device=&((PyDISPLAY_DEVICE *)self)->display_device; ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return NULL; + if (strcmp(name,"DeviceName")==0) if (pdisplay_device->DeviceName[31]==0) // in case DeviceName fills space and has no trailing NULL *************** *** 175,184 **** int PyDISPLAY_DEVICE::setattro(PyObject *self, PyObject *obname, PyObject *obvalue) { ! char *name; ! TCHAR *value=NULL; ! DWORD valuelen; ! name=PyString_AsString(obname); if (name==NULL) return -1; if (strcmp(name,"DeviceName")==0){ PDISPLAY_DEVICE pdisplay_device=&((PyDISPLAY_DEVICE *)self)->display_device; --- 174,184 ---- int PyDISPLAY_DEVICE::setattro(PyObject *self, PyObject *obname, PyObject *obvalue) { ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return -1; + + TCHAR *value=NULL; + DWORD valuelen; + if (strcmp(name,"DeviceName")==0){ PDISPLAY_DEVICE pdisplay_device=&((PyDISPLAY_DEVICE *)self)->display_device; Index: win32consolemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** win32consolemodule.cpp 7 Oct 2008 15:21:49 -0000 1.14 --- win32consolemodule.cpp 3 Dec 2008 22:34:21 -0000 1.15 *************** *** 149,154 **** static PyTypeObject PySMALL_RECTType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySMALL_RECT", sizeof(PySMALL_RECT), --- 149,153 ---- static PyTypeObject PySMALL_RECTType = { ! PYWIN_OBJECT_HEAD "PySMALL_RECT", sizeof(PySMALL_RECT), *************** *** 169,173 **** PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! 0, // tp_flags; "Wrapper for a SMALL_RECT struct. Create using PySMALL_RECTType(Left, Top, Right, Bottom)", // tp_doc 0, // traverseproc tp_traverse; --- 168,172 ---- PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; "Wrapper for a SMALL_RECT struct. Create using PySMALL_RECTType(Left, Top, Right, Bottom)", // tp_doc 0, // traverseproc tp_traverse; *************** *** 299,304 **** static PyTypeObject PyCOORDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyCOORD", sizeof(PyCOORD), --- 298,302 ---- static PyTypeObject PyCOORDType = { ! PYWIN_OBJECT_HEAD "PyCOORD", sizeof(PyCOORD), *************** *** 319,323 **** PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! 0, // tp_flags; "Wrapper for a COORD struct. Create using PyCOORDType(X,Y)", // tp_doc 0, // traverseproc tp_traverse; --- 317,321 ---- PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; "Wrapper for a COORD struct. Create using PyCOORDType(X,Y)", // tp_doc 0, // traverseproc tp_traverse; *************** *** 486,490 **** { INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; ! char *name=PyString_AsString(obname); if (name==NULL) return NULL; --- 484,488 ---- { INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return NULL; *************** *** 535,539 **** INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; char *name; ! name=PyString_AsString(obname); if (name==NULL) return -1; --- 533,537 ---- INPUT_RECORD *pir=&((PyINPUT_RECORD *)self)->input_record; char *name; ! name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return -1; *************** *** 555,558 **** --- 553,557 ---- return -1; } + #if (PY_VERSION_HEX < 0x02030000) *dest_ptr=PyLong_AsUnsignedLong(obvalue); *************** *** 608,613 **** static PyTypeObject PyINPUT_RECORDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyINPUT_RECORD", sizeof(PyINPUT_RECORD), --- 607,611 ---- static PyTypeObject PyINPUT_RECORDType = { ! PYWIN_OBJECT_HEAD "PyINPUT_RECORD", sizeof(PyINPUT_RECORD), *************** *** 628,632 **** PyINPUT_RECORD::tp_setattro, // tp_setattro 0, // tp_as_buffer; ! 0, // tp_flags; "Wrapper for a INPUT_RECORD struct. Create using PyINPUT_RECORDType(EventType)", // tp_doc 0, // traverseproc tp_traverse; --- 626,630 ---- PyINPUT_RECORD::tp_setattro, // tp_setattro 0, // tp_as_buffer; ! Py_TPFLAGS_DEFAULT, // tp_flags; "Wrapper for a INPUT_RECORD struct. Create using PyINPUT_RECORDType(EventType)", // tp_doc 0, // traverseproc tp_traverse; *************** *** 1516,1521 **** PyTypeObject PyConsoleScreenBufferType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyConsoleScreenBuffer", sizeof(PyConsoleScreenBuffer), --- 1514,1518 ---- PyTypeObject PyConsoleScreenBufferType = { ! PYWIN_OBJECT_HEAD "PyConsoleScreenBuffer", sizeof(PyConsoleScreenBuffer), *************** *** 1536,1540 **** PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer ! 0, // tp_flags "Handle to a console screen buffer.\nCreate using CreateConsoleScreenBuffer or PyConsoleScreenBufferType(Handle)", // tp_doc 0, // tp_traverse --- 1533,1537 ---- PyObject_GenericSetAttr, // tp_setattro 0, // tp_as_buffer ! Py_TPFLAGS_DEFAULT, // tp_flags "Handle to a console screen buffer.\nCreate using CreateConsoleScreenBuffer or PyConsoleScreenBufferType(Handle)", // tp_doc 0, // tp_traverse Index: win32security_sspi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security_sspi.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32security_sspi.cpp 12 Aug 2007 08:16:29 -0000 1.9 --- win32security_sspi.cpp 3 Dec 2008 22:34:21 -0000 1.10 *************** *** 88,93 **** PyTypeObject PySecBufferDescType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySecBufferDesc", sizeof(PySecBufferDesc), --- 88,92 ---- PyTypeObject PySecBufferDescType = { ! PYWIN_OBJECT_HEAD "PySecBufferDesc", sizeof(PySecBufferDesc), *************** *** 314,319 **** PyTypeObject PySecBufferType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySecBuffer", sizeof(PySecBuffer), --- 313,317 ---- PyTypeObject PySecBufferType = { ! PYWIN_OBJECT_HEAD "PySecBuffer", sizeof(PySecBuffer), *************** *** 412,416 **** { PSecBuffer psecbuffer=((PySecBuffer *)self)->GetSecBuffer(); ! char *name=PyString_AsString(obname); if (name==NULL) return NULL; --- 410,414 ---- { PSecBuffer psecbuffer=((PySecBuffer *)self)->GetSecBuffer(); ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return NULL; *************** *** 426,430 **** void *value; DWORD valuelen; ! name=PyString_AsString(obname); if (name==NULL) return -1; --- 424,428 ---- void *value; DWORD valuelen; ! name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return -1; *************** *** 508,513 **** PyTypeObject PyCtxtHandleType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyCtxtHandle", sizeof(PyCtxtHandle), --- 506,510 ---- PyTypeObject PyCtxtHandleType = { ! PYWIN_OBJECT_HEAD "PyCtxtHandle", sizeof(PyCtxtHandle), *************** *** 1064,1069 **** PyTypeObject PyCredHandleType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyCredHandle", sizeof(PyCredHandle), --- 1061,1065 ---- PyTypeObject PyCredHandleType = { ! PYWIN_OBJECT_HEAD "PyCredHandle", sizeof(PyCredHandle), Index: PySID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PySID.cpp 13 Nov 2008 11:11:58 -0000 1.13 --- PySID.cpp 3 Dec 2008 22:34:21 -0000 1.14 *************** *** 200,225 **** PYWINTYPES_EXPORT PyTypeObject PySIDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySID", sizeof(PySID), 0, PySID::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySID::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ // @pymeth __cmp__|Used when objects are compared. ! PySID::compareFunc, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, 0, /* tp_call */ ! PySID::strFunc, /* tp_str */ 0, /*tp_getattro*/ 0, /*tp_setattro*/ // @comm Note the PySID object supports the buffer interface. Thus buffer(sid) can be used to obtain the raw bytes. ! &PySID_as_buffer, /*tp_as_buffer*/ }; --- 200,224 ---- PYWINTYPES_EXPORT PyTypeObject PySIDType = { ! PYWIN_OBJECT_HEAD "PySID", sizeof(PySID), 0, PySID::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySID::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ // @pymeth __cmp__|Used when objects are compared. ! PySID::compareFunc, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, 0, /* tp_call */ ! PySID::strFunc, /* tp_str */ 0, /*tp_getattro*/ 0, /*tp_setattro*/ // @comm Note the PySID object supports the buffer interface. Thus buffer(sid) can be used to obtain the raw bytes. ! &PySID_as_buffer, /*tp_as_buffer*/ }; Index: PyOVERLAPPED.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyOVERLAPPED.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PyOVERLAPPED.cpp 25 May 2008 00:34:23 -0000 1.14 --- PyOVERLAPPED.cpp 3 Dec 2008 22:34:21 -0000 1.15 *************** *** 64,85 **** PYWINTYPES_EXPORT PyTypeObject PyOVERLAPPEDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyOVERLAPPED", sizeof(PyOVERLAPPED), 0, PyOVERLAPPED::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyOVERLAPPED::getattr, /* tp_getattr */ PyOVERLAPPED::setattr, /* tp_setattr */ // @pymeth __cmp__|Used when OVERLAPPED objects are compared. ! PyOVERLAPPED::compareFunc, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! PyOVERLAPPED::hashFunc, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; --- 64,84 ---- PYWINTYPES_EXPORT PyTypeObject PyOVERLAPPEDType = { ! PYWIN_OBJECT_HEAD "PyOVERLAPPED", sizeof(PyOVERLAPPED), 0, PyOVERLAPPED::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyOVERLAPPED::getattr, /* tp_getattr */ PyOVERLAPPED::setattr, /* tp_setattr */ // @pymeth __cmp__|Used when OVERLAPPED objects are compared. ! PyOVERLAPPED::compareFunc, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! PyOVERLAPPED::hashFunc, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: PySECURITY_ATTRIBUTES.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_ATTRIBUTES.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PySECURITY_ATTRIBUTES.cpp 27 Jan 2005 01:46:44 -0000 1.7 --- PySECURITY_ATTRIBUTES.cpp 3 Dec 2008 22:34:21 -0000 1.8 *************** *** 66,86 **** PYWINTYPES_EXPORT PyTypeObject PySECURITY_ATTRIBUTESType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySECURITY_ATTRIBUTES", sizeof(PySECURITY_ATTRIBUTES), 0, PySECURITY_ATTRIBUTES::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySECURITY_ATTRIBUTES::getattr, /* tp_getattr */ PySECURITY_ATTRIBUTES::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 66,85 ---- PYWINTYPES_EXPORT PyTypeObject PySECURITY_ATTRIBUTESType = { ! PYWIN_OBJECT_HEAD "PySECURITY_ATTRIBUTES", sizeof(PySECURITY_ATTRIBUTES), 0, PySECURITY_ATTRIBUTES::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySECURITY_ATTRIBUTES::getattr, /* tp_getattr */ PySECURITY_ATTRIBUTES::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; *************** *** 92,95 **** --- 91,97 ---- {NULL} }; + + + // @comm On platforms that support security descriptor operations, SECURITY_DESCRIPTOR // defaults to a blank security descriptor with no owner, group, dacl, or sacl. *************** *** 108,112 **** m_sa.lpSecurityDescriptor=((PySECURITY_DESCRIPTOR *)m_obSD)->GetSD(); // On win95/98/me (or any platform that doesn't have NT security) the ! // initialization of the SECURITY_DESCRIPTOR shoudl fail, leaving the // sd NULL. if (m_sa.lpSecurityDescriptor==NULL){ --- 110,114 ---- m_sa.lpSecurityDescriptor=((PySECURITY_DESCRIPTOR *)m_obSD)->GetSD(); // On win95/98/me (or any platform that doesn't have NT security) the ! // initialization of the SECURITY_DESCRIPTOR should fail, leaving the // sd NULL. if (m_sa.lpSecurityDescriptor==NULL){ Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** PyWinTypes.h 13 Nov 2008 04:04:51 -0000 1.53 --- PyWinTypes.h 3 Dec 2008 22:34:21 -0000 1.54 *************** *** 21,24 **** --- 21,41 ---- #include "windows.h" + // Helpers for our types. + #if (PY_VERSION_HEX < 0x03000000) + #define PYWIN_OBJECT_HEAD PyObject_HEAD_INIT(&PyType_Type) 0, + #define PYWIN_ATTR_CONVERT PyString_AsString + + #else // Py3k definitions + // Macro to handle PyObject layout changes in Py3k + #define PYWIN_OBJECT_HEAD PyVarObject_HEAD_INIT(NULL, 0) + + /* Attribute names are passed as Unicode in Py3k, so use a macro to + switch between string and unicode conversion. This function is not + documented, but is used extensively in the Python codebase itself, + so it's reasonable to assume it won't disappear anytime soon. + */ + #define PYWIN_ATTR_CONVERT _PyUnicode_AsString + #endif // PY_VERSION_HEX + // See PEP-353 - this is the "official" test... #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** win32gui.i 11 Nov 2008 00:17:55 -0000 1.119 --- win32gui.i 3 Dec 2008 22:34:21 -0000 1.120 *************** *** 866,876 **** PyTypeObject PyWNDCLASSType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyWNDCLASS", sizeof(PyWNDCLASS), 0, PyWNDCLASS::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyWNDCLASS::getattr, /* tp_getattr */ PyWNDCLASS::setattr, /* tp_setattr */ --- 866,875 ---- PyTypeObject PyWNDCLASSType = { ! PYWIN_OBJECT_HEAD "PyWNDCLASS", sizeof(PyWNDCLASS), 0, PyWNDCLASS::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyWNDCLASS::getattr, /* tp_getattr */ PyWNDCLASS::setattr, /* tp_setattr */ *************** *** 878,886 **** 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 877,885 ---- 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; *************** *** 1085,1095 **** PyTypeObject PyBITMAPType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyBITMAP", sizeof(PyBITMAP), 0, ! PyBITMAP::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyBITMAP::getattr, /* tp_getattr */ PyBITMAP::setattr, /* tp_setattr */ --- 1084,1093 ---- PyTypeObject PyBITMAPType = { ! PYWIN_OBJECT_HEAD "PyBITMAP", sizeof(PyBITMAP), 0, ! PyBITMAP::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyBITMAP::getattr, /* tp_getattr */ PyBITMAP::setattr, /* tp_setattr */ *************** *** 1097,1105 **** 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; #undef OFF --- 1095,1103 ---- 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; #undef OFF *************** *** 1193,1203 **** PyTypeObject PyLOGFONTType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyLOGFONT", sizeof(PyLOGFONT), 0, ! PyLOGFONT::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyLOGFONT::getattr, /* tp_getattr */ PyLOGFONT::setattr, /* tp_setattr */ --- 1191,1200 ---- PyTypeObject PyLOGFONTType = { ! PYWIN_OBJECT_HEAD "PyLOGFONT", sizeof(PyLOGFONT), 0, ! PyLOGFONT::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyLOGFONT::getattr, /* tp_getattr */ PyLOGFONT::setattr, /* tp_setattr */ *************** *** 1205,1213 **** 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; #undef OFF --- 1202,1210 ---- 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; #undef OFF Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PyTime.cpp 13 Jul 2007 02:59:33 -0000 1.19 --- PyTime.cpp 3 Dec 2008 22:34:21 -0000 1.20 *************** *** 363,373 **** PYWINTYPES_EXPORT PyTypeObject PyTimeType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "time", sizeof(PyTime), 0, ! PyTime::deallocFunc, /* tp_dealloc */ ! NULL, /* tp_print */ PyTime::getattrFunc, /* tp_getattr */ 0, /* tp_setattr */ --- 363,372 ---- PYWINTYPES_EXPORT PyTypeObject PyTimeType = { ! PYWIN_OBJECT_HEAD "time", sizeof(PyTime), 0, ! PyTime::deallocFunc, /* tp_dealloc */ ! NULL, /* tp_print */ PyTime::getattrFunc, /* tp_getattr */ 0, /* tp_setattr */ *************** *** 375,379 **** PyTime::compareFunc, /* tp_compare */ // @pymeth __repr__|Used for repr(ob) ! PyTime::reprFunc, /* tp_repr */ &PyTime_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ --- 374,378 ---- PyTime::compareFunc, /* tp_compare */ // @pymeth __repr__|Used for repr(ob) ! PyTime::reprFunc, /* tp_repr */ &PyTime_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ Index: win32helpmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32helpmodule.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32helpmodule.cpp 13 Nov 2008 11:11:58 -0000 1.5 --- win32helpmodule.cpp 3 Dec 2008 22:34:21 -0000 1.6 *************** *** 144,149 **** PyTypeObject PyHH_AKLINKType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHH_AKLINK", /* tp_name */ sizeof(PyHH_AKLINK), /* tp_basicsize */ --- 144,148 ---- PyTypeObject PyHH_AKLINKType = { ! PYWIN_OBJECT_HEAD "PyHH_AKLINK", /* tp_name */ sizeof(PyHH_AKLINK), /* tp_basicsize */ *************** *** 165,169 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 164,168 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HH_AKLINK structure", /* tp_doc */ }; *************** *** 446,451 **** PyTypeObject PyHH_FTS_QUERYType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHH_FTS_QUERY", /* tp_name */ sizeof(PyHH_FTS_QUERY), /* tp_basicsize */ --- 445,449 ---- PyTypeObject PyHH_FTS_QUERYType = { ! PYWIN_OBJECT_HEAD "PyHH_FTS_QUERY", /* tp_name */ sizeof(PyHH_FTS_QUERY), /* tp_basicsize */ *************** *** 467,471 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 465,469 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HH_FTS_QUERY struct", /* tp_doc */ }; *************** *** 534,551 **** Py_XDECREF(m_pszSearchQuery); } ! PyObject *PyHH_FTS_QUERY::getattr(PyObject *self, char *name) { PyHH_FTS_QUERY *pO = (PyHH_FTS_QUERY *)self; ! if (strcmp("searchQuery", name)==0) { PyObject *rc = pO->m_pszSearchQuery ? pO->m_pszSearchQuery : Py_None; Py_INCREF(rc); return rc; ! } return PyMember_Get((char *)self, memberlist, name); } ! int PyHH_FTS_QUERY::setattr(PyObject *self, char *name, PyObject *v) { --- 532,549 ---- Py_XDECREF(m_pszSearchQuery); } ! PyObject *PyHH_FTS_QUERY::getattr(PyObject *self, char *name) { PyHH_FTS_QUERY *pO = (PyHH_FTS_QUERY *)self; ! if (strcmp("searchQuery", name)==0) { PyObject *rc = pO->m_pszSearchQuery ? pO->m_pszSearchQuery : Py_None; Py_INCREF(rc); return rc; ! } return PyMember_Get((char *)self, memberlist, name); } ! int PyHH_FTS_QUERY::setattr(PyObject *self, char *name, PyObject *v) { *************** *** 590,594 **** return TRUE; } ! PyObject *PyWinObject_FromHH_FTS_QUERY(const HH_FTS_QUERY *pFTS_QUERY) { --- 588,592 ---- return TRUE; } ! PyObject *PyWinObject_FromHH_FTS_QUERY(const HH_FTS_QUERY *pFTS_QUERY) { *************** *** 663,668 **** PyTypeObject PyHH_POPUPType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHH_POPUP", /* tp_name */ sizeof(PyHH_POPUP), /* tp_basicsize */ --- 661,665 ---- PyTypeObject PyHH_POPUPType = { ! PYWIN_OBJECT_HEAD "PyHH_POPUP", /* tp_name */ sizeof(PyHH_POPUP), /* tp_basicsize */ *************** *** 684,688 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 681,685 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HH_POPUP structure", /* tp_doc */ }; *************** *** 791,799 **** Py_XDECREF(m_pszFont); } ! PyObject *PyHH_POPUP::getattr(PyObject *self, char *name) { PyHH_POPUP *pO = (PyHH_POPUP *)self; ! if (strcmp("text", name)==0) { PyObject *rc = pO->m_pszText ? pO->m_pszText : Py_None; --- 788,796 ---- Py_XDECREF(m_pszFont); } ! PyObject *PyHH_POPUP::getattr(PyObject *self, char *name) { PyHH_POPUP *pO = (PyHH_POPUP *)self; ! if (strcmp("text", name)==0) { PyObject *rc = pO->m_pszText ? pO->m_pszText : Py_None; *************** *** 819,823 **** return PyMember_Get((char *)self, memberlist, name); } ! int PyHH_POPUP::setattr(PyObject *self, char *name, PyObject *v) { --- 816,820 ---- return PyMember_Get((char *)self, memberlist, name); } ! int PyHH_POPUP::setattr(PyObject *self, char *name, PyObject *v) { *************** *** 827,831 **** return -1; } - PyHH_POPUP *pO = (PyHH_POPUP *)self; --- 824,827 ---- *************** *** 877,881 **** return PyMember_Set((char *)self, memberlist, name, v); } ! /*static*/ void PyHH_POPUP::deallocFunc(PyObject *ob) { --- 873,877 ---- return PyMember_Set((char *)self, memberlist, name, v); } ! /*static*/ void PyHH_POPUP::deallocFunc(PyObject *ob) { *************** *** 969,975 **** //<c HH_GET_WIN_TYPE><nl> ! PyTypeObject PyHH_WINTYPEType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHH_WINTYPE", /* tp_name */ sizeof(PyHH_WINTYPE), /* tp_basicsize */ --- 965,970 ---- //<c HH_GET_WIN_TYPE><nl> ! PyTypeObject PyHH_WINTYPEType = { ! PYWIN_OBJECT_HEAD "PyHH_WINTYPE", /* tp_name */ sizeof(PyHH_WINTYPE), /* tp_basicsize */ *************** *** 991,995 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 986,990 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HH_WINTYPE structure", /* tp_doc */ }; *************** *** 1249,1253 **** return -1; } - PyHH_WINTYPE *pO = (PyHH_WINTYPE *)self; --- 1244,1247 ---- *************** *** 1445,1450 **** PyTypeObject PyNMHDRType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyNMHDR", /* tp_name */ sizeof(PyNMHDR), /* tp_basicsize */ --- 1439,1443 ---- PyTypeObject PyNMHDRType = { ! PYWIN_OBJECT_HEAD "PyNMHDR", /* tp_name */ sizeof(PyNMHDR), /* tp_basicsize */ *************** *** 1466,1470 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 1459,1463 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an NMHDR structure", /* tp_doc */ }; *************** *** 1620,1625 **** PyTypeObject PyHHN_NOTIFYType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHHN_NOTIFY", /* tp_name */ sizeof(PyHHN_NOTIFY), /* tp_basicsize */ --- 1613,1617 ---- PyTypeObject PyHHN_NOTIFYType = { ! PYWIN_OBJECT_HEAD "PyHHN_NOTIFY", /* tp_name */ sizeof(PyHHN_NOTIFY), /* tp_basicsize */ *************** *** 1641,1645 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 1633,1637 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HHN_NOTIFY structure", /* tp_doc */ }; *************** *** 1721,1725 **** return -1; } - PyHHN_NOTIFY *pO = (PyHHN_NOTIFY *)self; --- 1713,1716 ---- *************** *** 1835,1840 **** PyTypeObject PyHHNTRACKType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHHNTRACK", /* tp_name */ sizeof(PyHHNTRACK), /* tp_basicsize */ --- 1826,1830 ---- PyTypeObject PyHHNTRACKType = { ! PYWIN_OBJECT_HEAD "PyHHNTRACK", /* tp_name */ sizeof(PyHHNTRACK), /* tp_basicsize */ *************** *** 1856,1860 **** 0, /* tp_as_buffer */ 0, /* tp_flags */ ! 0, /* tp_doc */ }; --- 1846,1850 ---- 0, /* tp_as_buffer */ 0, /* tp_flags */ ! "A Python object, representing an HHNTRACK structure.", /* tp_doc */ }; *************** *** 1928,1932 **** { PyHHNTRACK *pO = (PyHHNTRACK *)self; - if (strcmp("hdr", name)==0) { PyObject *rc = pO->m_hdr ? pO->m_hdr : Py_None; --- 1918,1921 ---- *************** *** 1955,1959 **** return -1; } - PyHHNTRACK *pO = (PyHHNTRACK *)self; --- 1944,1947 ---- Index: win2krasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win2krasmodule.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win2krasmodule.cpp 13 Nov 2008 11:11:58 -0000 1.7 --- win2krasmodule.cpp 3 Dec 2008 22:34:21 -0000 1.8 *************** *** 74,97 **** PyTypeObject PyRASEAPUSERIDENTITY::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyRASEAPUSERIDENTITY", sizeof(PyRASEAPUSERIDENTITY), 0, PyRASEAPUSERIDENTITY::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyRASEAPUSERIDENTITY::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ }; --- 74,96 ---- PyTypeObject PyRASEAPUSERIDENTITY::type = { ! PYWIN_OBJECT_HEAD "PyRASEAPUSERIDENTITY", sizeof(PyRASEAPUSERIDENTITY), 0, PyRASEAPUSERIDENTITY::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyRASEAPUSERIDENTITY::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ }; Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** odbc.cpp 21 Oct 2008 11:08:28 -0000 1.26 --- odbc.cpp 3 Dec 2008 22:34:21 -0000 1.27 *************** *** 111,116 **** static PyTypeObject Cursor_Type = { ! PyObject_HEAD_INIT (&PyType_Type) ! 0, /*ob_size */ "odbccur", /*tp_name */ sizeof(cursorObject), /*tp_basicsize */ --- 111,115 ---- static PyTypeObject Cursor_Type = { ! PYWIN_OBJECT_HEAD "odbccur", /*tp_name */ sizeof(cursorObject), /*tp_basicsize */ *************** *** 158,163 **** static PyTypeObject Connection_Type = { ! PyObject_HEAD_INIT (&PyType_Type) ! 0, /*ob_size */ "odbcconn", /*tp_name */ sizeof (connectionObject), /*tp_basicsize */ --- 157,161 ---- static PyTypeObject Connection_Type = { ! PYWIN_OBJECT_HEAD "odbcconn", /*tp_name */ sizeof (connectionObject), /*tp_basicsize */ Index: PyWAVEFORMATEX.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWAVEFORMATEX.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyWAVEFORMATEX.cpp 1 Dec 2004 23:13:57 -0000 1.2 --- PyWAVEFORMATEX.cpp 3 Dec 2008 22:34:21 -0000 1.3 *************** *** 43,48 **** PYWINTYPES_EXPORT PyTypeObject PyWAVEFORMATEXType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyWAVEFORMATEX", sizeof(PyWAVEFORMATEX), --- 43,47 ---- PYWINTYPES_EXPORT PyTypeObject PyWAVEFORMATEXType = { ! PYWIN_OBJECT_HEAD "PyWAVEFORMATEX", sizeof(PyWAVEFORMATEX), Index: PyHANDLE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PyHANDLE.cpp 3 Jun 2007 14:53:07 -0000 1.16 --- PyHANDLE.cpp 3 Dec 2008 22:34:21 -0000 1.17 *************** *** 139,144 **** PYWINTYPES_EXPORT PyTypeObject PyHANDLEType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHANDLE", sizeof(PyHANDLE), --- 139,143 ---- PYWINTYPES_EXPORT PyTypeObject PyHANDLEType = { ! PYWIN_OBJECT_HEAD "PyHANDLE", sizeof(PyHANDLE), *************** *** 150,163 **** 0, // PyHANDLE::setattr, /* tp_setattr */ // @pymeth __cmp__|Used when HANDLE objects are compared. ! PyHANDLE::compareFunc, /* tp_compare */ ! PyHANDLE::strFunc, /* tp_repr */ &PyHANDLE_NumberMethods, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ // @pymeth __hash__|Used when the hash value of an object is required ! PyHANDLE::hashFunc, /* tp_hash */ ! 0, /* tp_call */ // @pymeth __str__|Used when a string representation is required ! PyHANDLE::strFunc, /* tp_str */ }; --- 149,162 ---- 0, // PyHANDLE::setattr, /* tp_setattr */ // @pymeth __cmp__|Used when HANDLE objects are compared. ! PyHANDLE::compareFunc, /* tp_compare */ ! PyHANDLE::strFunc, /* tp_repr */ &PyHANDLE_NumberMethods, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ // @pymeth __hash__|Used when the hash value of an object is required ! PyHANDLE::hashFunc, /* tp_hash */ ! 0, /* tp_call */ // @pymeth __str__|Used when a string representation is required ! PyHANDLE::strFunc, /* tp_str */ }; *************** *** 309,315 **** PyObject * PyHANDLE::asStr(void) { ! TCHAR resBuf[160]; ! wsprintf(resBuf, _T("<%s:%Id>"), GetTypeName(), m_handle); ! return PyString_FromTCHAR(resBuf); } --- 308,314 ---- PyObject * PyHANDLE::asStr(void) { ! WCHAR resBuf[160]; ! _snwprintf(resBuf, 160, L"<%hs:%Id>", GetTypeName(), m_handle); ! return PyWinCoreString_FromString(resBuf); } Index: PyACL.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyACL.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyACL.cpp 23 Jul 2007 05:16:05 -0000 1.17 --- PyACL.cpp 3 Dec 2008 22:34:21 -0000 1.18 *************** *** 1134,1154 **** PYWINTYPES_EXPORT PyTypeObject PyACLType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyACL", sizeof(PyACL), 0, PyACL::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyACL::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 1134,1153 ---- PYWINTYPES_EXPORT PyTypeObject PyACLType = { ! PYWIN_OBJECT_HEAD "PyACL", sizeof(PyACL), 0, PyACL::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyACL::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: mmapfilemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/mmapfilemodule.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mmapfilemodule.cpp 13 Nov 2008 11:11:58 -0000 1.5 --- mmapfilemodule.cpp 3 Dec 2008 22:34:21 -0000 1.6 *************** *** 475,480 **** static PyTypeObject mmapfile_object_type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, // ob_size "mmapfile", // tp_name sizeof(mmapfile_object), // tp_size --- 475,479 ---- static PyTypeObject mmapfile_object_type = { ! PYWIN_OBJECT_HEAD "mmapfile", // tp_name sizeof(mmapfile_object), // tp_size Index: PyIID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyIID.cpp 13 Nov 2008 04:04:51 -0000 1.9 --- PyIID.cpp 3 Dec 2008 22:34:21 -0000 1.10 *************** *** 148,153 **** PYWINTYPES_EXPORT PyTypeObject PyIIDType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyIID", sizeof(PyIID), --- 148,152 ---- PYWINTYPES_EXPORT PyTypeObject PyIIDType = { ! PYWIN_OBJECT_HEAD "PyIID", sizeof(PyIID), *************** *** 169,176 **** // @pymeth __str__|Used whenever a string representation of the IID is required. PyIID::strFunc, /* tp_str */ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ // @comm Note that IID objects support the buffer interface. Thus buffer(iid) can be used to obtain the raw bytes. ! &PyIID_as_buffer, /*tp_as_buffer*/ }; --- 168,175 ---- // @pymeth __str__|Used whenever a string representation of the IID is required. PyIID::strFunc, /* tp_str */ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ // @comm Note that IID objects support the buffer interface. Thus buffer(iid) can be used to obtain the raw bytes. ! &PyIID_as_buffer, /*tp_as_buffer*/ }; Index: win32service.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32service.i,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** win32service.i 13 Nov 2008 11:11:58 -0000 1.18 --- win32service.i 3 Dec 2008 22:34:21 -0000 1.19 *************** *** 121,126 **** PyTypeObject PyHWINSTAType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHWINSTA", sizeof(PyHWINSTA), --- 121,125 ---- PyTypeObject PyHWINSTAType = { ! PYWIN_OBJECT_HEAD "PyHWINSTA", sizeof(PyHWINSTA), *************** *** 225,230 **** PyTypeObject PyHDESKType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyHDESK", sizeof(PyHDESK), --- 224,228 ---- PyTypeObject PyHDESKType = { ! PYWIN_OBJECT_HEAD "PyHDESK", sizeof(PyHDESK), *************** *** 239,243 **** 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ 0, /* tp_str */ --- 237,241 ---- 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ Index: win32file_comm.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file_comm.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32file_comm.cpp 13 Nov 2008 11:11:58 -0000 1.6 --- win32file_comm.cpp 3 Dec 2008 22:34:21 -0000 1.7 *************** *** 104,126 **** PyTypeObject PyDCB::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyDCB", sizeof(PyDCB), 0, PyDCB::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyDCB::getattr, /* tp_getattr */ PyDCB::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ - 0, 0, /* tp_call */ ! 0, /* tp_str */ }; #define OFF(e) offsetof(PyDCB, e) --- 104,126 ---- PyTypeObject PyDCB::type = { ! PYWIN_OBJECT_HEAD "PyDCB", sizeof(PyDCB), 0, PyDCB::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyDCB::getattr, /* tp_getattr */ PyDCB::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_call */ ! 0, /* tp_call */ ! 0, /* tp_str */ }; + #define OFF(e) offsetof(PyDCB, e) *************** *** 314,334 **** PyTypeObject PyCOMSTAT::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyCOMSTAT", sizeof(PyCOMSTAT), 0, ! PyCOMSTAT::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyCOMSTAT::getattr, /* tp_getattr */ PyCOMSTAT::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 314,333 ---- PyTypeObject PyCOMSTAT::type = { ! PYWIN_OBJECT_HEAD "PyCOMSTAT", sizeof(PyCOMSTAT), 0, ! PyCOMSTAT::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyCOMSTAT::getattr, /* tp_getattr */ PyCOMSTAT::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: PyDEVMODE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyDEVMODE.cpp 6 Feb 2008 18:37:46 -0000 1.7 --- PyDEVMODE.cpp 3 Dec 2008 22:34:21 -0000 1.8 *************** *** 113,118 **** PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyDEVMODE", sizeof(PyDEVMODE), --- 113,117 ---- PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType = { ! PYWIN_OBJECT_HEAD "PyDEVMODE", sizeof(PyDEVMODE), *************** *** 493,498 **** PYWINTYPES_EXPORT PyTypeObject PyDEVMODEWType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyDEVMODEW", sizeof(PyDEVMODEW), --- 492,496 ---- PYWINTYPES_EXPORT PyTypeObject PyDEVMODEWType = { ! PYWIN_OBJECT_HEAD "PyDEVMODEW", sizeof(PyDEVMODEW), |
From: Mark H. <mha...@us...> - 2008-12-03 22:34:25
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/win32/src/win32wnet Modified Files: PyNCB.cpp PyNetresource.cpp win32wnet.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: win32wnet.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/win32wnet.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** win32wnet.cpp 3 Jun 2007 14:53:07 -0000 1.13 --- win32wnet.cpp 3 Dec 2008 22:34:21 -0000 1.14 *************** *** 61,65 **** - /**************************************************************************** HELPER FUNCTIONS --- 61,64 ---- *************** *** 186,201 **** PyWNetCancelConnection2 (PyObject *self, PyObject *args) { ! LPSTR lpName; // @pyparm string|name||Name of existing connection to be closed DWORD dwFlags; // @pyparm int|flags||Currently determines if the persisent connection information will be updated as a result of this call. DWORD bForce; // @pyparm int|force||indicates if the close operation should be forced. (i.e. ignore open files and connections) DWORD ErrorNo; ! if(!PyArg_ParseTuple(args, "sii",&lpName, &dwFlags, &bForce)) return NULL; - Py_BEGIN_ALLOW_THREADS ErrorNo = WNetCancelConnection2(lpName, dwFlags, (BOOL)bForce); Py_END_ALLOW_THREADS ! if (ErrorNo != NO_ERROR) { --- 185,202 ---- PyWNetCancelConnection2 (PyObject *self, PyObject *args) { ! LPTSTR lpName; // @pyparm string|name||Name of existing connection to be closed DWORD dwFlags; // @pyparm int|flags||Currently determines if the persisent connection information will be updated as a result of this call. DWORD bForce; // @pyparm int|force||indicates if the close operation should be forced. (i.e. ignore open files and connections) DWORD ErrorNo; ! PyObject *obName; ! if(!PyArg_ParseTuple(args, "Okk", &obName, &dwFlags, &bForce)) ! return NULL; ! if (!PyWinObject_AsTCHAR(obName, &lpName, FALSE)) return NULL; Py_BEGIN_ALLOW_THREADS ErrorNo = WNetCancelConnection2(lpName, dwFlags, (BOOL)bForce); Py_END_ALLOW_THREADS ! PyWinObject_FreeTCHAR(lpName); if (ErrorNo != NO_ERROR) { *************** *** 220,232 **** // @pyparm int|type||Specifies the resource types to enumerate. // @pyparm int|usage||Specifies the resource usage to be enumerated. ! // @pyparm <o NETRESOURCE>|resource||Python NETRESOURCE object. if (!PyArg_ParseTuple(args, "iiiO", &dwScope,&dwType,&dwUsage,&ob_nr)) return NULL; ! if (ob_nr == Py_None) ! p_nr = NULL; ! else if ! (!PyWinObject_AsNETRESOURCE(ob_nr, &p_nr, FALSE)) ! return(ReturnError("failed converting NetResource Object","WNetOpenEnum")); Py_BEGIN_ALLOW_THREADS --- 221,230 ---- // @pyparm int|type||Specifies the resource types to enumerate. // @pyparm int|usage||Specifies the resource usage to be enumerated. ! // @pyparm <o PyNETRESOURCE>|resource||Python NETRESOURCE object. if (!PyArg_ParseTuple(args, "iiiO", &dwScope,&dwType,&dwUsage,&ob_nr)) return NULL; ! if (!PyWinObject_AsNETRESOURCE(ob_nr, &p_nr, TRUE)) ! return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 263,267 **** }; ! // @pymethod [<o NETRESOURCE>, ...]|win32wnet|WNetEnumResource|Enumerates a list of resources static PyObject * --- 261,265 ---- }; ! // @pymethod [<o PyNETRESOURCE>, ...]|win32wnet|WNetEnumResource|Enumerates a list of resources static PyObject * *************** *** 478,482 **** } ! // @pymethod (<o NETRESOURCE>, str)|win32wnet|WNetGetResourceInformation|Finds the type and provider of a network resource // @rdesc Returns a NETRESOURCE and a string containing the trailing part of the remote path PyObject * --- 476,480 ---- } ! // @pymethod (<o PyNETRESOURCE>, str)|win32wnet|WNetGetResourceInformation|Finds the type and provider of a network resource // @rdesc Returns a NETRESOURCE and a string containing the trailing part of the remote path PyObject * *************** *** 494,498 **** if (!PyArg_ParseTuple(args, "O!", &PyNETRESOURCEType, ! &NRT)) // @pyparm <o NETRESOURCE>|NetResource||Describes a network resource. lpRemoteName is required, dwType and lpProvider can be supplied if known return NULL; --- 492,496 ---- if (!PyArg_ParseTuple(args, "O!", &PyNETRESOURCEType, ! &NRT)) // @pyparm <o PyNETRESOURCE>|NetResource||Describes a network resource. lpRemoteName is required, dwType and lpProvider can be supplied if known return NULL; *************** *** 563,567 **** TCHAR errstr[1024], provider[256]; Py_BEGIN_ALLOW_THREADS ! err=WNetGetLastError(&extendederr, errstr, sizeof(errstr), provider, sizeof(provider)); Py_END_ALLOW_THREADS if (err==NO_ERROR) --- 561,565 ---- TCHAR errstr[1024], provider[256]; Py_BEGIN_ALLOW_THREADS ! err=WNetGetLastError(&extendederr, errstr, sizeof(errstr)/sizeof(TCHAR), provider, sizeof(provider)/sizeof(TCHAR)); Py_END_ALLOW_THREADS if (err==NO_ERROR) *************** *** 570,574 **** } ! // @pymethod <o NETRESOURCE>|win32wnet|WNetGetResourceParent|Finds the parent resource of a network resource PyObject *PyWNetGetResourceParent(PyObject *self, PyObject *args) { --- 568,572 ---- } ! // @pymethod <o PyNETRESOURCE>|win32wnet|WNetGetResourceParent|Finds the parent resource of a network resource PyObject *PyWNetGetResourceParent(PyObject *self, PyObject *args) { *************** *** 580,584 **** PyObject *obnr, *ret=NULL; if (!PyArg_ParseTuple(args, "O:WNetGetResourceParent", ! &obnr)) // @pyparm <o NETRESOURCE>|NetResource||Describes a network resource. lpRemoteName and lpProvider are required, dwType is recommended for efficiency return NULL; if (!PyWinObject_AsNETRESOURCE(obnr, &nr, FALSE)) --- 578,582 ---- PyObject *obnr, *ret=NULL; if (!PyArg_ParseTuple(args, "O:WNetGetResourceParent", ! &obnr)) // @pyparm <o PyNETRESOURCE>|NetResource||Describes a network resource. lpRemoteName and lpProvider are required, dwType is recommended for efficiency return NULL; if (!PyWinObject_AsNETRESOURCE(obnr, &nr, FALSE)) *************** *** 621,625 **** {"Netbios", PyWinMethod_Netbios, 1, "Calls the windows Netbios function"}, // @pymeth WNetAddConnection2|Creates a connection to a network resource. ! {"WNetAddConnection2", PyWNetAddConnection2, 1, "type,localname,remotename,provider,username,password (does not use NETRESOURCE)"}, // @pymeth WNetCancelConnection2|Closes network connections made by WNetAddConnection2 or 3 {"WNetCancelConnection2", PyWNetCancelConnection2, 1, "localname,dwflags,bforce"}, --- 619,623 ---- {"Netbios", PyWinMethod_Netbios, 1, "Calls the windows Netbios function"}, // @pymeth WNetAddConnection2|Creates a connection to a network resource. ! {"WNetAddConnection2", (PyCFunction)PyWNetAddConnection2, METH_KEYWORDS|METH_VARARGS, "WNetAddConnection2(NetResource, Password, UserName, Flags)"}, // @pymeth WNetCancelConnection2|Closes network connections made by WNetAddConnection2 or 3 {"WNetCancelConnection2", PyWNetCancelConnection2, 1, "localname,dwflags,bforce"}, *************** *** 660,662 **** Py_INCREF(PyWinExc_ApiError); } - --- 658,659 ---- Index: PyNetresource.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/PyNetresource.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyNetresource.cpp 19 Apr 2006 03:15:11 -0000 1.3 --- PyNetresource.cpp 3 Dec 2008 22:34:21 -0000 1.4 *************** *** 38,42 **** /* Main PYTHON entry point for creating a new reference. Registered by win32wnet module */ ! // @pymethod <o NETRESOURCE>|win32wnet|NETRESOURCE|Creates a new <o NETRESOURCE> object. PyObject *PyWinMethod_NewNETRESOURCE(PyObject *self, PyObject *args) --- 38,42 ---- /* Main PYTHON entry point for creating a new reference. Registered by win32wnet module */ ! // @pymethod <o PyNETRESOURCE>|win32wnet|NETRESOURCE|Creates a new <o NETRESOURCE> object. PyObject *PyWinMethod_NewNETRESOURCE(PyObject *self, PyObject *args) *************** *** 81,90 **** ! // @object NETRESOURCE|A Python object that encapsulates a Win32 NETRESOURCE structure. __declspec(dllexport) PyTypeObject PyNETRESOURCEType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyNETRESOURCE", sizeof(PyNETRESOURCE), --- 81,89 ---- ! // @object PyNETRESOURCE|A Python object that encapsulates a Win32 NETRESOURCE structure. __declspec(dllexport) PyTypeObject PyNETRESOURCEType = { ! PYWIN_OBJECT_HEAD "PyNETRESOURCE", sizeof(PyNETRESOURCE), *************** *** 104,116 **** }; - #define OFF(e) offsetof(PyNETRESOURCE, e) struct memberlist PyNETRESOURCE::memberlist[] = { ! {"dwScope", T_LONG, OFF(m_nr.dwScope), 0}, // @prop integer|dwScope| ! {"dwType", T_LONG, OFF(m_nr.dwType), 0}, // @prop integer|dwType| ! {"dwDisplayType", T_LONG,OFF(m_nr.dwDisplayType), 0}, // @prop integer|dwDisplayType| ! {"dwUsage", T_LONG, OFF(m_nr.dwUsage), 0}, // @prop integer|dwUsage| {"lpLocalName", T_STRING, OFF(m_nr.lpLocalName), 0}, // @prop string|localName| {"lpRemoteName",T_STRING, OFF(m_nr.lpRemoteName), 0},// @prop string|remoteName| --- 103,115 ---- }; #define OFF(e) offsetof(PyNETRESOURCE, e) struct memberlist PyNETRESOURCE::memberlist[] = { ! {"dwScope", T_ULONG, OFF(m_nr.dwScope), 0}, // @prop integer|dwScope| ! {"dwType", T_ULONG, OFF(m_nr.dwType), 0}, // @prop integer|dwType| ! {"dwDisplayType", T_ULONG,OFF(m_nr.dwDisplayType), 0}, // @prop integer|dwDisplayType| ! {"dwUsage", T_ULONG, OFF(m_nr.dwUsage), 0}, // @prop integer|dwUsage| ! {"lpLocalName", T_STRING, OFF(m_nr.lpLocalName), 0}, // @prop string|localName| {"lpRemoteName",T_STRING, OFF(m_nr.lpRemoteName), 0},// @prop string|remoteName| *************** *** 195,199 **** PyNETRESOURCE *This = (PyNETRESOURCE *)self; ! if (strcmp(name, "lpProvider") == 0) return PyWinObject_FromWCHAR(This->m_nr.lpProvider); else if --- 194,198 ---- PyNETRESOURCE *This = (PyNETRESOURCE *)self; ! if (strcmp(name, "lpProvider")==0) return PyWinObject_FromWCHAR(This->m_nr.lpProvider); else if *************** *** 215,224 **** int PyNETRESOURCE::setattr(PyObject *self, char *name, PyObject *v) { - PyNETRESOURCE *This = (PyNETRESOURCE *)self; - if (v == NULL) { PyErr_SetString(PyExc_AttributeError, "can't delete NETRESOURCE attributes"); return -1; } // the following specific string attributes can be set, all others generate an error. --- 214,222 ---- int PyNETRESOURCE::setattr(PyObject *self, char *name, PyObject *v) { if (v == NULL) { PyErr_SetString(PyExc_AttributeError, "can't delete NETRESOURCE attributes"); return -1; } + PyNETRESOURCE *This = (PyNETRESOURCE *)self; // the following specific string attributes can be set, all others generate an error. *************** *** 270,274 **** - void PyNETRESOURCE::deallocFunc(PyObject *ob) { --- 268,271 ---- Index: PyNCB.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/PyNCB.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyNCB.cpp 21 Oct 2005 06:14:04 -0000 1.4 --- PyNCB.cpp 3 Dec 2008 22:34:21 -0000 1.5 *************** *** 30,34 **** #endif ! #include <windows.h> #include "python.h" --- 30,34 ---- #endif ! #include "Pywintypes.h" #include <windows.h> #include "python.h" *************** *** 40,60 **** __declspec(dllexport)PyTypeObject PyNCBType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyNCB", sizeof(PyNCB), 0, ! PyNCB::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyNCB::getattr, /* tp_getattr */ PyNCB::setattr, /* tp_setattr */ // PyNCB::compareFunc, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* hash? */ ! 0, /* tp_call */ ! 0, /* tp_str */ }; --- 40,59 ---- __declspec(dllexport)PyTypeObject PyNCBType = { ! PYWIN_OBJECT_HEAD "PyNCB", sizeof(PyNCB), 0, ! PyNCB::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyNCB::getattr, /* tp_getattr */ PyNCB::setattr, /* tp_setattr */ // PyNCB::compareFunc, /* tp_compare */ ! 0, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ }; *************** *** 187,191 **** { PyNCB *This = (PyNCB *)self; - if (strcmp(name, "Callname") == 0) // these "strings" are not null terminated so build // a local representation of them and return --- 186,189 ---- *************** *** 309,311 **** } ! #endif \ No newline at end of file --- 307,309 ---- } ! #endif |
From: Mark H. <mha...@us...> - 2008-12-03 22:34:25
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/com/win32com/src/extensions Modified Files: PyFUNCDESC.cpp PySTGMEDIUM.cpp PyTYPEATTR.cpp PyVARDESC.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: PyTYPEATTR.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyTYPEATTR.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyTYPEATTR.cpp 24 May 2007 06:01:04 -0000 1.3 --- PyTYPEATTR.cpp 3 Dec 2008 22:34:20 -0000 1.4 *************** *** 49,69 **** PyTypeObject PyTYPEATTR::Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyTYPEATTR", sizeof(PyTYPEATTR), 0, ! PyTYPEATTR::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyTYPEATTR::getattr, /* tp_getattr */ PyTYPEATTR::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &PyTYPEATTR_Sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 49,68 ---- PyTypeObject PyTYPEATTR::Type = { ! PYWIN_OBJECT_HEAD "PyTYPEATTR", sizeof(PyTYPEATTR), 0, ! PyTYPEATTR::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyTYPEATTR::getattr, /* tp_getattr */ PyTYPEATTR::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &PyTYPEATTR_Sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: PySTGMEDIUM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PySTGMEDIUM.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PySTGMEDIUM.cpp 26 Nov 2008 01:19:25 -0000 1.9 --- PySTGMEDIUM.cpp 3 Dec 2008 22:34:20 -0000 1.10 *************** *** 106,126 **** PyTypeObject PySTGMEDIUM::Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PySTGMEDIUM", sizeof(PySTGMEDIUM), 0, PySTGMEDIUM::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySTGMEDIUM::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 106,125 ---- PyTypeObject PySTGMEDIUM::Type = { ! PYWIN_OBJECT_HEAD "PySTGMEDIUM", sizeof(PySTGMEDIUM), 0, PySTGMEDIUM::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PySTGMEDIUM::getattr, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: PyVARDESC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyVARDESC.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyVARDESC.cpp 1 Jul 2008 01:22:14 -0000 1.6 --- PyVARDESC.cpp 3 Dec 2008 22:34:21 -0000 1.7 *************** *** 96,116 **** PyTypeObject PyVARDESC::Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyVARDESC", sizeof(PyVARDESC), 0, PyVARDESC::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyVARDESC::getattr, /* tp_getattr */ PyVARDESC::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &PyVARDESC_Sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 96,115 ---- PyTypeObject PyVARDESC::Type = { ! PYWIN_OBJECT_HEAD "PyVARDESC", sizeof(PyVARDESC), 0, PyVARDESC::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyVARDESC::getattr, /* tp_getattr */ PyVARDESC::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &PyVARDESC_Sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; Index: PyFUNCDESC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyFUNCDESC.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyFUNCDESC.cpp 24 May 2007 06:01:04 -0000 1.2 --- PyFUNCDESC.cpp 3 Dec 2008 22:34:20 -0000 1.3 *************** *** 122,142 **** PyTypeObject PyFUNCDESC::Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyFUNCDESC", sizeof(PyFUNCDESC), 0, PyFUNCDESC::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyFUNCDESC::getattr, /* tp_getattr */ PyFUNCDESC::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &PyFUNCDESC_Sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 122,141 ---- PyTypeObject PyFUNCDESC::Type = { ! PYWIN_OBJECT_HEAD "PyFUNCDESC", sizeof(PyFUNCDESC), 0, PyFUNCDESC::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyFUNCDESC::getattr, /* tp_getattr */ PyFUNCDESC::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &PyFUNCDESC_Sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; |
From: Mark H. <mha...@us...> - 2008-12-03 22:34:24
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/Pythonwin Modified Files: win32uimodule.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: win32uimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** win32uimodule.cpp 13 Nov 2008 04:04:50 -0000 1.41 --- win32uimodule.cpp 3 Dec 2008 22:34:20 -0000 1.42 *************** *** 131,140 **** // probably better, as is forces _all_ python objects have the same type sig. static PyTypeObject type_template = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, /*ob_size*/ "template", /*tp_name*/ sizeof(ui_base_class), /*tp_size*/ 0, /*tp_itemsize*/ - /* methods */ (destructor) ui_base_class::sui_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ --- 131,138 ---- // probably better, as is forces _all_ python objects have the same type sig. static PyTypeObject type_template = { ! PYWIN_OBJECT_HEAD "template", /*tp_name*/ sizeof(ui_base_class), /*tp_size*/ 0, /*tp_itemsize*/ (destructor) ui_base_class::sui_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ *************** *** 143,147 **** 0, /*tp_compare*/ (reprfunc)ui_base_class::sui_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ }; --- 141,145 ---- 0, /*tp_compare*/ (reprfunc)ui_base_class::sui_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ }; *************** *** 2256,2269 **** return; dict = PyModule_GetDict(module); ! if (!dict) return; /* Another serious error!*/ ui_module_error = PyErr_NewException("win32ui.error", NULL, NULL); ! if (!ui_module_error) return; /* Another serious error!*/ ! PyDict_SetItemString(dict, "error", ui_module_error); // drop email addy - too many ppl use it for support requests for other // tools that simply embed Pythonwin... ! PyObject *copyright = PyWinCoreString_FromString("Copyright 1994-2008 Mark Hammond"); ! if ((copyright == NULL) || PyDict_SetItemString(dict, "copyright", copyright) == -1) ! RETURN_ERROR; ! Py_XDECREF(copyright); PyObject *dllhandle = PyWinLong_FromHANDLE(hWin32uiDll); --- 2254,2270 ---- return; dict = PyModule_GetDict(module); ! if (!dict) ! RETURN_ERROR; ! ui_module_error = PyErr_NewException("win32ui.error", NULL, NULL); ! if ((ui_module_error == NULL) || PyDict_SetItemString(dict, "error", ui_module_error) == -1) ! RETURN_ERROR; ! // drop email addy - too many ppl use it for support requests for other // tools that simply embed Pythonwin... ! PyObject *copyright = PyWinCoreString_FromString("Copyright 1994-2008 Mark Hammond"); ! if ((copyright == NULL) || PyDict_SetItemString(dict, "copyright", copyright) == -1) ! RETURN_ERROR; ! Py_XDECREF(copyright); PyObject *dllhandle = PyWinLong_FromHANDLE(hWin32uiDll); *************** *** 2280,2284 **** HookWindowsMessages(); // need to be notified of certain events... ! AddConstants(module); // Add all the types. --- 2281,2286 ---- HookWindowsMessages(); // need to be notified of certain events... ! if (AddConstants(module) == -1) ! RETURN_ERROR; // Add all the types. |
From: Mark H. <mha...@us...> - 2008-12-03 22:16:57
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32716/win32/src Modified Files: win32rasmodule.cpp Log Message: Change EnumConnections back to returning a list Index: win32rasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32rasmodule.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32rasmodule.cpp 3 Dec 2008 21:52:33 -0000 1.11 --- win32rasmodule.cpp 3 Dec 2008 22:16:53 -0000 1.12 *************** *** 551,555 **** pCon = &tc; } ! PyObject *ret = PyTuple_New(noConns); if (ret==NULL) return NULL; --- 551,555 ---- pCon = &tc; } ! PyObject *ret = PyList_New(noConns); if (ret==NULL) return NULL; *************** *** 566,570 **** break; } ! PyTuple_SET_ITEM(ret, i, item); } // @rdesc Each tuple is of format (handle, entryName, deviceType, deviceName) --- 566,570 ---- break; } ! PyList_SET_ITEM(ret, i, item); } // @rdesc Each tuple is of format (handle, entryName, deviceType, deviceName) |
From: Mark H. <mha...@us...> - 2008-12-03 22:16:45
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29538/win32/src Modified Files: win32pdhmodule.cpp Log Message: Merge unicode and 64bit fixes from py3k branch Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** win32pdhmodule.cpp 25 May 2008 00:44:43 -0000 1.17 --- win32pdhmodule.cpp 3 Dec 2008 21:34:22 -0000 1.18 *************** *** 36,40 **** // Function pointer typedefs typedef PDH_STATUS (WINAPI * FuncPdhEnumObjects)( ! LPCTSTR szReserved, // reserved LPCTSTR szMachineName, // machine name LPTSTR mszObjectList, // buffer for objects --- 36,40 ---- // Function pointer typedefs typedef PDH_STATUS (WINAPI * FuncPdhEnumObjects)( ! LPCTSTR szReserved, // DataSource LPCTSTR szMachineName, // machine name LPTSTR mszObjectList, // buffer for objects *************** *** 45,49 **** typedef PDH_STATUS (WINAPI * FuncPdhEnumObjectItems)( ! LPCTSTR szReserved, // reserved LPCTSTR szMachineName, // machine name LPCTSTR szObjectName, // object name --- 45,49 ---- typedef PDH_STATUS (WINAPI * FuncPdhEnumObjectItems)( ! LPCTSTR szReserved, // DataSource LPCTSTR szMachineName, // machine name LPCTSTR szObjectName, // object name *************** *** 57,62 **** typedef PDH_STATUS (WINAPI * FuncPdhOpenQuery)( ! LPVOID pReserved, // reserved ! 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 ) ; *************** *** 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 ); *************** *** 108,112 **** typedef PDH_STATUS (WINAPI * FuncPdhExpandCounterPath)( LPCTSTR szWildCardPath, // counter path to expand ! LPSTR mszExpandedPathList, // names that match LPDWORD pcchPathListLength // size of buffer ); --- 108,112 ---- typedef PDH_STATUS (WINAPI * FuncPdhExpandCounterPath)( LPCTSTR szWildCardPath, // counter path to expand ! LPTSTR mszExpandedPathList, // names that match LPDWORD pcchPathListLength // size of buffer ); *************** *** 125,132 **** typedef PDH_STATUS (WINAPI *FuncPdhParseInstanceName) ( ! LPCSTR szInstanceString, ! LPSTR szInstanceName, LPDWORD pcchInstanceNameLength, ! LPSTR szParentName, LPDWORD pcchParentNameLength, LPDWORD lpIndex --- 125,132 ---- typedef PDH_STATUS (WINAPI *FuncPdhParseInstanceName) ( ! LPCTSTR szInstanceString, ! LPTSTR szInstanceName, LPDWORD pcchInstanceNameLength, ! LPTSTR szParentName, LPDWORD pcchParentNameLength, LPDWORD lpIndex *************** *** 134,138 **** typedef PDH_STATUS (WINAPI *FuncPdhBrowseCounters) ( ! PPDH_BROWSE_DLG_CONFIG_A pBrowseDlgData ); --- 134,138 ---- typedef PDH_STATUS (WINAPI *FuncPdhBrowseCounters) ( ! PPDH_BROWSE_DLG_CONFIG pBrowseDlgData ); *************** *** 184,213 **** static PyObject *win32pdh_counter_error; BOOL LoadPointers() { ! HMODULE handle = LoadLibrary("pdh.dll"); if (handle==NULL) { // PyErr_SetString(PyExc_RuntimeError, "The PDH DLL could not be located"); 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 --- 184,220 ---- 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() { ! HMODULE handle = LoadLibrary(_T("pdh.dll")); if (handle==NULL) { // PyErr_SetString(PyExc_RuntimeError, "The PDH DLL could not be located"); 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 *************** *** 231,235 **** { DWORD detailLevel, flags = 0; ! char *reserved; PyObject *obMachine, *obObject; if (!PyArg_ParseTuple(args, "zOOi|i:EnumObjectItems", --- 238,242 ---- { DWORD detailLevel, flags = 0; ! TCHAR *reserved; PyObject *obMachine, *obObject; if (!PyArg_ParseTuple(args, "zOOi|i:EnumObjectItems", *************** *** 327,353 **** } ! PyObject *retCounter = PyList_New(0); ! if (szCounterListBuffer) ! for (szTemp = szCounterListBuffer; ! *szTemp != 0; ! szTemp += lstrlen(szTemp) + 1) { ! PyObject *obTemp = PyString_FromString(szTemp); ! PyList_Append(retCounter, obTemp); ! Py_XDECREF(obTemp); ! } ! PyObject *retInstance = PyList_New(0); if (szInstanceListBuffer) ! for (szTemp = szInstanceListBuffer; ! *szTemp != 0; ! szTemp += lstrlen(szTemp) + 1) { ! PyObject *obTemp = PyString_FromString(szTemp); ! PyList_Append(retInstance, obTemp); ! Py_XDECREF(obTemp); ! } ! PyObject *rc = Py_BuildValue("OO", retCounter, retInstance); ! Py_XDECREF(retCounter); ! Py_XDECREF(retInstance); ! free(szInstanceListBuffer); ! free(szCounterListBuffer); return rc; } --- 334,345 ---- } ! PyObject *rc = Py_BuildValue("NN", ! szCounterListBuffer ? PyWinObject_FromMultipleString(szCounterListBuffer) : PyList_New(0), ! szInstanceListBuffer ? PyWinObject_FromMultipleString(szInstanceListBuffer) : PyList_New(0)); ! if (szInstanceListBuffer) ! free(szInstanceListBuffer); ! if (szCounterListBuffer) ! free(szCounterListBuffer); return rc; } *************** *** 357,361 **** { DWORD detailLevel, refresh=1; ! char *reserved; PyObject *obMachine; if (!PyArg_ParseTuple(args, "zOi|i:EnumObjects", --- 349,353 ---- { DWORD detailLevel, refresh=1; ! TCHAR *reserved; // Is now DataSource (name of a performance log file) PyObject *obMachine; if (!PyArg_ParseTuple(args, "zOi|i:EnumObjects", *************** *** 382,386 **** pdhStatus = (*pPdhEnumObjects) ( ! reserved, // reserved strMachine, // local machine szObjectListBuffer, // pass in NULL buffers --- 374,378 ---- pdhStatus = (*pPdhEnumObjects) ( ! reserved, // DataSource strMachine, // local machine szObjectListBuffer, // pass in NULL buffers *************** *** 411,415 **** Py_BEGIN_ALLOW_THREADS pdhStatus = (*pPdhEnumObjects) ( ! reserved, // reserved strMachine, // local machine szObjectListBuffer, // pass in NULL buffers --- 403,407 ---- Py_BEGIN_ALLOW_THREADS pdhStatus = (*pPdhEnumObjects) ( ! reserved, // DataSource strMachine, // local machine szObjectListBuffer, // pass in NULL buffers *************** *** 425,439 **** } ! PyObject *retObject = PyList_New(0); if (szObjectListBuffer) ! for (szTemp = szObjectListBuffer; ! *szTemp != 0; ! szTemp += lstrlen(szTemp) + 1) { ! PyObject *obTemp = PyString_FromString(szTemp); ! PyList_Append(retObject, obTemp); ! Py_XDECREF(obTemp); ! } ! free(szObjectListBuffer); ! Py_INCREF(retObject); return retObject; } --- 417,423 ---- } ! PyObject *retObject = szObjectListBuffer ? PyWinObject_FromMultipleString(szObjectListBuffer) : PyList_New(0); if (szObjectListBuffer) ! free(szObjectListBuffer); return retObject; } *************** *** 445,461 **** 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) ( *************** *** 499,507 **** static PyObject *PyOpenQuery(PyObject *self, PyObject *args) { ! DWORD userData = 0; ! char *reserved = NULL; ! 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; --- 488,497 ---- 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; *************** *** 509,519 **** 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); --- 499,516 ---- 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); *************** *** 548,553 **** { PyObject *rc = NULL; ! char szResult[512]; ! DWORD bufSize = sizeof(szResult); DWORD flags = 0; DWORD dwInstanceIndex; --- 545,550 ---- { PyObject *rc = NULL; ! TCHAR szResult[512]; ! DWORD bufSize = sizeof(szResult)/sizeof(TCHAR); DWORD flags = 0; DWORD dwInstanceIndex; *************** *** 607,611 **** rc = PyWin_SetAPIError("MakeCounterPath for data", pdhStatus); else ! rc = PyString_FromString(szResult); done: --- 604,608 ---- rc = PyWin_SetAPIError("MakeCounterPath for data", pdhStatus); else ! rc = PyWinObject_FromTCHAR(szResult); done: *************** *** 654,679 **** 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); *************** *** 712,716 **** 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"); *************** *** 789,805 **** */ // @comm The result is limited to 4096 bytes! ! char *buf = (char *)malloc(dwSize * sizeof(TCHAR)); ! PDH_STATUS pdhStatus = (*pPdhExpandCounterPath) (path, buf, &dwSize); PyObject *rc; if (pdhStatus != ERROR_SUCCESS) rc = PyWin_SetAPIError("ExpandCounterPath for data", pdhStatus); ! else { ! rc = PyList_New(0); ! for (char *szTemp = buf;*szTemp != 0;szTemp += lstrlen(szTemp) + 1) { ! PyObject *obTemp = PyString_FromString(szTemp); ! PyList_Append(rc, obTemp); ! Py_XDECREF(obTemp); ! } ! } PyWinObject_FreeTCHAR(path); free(buf); --- 788,803 ---- */ // @comm The result is limited to 4096 bytes! ! TCHAR *buf = (TCHAR *)malloc(dwSize * sizeof(TCHAR)); ! if (buf==NULL){ ! PyErr_NoMemory(); ! PyWinObject_FreeTCHAR(path); ! return NULL; ! } ! PDH_STATUS pdhStatus = (*pPdhExpandCounterPath) (path, buf, &dwSize); PyObject *rc; if (pdhStatus != ERROR_SUCCESS) rc = PyWin_SetAPIError("ExpandCounterPath for data", pdhStatus); ! else ! rc = PyWinObject_FromMultipleString(buf); PyWinObject_FreeTCHAR(path); free(buf); *************** *** 848,858 **** 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); *************** *** 881,885 **** 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); } *************** *** 917,921 **** 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); --- 918,925 ---- 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); *************** *** 983,987 **** pcfg->pCallBack = PyCounterPathCallback; ! pcfg->szReturnPathBuffer = (char *)malloc(1024); pcfg->cchReturnPathLength = 1024; --- 987,991 ---- pcfg->pCallBack = PyCounterPathCallback; ! pcfg->szReturnPathBuffer = (TCHAR *)malloc(1024 * sizeof(TCHAR)); pcfg->cchReturnPathLength = 1024; *************** *** 998,1002 **** } else ! rc = PyString_FromString(pcfg->szReturnPathBuffer); // Note - myCfg does not own any references --- 1002,1006 ---- } else ! rc = PyWinObject_FromTCHAR(pcfg->szReturnPathBuffer); // Note - myCfg does not own any references *************** *** 1112,1148 **** }; - /* Initialize this module. */ - int AddConstant(PyObject *dict, char *key, long value) - { - PyObject *okey = PyString_FromString(key); - PyObject *oval = PyLong_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 ! initwin32pdh(void) { InitializeCriticalSection(&critSec); PyObject *dict, *module; module = Py_InitModule("win32pdh", win32pdh_functions); ! if (!module) /* Eeek - some serious error! */ ! return; dict = PyModule_GetDict(module); ! if (!dict) return; ! PyWinGlobals_Ensure(); ! 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. --- 1116,1159 ---- }; + #define ADD_CONSTANT(tok) PyModule_AddIntConstant(module, #tok, tok) ! extern"C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32pdh(void) ! #else ! PyObject *PyInit_win32pdh(void) ! #endif { 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, ! "win32pdh", ! "A module, encapsulating the Windows Performance Data Helpers API", ! -1, ! win32pdh_functions ! }; ! 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. *************** *** 1167,1169 **** --- 1178,1183 ---- ADD_CONSTANT(PERF_DETAIL_WIZARD); // ADD_CONSTANT(); + #if (PY_VERSION_HEX >= 0x03000000) + return module; + #endif } |
From: Mark H. <mha...@us...> - 2008-12-03 21:55:03
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30763/win32/src Modified Files: win32rasmodule.cpp Log Message: Many unicode and py3k friendly fixes from py3k branch Index: win32rasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32rasmodule.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win32rasmodule.cpp 12 Jul 2007 07:40:26 -0000 1.10 --- win32rasmodule.cpp 3 Dec 2008 21:52:33 -0000 1.11 *************** *** 51,55 **** { const int bufSize = 512; ! char buf[bufSize]; DWORD errorCode = err == 0 ? GetLastError() : err; BOOL bHaveMessage = FALSE; --- 51,55 ---- { const int bufSize = 512; ! TCHAR buf[bufSize]; DWORD errorCode = err == 0 ? GetLastError() : err; BOOL bHaveMessage = FALSE; *************** *** 62,74 **** } if (!bHaveMessage) ! strcpy(buf,"No error message is available"); /* strip trailing cr/lf */ ! size_t end = strlen(buf)-1; ! if (end>1 && (buf[end-1]=='\n' || buf[end-1]=='\r')) ! buf[end-1] = '\0'; else ! if (end>0 && (buf[end]=='\n' || buf[end]=='\r')) ! buf[end]='\0'; ! PyObject *v = Py_BuildValue("(iss)", errorCode, fnName, buf); if (v != NULL) { PyErr_SetObject(module_error, v); --- 62,76 ---- } if (!bHaveMessage) ! _tcscpy(buf, _T("No error message is available")); /* strip trailing cr/lf */ ! size_t end = _tcslen(buf)-1; ! if (end>1 && (buf[end-1]==_T('\n') || buf[end-1]==_T('\r'))) ! buf[end-1] = 0; else ! if (end>0 && (buf[end]==_T('\n') || buf[end]==_T('\r'))) ! buf[end]=0; ! PyObject *v = Py_BuildValue("(iNN)", errorCode, ! PyWinCoreString_FromString(fnName), ! PyWinObject_FromTCHAR(buf)); if (v != NULL) { PyErr_SetObject(module_error, v); *************** *** 131,135 **** #define PyRASDIALEXTENSIONS_Check(ob) ((ob)->ob_type == &PyRASDIALEXTENSIONS::type) ! // @object RASDIALEXTENSIONS|An object that describes a Win32 RASDIALPARAMS structure BOOL PyWinObject_AsRASDIALEXTENSIONS(PyObject *ob, RASDIALEXTENSIONS **ppRASDIALEXTENSIONS, BOOL bNoneOK /*= TRUE*/) { --- 133,137 ---- #define PyRASDIALEXTENSIONS_Check(ob) ((ob)->ob_type == &PyRASDIALEXTENSIONS::type) ! // @object RASDIALEXTENSIONS|An object that describes a Win32 RASDIALEXTENSIONS structure BOOL PyWinObject_AsRASDIALEXTENSIONS(PyObject *ob, RASDIALEXTENSIONS **ppRASDIALEXTENSIONS, BOOL bNoneOK /*= TRUE*/) { *************** *** 154,177 **** PyTypeObject PyRASDIALEXTENSIONS::type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyRASDIALEXTENSIONS", sizeof(PyRASDIALEXTENSIONS), 0, PyRASDIALEXTENSIONS::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyRASDIALEXTENSIONS::getattr, /* tp_getattr */ PyRASDIALEXTENSIONS::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ 0, /*tp_getattro*/ 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ }; --- 156,178 ---- PyTypeObject PyRASDIALEXTENSIONS::type = { ! PYWIN_OBJECT_HEAD "PyRASDIALEXTENSIONS", sizeof(PyRASDIALEXTENSIONS), 0, PyRASDIALEXTENSIONS::deallocFunc, /* tp_dealloc */ ! 0, /* tp_print */ PyRASDIALEXTENSIONS::getattr, /* tp_getattr */ PyRASDIALEXTENSIONS::setattr, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hahs */ 0, /* tp_call */ ! 0, /* tp_str */ 0, /*tp_getattro*/ 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ }; *************** *** 198,212 **** return PyInt_FromLong( py->m_ext.dwfOptions); // @prop integer|hwndParent| ! else if (strcmp(name, "hwndParent")==0) return PyLong_FromVoidPtr( py->m_ext.hwndParent ); // @prop integer|reserved| ! else if (strcmp(name, "reserved")==0) return PyWinObject_FromULONG_PTR(py->m_ext.reserved); #if (WINVER >= 0x500) // @prop integer|reserved1| ! else if (strcmp(name, "reserved1")==0) return PyWinObject_FromULONG_PTR(py->m_ext.reserved1); // @prop <o RASEAPINFO>|RasEapInfo| ! else if (strcmp(name, "RasEapInfo")==0) { Py_INCREF(py->m_pyeap); return py->m_pyeap; --- 199,213 ---- return PyInt_FromLong( py->m_ext.dwfOptions); // @prop integer|hwndParent| ! if (strcmp(name, "hwndParent")==0) return PyLong_FromVoidPtr( py->m_ext.hwndParent ); // @prop integer|reserved| ! if (strcmp(name, "reserved")==0) return PyWinObject_FromULONG_PTR(py->m_ext.reserved); #if (WINVER >= 0x500) // @prop integer|reserved1| ! if (strcmp(name, "reserved1")==0) return PyWinObject_FromULONG_PTR(py->m_ext.reserved1); // @prop <o RASEAPINFO>|RasEapInfo| ! if (strcmp(name, "RasEapInfo")==0) { Py_INCREF(py->m_pyeap); return py->m_pyeap; *************** *** 239,247 **** } #if (WINVER >= 0x500) ! else if (strcmp(name, "reserved1")==0) { long v = PyLong_AsLong( val ); if (PyErr_Occurred()) return -1; py->m_ext.reserved1 = v; ! } else if (strcmp(name, "RasEapInfo")==0) { RASEAPUSERIDENTITY *temp; if (!myPyWinObject_AsRASEAPUSERIDENTITY(val, &temp)) --- 240,249 ---- } #if (WINVER >= 0x500) ! if (strcmp(name, "reserved1")==0) { long v = PyLong_AsLong( val ); if (PyErr_Occurred()) return -1; py->m_ext.reserved1 = v; ! } ! if (strcmp(name, "RasEapInfo")==0) { RASEAPUSERIDENTITY *temp; if (!myPyWinObject_AsRASEAPUSERIDENTITY(val, &temp)) *************** *** 252,256 **** py->m_pyeap = val; Py_INCREF(val); ! } #endif else { --- 254,258 ---- py->m_pyeap = val; Py_INCREF(val); ! } #endif else { *************** *** 380,384 **** // @pyparm int|error||The error state of the connection // @pyparm int|extendedError|| ! PyObject *args = Py_BuildValue("iiiii",hrasconn, unMsg, rascs, dwError, dwExtendedError); if (args==NULL) return; PyObject *res = PyEval_CallObject(handler, args); --- 382,386 ---- // @pyparm int|error||The error state of the connection // @pyparm int|extendedError|| ! PyObject *args = Py_BuildValue("Niiii", PyWinLong_FromHANDLE(hrasconn), unMsg, rascs, dwError, dwExtendedError); if (args==NULL) return; PyObject *res = PyEval_CallObject(handler, args); *************** *** 477,481 **** PyErr_Clear(); } ! return Py_BuildValue( "ii", hRas, rc ); // @rdesc The return value is (handle, retCode). // <nl>It is possible for a valid handle to be returned even on failure. --- 479,483 ---- PyErr_Clear(); } ! return Py_BuildValue( "Ni", PyWinLong_FromHANDLE(hRas), rc ); // @rdesc The return value is (handle, retCode). // <nl>It is possible for a valid handle to be returned even on failure. *************** *** 549,559 **** pCon = &tc; } ! PyObject *ret = PyList_New(0); if (ret==NULL) return NULL; ! for (DWORD i=0;i<noConns;i++) ! PyList_Append( ret, Py_BuildValue("(isss)", pCon[i].hrasconn, pCon[i].szEntryName, pCon[i].szDeviceType, pCon[i].szDeviceName) ); ! // @rdesc Each tuple is of format (handle, entryName, deviceType, deviceName) if (pCon && pCon != &tc) --- 551,571 ---- pCon = &tc; } ! PyObject *ret = PyTuple_New(noConns); if (ret==NULL) return NULL; ! for (DWORD i=0;i<noConns;i++){ ! PyObject *item=Py_BuildValue("(NNNN)", ! PyWinLong_FromHANDLE(pCon[i].hrasconn), ! PyWinObject_FromTCHAR(pCon[i].szEntryName), ! PyWinObject_FromTCHAR(pCon[i].szDeviceType), ! PyWinObject_FromTCHAR(pCon[i].szDeviceName)); ! if (item==NULL){ ! Py_DECREF(ret); ! ret=NULL; ! break; ! } ! PyTuple_SET_ITEM(ret, i, item); ! } // @rdesc Each tuple is of format (handle, entryName, deviceType, deviceName) if (pCon && pCon != &tc) *************** *** 567,608 **** { DWORD rc; ! DWORD bufSize; ! DWORD noConns = 0; ! char *reserved = NULL; ! char *bookName = NULL; ! RASENTRYNAME tc; ! if (!PyArg_ParseTuple(args, "|zz:EnumEntries", ! &reserved, // @pyparm string|reserved|None|Reserved - must be None ! &bookName)) // @pyparm string|fileName|None|The name of the phonebook file, or None. return NULL; ! // make dummy call to determine buffer size. ! tc.dwSize = bufSize = sizeof(RASENTRYNAME); ! Py_BEGIN_ALLOW_THREADS ! RasEnumEntries(reserved, bookName, &tc, &bufSize, &noConns); ! Py_END_ALLOW_THREADS ! RASENTRYNAME *pE = NULL; ! if (bufSize) { ! pE = (RASENTRYNAME *)malloc(bufSize); ! if (pE==NULL) { ! PyErr_SetString(PyExc_MemoryError, "Allocating buffer for RAS entries"); ! return NULL; ! } ! // @pyseeapi RasEnumEntries ! pE[0].dwSize = sizeof(RASENTRYNAME); Py_BEGIN_ALLOW_THREADS ! rc=RasEnumEntries(reserved, bookName, pE, &bufSize, &noConns); Py_END_ALLOW_THREADS ! if (rc!=0) ! return ReturnRasError("RasEnumEntries", rc); ! } ! PyObject *ret = PyList_New(0); ! if (ret==NULL) ! return NULL; ! for (DWORD i=0;i<noConns;i++) ! PyList_Append( ret, Py_BuildValue("(s)", pE[i].szEntryName ) ); ! if (pE) ! free(pE); return ret; } --- 579,637 ---- { DWORD rc; ! DWORD bufSize=3*sizeof(RASENTRYNAME); ! RASENTRYNAME *buf = NULL; ! DWORD noConns = 0, i; ! TCHAR *reserved = NULL; ! TCHAR *bookName = NULL; ! PyObject *obreserved=Py_None, *obbookName=Py_None, *ret=NULL; ! ! if (!PyArg_ParseTuple(args, "|OO:EnumEntries", ! &obreserved, // @pyparm string|reserved|None|Reserved - must be None ! &obbookName)) // @pyparm string|fileName|None|The name of the phonebook file, or None. return NULL; + if (!PyWinObject_AsTCHAR(obreserved, &reserved, TRUE) || + !PyWinObject_AsTCHAR(obbookName, &bookName, TRUE)) + goto cleanup; ! while (true){ ! if (buf) ! free(buf); ! buf=(RASENTRYNAME *)malloc(bufSize); ! if (buf==NULL){ ! PyErr_NoMemory(); ! goto cleanup; ! } ! // ??? Not sure if this is needed, only sets the size of first struct in buf ??? ! buf->dwSize = sizeof(RASENTRYNAME); Py_BEGIN_ALLOW_THREADS ! rc=RasEnumEntries(reserved, bookName, buf, &bufSize, &noConns); Py_END_ALLOW_THREADS ! if (rc==0) ! break; ! if (rc==ERROR_BUFFER_TOO_SMALL) ! continue; ! ReturnRasError("RasEnumEntries", rc); ! goto cleanup; ! } ! ret = PyTuple_New(noConns); ! if (!ret) ! goto cleanup; ! for (i=0;i<noConns;i++){ ! PyObject *item=PyWinObject_FromTCHAR(buf[i].szEntryName); ! // ??? This struct now has some extra data ??? ! if (item==NULL){ ! Py_DECREF(ret); ! ret=NULL; ! break; ! } ! PyTuple_SET_ITEM(ret, i, item); ! } ! ! cleanup: ! if (buf) ! free(buf); ! PyWinObject_FreeTCHAR(reserved); ! PyWinObject_FreeTCHAR(bookName); return ret; } *************** *** 632,655 **** PyRasGetEntryDialParams( PyObject *self, PyObject *args ) { ! char *fileName; ! char *entryName; DWORD rc; ! if (!PyArg_ParseTuple(args, "zs:GetEntryDialParams", ! &fileName, // @pyparm string|fileName||The filename of the phonebook, or None. ! &entryName)) // @pyparm string|entryName||The name of the entry to retrieve the params for. return NULL; ! RASDIALPARAMS dp; ! BOOL bPass; ! dp.dwSize = sizeof(RASDIALPARAMS); ! strncpy(dp.szEntryName, entryName, RAS_MaxEntryName + 1); ! dp.szEntryName[RAS_MaxEntryName] = '\0'; ! // @pyseeapi RasGetEntryDialParams ! if ((rc=RasGetEntryDialParams(fileName, &dp, &bPass ))) ! return ReturnRasError("RasGetEntryDialParams",rc); // @pyseeapi RasGetConnectStatus ! return Py_BuildValue("(ssssss),i", ! dp.szEntryName, dp.szPhoneNumber, ! dp.szCallbackNumber, dp.szUserName, ! dp.szPassword, dp.szDomain, bPass ); // @rdesc The return value is a tuple describing the params retrieved, plus a BOOL integer // indicating if the password was also retrieved. --- 661,696 ---- PyRasGetEntryDialParams( PyObject *self, PyObject *args ) { ! TCHAR *fileName=NULL; ! TCHAR *entryName=NULL; ! PyObject *obfileName, *obentryName, *ret=NULL; DWORD rc; ! if (!PyArg_ParseTuple(args, "OO:GetEntryDialParams", ! &obfileName, // @pyparm string|fileName||The filename of the phonebook, or None. ! &obentryName)) // @pyparm string|entryName||The name of the entry to retrieve the params for. return NULL; ! if (PyWinObject_AsTCHAR(obfileName, &fileName, TRUE) ! && PyWinObject_AsTCHAR(obentryName, &entryName, FALSE)){ ! RASDIALPARAMS dp; ! BOOL bPass; ! dp.dwSize = sizeof(RASDIALPARAMS); ! _tcsncpy(dp.szEntryName, entryName, RAS_MaxEntryName + 1); ! dp.szEntryName[RAS_MaxEntryName] = '\0'; ! // @pyseeapi RasGetEntryDialParams ! if ((rc=RasGetEntryDialParams(fileName, &dp, &bPass ))) ! ReturnRasError("RasGetEntryDialParams",rc); // @pyseeapi RasGetConnectStatus ! else ! ret = Py_BuildValue("(NNNNNN),N", ! PyWinObject_FromTCHAR(dp.szEntryName), ! PyWinObject_FromTCHAR(dp.szPhoneNumber), ! PyWinObject_FromTCHAR(dp.szCallbackNumber), ! PyWinObject_FromTCHAR(dp.szUserName), ! PyWinObject_FromTCHAR(dp.szPassword), ! PyWinObject_FromTCHAR(dp.szDomain), ! PyBool_FromLong(bPass)); ! } ! PyWinObject_FreeTCHAR(fileName); ! PyWinObject_FreeTCHAR(entryName); ! return ret; // @rdesc The return value is a tuple describing the params retrieved, plus a BOOL integer // indicating if the password was also retrieved. *************** *** 666,674 **** return NULL; ! char buf[512]; // @pyseeapi RasGetErrorString ! if (rc=RasGetErrorString(error, buf, sizeof(buf))) return ReturnRasError("RasGetErrorString"); ! return Py_BuildValue("s", buf); } --- 707,715 ---- return NULL; ! TCHAR buf[512]; // @pyseeapi RasGetErrorString ! if (rc=RasGetErrorString(error, buf, sizeof(buf)/sizeof(buf[0]))) return ReturnRasError("RasGetErrorString"); ! return PyWinObject_FromTCHAR(buf); } *************** *** 679,684 **** DWORD rc; HRASCONN hras; ! if (!PyArg_ParseTuple(args, "i:HangUp", ! &hras)) // @pyparm int|hras||The handle to the RAS connection to be terminated. return NULL; --- 720,725 ---- DWORD rc; HRASCONN hras; ! if (!PyArg_ParseTuple(args, "O&:HangUp", ! PyWinObject_AsHANDLE, &hras)) // @pyparm int|hras||The handle to the RAS connection to be terminated. return NULL; *************** *** 696,704 **** { HRASCONN hras; ! if (!PyArg_ParseTuple(args, "i:IsHandleValid", ! &hras)) // @pyparm int|hras||The handle to the RAS connection being checked. return NULL; BOOL bRet = (hras>=0); ! return Py_BuildValue("i", bRet); } --- 737,745 ---- { HRASCONN hras; ! if (!PyArg_ParseTuple(args, "O&:IsHandleValid", ! PyWinObject_AsHANDLE, &hras)) // @pyparm int|hras||The handle to the RAS connection being checked. return NULL; BOOL bRet = (hras>=0); ! return PyBool_FromLong(bRet); } *************** *** 708,718 **** PyRasSetEntryDialParams( PyObject *self, PyObject *args ) { ! char *fileName; ! PyObject *obParams; RASDIALPARAMS dialParams; DWORD rc; BOOL bRemPass; ! if (!PyArg_ParseTuple(args, "zOi:SetEntryDialParams", ! &fileName, // @pyparm string|fileName||The filename of the phonebook, or None. &obParams,// @pyparm (tuple)|RasDialParams||A tuple describing a RASDIALPARAMS structure. &bRemPass)) // @pyparm int|bSavePassword||Indicates whether to remove password from entry's parameters. --- 749,759 ---- PyRasSetEntryDialParams( PyObject *self, PyObject *args ) { ! TCHAR *fileName; ! PyObject *obfileName, *obParams; RASDIALPARAMS dialParams; DWORD rc; BOOL bRemPass; ! if (!PyArg_ParseTuple(args, "OOi:SetEntryDialParams", ! &obfileName, // @pyparm string|fileName||The filename of the phonebook, or None. &obParams,// @pyparm (tuple)|RasDialParams||A tuple describing a RASDIALPARAMS structure. &bRemPass)) // @pyparm int|bSavePassword||Indicates whether to remove password from entry's parameters. *************** *** 721,726 **** if (!PyObjectToRasDialParams( obParams, &dialParams )) return NULL; ! // @pyseeapi SetEntryDialParams ! if ((rc=RasSetEntryDialParams(fileName, &dialParams, bRemPass))) return ReturnRasError("SetEntryDialParams",rc); // @pyseeapi RasGetConnectStatus Py_INCREF(Py_None); --- 762,771 ---- if (!PyObjectToRasDialParams( obParams, &dialParams )) return NULL; ! if (!PyWinObject_AsTCHAR(obfileName, &fileName,TRUE)) ! return NULL; ! // @pyseeapi RasSetEntryDialParams ! rc=RasSetEntryDialParams(fileName, &dialParams, bRemPass); ! PyWinObject_FreeTCHAR(fileName); ! if (rc) return ReturnRasError("SetEntryDialParams",rc); // @pyseeapi RasGetConnectStatus Py_INCREF(Py_None); *************** *** 749,772 **** }; ! 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) if (rc=AddConstant(dict,#tok, tok)) return rc ! #define ADD_ENUM(parta, partb) if (rc=AddConstant(dict,#parta "_" #partb, parta::partb)) return rc ! #define ADD_ENUM3(parta, partb, partc) if (rc=AddConstant(dict,#parta "_" #partb "_" #partc, parta::partb::partc)) return rc ! ! static int AddConstants(PyObject *dict) { int rc; --- 794,802 ---- }; + #define ADD_CONSTANT(tok) if (rc = PyModule_AddIntConstant(module, #tok, tok)) return rc + #define ADD_ENUM(parta, partb) if (rc = PyModule_AddIntConstant(module, #parta "_" #partb, parta::partb)) return rc + #define ADD_ENUM3(parta, partb, partc) if (rc = PyModule_AddIntConstant(module, #parta "_" #partb "_" #partc, parta::partb::partc)) return rc ! static int AddConstants(PyObject *module) { int rc; |
From: Mark H. <mha...@us...> - 2008-12-03 10:02:32
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12956/com/win32comext/shell/src Modified Files: shell.cpp Log Message: Better support for building with UNICODE and for long ints, from py3k branch Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** shell.cpp 26 Nov 2008 01:13:10 -0000 1.71 --- shell.cpp 3 Dec 2008 10:02:28 -0000 1.72 *************** *** 1748,1752 **** return PyErr_NoMemory(); nchars = ::DragQueryFile(hglobal, index, sz, nchars); ! PyObject *ret = PyString_FromStringAndSize(sz, nchars); free(sz); return ret; --- 1748,1752 ---- return PyErr_NoMemory(); nchars = ::DragQueryFile(hglobal, index, sz, nchars); ! PyObject *ret = PyWinObject_FromTCHAR(sz, nchars); free(sz); return ret; *************** *** 1947,1951 **** --- 1947,1955 ---- // on what other attributes exist. // @pyparm bool|make_unicode|False|If true, a FILEDESCRIPTORW object is created + #ifdef UNICODE + int make_unicode = TRUE; + #else int make_unicode = FALSE; + #endif if (!PyArg_ParseTuple(args, "O|i", &ob, &make_unicode)) return NULL; *************** *** 2068,2072 **** if (attr && attr != Py_None) { fd->dwFlags |= FD_FILESIZE; ! ok = PyLong_AsTwoI32(attr, (int *)&fd->nFileSizeHigh, (unsigned *)&fd->nFileSizeLow); } Py_XDECREF(attr); --- 2072,2081 ---- if (attr && attr != Py_None) { fd->dwFlags |= FD_FILESIZE; ! ULARGE_INTEGER fsize; ! ok=PyWinObject_AsULARGE_INTEGER(attr, &fsize); ! if (ok){ ! fd->nFileSizeHigh=fsize.HighPart; ! fd->nFileSizeLow=fsize.LowPart; ! } } Py_XDECREF(attr); *************** *** 2218,2222 **** if (fd->dwFlags & FD_FILESIZE) { ! val = PyLong_FromTwoInts(fd->nFileSizeHigh, fd->nFileSizeLow); if (val) PyDict_SetItemString(sub, "nFileSize", val); Py_XDECREF(val); --- 2227,2234 ---- if (fd->dwFlags & FD_FILESIZE) { ! ULARGE_INTEGER fsize; ! fsize.LowPart=fd->nFileSizeLow; ! fsize.HighPart=fd->nFileSizeHigh; ! val = PyWinObject_FromULARGE_INTEGER(fsize); if (val) PyDict_SetItemString(sub, "nFileSize", val); Py_XDECREF(val); *************** *** 3169,3173 **** /* List of module functions */ ! // @module shell|A module, encapsulating the ActiveX Control interfaces static struct PyMethodDef shell_methods[]= { --- 3181,3185 ---- /* List of module functions */ ! // @module shell|A module wrapping Windows Shell functions and interfaces static struct PyMethodDef shell_methods[]= { *************** *** 3312,3315 **** --- 3324,3328 ---- #define ADD_IID(tok) AddIID(dict, #tok, tok) + /* Module initialisation */ extern "C" __declspec(dllexport) void initshell() |
From: Mark H. <mha...@us...> - 2008-12-03 10:00:01
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12274/com/win32comext/shell/src Modified Files: PyIExtractIcon.h PyIExtractIcon.cpp Log Message: IExtractIcon explicitly uses the 'A' version to work with Unicode builds Index: PyIExtractIcon.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIExtractIcon.h 7 Oct 2003 02:32:11 -0000 1.2 --- PyIExtractIcon.h 3 Dec 2008 09:59:56 -0000 1.3 *************** *** 9,13 **** public: MAKE_PYCOM_CTOR(PyIExtractIcon); ! static IExtractIcon *GetI(PyObject *self); static PyComTypeObject type; --- 9,13 ---- public: MAKE_PYCOM_CTOR(PyIExtractIcon); ! static IExtractIconA *GetI(PyObject *self); static PyComTypeObject type; *************** *** 24,28 **** // Gateway Declaration ! class PyGExtractIcon : public PyGatewayBase, public IExtractIcon { protected: --- 24,28 ---- // Gateway Declaration ! class PyGExtractIcon : public PyGatewayBase, public IExtractIconA { protected: *************** *** 32,38 **** ! // IExtractIcon STDMETHOD(Extract)( ! LPCTSTR pszFile, UINT nIconIndex, HICON * phiconLarge, --- 32,38 ---- ! // IExtractIconA STDMETHOD(Extract)( ! LPCSTR pszFile, UINT nIconIndex, HICON * phiconLarge, *************** *** 42,46 **** STDMETHOD(GetIconLocation)( UINT uFlags, ! LPTSTR szIconFile, UINT cchMax, LPINT piIndex, --- 42,46 ---- STDMETHOD(GetIconLocation)( UINT uFlags, ! LPSTR szIconFile, UINT cchMax, LPINT piIndex, Index: PyIExtractIcon.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIExtractIcon.cpp 26 Jul 2008 02:31:48 -0000 1.5 --- PyIExtractIcon.cpp 3 Dec 2008 09:59:56 -0000 1.6 *************** *** 18,24 **** } ! /* static */ IExtractIcon *PyIExtractIcon::GetI(PyObject *self) { ! return (IExtractIcon *)PyIUnknown::GetI(self); } --- 18,24 ---- } ! /* static */ IExtractIconA *PyIExtractIcon::GetI(PyObject *self) { ! return (IExtractIconA *)PyIUnknown::GetI(self); } *************** *** 26,30 **** PyObject *PyIExtractIcon::Extract(PyObject *self, PyObject *args) { ! IExtractIcon *pIEI = GetI(self); if ( pIEI == NULL ) return NULL; --- 26,30 ---- PyObject *PyIExtractIcon::Extract(PyObject *self, PyObject *args) { ! IExtractIconA *pIEI = GetI(self); if ( pIEI == NULL ) return NULL; *************** *** 35,39 **** HICON hiconSmall; PyObject *obpszFile; ! TCHAR *pszFile; UINT nIconIndex; UINT nIconSize; --- 35,39 ---- HICON hiconSmall; PyObject *obpszFile; ! char *pszFile; UINT nIconIndex; UINT nIconSize; *************** *** 41,50 **** return NULL; BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsTCHAR(obpszFile, &pszFile)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEI->Extract( pszFile, nIconIndex, &hiconLarge, &hiconSmall, nIconSize ); ! PyWinObject_FreeTCHAR(pszFile); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) --- 41,50 ---- return NULL; BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsString(obpszFile, &pszFile)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIEI->Extract( pszFile, nIconIndex, &hiconLarge, &hiconSmall, nIconSize ); ! PyWinObject_FreeString(pszFile); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) *************** *** 62,66 **** PyObject *PyIExtractIcon::GetIconLocation(PyObject *self, PyObject *args) { ! IExtractIcon *pIEI = GetI(self); if ( pIEI == NULL ) return NULL; --- 62,66 ---- PyObject *PyIExtractIcon::GetIconLocation(PyObject *self, PyObject *args) { ! IExtractIconA *pIEI = GetI(self); if ( pIEI == NULL ) return NULL; *************** *** 71,75 **** if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax)) return NULL; ! TCHAR *buf = (TCHAR *)malloc(cchMax * sizeof(TCHAR)); if (!buf) return PyErr_NoMemory(); --- 71,75 ---- if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax)) return NULL; ! char *buf = (char *)malloc(cchMax * sizeof(char)); if (!buf) return PyErr_NoMemory(); *************** *** 84,88 **** return PyCom_BuildPyException(hr, pIEI, IID_IExtractIcon ); } ! PyObject *retStr = PyWinObject_FromTCHAR(buf); free(buf); return Py_BuildValue("iNii", hr, retStr, iIndex, flags); --- 84,88 ---- return PyCom_BuildPyException(hr, pIEI, IID_IExtractIcon ); } ! PyObject *retStr = PyString_FromString(buf); free(buf); return Py_BuildValue("iNii", hr, retStr, iIndex, flags); *************** *** 106,110 **** // Gateway Implementation STDMETHODIMP PyGExtractIcon::Extract( ! /* [unique][in] */ LPCTSTR pszFile, /* [unique][in] */ UINT nIconIndex, /* [out] */ HICON * phiconLarge, --- 106,110 ---- // Gateway Implementation STDMETHODIMP PyGExtractIcon::Extract( ! /* [unique][in] */ LPCSTR pszFile, /* [unique][in] */ UINT nIconIndex, /* [out] */ HICON * phiconLarge, *************** *** 114,118 **** PY_GATEWAY_METHOD; PyObject *obpszFile; ! obpszFile = PyString_FromString((LPTSTR)pszFile); PyObject *result; HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize); --- 114,118 ---- PY_GATEWAY_METHOD; PyObject *obpszFile; ! obpszFile = PyString_FromString(pszFile); PyObject *result; HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize); *************** *** 137,141 **** STDMETHODIMP PyGExtractIcon::GetIconLocation( /* [unique][in] */ UINT uFlags, ! /* [unique][out] */ LPTSTR szIconFile, /* [unique][in] */ UINT cchMax, /* [unique][out] */ LPINT piIndex, --- 137,141 ---- STDMETHODIMP PyGExtractIcon::GetIconLocation( /* [unique][in] */ UINT uFlags, ! /* [unique][out] */ LPSTR szIconFile, /* [unique][in] */ UINT cchMax, /* [unique][out] */ LPINT piIndex, |
From: Mark H. <mha...@us...> - 2008-12-03 09:57:00
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/authorization/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11649/com/win32comext/authorization/src Modified Files: authorization.cpp Log Message: autoduck changes merged from py3k branch Index: authorization.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/authorization/src/authorization.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** authorization.cpp 20 Mar 2006 03:10:57 -0000 1.2 --- authorization.cpp 3 Dec 2008 09:56:52 -0000 1.3 *************** *** 40,44 **** }; ! // @module win32com.authorization.authorization| static struct PyMethodDef authorization_methods[]= { --- 40,44 ---- }; ! // @module win32com.authorization.authorization|Module containing support for authorization COM interfaces static struct PyMethodDef authorization_methods[]= { |
From: Mark H. <mha...@us...> - 2008-12-03 09:56:59
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/propsys/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11649/com/win32comext/propsys/src Modified Files: propsys.cpp Log Message: autoduck changes merged from py3k branch Index: propsys.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/propsys/src/propsys.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** propsys.cpp 22 Jan 2008 12:22:14 -0000 1.1 --- propsys.cpp 3 Dec 2008 09:56:53 -0000 1.2 *************** *** 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[]= { |
From: Mark H. <mha...@us...> - 2008-12-03 06:23:11
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19882/win32/Lib Modified Files: win32rcparser.py Log Message: Add default styles for LISTBOX controls and comments. Index: win32rcparser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32rcparser.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32rcparser.py 27 Nov 2008 09:42:42 -0000 1.7 --- win32rcparser.py 3 Dec 2008 06:23:07 -0000 1.8 *************** *** 32,35 **** --- 32,40 ---- } + # These are "default styles" for certain controls - ie, Visual Studio assumes + # the styles will be applied, and emits a "NOT {STYLE_NAME}" if it is to be + # disabled. These defaults have been determined by experimentation, so may + # not be completely accurate (most notably, some styles and/or control-types + # may be missing. _addDefaults = {"EDITTEXT":win32con.WS_BORDER | win32con.WS_TABSTOP, "GROUPBOX":win32con.BS_GROUPBOX, *************** *** 39,43 **** "CTEXT":win32con.SS_CENTER, "RTEXT":win32con.SS_RIGHT, ! "ICON":win32con.SS_ICON} defaultControlStyle = win32con.WS_CHILD | win32con.WS_VISIBLE --- 44,50 ---- "CTEXT":win32con.SS_CENTER, "RTEXT":win32con.SS_RIGHT, ! "ICON":win32con.SS_ICON, ! "LISTBOX":win32con.LBS_NOTIFY, ! } defaultControlStyle = win32con.WS_CHILD | win32con.WS_VISIBLE |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:51
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/win32/test Modified Files: Tag: py3k handles.py test_clipboard.py test_security.py test_win32event.py Log Message: merge lots of fixes from the trunk Index: test_security.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_security.py,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** test_security.py 31 May 2005 02:07:35 -0000 1.4 --- test_security.py 27 Nov 2008 11:31:11 -0000 1.4.4.1 *************** *** 26,30 **** sacl.AddAuditAccessAce(win32security.ACL_REVISION,win32con.DELETE,admin_sid,1,1) sacl.AddAuditAccessAce(win32security.ACL_REVISION,win32con.GENERIC_ALL,pwr_sid,1,1) ! for x in xrange(0,200000): sd1.SetSecurityDescriptorOwner(admin_sid,0) sd2.SetSecurityDescriptorGroup(pwr_sid,0) --- 26,30 ---- sacl.AddAuditAccessAce(win32security.ACL_REVISION,win32con.DELETE,admin_sid,1,1) sacl.AddAuditAccessAce(win32security.ACL_REVISION,win32con.GENERIC_ALL,pwr_sid,1,1) ! for x in range(0,200000): sd1.SetSecurityDescriptorOwner(admin_sid,0) sd2.SetSecurityDescriptorGroup(pwr_sid,0) Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** handles.py 26 Nov 2008 09:03:30 -0000 1.4.2.1 --- handles.py 27 Nov 2008 11:31:10 -0000 1.4.2.2 *************** *** 104,108 **** self.assertRaises(TypeError, pywintypes.HANDLE, ()) # should be able to get a long! ! pywintypes.HANDLE(0L) if __name__ == '__main__': --- 104,108 ---- self.assertRaises(TypeError, pywintypes.HANDLE, ()) # should be able to get a long! ! pywintypes.HANDLE(0) if __name__ == '__main__': Index: test_clipboard.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_clipboard.py,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -d -r1.6.2.2 -r1.6.2.3 *** test_clipboard.py 26 Nov 2008 07:17:39 -0000 1.6.2.2 --- test_clipboard.py 27 Nov 2008 11:31:11 -0000 1.6.2.3 *************** *** 60,64 **** CloseClipboard() def test_unicode(self): ! val = u"test-\a9har" SetClipboardData(win32con.CF_UNICODETEXT, val) self.failUnlessEqual(GetClipboardData(win32con.CF_UNICODETEXT), val) --- 60,64 ---- CloseClipboard() def test_unicode(self): ! val = "test-\a9har" SetClipboardData(win32con.CF_UNICODETEXT, val) self.failUnlessEqual(GetClipboardData(win32con.CF_UNICODETEXT), val) Index: test_win32event.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32event.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** test_win32event.py 26 Nov 2008 07:17:39 -0000 1.1.4.1 --- test_win32event.py 27 Nov 2008 11:31:11 -0000 1.1.4.2 *************** *** 8,12 **** def testWaitableFire(self): h = win32event.CreateWaitableTimer(None, 0, None) ! dt = -160L # 160 ns. win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 1000) --- 8,12 ---- def testWaitableFire(self): h = win32event.CreateWaitableTimer(None, 0, None) ! dt = -160 # 160 ns. win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 1000) *************** *** 16,20 **** h = win32event.CreateWaitableTimer(None, 0, None) # for the sake of this, pass a long that doesn't fit in an int. ! dt = -2000000000L win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 10) # 10 ms. --- 16,20 ---- h = win32event.CreateWaitableTimer(None, 0, None) # for the sake of this, pass a long that doesn't fit in an int. ! dt = -2000000000 win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 10) # 10 ms. |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:48
|
Update of /cvsroot/pywin32/pywin32/com/win32com/servers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/com/win32com/servers Modified Files: Tag: py3k PythonTools.py Log Message: merge lots of fixes from the trunk Index: PythonTools.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/PythonTools.py,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -C2 -d -r1.3.4.2 -r1.3.4.3 *** PythonTools.py 27 Nov 2008 04:58:41 -0000 1.3.4.2 --- PythonTools.py 27 Nov 2008 11:31:05 -0000 1.3.4.3 *************** *** 7,11 **** def reload(self, module): ! if sys.modules.has_key(module): reload(sys.modules[module]) return "reload succeeded." --- 7,12 ---- def reload(self, module): ! # XXX - need py3k work for 'reload' ! if module in sys.modules: reload(sys.modules[module]) return "reload succeeded." |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:45
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/com/win32comext/axscript/test Modified Files: Tag: py3k leakTest.py testHost.py testHost4Dbg.py Log Message: merge lots of fixes from the trunk Index: testHost4Dbg.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost4Dbg.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** testHost4Dbg.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 --- testHost4Dbg.py 27 Nov 2008 11:31:05 -0000 1.1.4.2 *************** *** 51,55 **** # sessionProvider.StartDebugSession(None) ! raw_input("Press enter to continue") # forthEngine.Start() pyEngine.Start() # Actually run the Python code --- 51,55 ---- # sessionProvider.StartDebugSession(None) ! input("Press enter to continue") # forthEngine.Start() pyEngine.Start() # Actually run the Python code Index: testHost.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost.py,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** testHost.py 27 Nov 2008 04:58:41 -0000 1.5.2.3 --- testHost.py 27 Nov 2008 11:31:05 -0000 1.5.2.4 *************** *** 109,113 **** end sub """ ! PyScript = u"""\ # A unicode \xa9omment. prop = "Property Value" --- 109,113 ---- end sub """ ! PyScript = """\ # A unicode \xa9omment. prop = "Property Value" *************** *** 125,131 **** """ ! PyScript_Exc = u"""\ def hello(arg1): ! raise RuntimeError(u"exc with extended \xa9har") """ --- 125,134 ---- """ ! # XXX - needs py3k work! Throwing a bytes string with an extended char ! # doesn't make much sense, but py2x allows it. What it gets upset with ! # is a real unicode arg - which is the only thing py3k allows! ! PyScript_Exc = """\ def hello(arg1): ! raise RuntimeError("exc with extended \xa9har") """ *************** *** 218,222 **** self._TestEngine, "VBScript", ErrScript) def testPythonExceptions(self): ! expected = u"RuntimeError: exc with extended \xa9har" self._TestEngine("Python", PyScript_Exc, expected) --- 221,225 ---- self._TestEngine, "VBScript", ErrScript) def testPythonExceptions(self): ! expected = "RuntimeError: exc with extended \xa9har" self._TestEngine("Python", PyScript_Exc, expected) Index: leakTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/leakTest.py,v retrieving revision 1.1.4.2 retrieving revision 1.1.4.3 diff -C2 -d -r1.1.4.2 -r1.1.4.3 *** leakTest.py 27 Nov 2008 04:58:41 -0000 1.1.4.2 --- leakTest.py 27 Nov 2008 11:31:05 -0000 1.1.4.3 *************** *** 145,149 **** def dotestall(): ! for i in xrange(10): TestEngine("Python", PyScript) print(sys.gettotalrefcount()) --- 145,149 ---- def dotestall(): ! for i in range(10): TestEngine("Python", PyScript) print(sys.gettotalrefcount()) |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:41
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/dde In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/win32/Demos/dde Modified Files: Tag: py3k ddeclient.py Log Message: merge lots of fixes from the trunk Index: ddeclient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/dde/ddeclient.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** ddeclient.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 --- ddeclient.py 27 Nov 2008 11:31:05 -0000 1.1.4.2 *************** *** 1,4 **** # 'Request' example added jjk 11/20/98 ! import site ## Py3k bug 3279 import win32ui import dde --- 1,4 ---- # 'Request' example added jjk 11/20/98 ! import win32ui import dde |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/com/win32com/demos Modified Files: Tag: py3k excelRTDServer.py ietoolbar.py trybag.py Log Message: merge lots of fixes from the trunk Index: ietoolbar.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/ietoolbar.py,v retrieving revision 1.1.4.3 retrieving revision 1.1.4.4 diff -C2 -d -r1.1.4.3 -r1.1.4.4 *** ietoolbar.py 27 Nov 2008 05:36:19 -0000 1.1.4.3 --- ietoolbar.py 27 Nov 2008 11:31:04 -0000 1.1.4.4 *************** *** 75,79 **** def __setattr__(self, attr, val): ! if not attr.startswith("_") and not self.__dict__.has_key(attr): raise AttributeError(attr) self.__dict__[attr] = val --- 75,79 ---- def __setattr__(self, attr, val): ! if not attr.startswith("_") and attr not in self.__dict__: raise AttributeError(attr) self.__dict__[attr] = val Index: trybag.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/trybag.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** trybag.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 --- trybag.py 27 Nov 2008 11:31:04 -0000 1.1.4.2 *************** *** 14,18 **** def Read(self, propName, varType, errorLog): print("read: name=", propName, "type=", varType) ! if not self.data.has_key(propName): if errorLog: hr = 0x80070057 --- 14,18 ---- def Read(self, propName, varType, errorLog): print("read: name=", propName, "type=", varType) ! if propName not in self.data: if errorLog: hr = 0x80070057 Index: excelRTDServer.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/excelRTDServer.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** excelRTDServer.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 --- excelRTDServer.py 27 Nov 2008 11:31:04 -0000 1.1.4.2 *************** *** 156,160 **** self.OnDisconnectData(TopicID) ! if self.topics.has_key(TopicID): self.topics[TopicID] = None del self.topics[TopicID] --- 156,160 ---- self.OnDisconnectData(TopicID) ! if TopicID in self.topics: self.topics[TopicID] = None del self.topics[TopicID] *************** *** 187,191 **** # ( (topic_num1, topic_num2, ..., topic_numN), \ # (topic_val1, topic_val2, ..., topic_valN) ) ! for idx, topicdata in enumerate(self.topics.iteritems()): topicNum, topic = topicdata results[0][idx] = topicNum --- 187,191 ---- # ( (topic_num1, topic_num2, ..., topic_numN), \ # (topic_val1, topic_val2, ..., topic_valN) ) ! for idx, topicdata in enumerate(iter(self.topics.items())): topicNum, topic = topicdata results[0][idx] = topicNum *************** *** 335,339 **** if len(self.topics): refresh = False ! for topic in self.topics.itervalues(): topic.Update(self) if topic.HasChanged(): --- 335,339 ---- if len(self.topics): refresh = False ! for topic in self.topics.values(): topic.Update(self) if topic.HasChanged(): |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:32
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/com/win32comext/shell/demos Modified Files: Tag: py3k IActiveDesktop.py IShellLinkDataList.py Log Message: merge lots of fixes from the trunk Index: IShellLinkDataList.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/IShellLinkDataList.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** IShellLinkDataList.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 --- IShellLinkDataList.py 27 Nov 2008 11:31:05 -0000 1.1.4.2 *************** *** 22,26 **** 'AutoPosition':False, 'FontSize':(4, 5), ! 'FaceName':u'', 'HistoryBufferSize':32, 'InputBufferSize':0, --- 22,26 ---- 'AutoPosition':False, 'FontSize':(4, 5), ! 'FaceName':'', 'HistoryBufferSize':32, 'InputBufferSize':0, Index: IActiveDesktop.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/IActiveDesktop.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** IActiveDesktop.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 --- IActiveDesktop.py 27 Nov 2008 11:31:05 -0000 1.1.4.2 *************** *** 27,31 **** 'SubscribedURL': website, 'Source' : website, ! 'FriendlyName' : u'Pywin32 on SF', 'Checked' : True, ## this controls whether item is currently displayed 'NoScroll' : False, --- 27,31 ---- 'SubscribedURL': website, 'Source' : website, ! 'FriendlyName' : 'Pywin32 on SF', 'Checked' : True, ## this controls whether item is currently displayed 'NoScroll' : False, |
From: Mark H. <mha...@us...> - 2008-11-27 12:18:27
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/security In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/win32/Demos/security Modified Files: Tag: py3k GetTokenInformation.py list_rights.py security_enums.py Log Message: merge lots of fixes from the trunk Index: GetTokenInformation.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/GetTokenInformation.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** GetTokenInformation.py 29 Aug 2008 04:59:24 -0000 1.1.2.1 --- GetTokenInformation.py 27 Nov 2008 11:31:05 -0000 1.1.2.2 *************** *** 48,52 **** print('TokenElevation:', is_elevated) except pywintypes.error as details: ! if details.args[0] != winerror.ERROR_INVALID_PARAMETER: raise return None --- 48,52 ---- print('TokenElevation:', is_elevated) except pywintypes.error as details: ! if details.winerror != winerror.ERROR_INVALID_PARAMETER: raise return None Index: list_rights.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/list_rights.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** list_rights.py 29 Aug 2008 04:59:24 -0000 1.1.4.1 --- list_rights.py 27 Nov 2008 11:31:05 -0000 1.1.4.2 *************** *** 1,4 **** import win32security,win32file,win32api,ntsecuritycon,win32con ! from .security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), --- 1,4 ---- import win32security,win32file,win32api,ntsecuritycon,win32con ! from security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), Index: security_enums.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/security/security_enums.py,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** security_enums.py 29 Aug 2008 04:59:24 -0000 1.2.2.1 --- security_enums.py 27 Nov 2008 11:31:05 -0000 1.2.2.2 *************** *** 15,19 **** const_val=getattr(winnt, const_name) except AttributeError: ! raise AttributeError('Constant "%s" not found in win32security, ntsecuritycon, or winnt.' %const_name) setattr(self, const_name, const_val) --- 15,19 ---- const_val=getattr(winnt, const_name) except AttributeError: ! raise AttributeError('Constant "%s" not found in win32security, ntsecuritycon, or winnt.' %const_name) setattr(self, const_name, const_val) |
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/com/win32comext/axscript/client Modified Files: Tag: py3k debug.py error.py framework.py pydumper.py pyscript.py pyscript_rexec.py Log Message: merge lots of fixes from the trunk Index: debug.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/debug.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** debug.py 26 Nov 2008 09:03:29 -0000 1.3.4.1 --- debug.py 27 Nov 2008 11:31:05 -0000 1.3.4.2 *************** *** 6,10 **** from win32com.server.exception import COMException import pythoncom ! from framework import trace from win32com.axdebug import axdebug, gateways, contexts, stackframe, documents, adb from win32com.axdebug.codecontainer import SourceCodeContainer --- 6,10 ---- from win32com.server.exception import COMException import pythoncom ! from .framework import trace from win32com.axdebug import axdebug, gateways, contexts, stackframe, documents, adb from win32com.axdebug.codecontainer import SourceCodeContainer Index: pyscript.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript.py,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** pyscript.py 26 Nov 2008 09:03:29 -0000 1.11.2.2 --- pyscript.py 27 Nov 2008 11:31:05 -0000 1.11.2.3 *************** *** 30,34 **** def debug_attr_print(*args): if debugging_attr: ! apply(trace, args) def ExpandTabs(text): --- 30,34 ---- def debug_attr_print(*args): if debugging_attr: ! trace(*args) def ExpandTabs(text): Index: pydumper.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pydumper.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** pydumper.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 --- pydumper.py 27 Nov 2008 11:31:05 -0000 1.1.4.2 *************** *** 14,21 **** # and based on the script code you execute. ! import pyscript from win32com.axscript import axscript ! from pyscript import RaiseAssert, trace, Exception, SCRIPTTEXT_FORCEEXECUTION PyDump_CLSID = '{ac527e60-c693-11d0-9c25-00aa00125a98}' --- 14,21 ---- # and based on the script code you execute. ! from . import pyscript from win32com.axscript import axscript ! from .pyscript import RaiseAssert, trace, Exception, SCRIPTTEXT_FORCEEXECUTION PyDump_CLSID = '{ac527e60-c693-11d0-9c25-00aa00125a98}' Index: framework.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/framework.py,v retrieving revision 1.25.2.2 retrieving revision 1.25.2.3 diff -C2 -d -r1.25.2.2 -r1.25.2.3 *** framework.py 27 Nov 2008 04:58:41 -0000 1.25.2.2 --- framework.py 27 Nov 2008 11:31:05 -0000 1.25.2.3 *************** *** 29,33 **** from win32com.server.exception import Exception, IsCOMServerException ! import error # ax.client.error state_map = { --- 29,33 ---- from win32com.server.exception import Exception, IsCOMServerException ! from . import error # ax.client.error state_map = { *************** *** 46,50 **** # roll on 1.6 :-) # return prof.runcall(fn, *args) ! return apply(prof.runcall, (fn,) + args) finally: import pstats --- 46,50 ---- # roll on 1.6 :-) # return prof.runcall(fn, *args) ! return prof.runcall(*(fn,) + args) finally: import pstats *************** *** 187,191 **** RaiseAssert(winerror.E_UNEXPECTED, "The typeKind of the object is unexpected") cImplType = attr[8] ! for i in xrange(cImplType): # Look for the [source, default] interface on the coclass # that isn't marked as restricted. --- 187,191 ---- RaiseAssert(winerror.E_UNEXPECTED, "The typeKind of the object is unexpected") cImplType = attr[8] ! for i in range(cImplType): # Look for the [source, default] interface on the coclass # that isn't marked as restricted. *************** *** 211,215 **** numTypeInfos = 0 # Create an event handler for the item. ! for item in xrange(numTypeInfos): if isMulti: typeinfo, flags = mainTypeInfo.GetInfoOfIndex(item, axscript.MULTICLASSINFO_GETTYPEINFO) --- 211,215 ---- numTypeInfos = 0 # Create an event handler for the item. ! for item in range(numTypeInfos): if isMulti: typeinfo, flags = mainTypeInfo.GetInfoOfIndex(item, axscript.MULTICLASSINFO_GETTYPEINFO) *************** *** 222,226 **** self.iid = attr[0] cFuncs = attr[6] ! for i in xrange(cFuncs): funcdesc = sourceType.GetFuncDesc(i) event = Event() --- 222,226 ---- self.iid = attr[0] cFuncs = attr[6] ! for i in range(cFuncs): funcdesc = sourceType.GetFuncDesc(i) event = Event() *************** *** 400,404 **** except pythoncom.com_error: return ! for item in xrange(numTypeInfos): typeinfo, flags = multiTypeInfo.GetInfoOfIndex(item, axscript.MULTICLASSINFO_GETTYPEINFO) defaultType = self.GetDefaultSourceTypeInfo(typeinfo) --- 400,404 ---- except pythoncom.com_error: return ! for item in range(numTypeInfos): typeinfo, flags = multiTypeInfo.GetInfoOfIndex(item, axscript.MULTICLASSINFO_GETTYPEINFO) defaultType = self.GetDefaultSourceTypeInfo(typeinfo) *************** *** 455,459 **** RaiseAssert(winerror.E_UNEXPECTED, "The typeKind of the object is unexpected") cImplType = attr[8] ! for i in xrange(cImplType): # Look for the [source, default] interface on the coclass # that isn't marked as restricted. --- 455,459 ---- RaiseAssert(winerror.E_UNEXPECTED, "The typeKind of the object is unexpected") cImplType = attr[8] ! for i in range(cImplType): # Look for the [source, default] interface on the coclass # that isn't marked as restricted. *************** *** 562,566 **** try: import win32com.axdebug.axdebug # see if the core exists. ! import debug self.debugManager = debug.DebugManager(self) except pythoncom.com_error: --- 562,566 ---- try: import win32com.axdebug.axdebug # see if the core exists. ! from . import debug self.debugManager = debug.DebugManager(self) except pythoncom.com_error: *************** *** 842,848 **** return self.debugManager.adb.runcall(fn, *args) else: ! return apply(fn, args) else: ! return apply(fn, args) def ApplyInScriptedSection(self, codeBlock, fn, args): --- 842,848 ---- return self.debugManager.adb.runcall(fn, *args) else: ! return fn(*args) else: ! return fn(*args) def ApplyInScriptedSection(self, codeBlock, fn, args): *************** *** 1001,1005 **** # Loop over all methods print("Methods") ! for j in xrange(attr[6]): fdesc = list(typeinfo.GetFuncDesc(j)) id = fdesc[0] --- 1001,1005 ---- # Loop over all methods print("Methods") ! for j in range(attr[6]): fdesc = list(typeinfo.GetFuncDesc(j)) id = fdesc[0] *************** *** 1014,1018 **** # Loop over all variables (ie, properties) print("Variables") ! for j in xrange(attr[7]): fdesc = list(typeinfo.GetVarDesc(j)) names = typeinfo.GetNames(id) --- 1014,1018 ---- # Loop over all variables (ie, properties) print("Variables") ! for j in range(attr[7]): fdesc = list(typeinfo.GetVarDesc(j)) names = typeinfo.GetNames(id) Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v retrieving revision 1.9.2.3 retrieving revision 1.9.2.4 diff -C2 -d -r1.9.2.3 -r1.9.2.4 *** error.py 27 Nov 2008 04:58:41 -0000 1.9.2.3 --- error.py 27 Nov 2008 11:31:05 -0000 1.9.2.4 *************** *** 177,181 **** # all items in the list are utf8 courtesy of Python magically # converting unicode to utf8 before compilation. ! for i in xrange(len(bits)): if type(bits[i]) is str: #assert type(bits[i]) is str, type(bits[i]) --- 177,181 ---- # all items in the list are utf8 courtesy of Python magically # converting unicode to utf8 before compilation. ! for i in range(len(bits)): if type(bits[i]) is str: #assert type(bits[i]) is str, type(bits[i]) Index: pyscript_rexec.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript_rexec.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** pyscript_rexec.py 26 Nov 2008 09:03:29 -0000 1.3.4.1 --- pyscript_rexec.py 27 Nov 2008 11:31:05 -0000 1.3.4.2 *************** *** 11,15 **** from win32com.axscript import axscript import winerror ! import pyscript INTERFACE_USES_DISPEX = 0x00000004 # Object knows to use IDispatchEx --- 11,15 ---- from win32com.axscript import axscript import winerror ! from . import pyscript INTERFACE_USES_DISPEX = 0x00000004 # Object knows to use IDispatchEx |