pywin32-checkins Mailing List for Python for Windows Extensions (Page 89)
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: Roger U. <ru...@us...> - 2007-06-06 21:41:46
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25484/win32/src Modified Files: win32pipe.i Log Message: Some 64-bit and autoduck fixes Index: win32pipe.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pipe.i,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** win32pipe.i 16 Jul 2006 11:02:23 -0000 1.14 --- win32pipe.i 6 Jun 2007 21:41:46 -0000 1.15 *************** *** 297,311 **** PyObject *MyCallNamedPipe(PyObject *self, PyObject *args) { ! PyObject *obPipeName; ! char *data; ! int dataSize; DWORD timeOut; ! int readBufSize; TCHAR *szPipeName; ! if (!PyArg_ParseTuple(args, "Os#il:CallNamedPipe", ! &obPipeName, // @pyparm <o PyUNICODE>|pipeName||The name of the pipe. ! &data, &dataSize, // @pyparm string|data||The data to write. ! &readBufSize, // @pyparm int|bufSize||The size of the result buffer to allocate for the read. ! &timeOut)) // @pyparm int|timeOut||Specifies the number of milliseconds to wait for the named pipe to be available. In addition to numeric values, the following special values can be specified. // @flagh Value|Meaning // @flag win32pipe.NMPWAIT_NOWAIT|Does not wait for the named pipe. If the named pipe is not available, the function returns an error. --- 297,311 ---- PyObject *MyCallNamedPipe(PyObject *self, PyObject *args) { ! PyObject *obPipeName, *obdata; ! void *data; ! DWORD dataSize; DWORD timeOut; ! DWORD readBufSize; TCHAR *szPipeName; ! if (!PyArg_ParseTuple(args, "OOil:CallNamedPipe", ! &obPipeName, // @pyparm <o PyUNICODE>|pipeName||The name of the pipe. ! &obdata, // @pyparm string|data||The data to write. ! &readBufSize, // @pyparm int|bufSize||The size of the result buffer to allocate for the read. ! &timeOut)) // @pyparm int|timeOut||Specifies the number of milliseconds to wait for the named pipe to be available. In addition to numeric values, the following special values can be specified. // @flagh Value|Meaning // @flag win32pipe.NMPWAIT_NOWAIT|Does not wait for the named pipe. If the named pipe is not available, the function returns an error. *************** *** 313,327 **** // @flag win32pipe.NMPWAIT_USE_DEFAULT_WAIT|Uses the default time-out specified in a call to the CreateNamedPipe function. return NULL; ! if (!PyWinObject_AsTCHAR(obPipeName, &szPipeName)) return NULL; - void *readBuf = malloc(readBufSize); ! DWORD numRead = 0; BOOL ok; ! Py_BEGIN_ALLOW_THREADS ! ok = CallNamedPipe(szPipeName, (void *)data, dataSize, readBuf, readBufSize, &numRead, timeOut); ! Py_END_ALLOW_THREADS if (!ok) { PyWinObject_FreeTCHAR(szPipeName); --- 313,330 ---- // @flag win32pipe.NMPWAIT_USE_DEFAULT_WAIT|Uses the default time-out specified in a call to the CreateNamedPipe function. return NULL; ! if (!PyWinObject_AsReadBuffer(obdata, &data, &dataSize, FALSE)) ! return NULL; if (!PyWinObject_AsTCHAR(obPipeName, &szPipeName)) return NULL; void *readBuf = malloc(readBufSize); ! if (!readBuf){ ! PyWinObject_FreeTCHAR(szPipeName); ! return PyErr_NoMemory(); ! } DWORD numRead = 0; BOOL ok; ! Py_BEGIN_ALLOW_THREADS ! ok = CallNamedPipe(szPipeName, data, dataSize, readBuf, readBufSize, &numRead, timeOut); ! Py_END_ALLOW_THREADS if (!ok) { PyWinObject_FreeTCHAR(szPipeName); *************** *** 359,366 **** // @pyswig (int, int)|FdCreatePipe|As CreatePipe but returns file descriptors PyObject *FdCreatePipe( ! SECURITY_ATTRIBUTES *INPUT, // @pyparm <o PySECURITY_ATTRIBUTES>|sa|| ! DWORD nSize, // @pyparm int|nSize|| ! int mode // @pyparm int|mode|| ! ) { HANDLE hReadPipe; // variable for read handle --- 362,368 ---- // @pyswig (int, int)|FdCreatePipe|As CreatePipe but returns file descriptors PyObject *FdCreatePipe( ! SECURITY_ATTRIBUTES *INPUT, // @pyparm <o PySECURITY_ATTRIBUTES>|sa||Specifies security and inheritance for the pipe ! DWORD nSize, // @pyparm int|nSize||Buffer size for pipe. Use 0 for default size. ! int mode) // @pyparm int|mode||O_TEXT or O_BINARY { HANDLE hReadPipe; // variable for read handle *************** *** 377,382 **** return PyWin_SetAPIError("CreatePipe"); ! int read_fd = _open_osfhandle ((long) hReadPipe, mode); ! int write_fd = _open_osfhandle ((long) hWritePipe, mode); PyObject *result = Py_BuildValue("ii", read_fd, write_fd); return result; --- 379,384 ---- return PyWin_SetAPIError("CreatePipe"); ! int read_fd = _open_osfhandle ((INT_PTR)hReadPipe, mode); ! int write_fd = _open_osfhandle ((INT_PTR)hWritePipe, mode); PyObject *result = Py_BuildValue("ii", read_fd, write_fd); return result; *************** *** 443,447 **** PyObject *rc = NULL; if (PeekNamedPipe(hNamedPipe, buf, size, &bytesRead, &totalAvail, &bytesLeft)) { ! rc = Py_BuildValue("s#ii", (char *)buf, bytesRead, totalAvail, bytesLeft); } else PyWin_SetAPIError("PeekNamedPipe"); --- 445,451 ---- PyObject *rc = NULL; if (PeekNamedPipe(hNamedPipe, buf, size, &bytesRead, &totalAvail, &bytesLeft)) { ! rc = Py_BuildValue("Nii", ! PyString_FromStringAndSize((char *)buf, bytesRead), ! totalAvail, bytesLeft); } else PyWin_SetAPIError("PeekNamedPipe"); |
From: Roger U. <ru...@us...> - 2007-06-06 05:44:46
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1079/win32/src Modified Files: win32popen.cpp Log Message: Fix some 64-bit issues Index: win32popen.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32popen.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32popen.cpp 7 Apr 2004 05:07:39 -0000 1.9 --- win32popen.cpp 6 Jun 2007 05:44:46 -0000 1.10 *************** *** 170,175 **** char *s1,*s2, *s3=" /c "; const char *szConsoleSpawn = "win32popenWin9x.exe \""; ! int i; ! int x; if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) --- 170,175 ---- char *s1,*s2, *s3=" /c "; const char *szConsoleSpawn = "win32popenWin9x.exe \""; ! DWORD i; ! size_t x; if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) *************** *** 177,181 **** s1 = (char *)_alloca(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) ! return x; if (!g_fUsingWin9x) { --- 177,181 ---- s1 = (char *)_alloca(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) ! return FALSE; if (!g_fUsingWin9x) { *************** *** 208,212 **** // Now we'll just error out.. else ! return -1; ZeroMemory( &siStartInfo, sizeof(STARTUPINFO)); --- 208,212 ---- // Now we'll just error out.. else ! return FALSE; ZeroMemory( &siStartInfo, sizeof(STARTUPINFO)); *************** *** 310,314 **** case _O_WRONLY | _O_TEXT: // Case for writing to child Stdin in text mode. ! fd1 = _open_osfhandle((long)hChildStdinWrDup, mode); f1 = _fdopen(fd1, "w"); f = PyFile_FromFile(f1, cmdstring, "w", _PyPclose); --- 310,314 ---- case _O_WRONLY | _O_TEXT: // Case for writing to child Stdin in text mode. ! fd1 = _open_osfhandle((INT_PTR)hChildStdinWrDup, mode); f1 = _fdopen(fd1, "w"); f = PyFile_FromFile(f1, cmdstring, "w", _PyPclose); *************** *** 321,325 **** case _O_RDONLY | _O_TEXT: // Case for reading from child Stdout in text mode. ! fd1 = _open_osfhandle((long)hChildStdoutRdDup, mode); f1 = _fdopen(fd1, "r"); f = PyFile_FromFile(f1, cmdstring, "r", _PyPclose); --- 321,325 ---- case _O_RDONLY | _O_TEXT: // Case for reading from child Stdout in text mode. ! fd1 = _open_osfhandle((INT_PTR)hChildStdoutRdDup, mode); f1 = _fdopen(fd1, "r"); f = PyFile_FromFile(f1, cmdstring, "r", _PyPclose); *************** *** 332,336 **** case _O_RDONLY | _O_BINARY: // Case for readinig from child Stdout in binary mode. ! fd1 = _open_osfhandle((long)hChildStdoutRdDup, mode); f1 = _fdopen(fd1, "rb"); f = PyFile_FromFile(f1, cmdstring, "rb", _PyPclose); --- 332,336 ---- case _O_RDONLY | _O_BINARY: // Case for readinig from child Stdout in binary mode. ! fd1 = _open_osfhandle((INT_PTR)hChildStdoutRdDup, mode); f1 = _fdopen(fd1, "rb"); f = PyFile_FromFile(f1, cmdstring, "rb", _PyPclose); *************** *** 343,347 **** case _O_WRONLY | _O_BINARY: // Case for writing to child Stdin in binary mode. ! fd1 = _open_osfhandle((long)hChildStdinWrDup, mode); f1 = _fdopen(fd1, "wb"); f = PyFile_FromFile(f1, cmdstring, "wb", _PyPclose); --- 343,347 ---- case _O_WRONLY | _O_BINARY: // Case for writing to child Stdin in binary mode. ! fd1 = _open_osfhandle((INT_PTR)hChildStdinWrDup, mode); f1 = _fdopen(fd1, "wb"); f = PyFile_FromFile(f1, cmdstring, "wb", _PyPclose); *************** *** 372,378 **** } ! fd1 = _open_osfhandle((long)hChildStdinWrDup, mode); f1 = _fdopen(fd1, m2); ! fd2 = _open_osfhandle((long)hChildStdoutRdDup, mode); f2 = _fdopen(fd2, m1); p1 = PyFile_FromFile(f1, cmdstring, m2, _PyPclose); --- 372,378 ---- } ! fd1 = _open_osfhandle((INT_PTR)hChildStdinWrDup, mode); f1 = _fdopen(fd1, m2); ! fd2 = _open_osfhandle((INT_PTR)hChildStdoutRdDup, mode); f2 = _fdopen(fd2, m1); p1 = PyFile_FromFile(f1, cmdstring, m2, _PyPclose); *************** *** 407,415 **** } ! fd1 = _open_osfhandle((long)hChildStdinWrDup, mode); f1 = _fdopen(fd1, m2); ! fd2 = _open_osfhandle((long)hChildStdoutRdDup, mode); f2 = _fdopen(fd2, m1); ! fd3 = _open_osfhandle((long)hChildStderrRdDup, mode); f3 = _fdopen(fd3, m1); p1 = PyFile_FromFile(f1, cmdstring, m2, _PyPclose); --- 407,415 ---- } ! fd1 = _open_osfhandle((INT_PTR)hChildStdinWrDup, mode); f1 = _fdopen(fd1, m2); ! fd2 = _open_osfhandle((INT_PTR)hChildStdoutRdDup, mode); f2 = _fdopen(fd2, m1); ! fd3 = _open_osfhandle((INT_PTR)hChildStderrRdDup, mode); f3 = _fdopen(fd3, m1); p1 = PyFile_FromFile(f1, cmdstring, m2, _PyPclose); |
From: Roger U. <ru...@us...> - 2007-06-06 04:26:46
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4315/win32/src Modified Files: win32file.i Log Message: Add _getmaxstdio and _setmaxstdio Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** win32file.i 5 Jun 2007 09:47:46 -0000 1.84 --- win32file.i 6 Jun 2007 04:26:46 -0000 1.85 *************** *** 1597,1604 **** --- 1597,1607 ---- #ifndef MS_WINCE // @pyswig long|_get_osfhandle|Gets operating-system file handle associated with existing stream + // @pyparm int|fd||File descriptor as returned by file.fileno() %name(_get_osfhandle) PyObject *myget_osfhandle( int filehandle ); // @pyswig int|_open_osfhandle|Associates a C run-time file handle with a existing operating-system file handle. + // @pyparm <o PyHANDLE>|osfhandle||An open file handle + // @pyparm int|flags||O_APPEND,O_RDONLY, or O_TEXT %name(_open_osfhandle) PyObject *myopen_osfhandle ( PyHANDLE osfhandle, int flags ); *************** *** 1626,1629 **** --- 1629,1641 ---- %} + // @pyswig int|_setmaxstdio|Set the maximum allowed number of open stdio handles + // @rdesc Returns the number that was set, or -1 on failure. + int _setmaxstdio( + int newmax // @pyparm int|newmax||Maximum number of open stdio streams, 2048 max + ); + + // @pyswig int| _getmaxstdio|Returns the maximum number of CRT io streams. + int _getmaxstdio( void ); + // Overlapped Socket stuff |
From: Roger U. <ru...@us...> - 2007-06-05 09:47:50
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7024/win32/src Modified Files: win32file.i Log Message: In ReadFile, use PyInt_AsLong instead of PyLong_AsUnsignedLong for buffer size since it won't convert a plain int in Python 2.3 Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** win32file.i 3 Jun 2007 14:53:07 -0000 1.83 --- win32file.i 5 Jun 2007 09:47:46 -0000 1.84 *************** *** 890,894 **** PyBufferProcs *pb = NULL; ! bufSize = PyLong_AsUnsignedLong(obBuf); if ((bufSize!=(DWORD)-1) || !PyErr_Occurred()){ if (pOverlapped){ // guaranteed to be NULL on CE --- 890,894 ---- PyBufferProcs *pb = NULL; ! bufSize = PyInt_AsLong(obBuf); if ((bufSize!=(DWORD)-1) || !PyErr_Occurred()){ if (pOverlapped){ // guaranteed to be NULL on CE *************** *** 910,914 **** PyErr_Clear(); if (!PyWinObject_AsWriteBuffer(obBuf, &buf, &bufSize,FALSE)){ ! PyErr_SetString(PyExc_TypeError, "Second param must be an integer or a buffer object"); return NULL; } --- 910,914 ---- PyErr_Clear(); if (!PyWinObject_AsWriteBuffer(obBuf, &buf, &bufSize,FALSE)){ ! PyErr_SetString(PyExc_TypeError, "Second param must be an integer or writeable buffer object"); return NULL; } *************** *** 1807,1814 **** /* If we don't know the address family, don't raise an exception -- return it as a tuple. */ ! return Py_BuildValue("is#", ! addr->sa_family, ! addr->sa_data, ! sizeof(addr->sa_data)); } --- 1807,1813 ---- /* If we don't know the address family, don't raise an exception -- return it as a tuple. */ ! return Py_BuildValue("iN", ! addr->sa_family, ! PyString_FromStringAndSize(addr->sa_data,sizeof(addr->sa_data))); } |
From: Mark H. <mha...@us...> - 2007-06-05 05:46:50
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17140 Modified Files: PyWinTypes.h Log Message: PyWinObject_FromULONG_PTR must use PyWinLong_FromVoidPtr to be consistent with what we put together Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** PyWinTypes.h 3 Jun 2007 14:53:07 -0000 1.44 --- PyWinTypes.h 5 Jun 2007 05:46:48 -0000 1.45 *************** *** 294,298 **** // It is *not* actually a pointer (but is the same size as a pointer) inline PyObject *PyWinObject_FromULONG_PTR(ULONG_PTR v) { ! return PyLong_FromVoidPtr((void *)v); } inline BOOL PyWinLong_AsULONG_PTR(PyObject *ob, ULONG_PTR *r) { --- 294,298 ---- // It is *not* actually a pointer (but is the same size as a pointer) inline PyObject *PyWinObject_FromULONG_PTR(ULONG_PTR v) { ! return PyWinLong_FromVoidPtr((void *)v); } inline BOOL PyWinLong_AsULONG_PTR(PyObject *ob, ULONG_PTR *r) { |
From: Roger U. <ru...@us...> - 2007-06-05 05:35:59
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13579/win32/src Modified Files: win32dynamicdialog.cpp Log Message: Change a couple of ssize_t's to size_t Index: win32dynamicdialog.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32dynamicdialog.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32dynamicdialog.cpp 29 May 2007 13:03:26 -0000 1.4 --- win32dynamicdialog.cpp 5 Jun 2007 05:35:59 -0000 1.5 *************** *** 219,223 **** DwordAlign((PCHAR*)&ptr); #endif ! ssize_t len = (BYTE*)ptr - (BYTE*)hdr; ASSERT(len <= m_alloc); m_len = len; --- 219,223 ---- DwordAlign((PCHAR*)&ptr); #endif ! size_t len = (BYTE*)ptr - (BYTE*)hdr; ASSERT(len <= m_alloc); m_len = len; *************** *** 307,311 **** #endif RESCSTR txt = MAKERESSTR(text); ! ssize_t len = sizeof(DLGITEMTEMPLATE) + 20; if (txt) { --- 307,311 ---- #endif RESCSTR txt = MAKERESSTR(text); ! size_t len = sizeof(DLGITEMTEMPLATE) + 20; if (txt) { |
From: Mark H. <mha...@us...> - 2007-06-04 04:50:51
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28607 Modified Files: win32win.cpp Log Message: CWnd::SendMessage() was broken for the special handling of a single buffer object now that PyWinObject_AsPARAM() also allows a buffer. Rearrange the arg parsing to avoid this. Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** win32win.cpp 4 Jun 2007 02:57:10 -0000 1.16 --- win32win.cpp 4 Jun 2007 04:50:39 -0000 1.17 *************** *** 2199,2225 **** WPARAM wp = 0; LPARAM lp = 0; - PyObject *obwParam = Py_None, *oblParam = Py_None; BOOL ok = FALSE; ! if (PyArg_ParseTuple(args, "i|OO:SendMessage", ! &message, // @pyparm int|idMessage||The ID of the message to send. ! &obwParam, // @pyparm int|wParam|0|The wParam for the message ! &oblParam)) {// @pyparm int|lParam|0|The lParam for the message ! ok = (obwParam == Py_None || PyWinObject_AsPARAM(obwParam, &wp)) && ! (oblParam == Py_None || PyWinObject_AsPARAM(oblParam, &lp)); ! } ! if (!ok) { ! // Allow a buffer object to be passed as (size, address) ! PyErr_Clear(); void *p; PyObject *obParam; ! if (!PyArg_ParseTuple(args, "iO", ! &message, // @pyparmalt1 int|idMessage||The ID of the message to send. ! &obParam)) // @pyparmalt1 buffer|ob||A buffer whose size is passed in wParam, and address is passed in lParam return NULL; ! int wParam; ! if (!PyWinObject_AsReadBuffer(obParam, &p, &wParam)) return NULL; - lp = (LPARAM)p; - wp = (WPARAM)wParam; } LRESULT rc; --- 2199,2240 ---- WPARAM wp = 0; LPARAM lp = 0; BOOL ok = FALSE; ! // Old code assumes the following behaviour: ! // (msg, buffer_ob) -> lparam==&buffer, wparam=len(buffer) ! // (msg, [int_arg, int_arg]) - lparam and wparam cast from ints ! // However, PyWinObject_AsPARAM() has special casing for buffer objects - ! // their address is used, but size is discarded. This means we must check ! // for our special case before letting PyWinObject_AsPARAM at them. ! // Shortcut - our special case requires exactly 2 args be passed. ! if (args && PyTuple_Size(args)==2) { void *p; PyObject *obParam; ! ok = PyArg_ParseTuple(args, "iO", ! &message, // @pyparmalt1 int|idMessage||The ID of the message to send. ! &obParam); // @pyparmalt1 buffer|ob||A buffer whose size is passed in wParam, and address is passed in lParam ! if (ok) { ! int wParam; ! ok = PyWinObject_AsReadBuffer(obParam, &p, &wParam); ! if (ok) { ! lp = (LPARAM)p; ! wp = (WPARAM)wParam; ! } ! } ! // save unconditionally clearing it in the block below... ! if (!ok) ! PyErr_Clear(); ! } ! if (!ok) { ! // more general purpose args. ! PyObject *obwParam = Py_None, *oblParam = Py_None; ! if (!PyArg_ParseTuple(args, "i|OO:SendMessage", ! &message, // @pyparm int|idMessage||The ID of the message to send. ! &obwParam, // @pyparm int|wParam|0|The wParam for the message ! &oblParam)) // @pyparm int|lParam|0|The lParam for the message return NULL; ! if (obwParam != Py_None && !PyWinObject_AsPARAM(obwParam, &wp)) ! return NULL; ! if (oblParam != Py_None && !PyWinObject_AsPARAM(oblParam, &lp)) return NULL; } LRESULT rc; |
From: Mark H. <mha...@us...> - 2007-06-04 02:57:11
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21423 Modified Files: win32win.cpp win32win.h Log Message: Repair error I introduced to PyCWnd::SendMessage() and fix a number of other misc x64 issues in pywin Index: win32win.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32win.h 3 Jun 2007 12:35:58 -0000 1.2 --- win32win.h 4 Jun 2007 02:57:10 -0000 1.3 *************** *** 116,121 **** RETURN_TYPE_ERR("The object is not a Python MFC object"); } ! long wparam, lparam; ! if (!PyArg_ParseTuple(args, "ll", &wparam, &lparam)) return NULL; GUI_BGN_SAVE; --- 116,127 ---- RETURN_TYPE_ERR("The object is not a Python MFC object"); } ! PyObject *obwparam, *oblparam; ! if (!PyArg_ParseTuple(args, "OO", &obwparam, &oblparam)) ! return NULL; ! WPARAM wparam; ! LPARAM lparam; ! if (!PyWinObject_AsPARAM(obwparam, &wparam)) ! return NULL; ! if (!PyWinObject_AsPARAM(oblparam, &lparam)) return NULL; GUI_BGN_SAVE; Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** win32win.cpp 3 Jun 2007 13:23:45 -0000 1.15 --- win32win.cpp 4 Jun 2007 02:57:10 -0000 1.16 *************** *** 784,795 **** if (!pWnd) return NULL; ! int message, wparam, lparam; ! if (!PyArg_ParseTuple(args,"iii:DefWindowProc", &message, // @pyparm int|message||The Windows message. ! &wparam, // @pyparm int|idLast||The lParam for the message. ! &lparam))// @pyparm int|idCheck||The wParam for the message. return NULL; GUI_BGN_SAVE; ! LRESULT rc = ((WndHack *)pWnd)->DefWindowProc(message, (WPARAM)wparam, (LPARAM)lparam); GUI_END_SAVE; return PyWinObject_FromPARAM(rc); // @pyseemfc CWnd|DefWindowProc --- 784,801 ---- if (!pWnd) return NULL; ! int message; ! PyObject *obwparam, *oblparam; ! if (!PyArg_ParseTuple(args,"iOO:DefWindowProc", &message, // @pyparm int|message||The Windows message. ! &obwparam, // @pyparm int|idLast||The lParam for the message. ! &oblparam))// @pyparm int|idCheck||The wParam for the message. ! return NULL; ! WPARAM wparam; ! LPARAM lparam; ! if (!PyWinObject_AsPARAM(obwparam, &wparam) || ! !PyWinObject_AsPARAM(oblparam, &lparam)) return NULL; GUI_BGN_SAVE; ! LRESULT rc = ((WndHack *)pWnd)->DefWindowProc(message, wparam, lparam); GUI_END_SAVE; return PyWinObject_FromPARAM(rc); // @pyseemfc CWnd|DefWindowProc *************** *** 1886,1895 **** return NULL; UINT message; WPARAM wParam=0; LPARAM lParam=0; ! if (!PyArg_ParseTuple(args, "i|ii:PostMessage", ! &message, // @pyparm int|idMessage||The ID of the message to post. ! &wParam, // @pyparm int|wParam|0|The wParam for the message ! &lParam)) // @pyparm int|lParam|0|The lParam for the message return NULL; // @pyseemfc CWnd|PostMessage --- 1892,1906 ---- return NULL; UINT message; + PyObject *obwParam = Py_None, *oblParam = Py_None; + if (!PyArg_ParseTuple(args, "i|OO:PostMessage", + &message, // @pyparm int|idMessage||The ID of the message to post. + &obwParam, // @pyparm int|wParam|0|The wParam for the message + &oblParam)) // @pyparm int|lParam|0|The lParam for the message + return NULL; WPARAM wParam=0; LPARAM lParam=0; ! if (obwParam != Py_None && !PyWinObject_AsPARAM(obwParam, &wParam)) ! return NULL; ! if (oblParam != Py_None && !PyWinObject_AsPARAM(oblParam, &lParam)) return NULL; // @pyseemfc CWnd|PostMessage *************** *** 2186,2200 **** return NULL; int message; ! int wParam=0; ! int lParam=0; ! WPARAM wp; ! LPARAM lp; ! if (PyArg_ParseTuple(args, "i|ii:SendMessage", &message, // @pyparm int|idMessage||The ID of the message to send. ! &wParam, // @pyparm int|wParam|0|The wParam for the message ! &lParam)) {// @pyparm int|lParam|0|The lParam for the message ! wp = (WPARAM)wParam; ! lp = (LPARAM)lParam; ! } else { // Allow a buffer object to be passed as (size, address) PyErr_Clear(); --- 2197,2212 ---- return NULL; int message; ! WPARAM wp = 0; ! LPARAM lp = 0; ! PyObject *obwParam = Py_None, *oblParam = Py_None; ! BOOL ok = FALSE; ! if (PyArg_ParseTuple(args, "i|OO:SendMessage", &message, // @pyparm int|idMessage||The ID of the message to send. ! &obwParam, // @pyparm int|wParam|0|The wParam for the message ! &oblParam)) {// @pyparm int|lParam|0|The lParam for the message ! ok = (obwParam == Py_None || PyWinObject_AsPARAM(obwParam, &wp)) && ! (oblParam == Py_None || PyWinObject_AsPARAM(oblParam, &lp)); ! } ! if (!ok) { // Allow a buffer object to be passed as (size, address) PyErr_Clear(); *************** *** 2205,2208 **** --- 2217,2221 ---- &obParam)) // @pyparmalt1 buffer|ob||A buffer whose size is passed in wParam, and address is passed in lParam return NULL; + int wParam; if (!PyWinObject_AsReadBuffer(obParam, &p, &wParam)) return NULL; *************** *** 2225,2237 **** return NULL; UINT message; - WPARAM wParam=0; - LPARAM lParam=0; BOOL bDeep = TRUE; ! if (!PyArg_ParseTuple(args, "i|iii:SendMessageToDescendants", &message, // @pyparm int|idMessage||The ID of the message to send. ! &wParam, // @pyparm int|wParam|0|The wParam for the message ! &lParam, // @pyparm int|lParam|0|The lParam for the message &bDeep)) // @pyparm int|bDeep|1|Indicates if the message should be recursively sent to all children return NULL; GUI_BGN_SAVE; // @pyseemfc CWnd|SendMessageToDescendants --- 2238,2255 ---- return NULL; UINT message; BOOL bDeep = TRUE; ! PyObject *obwParam = Py_None, *oblParam = Py_None; ! if (!PyArg_ParseTuple(args, "i|OOi:SendMessageToDescendants", &message, // @pyparm int|idMessage||The ID of the message to send. ! &obwParam, // @pyparm int|wParam|0|The wParam for the message ! &oblParam, // @pyparm int|lParam|0|The lParam for the message &bDeep)) // @pyparm int|bDeep|1|Indicates if the message should be recursively sent to all children return NULL; + WPARAM wParam=0; + LPARAM lParam=0; + if (obwParam != Py_None && !PyWinObject_AsPARAM(obwParam, &wParam)) + return NULL; + if (oblParam != Py_None && !PyWinObject_AsPARAM(oblParam, &lParam)) + return NULL; GUI_BGN_SAVE; // @pyseemfc CWnd|SendMessageToDescendants *************** *** 2619,2625 **** PAINTSTRUCT ps; PyObject *obString; // @pyparm <o PAINTSTRUCT>|paintStruct||The object returned from <om PyCWnd.BeginPaint> ! if (!PyArg_ParseTuple(args, "(ii(iiii)iiO)", ! &ps.hdc, &ps.fErase, &ps.rcPaint.left, &ps.rcPaint.top, &ps.rcPaint.right, &ps.rcPaint.bottom, --- 2637,2644 ---- PAINTSTRUCT ps; PyObject *obString; + PyObject *obhdc; // @pyparm <o PAINTSTRUCT>|paintStruct||The object returned from <om PyCWnd.BeginPaint> ! if (!PyArg_ParseTuple(args, "(Oi(iiii)iiO)", ! &obhdc, &ps.fErase, &ps.rcPaint.left, &ps.rcPaint.top, &ps.rcPaint.right, &ps.rcPaint.bottom, *************** *** 2633,2636 **** --- 2652,2658 ---- memcpy(ps.rgbReserved, PyString_AsString(obString), sizeof(ps.rgbReserved)); + if (!PyWinObject_AsHANDLE(obhdc, (HANDLE *)&ps.hdc)) + return NULL; + CWnd *pWnd = GetWndPtr (self); if (pWnd == NULL) |
From: Roger U. <ru...@us...> - 2007-06-03 19:46:41
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32344/com/win32comext/directsound/src Modified Files: PyIDirectSound.cpp Log Message: Remove bNoneOk param to PyWinObject_AsHANDLE Index: PyIDirectSound.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/PyIDirectSound.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIDirectSound.cpp 21 Jan 2007 16:59:56 -0000 1.6 --- PyIDirectSound.cpp 3 Jun 2007 19:46:41 -0000 1.7 *************** *** 84,88 **** return NULL; ! if (!PyWinObject_AsHANDLE(obHWND, (HANDLE *)&hwnd, TRUE)) return NULL; if (hwnd == NULL) --- 84,88 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obHWND, (HANDLE *)&hwnd)) return NULL; if (hwnd == NULL) |
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/win32/src Modified Files: PyHANDLE.cpp PyOVERLAPPED.cpp PyWinTypes.h _winxptheme.i win2krasmodule.cpp win32api_display.cpp win32apimodule.cpp win32clipboardmodule.cpp win32consolemodule.cpp win32credmodule.cpp win32crypt.i win32file.i win32gui.i win32inet.i win32job.i win32pdhmodule.cpp win32process.i win32profilemodule.cpp win32security.i win32security_ds.cpp win32service.i win32transactionmodule.cpp win32tsmodule.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** win32process.i 6 Mar 2007 19:44:06 -0000 1.28 --- win32process.i 3 Jun 2007 14:53:07 -0000 1.29 *************** *** 204,208 **** { HANDLE htmp; ! if (!PyWinObject_AsHANDLE(v, &htmp, TRUE)) return -1; *ph=htmp; --- 204,208 ---- { HANDLE htmp; ! if (!PyWinObject_AsHANDLE(v, &htmp)) return -1; *ph=htmp; *************** *** 430,434 **** &flags)) // @pyparm int|flags|| return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess, FALSE)) return NULL; if (!PyWinLong_AsVoidPtr(obFunc, (void **)&Func)) --- 430,434 ---- &flags)) // @pyparm int|flags|| return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess)) return NULL; if (!PyWinLong_AsVoidPtr(obFunc, (void **)&Func)) *************** *** 828,832 **** &obth)) // @pyparm <o PyHANDLE>|Process||Handle to a process return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) return NULL; if (!(*pfnGetProcessPriorityBoost)(th, &ret)) --- 828,832 ---- &obth)) // @pyparm <o PyHANDLE>|Process||Handle to a process return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; if (!(*pfnGetProcessPriorityBoost)(th, &ret)) *************** *** 846,850 **** &disable)) // @pyparm boolean|DisablePriorityBoost||True to disable or False to enable return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) return NULL; if (!(*pfnSetProcessPriorityBoost)(th, disable)) --- 846,850 ---- &disable)) // @pyparm boolean|DisablePriorityBoost||True to disable or False to enable return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; if (!(*pfnSetProcessPriorityBoost)(th, disable)) *************** *** 864,868 **** &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) return NULL; if (!(*pfnGetThreadPriorityBoost)(th, &ret)) --- 864,868 ---- &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; if (!(*pfnGetThreadPriorityBoost)(th, &ret)) *************** *** 882,886 **** &disable)) // @pyparm boolean|DisablePriorityBoost||True to disable or False to enable return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) return NULL; if (!(*pfnSetThreadPriorityBoost)(th, disable)) --- 882,886 ---- &disable)) // @pyparm boolean|DisablePriorityBoost||True to disable or False to enable return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; if (!(*pfnSetThreadPriorityBoost)(th, disable)) *************** *** 900,904 **** &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) return NULL; if (!(*pfnGetThreadPriorityBoost)(th, &ret)) --- 900,904 ---- &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; if (!(*pfnGetThreadPriorityBoost)(th, &ret)) *************** *** 917,921 **** &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE)) return NULL; if (!(*pfnGetThreadTimes)(th, &ft[0], &ft[1], &ft[2], &ft[3])) --- 917,921 ---- &obth)) // @pyparm <o PyHANDLE>|Thread||Handle to a thread return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; if (!(*pfnGetThreadTimes)(th, &ft[0], &ft[1], &ft[2], &ft[3])) *************** *** 945,949 **** &obhprocess)) // @pyparm <o PyHANDLE>|Process||Handle to a process return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess, FALSE)) return NULL; pid=(*pfnGetProcessId)(hprocess); --- 945,949 ---- &obhprocess)) // @pyparm <o PyHANDLE>|Process||Handle to a process return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess)) return NULL; pid=(*pfnGetProcessId)(hprocess); *************** *** 1006,1010 **** &obhProcess)) // @pyparm <o PyHANDLE>|hProcess||handle to the process of interest return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; if (!GetProcessAffinityMask(hProcess, &processmask, &systemmask)) --- 1006,1010 ---- &obhProcess)) // @pyparm <o PyHANDLE>|hProcess||handle to the process of interest return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; if (!GetProcessAffinityMask(hProcess, &processmask, &systemmask)) *************** *** 1035,1039 **** &dwMask)) // @pyparm int|mask||a processor affinity mask return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; if (!(*pfnSetProcessAffinityMask)(hProcess, dwMask)) --- 1035,1039 ---- &dwMask)) // @pyparm int|mask||a processor affinity mask return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; if (!(*pfnSetProcessAffinityMask)(hProcess, dwMask)) *************** *** 1060,1064 **** &dwMask)) // @pyparm int|ThreadAffinityMask||a processor affinity mask return NULL; ! if (!PyWinObject_AsHANDLE(obhThread, &hThread, FALSE)) return NULL; prevMask=SetThreadAffinityMask(hThread, dwMask); --- 1060,1064 ---- &dwMask)) // @pyparm int|ThreadAffinityMask||a processor affinity mask return NULL; ! if (!PyWinObject_AsHANDLE(obhThread, &hThread)) return NULL; prevMask=SetThreadAffinityMask(hThread, dwMask); *************** *** 1187,1191 **** if (!PyArg_ParseTuple(args, "O:EnumProcessModules", &obhprocess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess, FALSE)) return NULL; bytes_allocated=nbr_hmods_allocated*sizeof(HMODULE); --- 1187,1191 ---- if (!PyArg_ParseTuple(args, "O:EnumProcessModules", &obhprocess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess)) return NULL; bytes_allocated=nbr_hmods_allocated*sizeof(HMODULE); *************** *** 1247,1253 **** if (!PyArg_ParseTuple(args, "OO:GetModuleFileNameEx", &obhprocess, &obhmod)) return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess, FALSE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhmod, (HANDLE *)&hmod, FALSE)) return NULL; --- 1247,1253 ---- if (!PyArg_ParseTuple(args, "OO:GetModuleFileNameEx", &obhprocess, &obhmod)) return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhmod, (HANDLE *)&hmod)) return NULL; *************** *** 1294,1298 **** if (!PyArg_ParseTuple(args, "O:GetProcessMemoryInfo", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; --- 1294,1298 ---- if (!PyArg_ParseTuple(args, "O:GetProcessMemoryInfo", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; *************** *** 1327,1331 **** if (!PyArg_ParseTuple(args, "O:GetProcessTimes", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; --- 1327,1331 ---- if (!PyArg_ParseTuple(args, "O:GetProcessTimes", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; *************** *** 1356,1360 **** if (!PyArg_ParseTuple(args, "O:GetProcessIoCounters", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; if (!(*pfnGetProcessIoCounters)(hProcess, &ioc)){ --- 1356,1360 ---- if (!PyArg_ParseTuple(args, "O:GetProcessIoCounters", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; if (!(*pfnGetProcessIoCounters)(hProcess, &ioc)){ *************** *** 1391,1395 **** if (!PyArg_ParseTuple(args, "O:GetProcessWorkingSetSize", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; if (!(*pfnGetProcessWorkingSetSize)(hProcess, &MinimumWorkingSetSize, &MaximumWorkingSetSize)){ --- 1391,1395 ---- if (!PyArg_ParseTuple(args, "O:GetProcessWorkingSetSize", &obhProcess)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; if (!(*pfnGetProcessWorkingSetSize)(hProcess, &MinimumWorkingSetSize, &MaximumWorkingSetSize)){ *************** *** 1425,1429 **** &MaximumWorkingSetSize)) // @pyparm int|MaximumWorkingSetSize||Maximum number of bytes to keep in physical memory return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess, FALSE)) return NULL; if (!(*pfnSetProcessWorkingSetSize)(hProcess, MinimumWorkingSetSize, MaximumWorkingSetSize)) --- 1425,1429 ---- &MaximumWorkingSetSize)) // @pyparm int|MaximumWorkingSetSize||Maximum number of bytes to keep in physical memory return NULL; ! if (!PyWinObject_AsHANDLE(obhProcess, &hProcess)) return NULL; if (!(*pfnSetProcessWorkingSetSize)(hProcess, MinimumWorkingSetSize, MaximumWorkingSetSize)) *************** *** 1487,1491 **** if (!PyArg_ParseTuple(args, "Ok:GetGuiResources", &obhprocess, &flags)) return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess, FALSE)) return NULL; handle_cnt=(*pfnGetGuiResources)(hprocess, flags); --- 1487,1491 ---- if (!PyArg_ParseTuple(args, "Ok:GetGuiResources", &obhprocess, &flags)) return NULL; ! if (!PyWinObject_AsHANDLE(obhprocess, &hprocess)) return NULL; handle_cnt=(*pfnGetGuiResources)(hprocess, flags); Index: win32inet.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32inet.i,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32inet.i 16 Jan 2007 19:04:21 -0000 1.5 --- win32inet.i 3 Jun 2007 14:53:07 -0000 1.6 *************** *** 74,88 **** %typemap(python,in) HINTERNET { ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target, FALSE)) return NULL; } %typemap(python,in) PyHINTERNET { ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target, FALSE)) return NULL; } %typemap(python,in) PyHINTERNET INPUT_NULLOK { ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target, TRUE)) return NULL; } --- 74,88 ---- %typemap(python,in) HINTERNET { ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target)) return NULL; } %typemap(python,in) PyHINTERNET { ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target)) return NULL; } %typemap(python,in) PyHINTERNET INPUT_NULLOK { ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target)) return NULL; } *************** *** 251,255 **** if (!PyArg_ParseTuple(args, "OOOi:InternetOpenUrl", &obH, &obURL, &obHeaders, &flags)) return NULL; ! if (!PyWinObject_AsHANDLE(obH, (HANDLE *)&hiin, FALSE)) goto done; if (!PyWinObject_AsString(obURL, &szURL, FALSE)) --- 251,255 ---- if (!PyArg_ParseTuple(args, "OOOi:InternetOpenUrl", &obH, &obURL, &obHeaders, &flags)) return NULL; ! if (!PyWinObject_AsHANDLE(obH, (HANDLE *)&hiin)) goto done; if (!PyWinObject_AsString(obURL, &szURL, FALSE)) *************** *** 389,393 **** return NULL; } ! if (!PyWinObject_AsHANDLE(obH, (HANDLE *)&hiin, FALSE)) goto done; Py_BEGIN_ALLOW_THREADS --- 389,393 ---- return NULL; } ! if (!PyWinObject_AsHANDLE(obH, (HANDLE *)&hiin)) goto done; Py_BEGIN_ALLOW_THREADS Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** win32apimodule.cpp 1 Jun 2007 14:57:19 -0000 1.76 --- win32apimodule.cpp 3 Jun 2007 14:53:07 -0000 1.77 *************** *** 306,310 **** &iFileNum)) // @pyparm int|fileNum|0xFFFFFFFF|Specifies the index of the file to query. return NULL; ! if (!PyWinObject_AsHANDLE(obhDrop, (HANDLE *)&hDrop, FALSE)) return NULL; if (iFileNum<0) --- 306,310 ---- &iFileNum)) // @pyparm int|fileNum|0xFFFFFFFF|Specifies the index of the file to query. return NULL; ! if (!PyWinObject_AsHANDLE(obhDrop, (HANDLE *)&hDrop)) return NULL; if (iFileNum<0) *************** *** 333,337 **** if (!PyArg_ParseTuple(args, "O:DragFinish", &obhDrop)) return NULL; ! if (!PyWinObject_AsHANDLE(obhDrop, (HANDLE *)&hDrop, FALSE)) return NULL; PyW32_BEGIN_ALLOW_THREADS --- 333,337 ---- if (!PyArg_ParseTuple(args, "O:DragFinish", &obhDrop)) return NULL; ! if (!PyWinObject_AsHANDLE(obhDrop, (HANDLE *)&hDrop)) return NULL; PyW32_BEGIN_ALLOW_THREADS *************** *** 551,555 **** if (!PyArg_ParseTuple(args, "O:FindNextChangeNotification", &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; PyW32_BEGIN_ALLOW_THREADS --- 551,555 ---- if (!PyArg_ParseTuple(args, "O:FindNextChangeNotification", &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; PyW32_BEGIN_ALLOW_THREADS *************** *** 571,575 **** if (!PyArg_ParseTuple(args, "O:FindCloseChangeNotification", &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; PyW32_BEGIN_ALLOW_THREADS --- 571,575 ---- if (!PyArg_ParseTuple(args, "O:FindCloseChangeNotification", &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; PyW32_BEGIN_ALLOW_THREADS *************** *** 623,627 **** return NULL; if (flags & FORMAT_MESSAGE_FROM_HMODULE) { ! if (!PyWinObject_AsHANDLE(obSource, (HANDLE *)&pSource, TRUE)) return NULL; } else if (flags & FORMAT_MESSAGE_FROM_STRING) { --- 623,627 ---- return NULL; if (flags & FORMAT_MESSAGE_FROM_HMODULE) { ! if (!PyWinObject_AsHANDLE(obSource, (HANDLE *)&pSource)) return NULL; } else if (flags & FORMAT_MESSAGE_FROM_STRING) { *************** *** 704,708 **** goto cleanup; if (flags & FORMAT_MESSAGE_FROM_HMODULE) { ! if (!PyWinObject_AsHANDLE(obSource, (HANDLE *)&pSource, TRUE)) goto cleanup; } else if (flags & FORMAT_MESSAGE_FROM_STRING) { --- 704,708 ---- goto cleanup; if (flags & FORMAT_MESSAGE_FROM_HMODULE) { ! if (!PyWinObject_AsHANDLE(obSource, (HANDLE *)&pSource)) goto cleanup; } else if (flags & FORMAT_MESSAGE_FROM_STRING) { *************** *** 1124,1128 **** &obhCursor)) // @pyparm <o PyHANDLE>|hCursor||The new cursor. Can be None to remove cursor. return NULL; ! if (!PyWinObject_AsHANDLE(obhCursor, (HANDLE *)&hCursor, TRUE)) return NULL; // @pyseeapi SetCursor --- 1124,1128 ---- &obhCursor)) // @pyparm <o PyHANDLE>|hCursor||The new cursor. Can be None to remove cursor. return NULL; ! if (!PyWinObject_AsHANDLE(obhCursor, (HANDLE *)&hCursor)) return NULL; // @pyseeapi SetCursor *************** *** 1145,1149 **** &obid)) // @pyparm <o PyResourceId>|cursorid||The ID of the cursor. Can be a resource id or for system cursors, one of win32con.IDC_* return NULL; ! if (!PyWinObject_AsHANDLE(obhInstance, (HANDLE *)&hInstance, TRUE)) return NULL; if (!PyWinObject_AsResourceId(obid, &id)) --- 1145,1149 ---- &obid)) // @pyparm <o PyResourceId>|cursorid||The ID of the cursor. Can be a resource id or for system cursors, one of win32con.IDC_* return NULL; ! if (!PyWinObject_AsHANDLE(obhInstance, (HANDLE *)&hInstance)) return NULL; if (!PyWinObject_AsResourceId(obid, &id)) *************** *** 1352,1356 **** &obhkl)) // @pyparm <o PyHANDLE>|hkl||Handle to a keyboard layout at returned by <om win32api.LoadKeyboardLayout> return (NULL); ! if (!PyWinObject_AsHANDLE(obhkl, (HANDLE *)&hkl, FALSE)) return NULL; int ret; --- 1352,1356 ---- &obhkl)) // @pyparm <o PyHANDLE>|hkl||Handle to a keyboard layout at returned by <om win32api.LoadKeyboardLayout> return (NULL); ! if (!PyWinObject_AsHANDLE(obhkl, (HANDLE *)&hkl)) return NULL; int ret; *************** *** 1420,1424 **** if (!PyArg_ParseTuple(args, "O:GetModuleFileName", &obhMod)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhMod, (HANDLE *)&hMod, TRUE)) return NULL; // @pyseeapi GetModuleFileName --- 1420,1424 ---- if (!PyArg_ParseTuple(args, "O:GetModuleFileName", &obhMod)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhMod, (HANDLE *)&hMod)) return NULL; // @pyseeapi GetModuleFileName *************** *** 1441,1445 **** if (!PyArg_ParseTuple(args, "O:GetModuleFileNameW", &obhMod)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhMod, (HANDLE *)&hMod, TRUE)) return NULL; // @pyseeapi GetModuleFileName --- 1441,1445 ---- if (!PyArg_ParseTuple(args, "O:GetModuleFileNameW", &obhMod)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhMod, (HANDLE *)&hMod)) return NULL; // @pyseeapi GetModuleFileName *************** *** 1632,1636 **** if (!PyArg_ParseTuple(args, "sOl:LoadLibraryEx", &fname, &obhandle, &flags)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhandle, &handle, TRUE)) return NULL; // @pyseeapi LoadLibraryEx --- 1632,1636 ---- if (!PyArg_ParseTuple(args, "sOl:LoadLibraryEx", &fname, &obhandle, &flags)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhandle, &handle)) return NULL; // @pyseeapi LoadLibraryEx *************** *** 1652,1656 **** if (!PyArg_ParseTuple(args, "O:FreeLibrary", &obhandle)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhandle, (HANDLE *)&handle, FALSE)) return NULL; // @pyseeapi FreeLibrary --- 1652,1656 ---- if (!PyArg_ParseTuple(args, "O:FreeLibrary", &obhandle)) return (NULL); ! if (!PyWinObject_AsHANDLE(obhandle, (HANDLE *)&handle)) return NULL; // @pyseeapi FreeLibrary *************** *** 1676,1680 **** &obfnName)) // @pyparm <o PyResourceId>|functionName||Specifies the name of the procedure, or its ordinal value return (NULL); ! if (!PyWinObject_AsHANDLE(obhandle, (HANDLE *)&handle, FALSE)) return NULL; // GetProcAddress is char only --- 1676,1680 ---- &obfnName)) // @pyparm <o PyResourceId>|functionName||Specifies the name of the procedure, or its ordinal value return (NULL); ! if (!PyWinObject_AsHANDLE(obhandle, (HANDLE *)&handle)) return NULL; // GetProcAddress is char only *************** *** 2452,2456 **** &oblParam)) // @pyparm int|lParam|None|The lParam for the message return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; if (!PyWinObject_AsPARAM(obwParam, &wParam)) --- 2452,2456 ---- &oblParam)) // @pyparm int|lParam|None|The lParam for the message return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinObject_AsPARAM(obwParam, &wParam)) *************** *** 2682,2686 **** if (PyWinObject_AsHKEY(obKey, &hKey) &&PyWinObject_AsWCHAR(obsubKey, &subKey, FALSE) ! &&PyWinObject_AsHANDLE(obtrans, &htrans, FALSE) &&PyWinObject_AsWCHAR(obclass, &class_name, TRUE) &&PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)){ --- 2682,2686 ---- if (PyWinObject_AsHKEY(obKey, &hKey) &&PyWinObject_AsWCHAR(obsubKey, &subKey, FALSE) ! &&PyWinObject_AsHANDLE(obtrans, &htrans) &&PyWinObject_AsWCHAR(obclass, &class_name, TRUE) &&PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)){ *************** *** 2749,2753 **** if (PyWinObject_AsHKEY(obKey, &hKey) &&PyWinObject_AsWCHAR(obsubKey, &subKey, FALSE) ! &&PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)){ rc=(*pfnRegDeleteKeyTransacted)(hKey, subKey, access, reserved, htrans, extparam); if (rc!=ERROR_SUCCESS) --- 2749,2753 ---- if (PyWinObject_AsHKEY(obKey, &hKey) &&PyWinObject_AsWCHAR(obsubKey, &subKey, FALSE) ! &&PyWinObject_AsHANDLE(obtrans, &htrans)){ rc=(*pfnRegDeleteKeyTransacted)(hKey, subKey, access, reserved, htrans, extparam); if (rc!=ERROR_SUCCESS) *************** *** 3001,3005 **** if (!PyWinObject_AsHKEY(obreghandle, ®handle)) return NULL; ! if (!PyWinObject_AsHANDLE(obevent, &hevent, TRUE)) // handle should be NULL if asynch is False return NULL; PyW32_BEGIN_ALLOW_THREADS --- 3001,3005 ---- if (!PyWinObject_AsHKEY(obreghandle, ®handle)) return NULL; ! if (!PyWinObject_AsHANDLE(obevent, &hevent)) // handle should be NULL if asynch is False return NULL; PyW32_BEGIN_ALLOW_THREADS *************** *** 3417,3421 **** if (PyWinObject_AsHKEY(obKey, &hKey) &&PyWinObject_AsWCHAR(obsubKey, &subKey, TRUE) ! &&PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)){ rc=(*pfnRegOpenKeyTransacted)(hKey, subKey, options, access, &retKey, htrans, extparam); if (rc!=ERROR_SUCCESS) --- 3417,3421 ---- if (PyWinObject_AsHKEY(obKey, &hKey) &&PyWinObject_AsWCHAR(obsubKey, &subKey, TRUE) ! &&PyWinObject_AsHANDLE(obtrans, &htrans)){ rc=(*pfnRegOpenKeyTransacted)(hKey, subKey, options, access, &retKey, htrans, extparam); if (rc!=ERROR_SUCCESS) *************** *** 3935,3939 **** &oblParam)) // @pyparm int/string|lParam|None|The lParam for the message return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; if (!PyWinObject_AsPARAM(obwParam, &wParam)) --- 3935,3939 ---- &oblParam)) // @pyparm int/string|lParam|None|The lParam for the message return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinObject_AsPARAM(obwParam, &wParam)) *************** *** 4039,4043 **** &show))// @pyparm int|bShow||Specifies whether the application is shown when it is opened. If the lpszFile parameter specifies a document file, this parameter is zero. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; if (dir==NULL) --- 4039,4043 ---- &show))// @pyparm int|bShow||Specifies whether the application is shown when it is opened. If the lpszFile parameter specifies a document file, this parameter is zero. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (dir==NULL) *************** *** 4108,4112 **** &dataOb)) // @pyparm int/string|data|0|Additional data specific to the help call. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; if (dataOb==Py_None) --- 4108,4112 ---- &dataOb)) // @pyparm int/string|data|0|Additional data specific to the help call. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (dataOb==Py_None) *************** *** 4213,4217 **** if (!PyArg_ParseTuple(args, "Os|zli:MessageBox(Ex)", &obhwnd, &message, &title, &style, &langId)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; --- 4213,4217 ---- if (!PyArg_ParseTuple(args, "Os|zli:MessageBox(Ex)", &obhwnd, &message, &title, &style, &langId)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; *************** *** 4255,4259 **** if (!PyArg_ParseTuple(args, "Oi:GetWindowLong", &obhwnd, &offset)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; --- 4255,4259 ---- if (!PyArg_ParseTuple(args, "Oi:GetWindowLong", &obhwnd, &offset)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; *************** *** 4278,4282 **** if (!PyArg_ParseTuple(args, "OiO:SetWindowLong", &obhwnd, &offset, &obval)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; if (!PyWinLong_AsVoidPtr(obval, (void **)&newVal)) --- 4278,4282 ---- if (!PyArg_ParseTuple(args, "OiO:SetWindowLong", &obhwnd, &offset, &obval)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinLong_AsVoidPtr(obval, (void **)&newVal)) *************** *** 4301,4305 **** if (!PyArg_ParseTuple(args, "OiH:SetWindowWord", &obhwnd, &offset, &newVal)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; PyW32_BEGIN_ALLOW_THREADS --- 4301,4305 ---- if (!PyArg_ParseTuple(args, "OiH:SetWindowWord", &obhwnd, &offset, &newVal)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; PyW32_BEGIN_ALLOW_THREADS *************** *** 4323,4327 **** if (!PyArg_ParseTuple(args, "OiO:SetClassLong", &obhwnd, &offset, &obval)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; if (!PyWinLong_AsVoidPtr(obval, (void **)&newVal)) --- 4323,4327 ---- if (!PyArg_ParseTuple(args, "OiO:SetClassLong", &obhwnd, &offset, &obval)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinLong_AsVoidPtr(obval, (void **)&newVal)) *************** *** 4347,4351 **** if (!PyArg_ParseTuple(args, "OiH:SetClassWord", &obhwnd, &offset, &newVal)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; PyW32_BEGIN_ALLOW_THREADS --- 4347,4351 ---- if (!PyArg_ParseTuple(args, "OiH:SetClassWord", &obhwnd, &offset, &newVal)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; PyW32_BEGIN_ALLOW_THREADS *************** *** 4645,4649 **** &numChars)) // @pyparm int|numChars|1024|Number of characters to allocate for the return buffer. return NULL; ! if (!PyWinObject_AsHANDLE(obhModule, (HANDLE *)&hModule, FALSE)) return NULL; int numBytes = sizeof(WCHAR) * numChars; --- 4645,4649 ---- &numChars)) // @pyparm int|numChars|1024|Number of characters to allocate for the return buffer. return NULL; ! if (!PyWinObject_AsHANDLE(obhModule, (HANDLE *)&hModule)) return NULL; int numBytes = sizeof(WCHAR) * numChars; *************** *** 4680,4684 **** ) ) return NULL; ! if (PyWinObject_AsHANDLE(obhModule, (HANDLE *)&hModule, TRUE) &&PyWinObject_AsResourceId(obType, &lpType) &&PyWinObject_AsResourceId(obName, &lpName)){ --- 4680,4684 ---- ) ) return NULL; ! if (PyWinObject_AsHANDLE(obhModule, (HANDLE *)&hModule) &&PyWinObject_AsResourceId(obType, &lpType) &&PyWinObject_AsResourceId(obName, &lpName)){ *************** *** 4751,4755 **** return NULL; ! if (PyWinObject_AsHANDLE(obhUpdate, (HANDLE *)&hUpdate, FALSE) &&PyWinObject_AsResourceIdW(obType, &lpType) &&PyWinObject_AsResourceIdW(obName, &lpName) --- 4751,4755 ---- return NULL; ! if (PyWinObject_AsHANDLE(obhUpdate, (HANDLE *)&hUpdate) &&PyWinObject_AsResourceIdW(obType, &lpType) &&PyWinObject_AsResourceIdW(obName, &lpName) *************** *** 4779,4783 **** ) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhUpdate, (HANDLE *)&hUpdate, FALSE)) return NULL; if ( !EndUpdateResource(hUpdate, fDiscard) ) --- 4779,4783 ---- ) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhUpdate, (HANDLE *)&hUpdate)) return NULL; if ( !EndUpdateResource(hUpdate, fDiscard) ) *************** *** 4817,4821 **** return NULL; ! if (!PyWinObject_AsHANDLE(obhmodule, (HANDLE *)&hmodule, FALSE)) return NULL; if (!PyWinObject_AsResourceId(obrestype, &restype)) --- 4817,4821 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obhmodule, (HANDLE *)&hmodule)) return NULL; if (!PyWinObject_AsResourceId(obrestype, &restype)) Index: win32api_display.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32api_display.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32api_display.cpp 24 May 2007 06:01:05 -0000 1.5 --- win32api_display.cpp 3 Jun 2007 14:53:07 -0000 1.6 *************** *** 438,442 **** &obrect)) // @pyparm <o PyRECT>|rcClip|None|Clipping rectangle, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obhdc, (HANDLE *)&hdc, TRUE)) return NULL; if (obrect==Py_None) --- 438,442 ---- &obrect)) // @pyparm <o PyRECT>|rcClip|None|Clipping rectangle, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obhdc, (HANDLE *)&hdc)) return NULL; if (obrect==Py_None) *************** *** 554,558 **** &Flags)) // @pyparm int|Flags|0|Flags that determine default behaviour, one of MONITOR_DEFAULTTONEAREST,MONITOR_DEFAULTTONULL,MONITOR_DEFAULTTOPRIMARY return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; hmonitor=(*pfnMonitorFromWindow)(hwnd, Flags); --- 554,558 ---- &Flags)) // @pyparm int|Flags|0|Flags that determine default behaviour, one of MONITOR_DEFAULTTONEAREST,MONITOR_DEFAULTTONULL,MONITOR_DEFAULTTOPRIMARY return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; hmonitor=(*pfnMonitorFromWindow)(hwnd, Flags); Index: win32consolemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win32consolemodule.cpp 24 May 2007 06:01:05 -0000 1.10 --- win32consolemodule.cpp 3 Jun 2007 14:53:07 -0000 1.11 *************** *** 1585,1589 **** if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", keywords, &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; // Handle will be duplicated so caller is still responsible for original handle --- 1585,1589 ---- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", keywords, &obh)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; // Handle will be duplicated so caller is still responsible for original handle Index: win32clipboardmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** win32clipboardmodule.cpp 1 Jun 2007 13:36:53 -0000 1.19 --- win32clipboardmodule.cpp 3 Jun 2007 14:53:07 -0000 1.20 *************** *** 62,68 **** return NULL; } ! if (!PyWinObject_AsHANDLE(obhWndRemove, (HANDLE *)&hWndRemove, FALSE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhWndNewNext, (HANDLE *)&hWndNewNext, TRUE)) return NULL; --- 62,68 ---- return NULL; } ! if (!PyWinObject_AsHANDLE(obhWndRemove, (HANDLE *)&hWndRemove)) return NULL; ! if (!PyWinObject_AsHANDLE(obhWndNewNext, (HANDLE *)&hWndNewNext)) return NULL; *************** *** 466,470 **** if (!PyArg_ParseTuple(args, "O", &obhglobal)) return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, &hglobal, FALSE)) return NULL; size_t size = GlobalSize(hglobal); --- 466,470 ---- if (!PyArg_ParseTuple(args, "O", &obhglobal)) return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, &hglobal)) return NULL; size_t size = GlobalSize(hglobal); *************** *** 787,791 **** return NULL; ! if (!PyWinObject_AsHANDLE(obhWnd, (HANDLE *)&hWnd, TRUE)) return NULL; BOOL rc; --- 787,791 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obhWnd, (HANDLE *)&hWnd)) return NULL; BOOL rc; *************** *** 896,900 **** &format, &obhandle)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle , &handle, TRUE)){ PyErr_Clear(); // @pyparmalt1 int|format||Specifies a clipboard format. For a description of --- 896,900 ---- &format, &obhandle)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle , &handle)){ PyErr_Clear(); // @pyparmalt1 int|format||Specifies a clipboard format. For a description of *************** *** 1017,1021 **** if (!PyArg_ParseTuple(args, "O:SetClipboardViewer", &obhwnd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hWndNewViewer, FALSE)) return NULL; HWND rc; --- 1017,1021 ---- if (!PyArg_ParseTuple(args, "O:SetClipboardViewer", &obhwnd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hWndNewViewer)) return NULL; HWND rc; Index: win32profilemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32profilemodule.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32profilemodule.cpp 13 Sep 2006 00:28:31 -0000 1.1 --- win32profilemodule.cpp 3 Jun 2007 14:53:07 -0000 1.2 *************** *** 126,130 **** &&PyWinObject_AsWCHAR(obServerName, &pi->lpServerName,TRUE) &&PyWinObject_AsWCHAR(obPolicyPath, &pi->lpPolicyPath,TRUE) ! &&PyWinObject_AsHANDLE(obhProfile, &pi->hProfile, TRUE); Py_DECREF(dummy_args); --- 126,130 ---- &&PyWinObject_AsWCHAR(obServerName, &pi->lpServerName,TRUE) &&PyWinObject_AsWCHAR(obPolicyPath, &pi->lpPolicyPath,TRUE) ! &&PyWinObject_AsHANDLE(obhProfile, &pi->hProfile); Py_DECREF(dummy_args); *************** *** 151,155 **** &obPROFILEINFO)) // @pyparm <o PyPROFILEINFO>|ProfileInfo||Dictionary representing a PROFILEINFO structure return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken, FALSE)) return NULL; if (!PyWinObject_AsPROFILEINFO(obPROFILEINFO, &profileinfo)) --- 151,155 ---- &obPROFILEINFO)) // @pyparm <o PyPROFILEINFO>|ProfileInfo||Dictionary representing a PROFILEINFO structure return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken)) return NULL; if (!PyWinObject_AsPROFILEINFO(obPROFILEINFO, &profileinfo)) *************** *** 177,183 **** return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken, FALSE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProfile, &hProfile, FALSE)) return NULL; if (!(*pfnUnloadUserProfile)(hToken, hProfile)){ --- 177,183 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken)) return NULL; ! if (!PyWinObject_AsHANDLE(obhProfile, &hProfile)) return NULL; if (!(*pfnUnloadUserProfile)(hToken, hProfile)){ *************** *** 282,286 **** &obhToken)) // @pyparm <o PyHANDLE>|Token||User token as returned by <om win32security.LogonUser> return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken, FALSE)) return NULL; (*pfnGetUserProfileDirectory)(hToken, profile_path, &bufsize); --- 282,286 ---- &obhToken)) // @pyparm <o PyHANDLE>|Token||User token as returned by <om win32security.LogonUser> return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken)) return NULL; (*pfnGetUserProfileDirectory)(hToken, profile_path, &bufsize); *************** *** 359,363 **** &inherit)) // @pyparm boolean|Inherit||Indicates if environment of current process should be inherited return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken, TRUE)) return NULL; if (!CreateEnvironmentBlock(&env, hToken, inherit)) --- 359,363 ---- &inherit)) // @pyparm boolean|Inherit||Indicates if environment of current process should be inherited return NULL; ! if (!PyWinObject_AsHANDLE(obhToken, &hToken)) return NULL; if (!CreateEnvironmentBlock(&env, hToken, inherit)) *************** *** 402,406 **** &obsrc)) // @pyparm <o PyUnicode>|Src||String containing environment variables enclosed in % signs return NULL; ! if (!PyWinObject_AsHANDLE(obtoken, &htoken, TRUE) || !PyWinObject_AsWCHAR(obsrc, &src, FALSE, &bufsize)) return NULL; --- 402,406 ---- &obsrc)) // @pyparm <o PyUnicode>|Src||String containing environment variables enclosed in % signs return NULL; ! if (!PyWinObject_AsHANDLE(obtoken, &htoken) || !PyWinObject_AsWCHAR(obsrc, &src, FALSE, &bufsize)) return NULL; Index: win32security.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** win32security.i 28 May 2007 23:25:43 -0000 1.38 --- win32security.i 3 Jun 2007 14:53:07 -0000 1.39 *************** *** 222,226 **** HANDLE lsahandle; NTSTATUS err; ! if (!PyWinObject_AsHANDLE(obHandle, &lsahandle, FALSE)) return FALSE; err=LsaClose(lsahandle); --- 222,226 ---- HANDLE lsahandle; NTSTATUS err; ! if (!PyWinObject_AsHANDLE(obHandle, &lsahandle)) return FALSE; err=LsaClose(lsahandle); *************** *** 244,248 **** HANDLE lsahandle; NTSTATUS err; ! if (!PyWinObject_AsHANDLE(obHandle, &lsahandle, FALSE)) return FALSE; // function pointer checked in PyLsaDeregisterLogonProcess --- 244,248 ---- HANDLE lsahandle; NTSTATUS err; ! if (!PyWinObject_AsHANDLE(obHandle, &lsahandle)) return FALSE; // function pointer checked in PyLsaDeregisterLogonProcess *************** *** 1187,1191 **** return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE )) return NULL; if (!PyWinObject_AsSID(obSidOwner, &pSidOwner, TRUE)) --- 1187,1191 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; if (!PyWinObject_AsSID(obSidOwner, &pSidOwner, TRUE)) *************** *** 1224,1228 **** if (!PyArg_ParseTuple(args, "Oll:GetSecurityInfo",&obhandle, &object_type, &required_info)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &handle, FALSE)) return NULL; --- 1224,1228 ---- if (!PyArg_ParseTuple(args, "Oll:GetSecurityInfo",&obhandle, &object_type, &required_info)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &handle)) return NULL; *************** *** 1525,1529 **** &obtg)) // @pyparm <o PyTOKEN_GROUPS>|NewState||Groups and attributes to be set for token return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &th, FALSE)) return NULL; if (!PyWinObject_AsTOKEN_GROUPS(obtg, &newstate)) --- 1525,1529 ---- &obtg)) // @pyparm <o PyTOKEN_GROUPS>|NewState||Groups and attributes to be set for token return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &th)) return NULL; if (!PyWinObject_AsTOKEN_GROUPS(obtg, &newstate)) *************** *** 1584,1588 **** return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE)) return NULL; --- 1584,1588 ---- return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; *************** *** 1752,1760 **** phThread = NULL; else { ! if (!PyWinObject_AsHANDLE(obThread, &hThread, FALSE)) return NULL; phThread = &hThread; } ! if (!PyWinObject_AsHANDLE(obToken, &hToken, TRUE)) return NULL; BOOL ok; --- 1752,1760 ---- phThread = NULL; else { ! if (!PyWinObject_AsHANDLE(obThread, &hThread)) return NULL; phThread = &hThread; } ! if (!PyWinObject_AsHANDLE(obToken, &hToken)) return NULL; BOOL ok; *************** *** 2019,2023 **** return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th, FALSE )) return NULL; --- 2019,2023 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obth, &th)) return NULL; *************** *** 2732,2736 **** &obHandle)) // @pyparm <o PyHANDLE>|NotificationEventHandle||Event handle to receives notification return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &hevent, FALSE)) return NULL; err=(*pfnLsaRegisterPolicyChangeNotification)(info_class,hevent); --- 2732,2736 ---- &obHandle)) // @pyparm <o PyHANDLE>|NotificationEventHandle||Event handle to receives notification return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &hevent)) return NULL; err=(*pfnLsaRegisterPolicyChangeNotification)(info_class,hevent); *************** *** 2759,2763 **** &obHandle)) // @pyparm <o PyHANDLE>|NotificationEventHandle||Event handle previously registered to receive policy change events return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &hevent, FALSE)) return NULL; err=(*pfnLsaUnregisterPolicyChangeNotification)(info_class,hevent); --- 2759,2763 ---- &obHandle)) // @pyparm <o PyHANDLE>|NotificationEventHandle||Event handle previously registered to receive policy change events return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &hevent)) return NULL; err=(*pfnLsaUnregisterPolicyChangeNotification)(info_class,hevent); *************** *** 2905,2909 **** &obsa)) // @pyparm <o PySECURITY_ATTRIBUTES>|TokenAttributes|None|Specifies security and inheritance for the new handle. None results in default DACL and no inheritance, return NULL; ! if (!PyWinObject_AsHANDLE(obtoken, &htoken, FALSE)) return NULL; if (!PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)) --- 2905,2909 ---- &obsa)) // @pyparm <o PySECURITY_ATTRIBUTES>|TokenAttributes|None|Specifies security and inheritance for the new handle. None results in default DACL and no inheritance, return NULL; ! if (!PyWinObject_AsHANDLE(obtoken, &htoken)) return NULL; if (!PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)) *************** *** 2931,2935 **** if (!PyArg_ParseTuple(args, "OO:CheckTokenMembership",&obtoken, &obsid)) return NULL; ! if (!PyWinObject_AsHANDLE(obtoken, &htoken, TRUE)) return NULL; if (!PyWinObject_AsSID(obsid, &sid, FALSE)) --- 2931,2935 ---- if (!PyArg_ParseTuple(args, "OO:CheckTokenMembership",&obtoken, &obsid)) return NULL; ! if (!PyWinObject_AsHANDLE(obtoken, &htoken)) return NULL; if (!PyWinObject_AsSID(obsid, &sid, FALSE)) *************** *** 2964,2968 **** &obSidsToRestrict)) // @pyparm (<o PySID_AND_ATTRIBUTES>,...)|SidsToRestrict||Can be None, otherwise must be a sequence of <o PySID_AND_ATTRIBUTES> tuples (attributes must be 0) return NULL; ! if (PyWinObject_AsHANDLE(obExistingTokenHandle, &ExistingTokenHandle, FALSE)) if (PyWinObject_AsSID_AND_ATTRIBUTESArray(obSidsToDisable, &SidsToDisable, &DisableSidCount)) if (PyWinObject_AsSID_AND_ATTRIBUTESArray(obSidsToRestrict, &SidsToRestrict, &RestrictedSidCount)) --- 2964,2968 ---- &obSidsToRestrict)) // @pyparm (<o PySID_AND_ATTRIBUTES>,...)|SidsToRestrict||Can be None, otherwise must be a sequence of <o PySID_AND_ATTRIBUTES> tuples (attributes must be 0) return NULL; ! if (PyWinObject_AsHANDLE(obExistingTokenHandle, &ExistingTokenHandle)) if (PyWinObject_AsSID_AND_ATTRIBUTESArray(obSidsToDisable, &SidsToDisable, &DisableSidCount)) if (PyWinObject_AsSID_AND_ATTRIBUTESArray(obSidsToRestrict, &SidsToRestrict, &RestrictedSidCount)) *************** *** 3063,3067 **** &obhandle, &obname)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &lsahandle, FALSE)) return NULL; if (!PyWinObject_AsLSA_STRING(obname, &packagename)) --- 3063,3067 ---- &obhandle, &obname)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &lsahandle)) return NULL; if (!PyWinObject_AsLSA_STRING(obname, &packagename)) *************** *** 3434,3438 **** if (!PyArg_ParseTuple(args, "OllO:LsaCallAuthenticationPackage", &obhandle, &pkgid, &msgtype, &obinputbuf)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &lsahandle, FALSE)) return NULL; --- 3434,3438 ---- if (!PyArg_ParseTuple(args, "OllO:LsaCallAuthenticationPackage", &obhandle, &pkgid, &msgtype, &obinputbuf)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &lsahandle)) return NULL; Index: PyOVERLAPPED.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyOVERLAPPED.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyOVERLAPPED.cpp 19 Jan 2007 23:05:30 -0000 1.12 --- PyOVERLAPPED.cpp 3 Jun 2007 14:53:07 -0000 1.13 *************** *** 175,179 **** // Use an intermediate so the original isn't lost if conversion fails HANDLE htmp; ! if (!PyWinObject_AsHANDLE(v, &htmp, FALSE)) return -1; pO->m_overlapped.hEvent=htmp; --- 175,179 ---- // Use an intermediate so the original isn't lost if conversion fails HANDLE htmp; ! if (!PyWinObject_AsHANDLE(v, &htmp)) return -1; pO->m_overlapped.hEvent=htmp; Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** PyWinTypes.h 3 Jun 2007 12:32:09 -0000 1.43 --- PyWinTypes.h 3 Jun 2007 14:53:07 -0000 1.44 *************** *** 495,499 **** #define PyHANDLE_Check(ob) ((ob)->ob_type == &PyHANDLEType) ! PYWINTYPES_EXPORT BOOL PyWinObject_AsHANDLE(PyObject *ob, HANDLE *pRes, BOOL bNoneOK = FALSE); // For handles that use PyHANDLE. PYWINTYPES_EXPORT PyObject *PyWinObject_FromHANDLE(HANDLE h); --- 495,500 ---- #define PyHANDLE_Check(ob) ((ob)->ob_type == &PyHANDLEType) ! // Convert an object to a HANDLE - None is always OK, as are ints, etc. ! PYWINTYPES_EXPORT BOOL PyWinObject_AsHANDLE(PyObject *ob, HANDLE *pRes); // For handles that use PyHANDLE. PYWINTYPES_EXPORT PyObject *PyWinObject_FromHANDLE(HANDLE h); *************** *** 510,514 **** PYWINTYPES_EXPORT BOOL PyWinObject_CloseHANDLE(PyObject *obHandle); ! PYWINTYPES_EXPORT BOOL PyWinObject_AsHKEY(PyObject *ob, HKEY *pRes, BOOL bNoneOK = FALSE); PYWINTYPES_EXPORT PyObject *PyWinObject_FromHKEY(HKEY h); PYWINTYPES_EXPORT BOOL PyWinObject_CloseHKEY(PyObject *obHandle); --- 511,515 ---- PYWINTYPES_EXPORT BOOL PyWinObject_CloseHANDLE(PyObject *obHandle); ! PYWINTYPES_EXPORT BOOL PyWinObject_AsHKEY(PyObject *ob, HKEY *pRes); PYWINTYPES_EXPORT PyObject *PyWinObject_FromHKEY(HKEY h); PYWINTYPES_EXPORT BOOL PyWinObject_CloseHKEY(PyObject *obHandle); Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** win32file.i 27 May 2007 17:32:14 -0000 1.82 --- win32file.i 3 Jun 2007 14:53:07 -0000 1.83 *************** *** 246,252 **** return NULL; HANDLE hFile, hExisting; ! if (!PyWinObject_AsHANDLE(obFileHandle, &hFile, FALSE)) return NULL; ! if (!PyWinObject_AsHANDLE(obExistingHandle, &hExisting, TRUE)) return NULL; if (hExisting) { --- 246,252 ---- return NULL; HANDLE hFile, hExisting; ! if (!PyWinObject_AsHANDLE(obFileHandle, &hFile)) return NULL; ! if (!PyWinObject_AsHANDLE(obExistingHandle, &hExisting)) return NULL; if (hExisting) { *************** *** 1159,1163 **** return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE)) return NULL; DWORD bytes = 0; --- 1159,1163 ---- return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; DWORD bytes = 0; *************** *** 1191,1195 **** return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE)) return NULL; OVERLAPPED *pOverlapped; --- 1191,1195 ---- return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; OVERLAPPED *pOverlapped; *************** *** 1412,1416 **** if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &handle, FALSE)) return NULL; // Todo: overlappedRoutine support. --- 1412,1416 ---- if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &handle)) return NULL; // Todo: overlappedRoutine support. *************** *** 1553,1557 **** return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE)) return NULL; long offHigh; --- 1553,1557 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; long offHigh; *************** *** 2401,2405 **** return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE)) return NULL; BOOL rc; --- 2401,2405 ---- return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; BOOL rc; *************** *** 2526,2530 **** return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, FALSE)) return NULL; PyOVERLAPPED *pyoverlapped; --- 2526,2530 ---- return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; PyOVERLAPPED *pyoverlapped; *************** *** 2893,2897 **** &trans_obj)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(trans_obj, &htrans, TRUE)) return NULL; if (!PyWinObject_AsSECURITY_ATTRIBUTES(sa_obj, &sa, TRUE)) --- 2893,2897 ---- &trans_obj)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(trans_obj, &htrans)) return NULL; if (!PyWinObject_AsSECURITY_ATTRIBUTES(sa_obj, &sa, TRUE)) *************** *** 2942,2946 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; if (htrans){ --- 2942,2946 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (htrans){ *************** *** 3519,3523 **** if (!PyArg_ParseTuple(args, "OlOllO:BackupRead", &obh, &bytes_requested, &obbuf, &bAbort, &bProcessSecurity, &obctxt)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; if (!PyWinLong_AsVoidPtr(obctxt, &ctxt)) --- 3519,3523 ---- if (!PyArg_ParseTuple(args, "OlOllO:BackupRead", &obh, &bytes_requested, &obbuf, &bAbort, &bProcessSecurity, &obctxt)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; if (!PyWinLong_AsVoidPtr(obctxt, &ctxt)) *************** *** 3566,3570 **** if (!PyArg_ParseTuple(args,"OOO:BackupSeek", &obh, &obbytes_to_seek, &obctxt)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; if (!PyWinLong_AsVoidPtr(obctxt, &ctxt)) --- 3566,3570 ---- if (!PyArg_ParseTuple(args,"OOO:BackupSeek", &obh, &obbytes_to_seek, &obctxt)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; if (!PyWinLong_AsVoidPtr(obctxt, &ctxt)) *************** *** 3608,3612 **** if (!PyArg_ParseTuple(args, "OlOllO:BackupWrite", &obh, &bytes_to_write, &obbuf, &bAbort, &bProcessSecurity, &obctxt)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; if (!PyWinLong_AsVoidPtr(obctxt, &ctxt)) --- 3608,3612 ---- if (!PyArg_ParseTuple(args, "OlOllO:BackupWrite", &obh, &bytes_to_write, &obbuf, &bAbort, &bProcessSecurity, &obctxt)) return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; if (!PyWinLong_AsVoidPtr(obctxt, &ctxt)) *************** *** 3639,3643 **** &obshortname)) // @pyparm <o PyUNICODE>|ShortName||The 8.3 name to be applied to the file return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h, FALSE)) return NULL; if (!PyWinObject_AsWCHAR(obshortname, &shortname, FALSE)) --- 3639,3643 ---- &obshortname)) // @pyparm <o PyUNICODE>|ShortName||The 8.3 name to be applied to the file return NULL; ! if (!PyWinObject_AsHANDLE(obh, &h)) return NULL; if (!PyWinObject_AsWCHAR(obshortname, &shortname, FALSE)) *************** *** 3783,3787 **** return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)) return NULL; if (obcallback!=Py_None){ --- 3783,3787 ---- return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (obcallback!=Py_None){ *************** *** 3896,3900 **** &flags)) // @pyparm int|Flags|0|Combination of MOVEFILE_* flags return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htransaction, FALSE)) return NULL; if (obcallback!=Py_None){ --- 3896,3900 ---- &flags)) // @pyparm int|Flags|0|Combination of MOVEFILE_* flags return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htransaction)) return NULL; if (obcallback!=Py_None){ *************** *** 4211,4217 **** if (!PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhtemplate, &htemplate, TRUE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhtransaction, &htransaction, FALSE)) return NULL; if (obextendedparameter!=Py_None){ --- 4211,4217 ---- if (!PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhtemplate, &htemplate)) return NULL; ! if (!PyWinObject_AsHANDLE(obhtransaction, &htransaction)) return NULL; if (obextendedparameter!=Py_None){ *************** *** 4256,4260 **** &obhtransaction)) // @pyparm <o PyHANDLE>|Transaction||Transaction handle as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(obhtransaction, &htransaction, FALSE)) return NULL; if (!PyWinObject_AsWCHAR(obfilename, &filename, FALSE)) --- 4256,4260 ---- &obhtransaction)) // @pyparm <o PyHANDLE>|Transaction||Transaction handle as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(obhtransaction, &htransaction)) return NULL; if (!PyWinObject_AsWCHAR(obfilename, &filename, FALSE)) *************** *** 4293,4297 **** &lvl)) // @pyparm int|InfoLevelId|GetFileExInfoStandard|Level of information to return (GET_FILEEX_INFO_LEVELS enum) return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)) return NULL; switch (lvl){ --- 4293,4297 ---- &lvl)) // @pyparm int|InfoLevelId|GetFileExInfoStandard|Level of information to return (GET_FILEEX_INFO_LEVELS enum) return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; switch (lvl){ *************** *** 4339,4343 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction||Handle to the transaction. See <om win32transaction.CreateTransaction>. return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)) return NULL; if (!PyWinObject_AsWCHAR(obfname, &fname, FALSE)) --- 4339,4343 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction||Handle to the transaction. See <om win32transaction.CreateTransaction>. return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (!PyWinObject_AsWCHAR(obfname, &fname, FALSE)) *************** *** 4371,4375 **** &obsa)) // @pyparm <o PySECURITY_ATTRIBUTES>|SecurityAttributes|None|Security for new directory return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)) return NULL; if (!PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)) --- 4371,4375 ---- &obsa)) // @pyparm <o PySECURITY_ATTRIBUTES>|SecurityAttributes|None|Security for new directory return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (!PyWinObject_AsSECURITY_ATTRIBUTES(obsa, &psa, TRUE)) *************** *** 4406,4410 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction||Handle to the transaction. See <om win32transaction.CreateTransaction>. return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, FALSE)) return NULL; if (!PyWinObject_AsWCHAR(obdirname, &dirname, FALSE)) --- 4406,4410 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction||Handle to the transaction. See <om win32transaction.CreateTransaction>. return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (!PyWinObject_AsWCHAR(obdirname, &dirname, FALSE)) *************** *** 4437,4441 **** // If this parameter is not None, FindFirstFileTransacted will be called to perform a transacted search return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; if (htrans!=NULL) --- 4437,4441 ---- // If this parameter is not None, FindFirstFileTransacted will be called to perform a transacted search return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (htrans!=NULL) *************** *** 4509,4513 **** // If this parameter is not None, FindFirstFileTransacted will be called to perform a transacted search return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; if (htrans!=NULL) --- 4509,4513 ---- // If this parameter is not None, FindFirstFileTransacted will be called to perform a transacted search return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (htrans!=NULL) *************** *** 4570,4574 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; if (htrans!=NULL) --- 4570,4574 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (htrans!=NULL) *************** *** 4635,4639 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; if (htrans!=NULL) --- 4635,4639 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (htrans!=NULL) *************** *** 4732,4736 **** &flags)) // @pyparm int|Flags||Specifies type of path to return. (win32con.FILE_NAME_NORMALIZED,FILE_NAME_OPENED,VOLUME_NAME_DOS,VOLUME_NAME_GUID,VOLUME_NAME_NONE,VOLUME_NAME_NT) return NULL; ! if (!PyWinObject_AsHANDLE(obhfile, &hfile, FALSE)) return NULL; --- 4732,4736 ---- &flags)) // @pyparm int|Flags||Specifies type of path to return. (win32con.FILE_NAME_NORMALIZED,FILE_NAME_OPENED,VOLUME_NAME_DOS,VOLUME_NAME_GUID,VOLUME_NAME_NONE,VOLUME_NAME_NT) return NULL; ! if (!PyWinObject_AsHANDLE(obhfile, &hfile)) return NULL; *************** *** 4830,4834 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction. If specified, GetLongPathNameTransacted will be called. return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; if (htrans){ --- 4830,4834 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction. If specified, GetLongPathNameTransacted will be called. return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; if (htrans){ *************** *** 4896,4900 **** &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans, TRUE)) return NULL; --- 4896,4900 ---- &obtrans)) // @pyparm <o PyHANDLE>|Transaction|None|Handle to a transaction as returned by <om win32transaction.CreateTransaction> return NULL; ! if (!PyWinObject_AsHANDLE(obtrans, &htrans)) return NULL; Index: win32credmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32credmodule.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32credmodule.cpp 30 May 2007 06:48:02 -0000 1.6 --- win32credmodule.cpp 3 Jun 2007 14:53:07 -0000 1.7 *************** *** 342,347 ... [truncated message content] |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:07
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/com/win32comext/shell/src Modified Files: PyIActiveDesktop.cpp PyIContextMenu.cpp PyICopyHook.cpp PyIDropTargetHelper.cpp PyIQueryAssociations.cpp PyIShellBrowser.cpp PyIShellExtInit.cpp PyIShellFolder.cpp PyIShellLink.cpp PyIShellView.cpp shell.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: PyIDropTargetHelper.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIDropTargetHelper.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIDropTargetHelper.cpp 21 Jan 2007 12:47:50 -0000 1.3 --- PyIDropTargetHelper.cpp 3 Jun 2007 14:53:07 -0000 1.4 *************** *** 55,59 **** &dwEffect)) // @pyparm int|dwEffect||One of shellcon.DROPEFFECT_* values return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; BOOL bPythonIsHappy = TRUE; --- 55,59 ---- &dwEffect)) // @pyparm int|dwEffect||One of shellcon.DROPEFFECT_* values return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; BOOL bPythonIsHappy = TRUE; Index: PyIShellExtInit.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellExtInit.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIShellExtInit.cpp 9 Oct 2003 12:09:17 -0000 1.3 --- PyIShellExtInit.cpp 3 Jun 2007 14:53:07 -0000 1.4 *************** *** 47,51 **** if (!PyCom_InterfaceFromPyInstanceOrObject(obpDataObject, IID_IDataObject, (void **)&pDataObject, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!PyWinObject_AsHANDLE(obhkey, (HANDLE *)&hkey, FALSE)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; --- 47,51 ---- if (!PyCom_InterfaceFromPyInstanceOrObject(obpDataObject, IID_IDataObject, (void **)&pDataObject, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!PyWinObject_AsHANDLE(obhkey, (HANDLE *)&hkey)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** shell.cpp 3 Jun 2007 01:35:16 -0000 1.56 --- shell.cpp 3 Jun 2007 14:53:07 -0000 1.57 *************** *** 482,488 **** &pci->nShow, &pci->dwHotKey, &obhIcon)) return FALSE; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&pci->hwnd, FALSE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhIcon, (HANDLE *)&pci->hIcon, TRUE)) return NULL; if (PyString_Check(obVerb)) { --- 482,488 ---- &pci->nShow, &pci->dwHotKey, &obhIcon)) return FALSE; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&pci->hwnd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhIcon, (HANDLE *)&pci->hIcon)) return NULL; if (PyString_Check(obVerb)) { *************** *** 589,593 **** PyObject *obhwnd; return PyArg_ParseTuple(obpmsg, "Oiiii(ii)", &obhwnd,&msg->message,&msg->wParam,&msg->lParam,&msg->time,&msg->pt.x,&msg->pt.y) ! && PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&msg->hwnd, FALSE); } --- 589,593 ---- PyObject *obhwnd; return PyArg_ParseTuple(obpmsg, "Oiiii(ii)", &obhwnd,&msg->message,&msg->wParam,&msg->lParam,&msg->time,&msg->pt.x,&msg->pt.y) ! && PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&msg->hwnd); } *************** *** 839,843 **** &obProgressTitle)) // @tupleitem 6|string|ProgressTitle|Title for progress dialog (flags must contain FOF_SIMPLEPROGRESS). Default=None return FALSE; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd, TRUE)) return NULL; if (obNameMappings != Py_None) { --- 839,843 ---- &obProgressTitle)) // @tupleitem 6|string|ProgressTitle|Title for progress dialog (flags must contain FOF_SIMPLEPROGRESS). Default=None return FALSE; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd)) return NULL; if (obNameMappings != Py_None) { *************** *** 934,938 **** &obcbparam)) // @pyparm object|callback_data|None|An object passed to the callback function return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&bi.hwndOwner, TRUE)) return NULL; if (obcb != Py_None) { --- 934,938 ---- &obcbparam)) // @pyparm object|callback_data|None|An object passed to the callback function return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&bi.hwndOwner)) return NULL; if (obcb != Py_None) { *************** *** 1053,1057 **** &bCreate)) // @pyparm int|bCreate|0|Should the path be created. return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; // @comm This method is only available in shell version 4.71. If the --- 1053,1057 ---- &bCreate)) // @pyparm int|bCreate|0|Should the path be created. return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; // @comm This method is only available in shell version 4.71. If the *************** *** 1081,1085 **** &nFolder)) // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; LPITEMIDLIST pidl; --- 1081,1085 ---- &nFolder)) // @pyparm int|nFolder||One of the CSIDL_* constants specifying the path. return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; LPITEMIDLIST pidl; *************** *** 1157,1164 **** &flags)) // @pyparm int|flags||Controls which path is returned. May be SHGFP_TYPE_CURRENT or SHGFP_TYPE_DEFAULT return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle, TRUE)) return NULL; --- 1157,1164 ---- &flags)) // @pyparm int|flags||Controls which path is returned. May be SHGFP_TYPE_CURRENT or SHGFP_TYPE_DEFAULT return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; HANDLE handle; ! if (!PyWinObject_AsHANDLE(obHandle, &handle)) return NULL; *************** *** 1194,1198 **** &obToken)) // @pyparm <o PyHANDLE>|hToken|None|Handle to an access token, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obToken, &hToken, TRUE)) return NULL; if (!PyWinObject_AsWCHAR(obPath, &Path, FALSE)) --- 1194,1198 ---- &obToken)) // @pyparm <o PyHANDLE>|hToken|None|Handle to an access token, can be None return NULL; ! if (!PyWinObject_AsHANDLE(obToken, &hToken)) return NULL; if (!PyWinObject_AsWCHAR(obPath, &Path, FALSE)) *************** *** 1225,1231 **** &flags)) // @pyparm int|reserved|0|Must be 0 return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; ! if (!PyWinObject_AsHANDLE(obToken, &hToken, TRUE)) return NULL; LPITEMIDLIST pidl; --- 1225,1231 ---- &flags)) // @pyparm int|reserved|0|Must be 0 return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; ! if (!PyWinObject_AsHANDLE(obToken, &hToken)) return NULL; LPITEMIDLIST pidl; *************** *** 1274,1278 **** &flags)) // @pyparm int|flags||One of the SHERB_* values. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; // @comm This method is only available in shell version 4.71. If the function is not available, a COM Exception with HRESULT=E_NOTIMPL will be raised. --- 1274,1278 ---- &flags)) // @pyparm int|flags||One of the SHERB_* values. return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; // @comm This method is only available in shell version 4.71. If the function is not available, a COM Exception with HRESULT=E_NOTIMPL will be raised. *************** *** 1518,1522 **** &entry.fRecursive)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; if (!PyObject_AsPIDL(obPIDL, (ITEMIDLIST **)&entry.pidl, TRUE)) --- 1518,1522 ---- &entry.fRecursive)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyObject_AsPIDL(obPIDL, (ITEMIDLIST **)&entry.pidl, TRUE)) *************** *** 1565,1569 **** &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal, FALSE)) return NULL; if (index==0xFFFFFFFF) { --- 1565,1569 ---- &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal)) return NULL; if (index==0xFFFFFFFF) { *************** *** 1591,1595 **** &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal, FALSE)) return NULL; if (index==0xFFFFFFFF) { --- 1591,1595 ---- &index)) // @pyparm int|index||The index to retrieve. If -1, the result if an integer representing the valid index values. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal)) return NULL; if (index==0xFFFFFFFF) { *************** *** 1617,1621 **** &obhglobal)) // @pyparm <o PyHANDLE>|hglobal||The HGLOBAL object - generally obtained the 'data_handle' property of a <o PySTGMEDIUM> return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal, FALSE)) return NULL; POINT pt; --- 1617,1621 ---- &obhglobal)) // @pyparm <o PyHANDLE>|hglobal||The HGLOBAL object - generally obtained the 'data_handle' property of a <o PySTGMEDIUM> return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, (HANDLE *)&hglobal)) return NULL; POINT pt; *************** *** 2107,2111 **** &obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor|| goto done; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd, TRUE)) goto done; if (obVerb && !PyWinObject_AsString(obVerb, (char **)&p->lpVerb)) --- 2107,2111 ---- &obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor|| goto done; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&p->hwnd)) goto done; if (obVerb && !PyWinObject_AsString(obVerb, (char **)&p->lpVerb)) Index: PyIActiveDesktop.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIActiveDesktop.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIActiveDesktop.cpp 17 Jan 2007 13:55:04 -0000 1.3 --- PyIActiveDesktop.cpp 3 Jun 2007 14:53:07 -0000 1.4 *************** *** 481,485 **** &flags)) // @pyparm int|Flags||One of shellcon.DTI_ADDUI_* flags return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; if (!PyWinObject_AsCOMPONENT(obcomp, &comp)) --- 481,485 ---- &flags)) // @pyparm int|Flags||One of shellcon.DTI_ADDUI_* flags return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinObject_AsCOMPONENT(obcomp, &comp)) *************** *** 669,673 **** &flags)) // @pyparm int|Flags||ADDURL_SILENT, or 0 return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; if (!PyWinObject_AsCOMPONENT(obcomp, &comp)) --- 669,673 ---- &flags)) // @pyparm int|Flags||ADDURL_SILENT, or 0 return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinObject_AsCOMPONENT(obcomp, &comp)) Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PyIShellFolder.cpp 24 May 2007 06:01:05 -0000 1.15 --- PyIShellFolder.cpp 3 Jun 2007 14:53:07 -0000 1.16 *************** *** 55,59 **** &oblpszDisplayName, &pdwAttributes) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; BOOL bPythonIsHappy = TRUE; --- 55,59 ---- &oblpszDisplayName, &pdwAttributes) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; BOOL bPythonIsHappy = TRUE; *************** *** 95,99 **** if ( !PyArg_ParseTuple(args, "|Ol:EnumObjects", &obhwndOwner, &grfFlags) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; --- 95,99 ---- if ( !PyArg_ParseTuple(args, "|Ol:EnumObjects", &obhwndOwner, &grfFlags) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; *************** *** 247,251 **** if ( !PyArg_ParseTuple(args, "OO:CreateViewObject", &obhwndOwner, &obriid) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; BOOL bPythonIsHappy = TRUE; --- 247,251 ---- if ( !PyArg_ParseTuple(args, "OO:CreateViewObject", &obhwndOwner, &obriid) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; BOOL bPythonIsHappy = TRUE; *************** *** 316,320 **** if ( !PyArg_ParseTuple(args, "OOOl|O:GetUIObjectOf", &obhwndOwner, &obpidl, &obriid, &rgfInOut, &obiidout) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; BOOL bPythonIsHappy = TRUE; --- 316,320 ---- if ( !PyArg_ParseTuple(args, "OOOl|O:GetUIObjectOf", &obhwndOwner, &obpidl, &obriid, &rgfInOut, &obiidout) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; BOOL bPythonIsHappy = TRUE; *************** *** 393,397 **** if ( !PyArg_ParseTuple(args, "OOOl:SetNameOf", &obhwndOwner, &obpidl, &oblpszName, &flags) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner, TRUE)) return NULL; --- 393,397 ---- if ( !PyArg_ParseTuple(args, "OOOl:SetNameOf", &obhwndOwner, &obpidl, &oblpszName, &flags) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&hwndOwner)) return NULL; Index: PyIContextMenu.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIContextMenu.cpp 24 May 2007 06:01:05 -0000 1.5 --- PyIContextMenu.cpp 3 Jun 2007 14:53:07 -0000 1.6 *************** *** 44,48 **** &uFlags)) // @pyparm int|uFlags||Combination of shellcon.CMF_* flags, can be 0 return NULL; ! if (!PyWinObject_AsHANDLE(obhmenu, (HANDLE *)&hmenu, FALSE)) return NULL; HRESULT hr; --- 44,48 ---- &uFlags)) // @pyparm int|uFlags||Combination of shellcon.CMF_* flags, can be 0 return NULL; ! if (!PyWinObject_AsHANDLE(obhmenu, (HANDLE *)&hmenu)) return NULL; HRESULT hr; Index: PyIShellBrowser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellBrowser.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyIShellBrowser.cpp 20 Feb 2007 10:10:23 -0000 1.8 --- PyIShellBrowser.cpp 3 Jun 2007 14:53:07 -0000 1.9 *************** *** 45,49 **** &obMenuWidths)) // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Tuple of 6 ints. Items 0,2,and 4 are updated when the tuple is returned. return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared, FALSE)) return NULL; if (!PyObject_AsOLEMENUGROUPWIDTHS( obMenuWidths, &menuWidths)) --- 45,49 ---- &obMenuWidths)) // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Tuple of 6 ints. Items 0,2,and 4 are updated when the tuple is returned. return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) return NULL; if (!PyObject_AsOLEMENUGROUPWIDTHS( obMenuWidths, &menuWidths)) *************** *** 73,81 **** &obhwndActiveObject)) // @pyparm <o PyHANDLE>|hwndActiveObject||Handle to the shell window return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared, FALSE)) return NULL; ! if (!PyWinObject_AsHANDLE(obholemenuRes, (HANDLE *)&holemenuRes, TRUE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndActiveObject, (HANDLE *)&hwndActiveObject, FALSE)) return NULL; --- 73,81 ---- &obhwndActiveObject)) // @pyparm <o PyHANDLE>|hwndActiveObject||Handle to the shell window return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) return NULL; ! if (!PyWinObject_AsHANDLE(obholemenuRes, (HANDLE *)&holemenuRes)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwndActiveObject, (HANDLE *)&hwndActiveObject)) return NULL; *************** *** 103,107 **** &obhmenuShared)) // @pyparm <o PyHANDLE>|hmenuShared||Handle to the composite menu return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared, FALSE)) return NULL; --- 103,107 ---- &obhmenuShared)) // @pyparm <o PyHANDLE>|hmenuShared||Handle to the composite menu return NULL; ! if (!PyWinObject_AsHANDLE(obhmenuShared, (HANDLE *)&hmenuShared)) return NULL; *************** *** 504,508 **** if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd, TRUE)) hr = PyCom_HandlePythonFailureToCOM(); Py_DECREF(result); --- 504,508 ---- if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd)) hr = PyCom_HandlePythonFailureToCOM(); Py_DECREF(result); Index: PyIShellView.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIShellView.cpp 27 Jan 2007 17:18:28 -0000 1.6 --- PyIShellView.cpp 3 Jun 2007 14:53:07 -0000 1.7 *************** *** 388,392 **** if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (!PyWinObject_AsHANDLE(result, (HANDLE *)phWnd, TRUE)) hr=MAKE_PYCOM_GATEWAY_FAILURE_CODE("CreateViewWindow"); Py_DECREF(result); --- 388,392 ---- if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (!PyWinObject_AsHANDLE(result, (HANDLE *)phWnd)) hr=MAKE_PYCOM_GATEWAY_FAILURE_CODE("CreateViewWindow"); Py_DECREF(result); Index: PyIShellLink.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellLink.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyIShellLink.cpp 21 Jan 2007 02:36:31 -0000 1.8 --- PyIShellLink.cpp 3 Jun 2007 14:53:07 -0000 1.9 *************** *** 479,483 **** if ( !PyArg_ParseTuple(args, "Ol:Resolve", &obhwnd, &fFlags) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; HRESULT hr; --- 479,483 ---- if ( !PyArg_ParseTuple(args, "Ol:Resolve", &obhwnd, &fFlags) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; HRESULT hr; Index: PyICopyHook.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyICopyHook.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyICopyHook.cpp 20 Jan 2007 22:46:30 -0000 1.3 --- PyICopyHook.cpp 3 Jun 2007 14:53:07 -0000 1.4 *************** *** 50,54 **** if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; BOOL bPythonIsHappy = TRUE; --- 50,54 ---- if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; BOOL bPythonIsHappy = TRUE; Index: PyIQueryAssociations.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIQueryAssociations.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIQueryAssociations.cpp 21 Jan 2007 13:34:42 -0000 1.5 --- PyIQueryAssociations.cpp 3 Jun 2007 14:53:07 -0000 1.6 *************** *** 44,50 **** if (!PyWinObject_AsWCHAR(obAssoc, &pszAssoc, TRUE)) return NULL; ! if (!PyWinObject_AsHKEY(obhkProgid, &hkProgid, TRUE)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; HRESULT hr; --- 44,50 ---- if (!PyWinObject_AsWCHAR(obAssoc, &pszAssoc, TRUE)) return NULL; ! if (!PyWinObject_AsHKEY(obhkProgid, &hkProgid)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; HRESULT hr; |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:07
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32print In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/win32/src/win32print Modified Files: win32print.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: win32print.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** win32print.cpp 30 May 2007 02:37:01 -0000 1.26 --- win32print.cpp 3 Jun 2007 14:53:07 -0000 1.27 *************** *** 55,59 **** // To be used in PyArg_ParseTuple with O& format BOOL PyWinObject_AsPrinterHANDLE(PyObject *obhprinter, HANDLE *phprinter){ ! return PyWinObject_AsHANDLE(obhprinter, phprinter, FALSE); } --- 55,59 ---- // To be used in PyArg_ParseTuple with O& format BOOL PyWinObject_AsPrinterHANDLE(PyObject *obhprinter, HANDLE *phprinter){ ! return PyWinObject_AsHANDLE(obhprinter, phprinter); } *************** *** 1206,1210 **** &devicename, &obdmoutput, &obdminput, &mode)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, TRUE)) return NULL; if (!PyWinObject_AsDEVMODE(obdmoutput, &dmoutput, TRUE)) --- 1206,1210 ---- &devicename, &obdmoutput, &obdminput, &mode)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinObject_AsDEVMODE(obdmoutput, &dmoutput, TRUE)) |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:07
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32wnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/win32/src/win32wnet Modified Files: win32wnet.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: win32wnet.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/win32wnet.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32wnet.cpp 10 Jul 2006 12:45:44 -0000 1.12 --- win32wnet.cpp 3 Jun 2007 14:53:07 -0000 1.13 *************** *** 289,293 **** return NULL; ! if (!PyWinObject_AsHANDLE(Eob, &hEnum, FALSE)) // shouldn't fail unless out of memory? return NULL; --- 289,293 ---- return NULL; ! if (!PyWinObject_AsHANDLE(Eob, &hEnum)) // shouldn't fail unless out of memory? return NULL; |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:06
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/com/win32comext/taskscheduler/src Modified Files: PyIScheduledWorkItem.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: PyIScheduledWorkItem.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src/PyIScheduledWorkItem.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyIScheduledWorkItem.cpp 24 May 2007 06:01:05 -0000 1.4 --- PyIScheduledWorkItem.cpp 3 Jun 2007 14:53:07 -0000 1.5 *************** *** 312,316 **** if (!PyArg_ParseTuple(args, "|Ol:PyIScheduledWorkItem::EditWorkItem", &obhParent, &dwReserved)) return NULL; ! if (!PyWinObject_AsHANDLE(obhParent, (HANDLE *)&hParent, TRUE)) return NULL; HRESULT hr; --- 312,316 ---- if (!PyArg_ParseTuple(args, "|Ol:PyIScheduledWorkItem::EditWorkItem", &obhParent, &dwReserved)) return NULL; ! if (!PyWinObject_AsHANDLE(obhParent, (HANDLE *)&hParent)) return NULL; HRESULT hr; |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:06
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/com/win32com/src Modified Files: PyStorage.cpp PythonCOM.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** PythonCOM.cpp 27 Apr 2007 05:45:42 -0000 1.45 --- PythonCOM.cpp 3 Jun 2007 14:53:06 -0000 1.46 *************** *** 1661,1665 **** if (!PyArg_ParseTuple(args, "OO:RegisterDragDrop", &obhwnd, &obd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; // @pyparm <o PyHANDLE>|hwnd||Handle to a window --- 1661,1665 ---- if (!PyArg_ParseTuple(args, "OO:RegisterDragDrop", &obhwnd, &obd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; // @pyparm <o PyHANDLE>|hwnd||Handle to a window *************** *** 1691,1695 **** if (!PyArg_ParseTuple(args, "O:RevokeDragDrop", &obhwnd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; HRESULT hr; --- 1691,1695 ---- if (!PyArg_ParseTuple(args, "O:RevokeDragDrop", &obhwnd)) return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; HRESULT hr; Index: PyStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyStorage.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyStorage.cpp 27 Apr 2007 05:45:42 -0000 1.10 --- PyStorage.cpp 3 Jun 2007 14:53:06 -0000 1.11 *************** *** 112,116 **** &bdelete)) // @pyparm bool|DeleteOnRelease|True|Indicates if global memory should be freed when IStream object is destroyed. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, &hglobal, TRUE)) return NULL; PY_INTERFACE_PRECALL; --- 112,116 ---- &bdelete)) // @pyparm bool|DeleteOnRelease|True|Indicates if global memory should be freed when IStream object is destroyed. return NULL; ! if (!PyWinObject_AsHANDLE(obhglobal, &hglobal)) return NULL; PY_INTERFACE_PRECALL; |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:06
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/authorization/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/com/win32comext/authorization/src Modified Files: PyGSecurityInformation.cpp Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: PyGSecurityInformation.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/authorization/src/PyGSecurityInformation.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyGSecurityInformation.cpp 17 Jan 2007 15:00:15 -0000 1.3 --- PyGSecurityInformation.cpp 3 Jun 2007 14:53:06 -0000 1.4 *************** *** 89,93 **** &&PyArg_ParseTuple(result, "kOOOOO", &ObjectInfo.dwFlags, &obhInstance, &obServerName, &obObjectName, &obPageTitle, &obObjectType) ! &&PyWinObject_AsHANDLE(obhInstance, (PHANDLE)&ObjectInfo.hInstance, TRUE) &&PyWinObject_AsWCHAR(obServerName, &ObjectInfo.pszServerName, TRUE) &&PyWinObject_AsWCHAR(obObjectName, &ObjectInfo.pszObjectName, FALSE) --- 89,93 ---- &&PyArg_ParseTuple(result, "kOOOOO", &ObjectInfo.dwFlags, &obhInstance, &obServerName, &obObjectName, &obPageTitle, &obObjectType) ! &&PyWinObject_AsHANDLE(obhInstance, (PHANDLE)&ObjectInfo.hInstance) &&PyWinObject_AsWCHAR(obServerName, &ObjectInfo.pszServerName, TRUE) &&PyWinObject_AsWCHAR(obObjectName, &ObjectInfo.pszObjectName, FALSE) |
From: Mark H. <mha...@us...> - 2007-06-03 14:53:06
|
Update of /cvsroot/pywin32/pywin32/SWIG/swig_lib/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21318/SWIG/swig_lib/python Modified Files: pywintypes.i Log Message: PyWinObject_AsHANDLE losts its 3rd param - None is always OK (zero always was, so the distinction is futile Index: pywintypes.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/SWIG/swig_lib/python/pywintypes.i,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pywintypes.i 16 Jan 2007 19:04:21 -0000 1.6 --- pywintypes.i 3 Jun 2007 14:53:06 -0000 1.7 *************** *** 303,325 **** %typemap(python,in) HANDLE { ! if (!PyWinObject_AsHANDLE($source, &$target, TRUE)) return NULL; } %typemap(python,in) PyHANDLE { ! if (!PyWinObject_AsHANDLE($source, &$target, FALSE)) return NULL; } %typemap(python,in) PyHKEY { ! if (!PyWinObject_AsHKEY($source, &$target, FALSE)) return NULL; } %typemap(python,in) PyHANDLE INPUT_NULLOK { ! if (!PyWinObject_AsHANDLE($source, &$target, TRUE)) return NULL; } %typemap(python,in) PyHKEY INPUT_NULLOK { ! if (!PyWinObject_AsHKEY($source, &$target, TRUE)) return NULL; } --- 303,325 ---- %typemap(python,in) HANDLE { ! if (!PyWinObject_AsHANDLE($source, &$target)) return NULL; } %typemap(python,in) PyHANDLE { ! if (!PyWinObject_AsHANDLE($source, &$target)) return NULL; } %typemap(python,in) PyHKEY { ! if (!PyWinObject_AsHKEY($source, &$target)) return NULL; } %typemap(python,in) PyHANDLE INPUT_NULLOK { ! if (!PyWinObject_AsHANDLE($source, &$target)) return NULL; } %typemap(python,in) PyHKEY INPUT_NULLOK { ! if (!PyWinObject_AsHKEY($source, &$target)) return NULL; } *************** *** 387,391 **** typedef float HWND; %typemap(python, in) HWND{ ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target, FALSE)) return NULL; } --- 387,391 ---- typedef float HWND; %typemap(python, in) HWND{ ! if (!PyWinObject_AsHANDLE($source, (HANDLE *)&$target)) return NULL; } |
From: Mark H. <mha...@us...> - 2007-06-03 14:37:52
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16048 Modified Files: setup.py Log Message: enable x64 warnings unless it is a quiet build. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** setup.py 24 May 2007 12:50:50 -0000 1.59 --- setup.py 3 Jun 2007 14:37:53 -0000 1.60 *************** *** 732,735 **** --- 732,738 ---- if is_32bit: ext.extra_compile_args.append("/YX"+ext.pch_header) + # if we are a verbose build, allow 64bit warnings + if self.distribution.verbose: + ext.extra_compile_args.append("/Wp64") pch_name = os.path.join(self.build_temp, ext.name) + ".pch" ext.extra_compile_args.append("/Fp"+pch_name) |
From: Mark H. <mha...@us...> - 2007-06-03 13:27:02
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22285 Modified Files: pippo.idl pippo_server.py testPippo.py Log Message: Most of the tests from [ 1578151 ] Patch for Testing Parameter Problem Index: testPippo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPippo.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testPippo.py 10 Jan 2006 06:31:38 -0000 1.3 --- testPippo.py 3 Jun 2007 13:27:02 -0000 1.4 *************** *** 30,33 **** --- 30,38 ---- self.fail("We lost %d references!" % (end-start,)) + def testResults(self): + rc, out1 = self.object.Method2(123, 111) + self.failUnlessEqual(rc, 123) + self.failUnlessEqual(out1, 222) + def testLeaksGencache(self): try: Index: pippo.idl =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/pippo.idl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pippo.idl 22 Apr 2004 08:24:00 -0000 1.1 --- pippo.idl 3 Jun 2007 13:27:01 -0000 1.2 *************** *** 31,34 **** --- 31,36 ---- [id(1), helpstring("method Method1")] HRESULT Method1([out, retval] IPippo **val); [propget, id(2), helpstring("property MyProp1")] HRESULT MyProp1([out, retval] long *pVal); + [id(3), helpstring("method Method2")] HRESULT Method2([in] long in1, [in, out] long *inout1, + [out, retval] long *val); }; Index: pippo_server.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/pippo_server.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pippo_server.py 22 Apr 2004 08:24:00 -0000 1.1 --- pippo_server.py 3 Jun 2007 13:27:01 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- return wrap(CPippo()) + def Method2(self, in1, inout1): + return in1, inout1 * 2 + def BuildTypelib(): from distutils.dep_util import newer |
From: Mark H. <mha...@us...> - 2007-06-03 13:23:55
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21179 Modified Files: win32util.cpp win32win.cpp Log Message: fix error in previous 64bit checkin, and another handle I missed completely Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32util.cpp 3 Jun 2007 12:35:58 -0000 1.9 --- win32util.cpp 3 Jun 2007 13:23:45 -0000 1.10 *************** *** 205,211 **** if (fnName==NULL) fnName = "CREATESTRUCT value"; if (bFromTuple) ! sprintf(argBuf, "(iiii(iiii)illi):%s", fnName); else ! sprintf(argBuf, "iiii(iiii)illi:%s", fnName); PyObject *obname, *obclassName; BOOL ret = PyArg_ParseTuple(ob, argBuf, --- 205,211 ---- if (fnName==NULL) fnName = "CREATESTRUCT value"; if (bFromTuple) ! sprintf(argBuf, "(iiii(iiii)iOOi):%s", fnName); else ! sprintf(argBuf, "iiii(iiii)iOOi:%s", fnName); PyObject *obname, *obclassName; BOOL ret = PyArg_ParseTuple(ob, argBuf, Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** win32win.cpp 3 Jun 2007 12:35:58 -0000 1.14 --- win32win.cpp 3 Jun 2007 13:23:45 -0000 1.15 *************** *** 2139,2150 **** return NULL; - HWND insertAfter; int x,y,cx,cy; int flags; ! // @pyparm int|hWndInsertAfter||A hwnd, else one of the win32con.HWND_* constants. // @pyparm (x,y,cx,cy)|position||The new position of the window. // @pyparm int|flags||Window positioning flags. ! if (!PyArg_ParseTuple(args,"i(iiii)i:SetWindowPos", ! (int *)(&insertAfter), &x, &y, &cx, &cy, &flags )) return NULL; GUI_BGN_SAVE; --- 2139,2153 ---- return NULL; int x,y,cx,cy; int flags; ! PyObject *obAfter; ! // @pyparm int|hWndInsertAfter||A hwnd, else one of the win32con.HWND_* constants. // @pyparm (x,y,cx,cy)|position||The new position of the window. // @pyparm int|flags||Window positioning flags. ! if (!PyArg_ParseTuple(args,"O(iiii)i:SetWindowPos", ! &obAfter, &x, &y, &cx, &cy, &flags )) ! return NULL; ! HWND insertAfter; ! if (!PyWinObject_AsHANDLE(obAfter, (HANDLE *)&insertAfter)) return NULL; GUI_BGN_SAVE; |
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3666 Modified Files: Win32uiHostGlue.h dibapi.cpp win32ImageList.cpp win32app.cpp win32bitmap.cpp win32brush.cpp win32cmd.cpp win32control.cpp win32ctrlList.cpp win32ctrlRichEdit.cpp win32ctrlTree.cpp win32dc.cpp win32dlg.cpp win32font.cpp win32menu.cpp win32notify.cpp win32prinfo.cpp win32prop.cpp win32toolbar.cpp win32ui.h win32uiExt.h win32uimodule.cpp win32util.cpp win32virt.cpp win32win.cpp win32win.h Log Message: Lots of 64bit changes. Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** win32win.cpp 24 May 2007 12:50:50 -0000 1.13 --- win32win.cpp 3 Jun 2007 12:35:58 -0000 1.14 *************** *** 54,58 **** void OnClose() { CWnd::OnClose(); } ! UINT OnNcHitTest(CPoint point) { return CWnd::OnNcHitTest(point);} BOOL OnSetCursor( CWnd *pWnd, UINT ht, UINT msg) --- 54,58 ---- void OnClose() { CWnd::OnClose(); } ! LRESULT OnNcHitTest(CPoint point) { return CWnd::OnNcHitTest(point);} BOOL OnSetCursor( CWnd *pWnd, UINT ht, UINT msg) *************** *** 105,111 **** CWnd *GetWndPtrFromParam(PyObject *ob, ui_type_CObject &type) { ! if (PyInt_Check(ob)) { ! HWND hwnd = (HWND)PyInt_AsLong(ob); ! if (!IsWindow(hwnd)) RETURN_ERR(szErrMsgBadHandle); CWnd *ret = CWnd::FromHandle(hwnd); --- 105,111 ---- CWnd *GetWndPtrFromParam(PyObject *ob, ui_type_CObject &type) { ! if (PyInt_Check(ob) || PyLong_Check(ob)) { ! HWND hwnd = 0; ! if (!PyWinObject_AsHANDLE(ob, (HANDLE *)&hwnd) || !IsWindow(hwnd)) RETURN_ERR(szErrMsgBadHandle); CWnd *ret = CWnd::FromHandle(hwnd); *************** *** 171,175 **** { PyObject *ob; ! int len = PyTuple_Size(args); if (len<1 || len > 5) { PyErr_SetString(PyExc_TypeError, "SCROLLINFO tuple has invalid size"); --- 171,175 ---- { PyObject *ob; ! Py_ssize_t len = PyTuple_Size(args); if (len<1 || len > 5) { PyErr_SetString(PyExc_TypeError, "SCROLLINFO tuple has invalid size"); *************** *** 378,384 **** PyCWnd::CreateWindowFromHandle(PyObject *self, PyObject *args) { ! int hwnd; ! if (!PyArg_ParseTuple(args, "i:CreateWindowFromHandle", ! &hwnd)) // @pyparm int|hwnd||The window handle. return NULL; CWnd *pWnd = CWnd::FromHandle((HWND)hwnd); --- 378,387 ---- PyCWnd::CreateWindowFromHandle(PyObject *self, PyObject *args) { ! PyObject *obhwnd; ! if (!PyArg_ParseTuple(args, "O:CreateWindowFromHandle", ! &obhwnd)) // @pyparm int|hwnd||The window handle. ! return NULL; ! HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; CWnd *pWnd = CWnd::FromHandle((HWND)hwnd); *************** *** 554,566 **** } ! BOOL PyCWnd::check_key_stroke(UINT ch) { PyObject *pythonObject; BOOL bCallBase = TRUE; if (obKeyStrokeHandler!= NULL) ! bCallBase = Python_callback(obKeyStrokeHandler, (int)ch); if (bCallBase && pKeyHookList && pKeyHookList->Lookup((WORD)ch, (void *&)pythonObject)) ! bCallBase = Python_callback(pythonObject,(int)ch); return bCallBase; } --- 557,569 ---- } ! BOOL PyCWnd::check_key_stroke(WPARAM ch) { PyObject *pythonObject; BOOL bCallBase = TRUE; if (obKeyStrokeHandler!= NULL) ! bCallBase = Python_callback(obKeyStrokeHandler, ch); if (bCallBase && pKeyHookList && pKeyHookList->Lookup((WORD)ch, (void *&)pythonObject)) ! bCallBase = Python_callback(pythonObject,ch); return bCallBase; } *************** *** 615,619 **** pSearch = CWnd::FromHandlePermanent(wnd); // FromHandlePerm is thread specific! ! if (pSearch==NULL && GetWindowLong(wnd, GWLP_WNDPROC)==(LONG)AfxGetAfxWndProc()) { /******* --- 618,622 ---- pSearch = CWnd::FromHandlePermanent(wnd); // FromHandlePerm is thread specific! ! if (pSearch==NULL && GetWindowLongPtr(wnd, GWLP_WNDPROC)==(LONG_PTR)AfxGetAfxWndProc()) { /******* *************** *** 788,794 **** return NULL; GUI_BGN_SAVE; ! long rc = ((WndHack *)pWnd)->DefWindowProc(message, (WPARAM)wparam, (LPARAM)lparam); GUI_END_SAVE; ! return Py_BuildValue("l", rc); // @pyseemfc CWnd|DefWindowProc } --- 791,797 ---- return NULL; GUI_BGN_SAVE; ! LRESULT rc = ((WndHack *)pWnd)->DefWindowProc(message, (WPARAM)wparam, (LPARAM)lparam); GUI_END_SAVE; ! return PyWinObject_FromPARAM(rc); // @pyseemfc CWnd|DefWindowProc } *************** *** 860,864 **** --- 863,871 ---- char buf[MAX_PATH]; GUI_BGN_SAVE; + #if _MFC_VER >= 0x0800 + rc = pWnd->DlgDirSelect( buf, sizeof(buf), nIDListBox); + #else rc = pWnd->DlgDirSelect( buf, nIDListBox); + #endif // @pyseemfc CWnd|DlgDirSelect GUI_END_SAVE; *************** *** 883,887 **** --- 890,898 ---- GUI_BGN_SAVE; // @pyseemfc CWnd|DlgDirSelectComboBox + #if _MFC_VER >= 0x0800 + rc = pWnd->DlgDirSelectComboBox( buf, sizeof(buf), nIDListBox); + #else rc = pWnd->DlgDirSelectComboBox( buf, nIDListBox); + #endif GUI_END_SAVE; if (!rc) *************** *** 1268,1272 **** HWND hwnd = pWnd->GetSafeHwnd(); GUI_END_SAVE; ! return Py_BuildValue("l", (long)hwnd); } --- 1279,1283 ---- HWND hwnd = pWnd->GetSafeHwnd(); GUI_END_SAVE; ! return PyWinLong_FromHANDLE(hwnd); } *************** *** 1761,1765 **** GUI_END_SAVE; // @pyseemfc CWnd|OnCtlColor ! return Py_BuildValue("i", (int)brush); } --- 1772,1776 ---- GUI_END_SAVE; // @pyseemfc CWnd|OnCtlColor ! return PyWinLong_FromHANDLE(brush); } *************** *** 1799,1803 **** HICON rc = pWnd->OnQueryDragIcon(); GUI_END_SAVE; ! return Py_BuildValue("i", (int)rc); } --- 1810,1814 ---- HICON rc = pWnd->OnQueryDragIcon(); GUI_END_SAVE; ! return PyWinLong_FromHANDLE(rc); } *************** *** 1863,1867 **** // return value from the MFC function call, and the value of the // lResult param. Please see the MFC documentation for more details. ! return Py_BuildValue("ii", rc, (int)res); RETURN_NONE; } --- 1874,1878 ---- // return value from the MFC function call, and the value of the // lResult param. Please see the MFC documentation for more details. ! return Py_BuildValue("iN", rc, PyWinObject_FromPARAM(res)); RETURN_NONE; } *************** *** 2186,2202 **** PyErr_Clear(); void *p; ! if (!PyArg_ParseTuple(args, "is#", &message, // @pyparmalt1 int|idMessage||The ID of the message to send. ! &p, &wParam )) // @pyparmalt1 buffer|ob||A buffer whose size is passed in wParam, and address is passed in lParam return NULL; lp = (LPARAM)p; wp = (WPARAM)wParam; } ! int rc; GUI_BGN_SAVE; // @pyseemfc CWnd|SendMessage rc = pWnd->SendMessage(message, wp, lp); GUI_END_SAVE; ! return PyInt_FromLong(rc); } // @pymethod |PyCWnd|SendMessageToDescendants|Send a message to all descendant windows. --- 2197,2216 ---- PyErr_Clear(); void *p; ! PyObject *obParam; ! if (!PyArg_ParseTuple(args, "iO", &message, // @pyparmalt1 int|idMessage||The ID of the message to send. ! &obParam)) // @pyparmalt1 buffer|ob||A buffer whose size is passed in wParam, and address is passed in lParam ! return NULL; ! if (!PyWinObject_AsReadBuffer(obParam, &p, &wParam)) return NULL; lp = (LPARAM)p; wp = (WPARAM)wParam; } ! LRESULT rc; GUI_BGN_SAVE; // @pyseemfc CWnd|SendMessage rc = pWnd->SendMessage(message, wp, lp); GUI_END_SAVE; ! return PyWinObject_FromPARAM(rc); } // @pymethod |PyCWnd|SendMessageToDescendants|Send a message to all descendant windows. *************** *** 2586,2590 **** RETURN_ERR("BeginPaint failed"); PyObject *obDC = ui_assoc_object::make (ui_dc_object::type, pTemp)->GetGoodRet(); ! PyObject *obRet = Py_BuildValue("O(ii(iiii)iis#)", obDC, ps.hdc, ps.fErase, --- 2600,2604 ---- RETURN_ERR("BeginPaint failed"); PyObject *obDC = ui_assoc_object::make (ui_dc_object::type, pTemp)->GetGoodRet(); ! PyObject *obRet = Py_BuildValue("O(ii(iiii)iiN)", obDC, ps.hdc, ps.fErase, *************** *** 2592,2596 **** ps.fRestore, ps.fIncUpdate, ! ps.rgbReserved, sizeof(ps.rgbReserved)); Py_XDECREF(obDC); return obRet; --- 2606,2610 ---- ps.fRestore, ps.fIncUpdate, ! PyString_FromStringAndSize((char *)ps.rgbReserved, sizeof(ps.rgbReserved))); Py_XDECREF(obDC); return obRet; *************** *** 2797,2802 **** // Convert the list of point tuples into an array of POINT structs ! int num = PyList_Size (point_list); ! int i; POINT * point_array = new POINT[num]; for (i=0; i < num; i++) --- 2811,2816 ---- // Convert the list of point tuples into an array of POINT structs ! Py_ssize_t num = PyList_Size (point_list); ! Py_ssize_t i; POINT * point_array = new POINT[num]; for (i=0; i < num; i++) *************** *** 2835,2839 **** // can finally call the mfc function. GUI_BGN_SAVE; ! pWnd->MapWindowPoints(pWndTo,point_array, num); GUI_END_SAVE; --- 2849,2853 ---- // can finally call the mfc function. GUI_BGN_SAVE; ! pWnd->MapWindowPoints(pWndTo,point_array, PyWin_SAFE_DOWNCAST(num, Py_ssize_t, UINT)); GUI_END_SAVE; *************** *** 2864,2870 **** // @pyseemfc CWnd|SetTimer GUI_BGN_SAVE; ! UINT id = pWnd->SetTimer(nIDEvent,nElapse,NULL); GUI_END_SAVE; ! return Py_BuildValue("i", id); } --- 2878,2884 ---- // @pyseemfc CWnd|SetTimer GUI_BGN_SAVE; ! UINT_PTR id = pWnd->SetTimer(nIDEvent,nElapse,NULL); GUI_END_SAVE; ! return PyWinObject_FromPARAM(id); } *************** *** 2968,2974 **** return NULL; GUI_BGN_SAVE; ! UINT rc = ((WndHack *)pWnd)->OnNcHitTest(p); GUI_END_SAVE; ! return PyInt_FromLong(rc); } --- 2982,2988 ---- return NULL; GUI_BGN_SAVE; ! LRESULT rc = ((WndHack *)pWnd)->OnNcHitTest(p); GUI_END_SAVE; ! return PyWinObject_FromPARAM(rc); } *************** *** 3199,3206 **** CString csRet; char *buf = csRet.GetBuffer(40); ! int numMsg = pMessageHookList ? pMessageHookList->GetCount() : 0; ! int numKey = pKeyHookList ? pKeyHookList->GetCount() : 0; char *hookStr = obKeyStrokeHandler ? " (AllKeys Hook Active)" : ""; ! sprintf(buf, ", mh=%d, kh=%d%s", numMsg, numKey, hookStr); csRet.ReleaseBuffer(-1); return PyCCmdTarget::repr() + csRet; --- 3213,3220 ---- CString csRet; char *buf = csRet.GetBuffer(40); ! UINT_PTR numMsg = pMessageHookList ? pMessageHookList->GetCount() : 0; ! UINT_PTR numKey = pKeyHookList ? pKeyHookList->GetCount() : 0; char *hookStr = obKeyStrokeHandler ? " (AllKeys Hook Active)" : ""; ! sprintf(buf, ", mh=%I, kh=%I%s", numMsg, numKey, hookStr); csRet.ReleaseBuffer(-1); return PyCCmdTarget::repr() + csRet; Index: win32ctrlRichEdit.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlRichEdit.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32ctrlRichEdit.cpp 24 May 2007 12:50:50 -0000 1.3 --- win32ctrlRichEdit.cpp 3 Jun 2007 12:35:58 -0000 1.4 *************** *** 101,105 **** } else { strcpy((char *)pbBuff, s); ! *pcb = strlen(s); retval = 0; } --- 101,105 ---- } else { strcpy((char *)pbBuff, s); ! *pcb = PyWin_SAFE_DOWNCAST(strlen(s), size_t, DWORD); retval = 0; } *************** *** 739,743 **** DOINCREF(method); EDITSTREAM es; ! es.dwCookie = (DWORD)method; es.dwError = 0; es.pfnCallback = PyCRichEditCallbackIn; --- 739,743 ---- DOINCREF(method); EDITSTREAM es; ! es.dwCookie = (DWORD_PTR)method; es.dwError = 0; es.pfnCallback = PyCRichEditCallbackIn; *************** *** 769,773 **** EDITSTREAM es; DOINCREF(method); ! es.dwCookie = (DWORD)method; es.dwError = 0; es.pfnCallback = PyCRichEditCallbackOut; --- 769,773 ---- EDITSTREAM es; DOINCREF(method); ! es.dwCookie = (DWORD_PTR)method; es.dwError = 0; es.pfnCallback = PyCRichEditCallbackOut; Index: win32uiExt.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uiExt.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32uiExt.h 27 May 2007 12:53:48 -0000 1.11 --- win32uiExt.h 3 Jun 2007 12:35:58 -0000 1.12 *************** *** 186,190 **** // @xref <om PyCWnd.OnCtlColor> CVirtualHelper helper( "OnCtlColor", this ); ! int hRet; if (helper.HaveHandler() && helper.call(pDC, pWnd, nCtlColor) && helper.retval(hRet)) --- 186,190 ---- // @xref <om PyCWnd.OnCtlColor> CVirtualHelper helper( "OnCtlColor", this ); ! HANDLE hRet; if (helper.HaveHandler() && helper.call(pDC, pWnd, nCtlColor) && helper.retval(hRet)) *************** *** 243,247 **** if (!helper.HaveHandler()) return T::OnQueryDragIcon(); ! int ret; if (!helper.call()) return NULL; --- 243,247 ---- if (!helper.HaveHandler()) return T::OnQueryDragIcon(); ! HANDLE ret; if (!helper.call()) return NULL; *************** *** 861,865 **** afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM) { PreInitDialog(); ! BOOL result = Default(); CVirtualHelper helper( "HandleInitDialog", this ); BOOL hresult; --- 861,865 ---- afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM) { PreInitDialog(); ! LRESULT result = Default(); CVirtualHelper helper( "HandleInitDialog", this ); BOOL hresult; Index: win32dlg.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32dlg.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32dlg.cpp 21 Jun 2005 08:05:26 -0000 1.8 --- win32dlg.cpp 3 Jun 2007 12:35:58 -0000 1.9 *************** *** 368,374 **** HWND hwnd = pWnd->GetSafeHwnd(); DWORD dwStyle = ::GetWindowLong(hwnd, GWL_STYLE); ! DWORD dwCode = ::SendMessage(hwnd, WM_GETDLGCODE, 0, 0L); ! BOOL bRadio = dwCode & DLGC_RADIOBUTTON; ! BOOL bCheck = dwStyle & BS_CHECKBOX; if (!bRadio && !bCheck) return set_exchange_error("only radios and checkboxes are supported for button controls", index); --- 368,374 ---- HWND hwnd = pWnd->GetSafeHwnd(); DWORD dwStyle = ::GetWindowLong(hwnd, GWL_STYLE); ! LRESULT dwCode = ::SendMessage(hwnd, WM_GETDLGCODE, 0, 0L); ! BOOL bRadio = (dwCode & DLGC_RADIOBUTTON) != 0; ! BOOL bCheck = (dwStyle & BS_CHECKBOX) != 0; if (!bRadio && !bCheck) return set_exchange_error("only radios and checkboxes are supported for button controls", index); *************** *** 572,581 **** Py_INCREF(self); // make sure Python doesnt kill the object while in a modal call. // really only for the common dialog, and other non CPythonDlg's ! int ret; GUI_BGN_SAVE; ret = pDlg->DoModal(); // @pyseemfc CDialog|DoModal GUI_END_SAVE; DODECREF(self); ! return Py_BuildValue("i", ret); // @rdesc The return value from the dialog. This is the value passed to <om PyCDialog.EndDialog>. } --- 572,581 ---- Py_INCREF(self); // make sure Python doesnt kill the object while in a modal call. // really only for the common dialog, and other non CPythonDlg's ! INT_PTR ret; GUI_BGN_SAVE; ret = pDlg->DoModal(); // @pyseemfc CDialog|DoModal GUI_END_SAVE; DODECREF(self); ! return PyWinObject_FromDWORD_PTR(ret); // @rdesc The return value from the dialog. This is the value passed to <om PyCDialog.EndDialog>. } *************** *** 1068,1071 **** --- 1068,1082 ---- } + #define MAKE_INT_PTR_METH(fnname, mfcName) \ + static PyObject *fnname( PyObject *self, PyObject *args ) { \ + CHECK_NO_ARGS2(args,mfcName); \ + CFontDialog *pDlg = GetFontDialog(self); \ + if (!pDlg) return NULL; \ + GUI_BGN_SAVE; \ + INT_PTR ret = pDlg->mfcName(); \ + GUI_END_SAVE; \ + return PyWinObject_FromDWORD_PTR(ret); \ + } + // @pymethod string|PyCFontDialog|GetFaceName|Returns the face name of the selected font. // @pyseemfc CFontDialog|GetFaceName *************** *** 1101,1105 **** // @pymethod int|PyCFontDialog|DoModal|Displays a dialog and allows the user to make a selection. // @pyseemfc CFontDialog|DoModal ! MAKE_INT_METH(ui_font_dialog_do_modal,DoModal) // @pymethod int|PyCFontDialog|GetColor|Determines the color of the selected font. --- 1112,1116 ---- // @pymethod int|PyCFontDialog|DoModal|Displays a dialog and allows the user to make a selection. // @pyseemfc CFontDialog|DoModal ! MAKE_INT_PTR_METH(ui_font_dialog_do_modal,DoModal) // @pymethod int|PyCFontDialog|GetColor|Determines the color of the selected font. *************** *** 1224,1228 **** // @pymethod int|PyCColorDialog|DoModal|Displays a dialog and allows the user to make a selection. // @pyseemfc CColorDialog|DoModal ! MAKE_INT_METH(ui_color_dialog_do_modal,DoModal) // @pymethod int|PyCColorDialog|GetColor|Determines the selected color. --- 1235,1239 ---- // @pymethod int|PyCColorDialog|DoModal|Displays a dialog and allows the user to make a selection. // @pyseemfc CColorDialog|DoModal ! MAKE_INT_PTR_METH(ui_color_dialog_do_modal,DoModal) // @pymethod int|PyCColorDialog|GetColor|Determines the selected color. *************** *** 1281,1285 **** if (!PyArg_ParseTuple(args, "O", &obCols)) return NULL; ! int len = PySequence_Length(obCols); if (PyErr_Occurred() || len <= 0 || len > 16) { PyErr_Clear(); --- 1292,1296 ---- if (!PyArg_ParseTuple(args, "O", &obCols)) return NULL; ! Py_ssize_t len = PySequence_Length(obCols); if (PyErr_Occurred() || len <= 0 || len > 16) { PyErr_Clear(); Index: win32ctrlTree.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlTree.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32ctrlTree.cpp 3 Nov 2003 07:35:32 -0000 1.4 --- win32ctrlTree.cpp 3 Jun 2007 12:35:58 -0000 1.5 *************** *** 581,587 **** if (!pList) return NULL; GUI_BGN_SAVE; ! long rc = pList->GetItemData(item); GUI_END_SAVE; ! return PyInt_FromLong(rc); } --- 581,587 ---- if (!pList) return NULL; GUI_BGN_SAVE; ! DWORD_PTR rc = pList->GetItemData(item); GUI_END_SAVE; ! return PyWinObject_FromDWORD_PTR(rc); } Index: win32virt.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32virt.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32virt.cpp 24 May 2007 12:50:50 -0000 1.5 --- win32virt.cpp 3 Jun 2007 12:35:58 -0000 1.6 *************** *** 427,431 **** if (!handler) return FALSE; CEnterLeavePython _celp; ! PyObject *arglst = Py_BuildValue("iill",nID, nCode, (long)pExtra, (long)pHandlerInfo); BOOL ret = do_call(arglst); return ret; --- 427,431 ---- if (!handler) return FALSE; CEnterLeavePython _celp; ! PyObject *arglst = Py_BuildValue("iiNN",nID, nCode, PyWinLong_FromVoidPtr(pExtra), PyWinLong_FromVoidPtr(pHandlerInfo)); BOOL ret = do_call(arglst); return ret; *************** *** 491,494 **** --- 491,511 ---- } + BOOL CVirtualHelper::retval( HANDLE &ret ) + { + ASSERT(retVal); + if (!retVal) + return FALSE; // failed - assume didnt work in non debug + if (retVal==Py_None) { + ret = 0; + return TRUE; + } + CEnterLeavePython _celp; + if (!PyWinObject_AsHANDLE(retVal, &ret)) { + PyErr_Clear(); + return FALSE; + } + return TRUE; + } + BOOL CVirtualHelper::retval( char *&ret ) { Index: win32prop.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32prop.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32prop.cpp 20 Jan 2004 22:28:57 -0000 1.2 --- win32prop.cpp 3 Jun 2007 12:35:58 -0000 1.3 *************** *** 329,338 **** Py_INCREF(self); // make sure Python doesnt kill the object while in a modal call. // really only for the common dialog(!?), and other non CPythonPropSheet's ! int ret; GUI_BGN_SAVE; ret = pPS->DoModal(); GUI_END_SAVE; DODECREF(self); ! return Py_BuildValue("i", ret); } --- 329,338 ---- Py_INCREF(self); // make sure Python doesnt kill the object while in a modal call. // really only for the common dialog(!?), and other non CPythonPropSheet's ! INT_PTR ret; GUI_BGN_SAVE; ret = pPS->DoModal(); GUI_END_SAVE; DODECREF(self); ! return PyWinObject_FromDWORD_PTR(ret); } *************** *** 754,758 **** LRESULT result = pPP->CPropertyPage::OnWizardBack(); GUI_END_SAVE; ! return PyInt_FromLong(result); } // @pymethod |PyCPropertyPage|OnWizardNext|Calls the default MFC OnWizardNext handler. --- 754,758 ---- LRESULT result = pPP->CPropertyPage::OnWizardBack(); GUI_END_SAVE; ! return PyWinObject_FromPARAM(result); } // @pymethod |PyCPropertyPage|OnWizardNext|Calls the default MFC OnWizardNext handler. *************** *** 767,771 **** LRESULT result = pPP->CPropertyPage::OnWizardNext(); GUI_END_SAVE; ! return PyInt_FromLong(result); } // @pymethod |PyCPropertyPage|OnWizardFinish|Calls the default MFC OnWizardFinish handler. --- 767,771 ---- LRESULT result = pPP->CPropertyPage::OnWizardNext(); GUI_END_SAVE; ! return PyWinObject_FromPARAM(result); } // @pymethod |PyCPropertyPage|OnWizardFinish|Calls the default MFC OnWizardFinish handler. Index: win32notify.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32notify.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32notify.cpp 1 Sep 1999 23:33:02 -0000 1.1 --- win32notify.cpp 3 Jun 2007 12:35:58 -0000 1.2 *************** *** 171,176 **** if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *val = PyString_AsString(ob); ! int slen = strlen(val); ! int copylen = max(bufSize-1, slen); strncpy( pUse, val, copylen); pUse[copylen] = '\0'; --- 171,176 ---- if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *val = PyString_AsString(ob); ! ssize_t slen = strlen(val); ! ssize_t copylen = max(bufSize-1, slen); strncpy( pUse, val, copylen); pUse[copylen] = '\0'; *************** *** 190,194 **** if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *szVal = PyString_AsString(ob); ! int slen = strlen(szVal); mbstowcs( (wchar_t *)pUse, szVal, bufSize ); } --- 190,194 ---- if (!PyString_Check(ob)) MY_RET_ERR("Expected string object") char *szVal = PyString_AsString(ob); ! ssize_t slen = strlen(szVal); mbstowcs( (wchar_t *)pUse, szVal, bufSize ); } *************** *** 284,288 **** PyObject *ob2; if (fmt==NULL) ! ob2 = PyInt_FromLong((int)(pHdr + 1)); else ob2 = PyNotifyMakeExtraTuple(pHdr, fmt); --- 284,288 ---- PyObject *ob2; if (fmt==NULL) ! ob2 = PyWinLong_FromVoidPtr(pHdr + 1); else ob2 = PyNotifyMakeExtraTuple(pHdr, fmt); Index: win32app.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32app.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32app.cpp 10 Jan 2006 04:39:43 -0000 1.5 --- win32app.cpp 3 Jun 2007 12:35:57 -0000 1.6 *************** *** 283,287 **** if (hc==0) RETURN_API_ERR("LoadCursor"); ! return PyInt_FromLong((long)hc); } --- 283,287 ---- if (hc==0) RETURN_API_ERR("LoadCursor"); ! return PyWinLong_FromHANDLE(hc); } *************** *** 305,309 **** if (hc==0) RETURN_API_ERR("LoadStandardCursor"); ! return PyInt_FromLong((long)hc); } --- 305,309 ---- if (hc==0) RETURN_API_ERR("LoadStandardCursor"); ! return PyWinLong_FromHANDLE(hc); } *************** *** 319,323 **** if (hc==0) RETURN_API_ERR("LoadOEMCursor"); ! return PyInt_FromLong((long)hc); } --- 319,323 ---- if (hc==0) RETURN_API_ERR("LoadOEMCursor"); ! return PyWinLong_FromHANDLE(hc); } Index: win32font.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32font.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32font.cpp 5 Mar 2005 04:57:04 -0000 1.3 --- win32font.cpp 3 Jun 2007 12:35:58 -0000 1.4 *************** *** 71,75 **** CFont *pFont = PyCFont::GetFont(self); if (pFont==NULL) return NULL; ! return PyInt_FromLong((long)pFont->GetSafeHandle()); } --- 71,76 ---- CFont *pFont = PyCFont::GetFont(self); if (pFont==NULL) return NULL; ! return PyWinLong_FromHANDLE(pFont->GetSafeHandle()); ! return PyWinLong_FromHANDLE(pFont->GetSafeHandle()); } Index: win32ImageList.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ImageList.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32ImageList.cpp 2 Apr 2000 00:11:48 -0000 1.2 --- win32ImageList.cpp 3 Jun 2007 12:35:57 -0000 1.3 *************** *** 120,150 **** PyObject *PyCImageList_Add( PyObject *self, PyObject *args ) { ! HICON hIcon; ! int bmp1, bmp2, mask; CImageList *pList = PyCImageList::GetImageList(self); int rc; if (!pList) return NULL; ! if (PyArg_ParseTuple(args, "(ii)", ! &bmp1, &bmp2)) {// @pyparm (int,int)|bitmap, bitmapMask||2 Bitmaps to use (primary and mask) ! if (!IsGdiHandleValid((HANDLE)bmp1) || !IsGdiHandleValid((HANDLE)bmp2)) RETURN_ERR("One of the bitmap handles is invalid"); GUI_BGN_SAVE; ! rc = pList->Add(CBitmap::FromHandle((HBITMAP)bmp1), CBitmap::FromHandle((HBITMAP)bmp2)); GUI_END_SAVE; } else { PyErr_Clear(); ! if (PyArg_ParseTuple(args, "ii", ! &bmp1, // @pyparmalt1 int|bitmap||Bitmap to use &mask)) { // @pyparmalt1 int|color||Color to use for the mask. ! if (!IsGdiHandleValid((HANDLE)bmp1)) RETURN_ERR("The bitmap handle is invalid"); GUI_BGN_SAVE; ! rc = pList->Add(CBitmap::FromHandle((HBITMAP)bmp1), (COLORREF)mask); GUI_END_SAVE; } else { PyErr_Clear(); ! if (PyArg_ParseTuple(args, "i", ! &hIcon)) {// @pyparmalt2 int|hIcon||Handle of an icon to add. GUI_BGN_SAVE; rc = pList->Add(hIcon); --- 120,160 ---- PyObject *PyCImageList_Add( PyObject *self, PyObject *args ) { ! PyObject *obbmp1, *obbmp2; ! int mask; CImageList *pList = PyCImageList::GetImageList(self); int rc; if (!pList) return NULL; ! if (PyArg_ParseTuple(args, "(OO)", ! &obbmp1, &obbmp2)) {// @pyparm (int,int)|bitmap, bitmapMask||2 Bitmaps to use (primary and mask) ! HBITMAP bmp1, bmp2; ! if (!PyWinObject_AsHANDLE(obbmp1, (HANDLE *)&bmp1) || !PyWinObject_AsHANDLE(obbmp2, (HANDLE *)&bmp2)) ! return NULL; ! if (!IsGdiHandleValid(bmp1) || !IsGdiHandleValid(bmp2)) RETURN_ERR("One of the bitmap handles is invalid"); GUI_BGN_SAVE; ! rc = pList->Add(CBitmap::FromHandle(bmp1), CBitmap::FromHandle(bmp2)); GUI_END_SAVE; } else { PyErr_Clear(); ! HBITMAP bmp1; ! if (PyArg_ParseTuple(args, "Oi", ! &obbmp1, // @pyparmalt1 int|bitmap||Bitmap to use &mask)) { // @pyparmalt1 int|color||Color to use for the mask. ! if (!PyWinObject_AsHANDLE(obbmp1, (HANDLE *)&bmp1)) ! return NULL; ! if (!IsGdiHandleValid(bmp1)) RETURN_ERR("The bitmap handle is invalid"); GUI_BGN_SAVE; ! rc = pList->Add(CBitmap::FromHandle(bmp1), (COLORREF)mask); GUI_END_SAVE; } else { PyErr_Clear(); ! PyObject *obIcon; ! if (PyArg_ParseTuple(args, "O", ! &obIcon)) {// @pyparmalt2 int|hIcon||Handle of an icon to add. ! HICON hIcon; ! if (!PyWinObject_AsHANDLE(obIcon, (HANDLE *)&hIcon)) ! return NULL; GUI_BGN_SAVE; rc = pList->Add(hIcon); Index: dibapi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/dibapi.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dibapi.cpp 1 Sep 1999 23:32:59 -0000 1.1 --- dibapi.cpp 3 Jun 2007 12:35:57 -0000 1.2 *************** *** 600,605 **** BYTE *lpCopy; BYTE *lp; ! HANDLE hCopy; ! DWORD dwLen; if (h == NULL) --- 600,605 ---- BYTE *lpCopy; BYTE *lp; ! HANDLE hCopy; ! SIZE_T dwLen; if (h == NULL) Index: win32control.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32control.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32control.cpp 7 Oct 2004 08:41:17 -0000 1.5 --- win32control.cpp 3 Jun 2007 12:35:57 -0000 1.6 *************** *** 215,221 **** PyCButton_set_bitmap(PyObject *self, PyObject *args) { ! int hBitmap; ! if (!PyArg_ParseTuple(args, "i", ! &hBitmap)) // @pyparm int|hBitmap|1|Handle of the new bitmap return NULL; CButton *pBut = GetButton(self); --- 215,224 ---- PyCButton_set_bitmap(PyObject *self, PyObject *args) { ! PyObject *obBitmap; ! if (!PyArg_ParseTuple(args, "O", ! &obBitmap)) // @pyparm int|hBitmap|1|Handle of the new bitmap ! return NULL; ! HBITMAP hBitmap; ! if (!PyWinObject_AsHANDLE(obBitmap, (HANDLE *)&hBitmap)) return NULL; CButton *pBut = GetButton(self); *************** *** 223,229 **** return NULL; GUI_BGN_SAVE; ! HBITMAP rc = pBut->SetBitmap((HBITMAP) hBitmap); GUI_END_SAVE; ! return Py_BuildValue("i", (int)rc); } // @pymethod int|PyCButton|GetBitmap|Get the button's bitmap --- 226,232 ---- return NULL; GUI_BGN_SAVE; ! HBITMAP rc = pBut->SetBitmap(hBitmap); GUI_END_SAVE; ! return PyWinLong_FromHANDLE(rc); } // @pymethod int|PyCButton|GetBitmap|Get the button's bitmap *************** *** 238,242 **** HBITMAP rc = pBut->GetBitmap(); GUI_END_SAVE; ! return Py_BuildValue("i", (int)rc); } --- 241,245 ---- HBITMAP rc = pBut->GetBitmap(); GUI_END_SAVE; ! return PyWinLong_FromHANDLE(rc); } *************** *** 431,440 **** if (!pLB) return NULL; GUI_BGN_SAVE; ! long rc = pLB->GetItemData(item); GUI_END_SAVE; ! PyObject *ret = PyWin_GetPythonObjectFromLong(rc); ! // inc ref count for return value. ! Py_XINCREF(ret); ! return ret; } --- 434,440 ---- if (!pLB) return NULL; GUI_BGN_SAVE; ! DWORD_PTR rc = pLB->GetItemData(item); GUI_END_SAVE; ! return PyWinObject_FromDWORD_PTR(rc); } *************** *** 737,741 **** if (data==Py_None) data = NULL; GUI_BGN_SAVE; ! BOOL ok = pLB->SetItemData(item, (DWORD)data); GUI_END_SAVE; if (!ok) --- 737,741 ---- if (data==Py_None) data = NULL; GUI_BGN_SAVE; ! BOOL ok = pLB->SetItemData(item, (DWORD_PTR)data); GUI_END_SAVE; if (!ok) *************** *** 788,795 **** if (!PyList_Check(listOb)) RETURN_TYPE_ERR("Param must be a list object"); ! int numChildren = PyList_Size(listOb); int *pArray = new int[numChildren]; int tabVal; ! for (int child=0;child<numChildren;child++) { PyObject *obChild = PyList_GetItem(listOb, child ); if (!PyArg_Parse( obChild, "i", &tabVal)) { --- 788,795 ---- if (!PyList_Check(listOb)) RETURN_TYPE_ERR("Param must be a list object"); ! Py_ssize_t numChildren = PyList_Size(listOb); int *pArray = new int[numChildren]; int tabVal; ! for (Py_ssize_t child=0;child<numChildren;child++) { PyObject *obChild = PyList_GetItem(listOb, child ); if (!PyArg_Parse( obChild, "i", &tabVal)) { *************** *** 800,804 **** } GUI_BGN_SAVE; ! rc = pLB->SetTabStops( numChildren, pArray ); GUI_END_SAVE; delete pArray; --- 800,804 ---- } GUI_BGN_SAVE; ! rc = pLB->SetTabStops( PyWin_SAFE_DOWNCAST(numChildren, Py_ssize_t, int), pArray ); GUI_END_SAVE; delete pArray; *************** *** 1046,1055 **** if (!pLB) return NULL; GUI_BGN_SAVE; ! long rc = pLB->GetItemData(item); GUI_END_SAVE; ! PyObject *ret = PyWin_GetPythonObjectFromLong(rc); ! // inc ref count for return value. ! Py_XINCREF(ret); ! return ret; } --- 1046,1052 ---- if (!pLB) return NULL; GUI_BGN_SAVE; ! DWORD_PTR rc = pLB->GetItemData(item); GUI_END_SAVE; ! return PyWinObject_FromDWORD_PTR(rc); } *************** *** 1225,1229 **** if (data==Py_None) data = NULL; GUI_BGN_SAVE; ! BOOL ok = pLB->SetItemData(item, (DWORD)data); GUI_END_SAVE; if (!ok) --- 1222,1226 ---- if (data==Py_None) data = NULL; GUI_BGN_SAVE; ! BOOL ok = pLB->SetItemData(item, (DWORD_PTR)data); GUI_END_SAVE; if (!ok) *************** *** 2261,2266 **** PyCStatusBarCtrl_set_parts (PyObject *self, PyObject *args) { ! int nParts = 0; ! int i; CStatusBarCtrl *pSB = GetStatusBarCtrl(self); --- 2258,2263 ---- PyCStatusBarCtrl_set_parts (PyObject *self, PyObject *args) { ! Py_ssize_t nParts = 0; ! Py_ssize_t i; CStatusBarCtrl *pSB = GetStatusBarCtrl(self); *************** *** 2283,2287 **** GUI_BGN_SAVE; ! pSB->SetParts (nParts, pParts); GUI_END_SAVE; --- 2280,2284 ---- GUI_BGN_SAVE; ! pSB->SetParts (PyWin_SAFE_DOWNCAST(nParts, Py_ssize_t, int), pParts); GUI_END_SAVE; Index: win32ctrlList.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlList.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32ctrlList.cpp 9 Oct 1999 23:41:08 -0000 1.2 --- win32ctrlList.cpp 3 Jun 2007 12:35:58 -0000 1.3 *************** *** 488,492 **** if (len==0) RETURN_ERR("GetItemText failed"); ! return Py_BuildValue("s#",buf,len); } --- 488,492 ---- if (len==0) RETURN_ERR("GetItemText failed"); ! return PyString_FromStringAndSize(buf,len); } *************** *** 577,581 **** if (data==Py_None) data = NULL; GUI_BGN_SAVE; ! BOOL ok = pList->SetItemData(item, (DWORD)data); GUI_END_SAVE; if (!ok) --- 577,581 ---- if (data==Py_None) data = NULL; GUI_BGN_SAVE; ! BOOL ok = pList->SetItemData(item, (DWORD_PTR)data); GUI_END_SAVE; if (!ok) Index: win32brush.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32brush.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32brush.cpp 1 Sep 1999 23:33:00 -0000 1.1 --- win32brush.cpp 3 Jun 2007 12:35:57 -0000 1.2 *************** *** 81,85 **** CBrush *pBrush = PyCBrush::GetBrush(self); if (pBrush==NULL) return NULL; ! return PyInt_FromLong((long)pBrush->GetSafeHandle()); } --- 81,85 ---- CBrush *pBrush = PyCBrush::GetBrush(self); if (pBrush==NULL) return NULL; ! return PyWinLong_FromHANDLE(pBrush->GetSafeHandle()); } Index: win32win.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32win.h 1 Sep 1999 23:33:03 -0000 1.1 --- win32win.h 3 Jun 2007 12:35:58 -0000 1.2 *************** *** 35,39 **** virtual CString repr(); ! BOOL check_key_stroke(UINT ch); static ui_type_CObject type; --- 35,39 ---- virtual CString repr(); ! BOOL check_key_stroke(WPARAM ch); static ui_type_CObject type; Index: win32ui.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ui.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32ui.h 24 May 2007 12:50:50 -0000 1.4 --- win32ui.h 3 Jun 2007 12:35:58 -0000 1.5 *************** *** 303,306 **** --- 303,307 ---- BOOL retval( CString &ret ); BOOL retval( MSG *msg); + BOOL retval( HANDLE &ret ); BOOL retnone(); PyObject *GetHandler(); *************** *** 320,323 **** --- 321,326 ---- PYW_EXPORT int Python_callback(PyObject *); PYW_EXPORT int Python_callback(PyObject *, int); + PYW_EXPORT int Python_callback(PyObject *, WPARAM); + PYW_EXPORT int Python_callback(PyObject *, LPARAM); PYW_EXPORT int Python_callback(PyObject *, int, int); PYW_EXPORT int Python_callback(PyObject *, const MSG *); *************** *** 350,354 **** PYW_EXPORT PyObject *MakeTV_ITEMTuple(TV_ITEM *item); ! PyObject *PyWin_GetPythonObjectFromLong(long val); PYW_EXPORT PyObject *PyWinObject_FromRECT(RECT *p, bool bTakeCopy); --- 353,357 ---- PYW_EXPORT PyObject *MakeTV_ITEMTuple(TV_ITEM *item); ! PyObject *PyWin_GetPythonObjectFromLong(LONG_PTR val); PYW_EXPORT PyObject *PyWinObject_FromRECT(RECT *p, bool bTakeCopy); Index: win32prinfo.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32prinfo.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32prinfo.cpp 5 Nov 1999 06:20:32 -0000 1.3 --- win32prinfo.cpp 3 Jun 2007 12:35:58 -0000 1.4 *************** *** 509,521 **** static PyObject *ui_set_hdc(PyObject * self, PyObject * args) { ! int dc; // @pyparm int|hdc||The DC. ! if (!PyArg_ParseTuple(args, "i:SetHDC", &dc)) return NULL; CPrintInfo *pInfo = ui_prinfo_object::GetPrintInfo(self); if (!pInfo) return NULL; pInfo->m_pPD->m_pd.Flags |= PD_RETURNDC; ! pInfo->m_pPD->m_pd.hDC = (HDC)dc; RETURN_NONE; } --- 509,524 ---- static PyObject *ui_set_hdc(PyObject * self, PyObject * args) { ! PyObject *obdc; // @pyparm int|hdc||The DC. ! if (!PyArg_ParseTuple(args, "O:SetHDC", &obdc)) return NULL; + HDC dc; + if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&dc)) + return NULL; CPrintInfo *pInfo = ui_prinfo_object::GetPrintInfo(self); if (!pInfo) return NULL; pInfo->m_pPD->m_pd.Flags |= PD_RETURNDC; ! pInfo->m_pPD->m_pd.hDC = dc; RETURN_NONE; } *************** *** 532,536 **** HDC hDC = pInfo->m_pPD->CreatePrinterDC(); GUI_END_SAVE; ! return Py_BuildValue("l", (long)hDC); } --- 535,539 ---- HDC hDC = pInfo->m_pPD->CreatePrinterDC(); GUI_END_SAVE; ! return PyWinLong_FromHANDLE(hDC); } *************** *** 544,550 **** return NULL; GUI_BGN_SAVE; ! int res = pInfo->m_pPD->DoModal(); GUI_END_SAVE; ! return Py_BuildValue("i", res); } --- 547,553 ---- return NULL; GUI_BGN_SAVE; ! INT_PTR res = pInfo->m_pPD->DoModal(); GUI_END_SAVE; ! return PyWinObject_FromDWORD_PTR(res); } *************** *** 640,644 **** HDC hDC = pInfo->m_pPD->GetPrinterDC(); GUI_END_SAVE; ! return Py_BuildValue("l", (long)hDC); } --- 643,647 ---- HDC hDC = pInfo->m_pPD->GetPrinterDC(); GUI_END_SAVE; ! return PyWinLong_FromHANDLE(hDC); } *************** *** 671,675 **** return NULL; HDC hDC = pInfo->m_pPD->m_pd.hDC; ! return Py_BuildValue("l", (long)hDC); } --- 674,678 ---- return NULL; HDC hDC = pInfo->m_pPD->m_pd.hDC; ! return PyWinLong_FromHANDLE(hDC); } Index: win32dc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32dc.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32dc.cpp 25 Oct 2003 05:32:20 -0000 1.3 --- win32dc.cpp 3 Jun 2007 12:35:58 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- */ + #define PY_SSIZE_T_CLEAN // this module is Py_ssize_t clean! #include "stdafx.h" *************** *** 35,39 **** return FALSE; } ! int n = PySequence_Length(obLogPal); *ppLogPal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + n * sizeof(PALETTEENTRY)); LOGPALETTE *pPal = *ppLogPal; --- 36,40 ---- return FALSE; } ! Py_ssize_t n = PySequence_Length(obLogPal); *ppLogPal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + n * sizeof(PALETTEENTRY)); LOGPALETTE *pPal = *ppLogPal; *************** *** 44,50 **** pPal->palVersion = 0x300; ! pPal->palNumEntries = n; ! for (int i=0;i<n;i++) { PyObject *subOb = PySequence_GetItem(obLogPal, i); if (subOb==NULL) --- 45,51 ---- pPal->palVersion = 0x300; ! pPal->palNumEntries = PyWin_SAFE_DOWNCAST(n, Py_ssize_t, WORD); ! for (Py_ssize_t i=0;i<n;i++) { PyObject *subOb = PySequence_GetItem(obLogPal, i); if (subOb==NULL) *************** *** 99,103 **** if (hp==NULL) RETURN_API_ERR("CreatePalette"); ! return PyInt_FromLong((long)hp); } --- 100,104 ---- if (hp==NULL) RETURN_API_ERR("CreatePalette"); ! return PyWinLong_FromHANDLE(hp); } *************** *** 246,250 **** // @pyseemfc CDC|GetSafeHdc HDC hdc = pDC->GetSafeHdc(); ! return Py_BuildValue("l", (long)hdc); } --- 247,251 ---- // @pyseemfc CDC|GetSafeHdc HDC hdc = pDC->GetSafeHdc(); ! return PyWinLong_FromHANDLE(hdc); } *************** *** 487,491 **** return NULL; char *text; ! int strLen, x, y; UINT options; PyObject *rectObject, *widthObject = NULL; --- 488,493 ---- return NULL; char *text; ! Py_ssize_t strLen; ! int x, y; UINT options; PyObject *rectObject, *widthObject = NULL; *************** *** 518,525 **** BOOL error = !PyTuple_Check(widthObject); if (!error) { ! int len = PyTuple_Size(widthObject); if (len == (strLen - 1)) { widths = new int[len + 1]; ! for (int i = 0; i < len; i++) { PyObject *item = PyTuple_GetItem(widthObject, i); if (!PyInt_Check(item)) --- 520,527 ---- BOOL error = !PyTuple_Check(widthObject); if (!error) { ! Py_ssize_t len = PyTuple_Size(widthObject); if (len == (strLen - 1)) { widths = new int[len + 1]; ! for (Py_ssize_t i = 0; i < len; i++) { PyObject *item = PyTuple_GetItem(widthObject, i); if (!PyInt_Check(item)) *************** *** 537,541 **** GUI_BGN_SAVE; ! BOOL ret = pDC->ExtTextOut(x, y, options, rectPtr, text, strLen, widths); // @pyseemfc CDC|ExtTextOut GUI_END_SAVE; delete [] widths; --- 539,545 ---- GUI_BGN_SAVE; ! BOOL ret = pDC->ExtTextOut(x, y, options, rectPtr, text, ! PyWin_SAFE_DOWNCAST(strLen, Py_ssize_t, DWORD), ! widths); // @pyseemfc CDC|ExtTextOut GUI_END_SAVE; delete [] widths; *************** *** 678,684 **** } else { // Convert the list of point tuples into an array of POINT structs ! int num = PyList_Size (point_list); POINT * point_array = new POINT[num]; ! for (int i=0; i < num; i++) { PyObject * point_tuple = PyList_GetItem (point_list, i); if (!PyTuple_Check (point_tuple) || PyTuple_Size (point_tuple) != 2) { --- 682,688 ---- } else { // Convert the list of point tuples into an array of POINT structs ! Py_ssize_t num = PyList_Size (point_list); POINT * point_array = new POINT[num]; ! for (Py_ssize_t i=0; i < num; i++) { PyObject * point_tuple = PyList_GetItem (point_list, i); if (!PyTuple_Check (point_tuple) || PyTuple_Size (point_tuple) != 2) { *************** *** 708,712 **** // can finally draw the polygon. GUI_BGN_SAVE; ! BOOL ret = pDC->Polygon (point_array, num); GUI_END_SAVE; delete[] point_array; --- 712,716 ---- // can finally draw the polygon. GUI_BGN_SAVE; ! BOOL ret = pDC->Polygon (point_array, PyWin_SAFE_DOWNCAST(num, Py_ssize_t, int)); GUI_END_SAVE; delete[] point_array; *************** *** 736,740 **** } else { int index = 0; ! int num = PyList_Size (triple_list); #define HURL \ --- 740,744 ---- } else { int index = 0; ! Py_ssize_t num = PyList_Size (triple_list); #define HURL \ *************** *** 748,752 **** POINT * point_array = new POINT[num*3]; ! for (int i=0; i < num; i++) { PyObject * triplet = PyList_GetItem (triple_list, i); if (!PyTuple_Check (triplet) || PyTuple_Size (triplet) != 3) { --- 752,756 ---- POINT * point_array = new POINT[num*3]; ! for (Py_ssize_t i=0; i < num; i++) { PyObject * triplet = PyList_GetItem (triple_list, i); if (!PyTuple_Check (triplet) || PyTuple_Size (triplet) != 3) { *************** *** 913,922 **** return NULL; char *text; ! int strLen; // @pyparm string|text||The text to calculate for. if (!PyArg_ParseTuple (args, "s#", &text, &strLen)) return NULL; GUI_BGN_SAVE; ! CSize sz = pDC->GetTextExtent(text, strLen); // @pyseemfc CFC|GetTextExtent GUI_END_SAVE; return Py_BuildValue ("(ii)", sz.cx, sz.cy); --- 917,927 ---- return NULL; char *text; ! Py_ssize_t strLen; // @pyparm string|text||The text to calculate for. if (!PyArg_ParseTuple (args, "s#", &text, &strLen)) return NULL; GUI_BGN_SAVE; ! CSize sz = pDC->GetTextExtent(text, PyWin_SAFE_DOWNCAST(strLen, Py_ssize_t, DWORD)); ! // @pyseemfc CFC|GetTextExtent GUI_END_SAVE; return Py_BuildValue ("(ii)", sz.cx, sz.cy); *************** *** 1388,1392 **** HPALETTE ret = ::SelectPalette(pDC->GetSafeHdc(), hPal, bForceBG); // @pyseemfc CDC|SelectePalette GUI_END_SAVE; ! return Py_BuildValue ("i", (int)ret); // @rdesc The previous palette handle. } --- 1393,1397 ---- HPALETTE ret = ::SelectPalette(pDC->GetSafeHdc(), hPal, bForceBG); // @pyseemfc CDC|SelectePalette GUI_END_SAVE; ! return PyWinLong_FromHANDLE(ret); // @rdesc The previous palette handle. } *************** *** 1438,1442 **** return NULL; char *text; ! int strLen, x, y; if (!PyArg_ParseTuple (args, "iis#", &x, // @pyparm x|int||The x coordinate to write the text to. --- 1443,1448 ---- return NULL; char *text; ! Py_ssize_t strLen; ! int x, y; if (!PyArg_ParseTuple (args, "iis#", &x, // @pyparm x|int||The x coordinate to write the text to. *************** *** 1446,1450 **** return NULL; GUI_BGN_SAVE; ! BOOL ret = pDC->TextOut (x, y, text, strLen); // @pyseemfc CDC|TextOut GUI_END_SAVE; if (!ret) --- 1452,1457 ---- return NULL; GUI_BGN_SAVE; ! BOOL ret = pDC->TextOut (x, y, text, ! PyWin_SAFE_DOWNCAST(strLen, Py_ssize_t, DWORD)); // @pyseemfc CDC|TextOut GUI_END_SAVE; if (!ret) *************** *** 2055,2061 **** } else { // Convert the list of point tuples into an array of POINT structs ! int num = PySequence_Length(point_list); POINT * point_array = new POINT[num]; ! for (int i=0; i < num; i++) { PyObject * point_tuple = PySequence_GetItem (point_list, i); if (!PyTuple_Check (point_tuple) || PyTuple_Size (point_tuple) != 2) { --- 2062,2068 ---- } else { // Convert the list of point tuples into an array of POINT structs ! Py_ssize_t num = PySequence_Length(point_list); POINT * point_array = new POINT[num]; ! for (Py_ssize_t i=0; i < num; i++) { PyObject * point_tuple = PySequence_GetItem (point_list, i); if (!PyTuple_Check (point_tuple) || PyTuple_Size (point_tuple) != 2) { *************** *** 2085,2089 **** // can finally draw the polyline. GUI_BGN_SAVE; ! BOOL ret = pDC->Polyline(point_array, num); GUI_END_SAVE; delete[] point_array; --- 2092,2096 ---- // can finally draw the polyline. GUI_BGN_SAVE; ! BOOL ret = pDC->Polyline(point_array, PyWin_SAFE_DOWNCAST(num, Py_ssize_t, int)); GUI_END_SAVE; delete[] point_array; Index: win32bitmap.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32bitmap.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32bitmap.cpp 3 Aug 2006 05:27:58 -0000 1.4 --- win32bitmap.cpp 3 Jun 2007 12:35:57 -0000 1.5 *************** *** 57,67 **** PyObject *ui_bitmap::create_from_handle( PyObject *self, PyObject *args ) { ! PyObject *pObj; ! int handle; ! if (!PyArg_ParseTuple(args, "i", &handle)) return NULL; CBitmap *pBitmap = new CBitmap; // if (!pBitmap->Attach((HGDIOBJ)handle)) { ! if (!pBitmap->Attach((HBITMAP)handle)) { delete pBitmap; RETURN_ERR("Attach failed!"); --- 57,69 ---- PyObject *ui_bitmap::create_from_handle( PyObject *self, PyObject *args ) { ! PyObject *pObj, *obhandle; ! if (!PyArg_ParseTuple(args, "O", &obhandle)) ! return NULL; ! HBITMAP handle; ! if (!PyWinObject_AsHANDLE(obhandle, (HANDLE *)&handle)) return NULL; CBitmap *pBitmap = new CBitmap; // if (!pBitmap->Attach((HGDIOBJ)handle)) { ! if (!pBitmap->Attach(handle)) { delete pBitmap; RETURN_ERR("Attach failed!"); *************** *** 186,190 **** return NULL; } ! int len = PyString_Size(result); if (len != sizeof(BITMAPFILEHEADER)) { DODECREF(seeker); --- 188,192 ---- return NULL; } ! Py_ssize_t len = PyString_Size(result); if (len != sizeof(BITMAPFILEHEADER)) { DODECREF(seeker); *************** *** 307,311 **** return NULL; } ! int lenRead = PyString_Size(result); // work out size of bitmap int headerSize = sizeof(BITMAPINFOHEADER); --- 309,313 ---- return NULL; } ! Py_ssize_t lenRead = PyString_Size(result); // work out size of bitmap int headerSize = sizeof(BITMAPINFOHEADER); Index: win32uimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** win32uimodule.cpp 28 Mar 2007 12:26:50 -0000 1.33 --- win32uimodule.cpp 3 Jun 2007 12:35:58 -0000 1.34 *************** *** 449,454 **** if (!GetFullPath(fullWorkBuf, workBuf)) // not a valid path continue; // ignore it. ! int listLen = PyList_Size(p); ! int itemNo; for (itemNo=0;itemNo<listLen;itemNo++) { char *thisPath = PyString_AsString(PyList_GetItem(p, itemNo)); --- 449,454 ---- if (!GetFullPath(fullWorkBuf, workBuf)) // not a valid path continue; // ignore it. ! Py_ssize_t listLen = PyList_Size(p); ! Py_ssize_t itemNo; for (itemNo=0;itemNo<listLen;itemNo++) { char *thisPath = PyString_AsString(PyList_GetItem(p, itemNo)); *************** *** 811,814 **** --- 811,826 ---- return retVal; } + int Python_callback(PyObject *method, WPARAM val) + { + PyObject *meth = method; + PyObject *thearglst = Py_BuildValue("(N)",PyWinObject_FromPARAM(val)); + return Python_do_int_callback(meth,thearglst); + } + int Python_callback(PyObject *method, LPARAM val) + { + PyObject *meth = method; + PyObject *thearglst = Py_BuildValue("(N)",PyWinObject_FromPARAM(val)); + return Python_do_int_callback(meth,thearglst); + } int Python_callback(PyObject *method, int val) { *************** *** 1480,1484 **** UINT cmd = HELP_CONTEXT; PyObject *dataOb; ! DWORD data; if (!PyArg_ParseTuple(args, "iO:WinHelp", &cmd, // @pyparm int|cmd|win32con.HELP_CONTEXT|The type of help. See the api for full details. --- 1492,1496 ---- UINT cmd = HELP_CONTEXT; PyObject *dataOb; ! ULONG_PTR data; if (!PyArg_ParseTuple(args, "iO:WinHelp", &cmd, // @pyparm int|cmd|win32con.HELP_CONTEXT|The type of help. See the api for full details. *************** *** 1486,1492 **** return NULL; if (PyString_Check(dataOb)) ! data = (DWORD)PyString_AsString(dataOb); else if (PyInt_Check(dataOb)) ! data = (DWORD)PyInt_AsLong(dataOb); else { RETURN_TYPE_ERR("First argument must be a string or an integer."); --- 1498,1504 ---- return NULL; if (PyString_Check(dataOb)) ! data = (DWORD_PTR)PyString_AsString(dataOb); else if (PyInt_Check(dataOb)) ! data = (DWORD_PTR)PyInt_AsLong(dataOb); else { RETURN_TYPE_ERR("First argument must be a string or an integer."); *************** *** 1643,1652 **** { long style; ! long hCursor = 0, hBrush = 0, hIcon = 0; ! if (!PyArg_ParseTuple(args,"l|lll:RegisterWndClass", &style, // @pyparm int|style||Specifies the Windows class style or combination of styles ! &hCursor, // @pyparm int|hCursor|0| ! &hBrush, // @pyparm int|hBrush|0| ! &hIcon)) // @pyparm int|hIcon|0| return NULL; --- 1655,1670 ---- { long style; ! PyObject *obCursor = Py_None, *obBrush = Py_None, *obIcon = Py_None; ! if (!PyArg_ParseTuple(args,"l|OOO:RegisterWndClass", &style, // @pyparm int|style||Specifies the Windows class style or combination of styles ! &obCursor, // @pyparm int|hCursor|0| ! &obBrush, // @pyparm int|hBrush|0| ! &obIcon)) // @pyparm int|hIcon|0| ! return NULL; ! ! HANDLE hCursor = 0, hBrush = 0, hIcon = 0; ! if (!PyWinObject_AsHANDLE(obCursor, &hCursor) || ! !PyWinObject_AsHANDLE(obBrush, &hBrush) || ! !PyWinObject_AsHANDLE(obIcon, &hIcon)) return NULL; *************** *** 1688,1698 **** ui_set_afxCurrentInstanceHandle(PyObject *self, PyObject *args) { ! HMODULE newVal; // @pyparm int|newVal||The new value for afxCurrentInstanceHandle ! if (!PyArg_ParseTuple(args, "l", &newVal)) return NULL; HMODULE old = afxCurrentInstanceHandle; afxCurrentInstanceHandle = newVal; ! return PyInt_FromLong((long)old); // @rdesc The result is the previous value of afxCurrentInstanceHandle } --- 1706,1719 ---- ui_set_afxCurrentInstanceHandle(PyObject *self, PyObject *args) { ! PyObject *obMod; // @pyparm int|newVal||The new value for afxCurrentInstanceHandle ! if (!PyArg_ParseTuple(args, "O", &obMod)) ! return NULL; ! HMODULE newVal; ! if (!PyWinObject_AsHANDLE(obMod, (HANDLE *)&newVal)) return NULL; HMODULE old = afxCurrentInstanceHandle; afxCurrentInstanceHandle = newVal; ! return PyWinLong_FromHANDLE(old); // @rdesc The result is the previous value of afxCurrentInstanceHandle } *************** *** 1708,1712 **** HMODULE old = afxCurrentResourceHandle; afxCurrentResourceHandle = newVal; ! return PyInt_FromLong((long)old); // @rdesc The result is the previous value of afxCurrentResourceHandle } --- 1729,1733 ---- HMODULE old = afxCurrentResourceHandle; afxCurrentResourceHandle = newVal; ! return PyWinLong_FromHANDLE(old); // @rdesc The result is the previous value of afxCurrentResourceHandle } *************** *** 1715,1720 **** static PyObject *ui_get_bytes(PyObject *self, PyObject *args) { ! long address; int size; // @pyparm int|address||The memory address // @pyparm int|size||The size to get. --- 1736,1742 ---- static PyObject *ui_get_bytes(PyObject *self, PyObject *args) { ! void *address; int size; + PyObject *obaddress; // @pyparm int|address||The memory address // @pyparm int|size||The size to get. *************** *** 1722,1726 **** // You must be very carefull when using this method. // @rdesc The result is a string with a length of size. ! if (!PyArg_ParseTuple(args, "li|GetBytes", &address, &size)) return NULL; return PyString_FromStringAndSize((char *)address, size); --- 1744,1750 ---- // You must be very carefull when using this method. // @rdesc The result is a string with a length of size. ! if (!PyArg_ParseTuple(args, "Oi|GetBytes", &obaddress, &size)) ! return NULL; ! if (!PyWinLong_AsVoidPtr(obaddress, &address)) return NULL; return PyString_FromStringAndSize((char *)address, size); *************** *** 1742,1749 **** // @pyparm int|hdc|| // @pyparm int|index|| ! int hdc, index; ! if (!PyArg_ParseTuple(args, "ii", &hdc, &index)) return NULL; ! return PyInt_FromLong( ::GetDeviceCaps( (HDC)hdc, index) ); } --- 1766,1777 ---- // @pyparm int|hdc|| // @pyparm int|index|| ! int index; ! PyObject *obdc; ! if (!PyArg_ParseTuple(args, "Oi", &obdc, &index)) return NULL; ! HDC hdc; ! if (!PyWinObject_AsHANDLE(obdc, (HANDLE *)&hdc)) ! return NULL; ! return PyInt_FromLong( ::GetDeviceCaps( hdc, index) ); } *************** *** 2244,2248 **** PyDict_SetItemString(dict, "copyright", copyright); Py_XDECREF(copyright); ! PyObject *dllhandle = PyInt_FromLong((long)hWin32uiDll); PyDict_SetItemString(dict, "dllhandle", dllhandle); Py_XDECREF(dllhandle); --- 2272,2276 ---- PyDict_SetItemString(dict, "copyright", copyright); Py_XDECREF(copyright); ! PyObject *dllhandle = PyWinLong_FromHANDLE(hWin32uiDll); PyDict_SetItemString(dict, "dllhandle", dllhandle); Py_XDECREF(dllhandle); Index: win32menu.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32menu.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32menu.cpp 1 Sep 1999 23:33:02 -0000 1.1 --- win32menu.cpp 3 Jun 2007 12:35:58 -0000 1.2 *************** *** 243,247 **** } else { HMENU hSubMenu = GetMenu(subMenu); ! if (!::InsertMenu(hMenu, pos, flags, (int)hSubMenu, value)) RETURN_API_ERR("::InsertMenu"); } --- 243,247 ---- } else { HMENU hSubMenu = GetMenu(subMenu); ! if (!::InsertMenu(hMenu, pos, flags, (UINT_PTR)hSubMenu, value)) RETURN_API_ERR("::InsertMenu"); } Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32util.cpp 24 May 2007 12:50:50 -0000 1.8 --- win32util.cpp 3 Jun 2007 12:35:58 -0000 1.9 *************** *** 182,186 **** PyObject *PyObjectFromCreateStruct(LPCREATESTRUCT lpcs) { ! return Py_BuildValue("(iiii(iiii)illi)", lpcs->lpCreateParams, // @pyparm int|createParams|| lpcs->hInstance, // @pyparm int|hInstance|| --- 182,186 ---- PyObject *PyObjectFromCreateStruct(LPCREATESTRUCT lpcs) { ! return Py_BuildValue("(iiii(iiii)iNNi)", lpcs->lpCreateParams, // @pyparm int|createParams|| lpcs->hInstance, // @pyparm int|hInstance|| *************** *** 192,197 **** lpcs->x, lpcs->style,// @pyparm int|style|| ! (long)lpcs->lpszName,// @pyparm int|lpszName||A string cast to a long. ! (long)lpcs->lpszClass,// @pyparm int|lpszClass||A string cast to a long!? lpcs->dwExStyle);// @pyparm int|dwExStyle|| --- 192,197 ---- lpcs->x, lpcs->style,// @pyparm int|style|| ! PyWinLong_FromVoidPtr(lpcs->lpszName),// @pyparm int|lpszName||A string cast to a long. ! PyWinLong_FromVoidPtr(lpcs->lpszClass),// @pyparm int|lpszClass||A string cast to a long!? lpcs->dwExStyle);// @pyparm int|dwExStyle|| *************** *** 208,212 **** else sprintf(argBuf, "iiii(iiii)illi:%s", fnName); ! long name, className; BOOL ret = PyArg_ParseTuple(ob, argBuf, &lpcs->lpCreateParams, --- 208,212 ---- else sprintf(argBuf, "iiii(iiii)illi:%s", fnName); ! PyObject *obname, *obclassName; BOOL ret = PyArg_ParseTuple(ob, argBuf, &lpcs->lpCreateParams, *************** *** 219,228 **** &lpcs->x, &lpcs->style, ! &name, ! &className, &lpcs->dwExStyle); // CCreateStruct ! lpcs->lpszName = (LPCTSTR)name; ! lpcs->lpszClass = (LPCTSTR)className; return ret; } --- 219,229 ---- &lpcs->x, &lpcs->style, ! &obname, ! &obclassName, &lpcs->dwExStyle); // CCreateStruct ! if (!ret || !PyWinLong_AsVoidPtr(obname, (void **)&lpcs->lpszName) || ! !PyWinLong_AsVoidPtr(obclassName, (void **)&lpcs->lpszClass)) ! return FALSE; return ret; } *************** *** 359,363 **** } if (item->mask & LVIF_PARAM && item->lParam) { ! PyObject *ob = PyInt_FromLong(item->lParam); PyTuple_SET_ITEM(ret, 6, ob); } else { --- 360,364 ---- } if (item->mask & LVIF_PARAM && item->lParam) { ! PyObject *ob = PyWinObject_FromPARAM(item->lParam); PyTuple_SET_ITEM(ret, 6, ob); } else { *************** *** 383,387 **** PyObject *ob; pItem->mask = 0; ! int len = PyTuple_Size(args); if (len<2 || len > 7) { PyErr_SetString(PyExc_TypeError, "LV_ITEM tuple has invalid size"); --- 384,388 ---- PyObject *ob; pItem->mask = 0; ! Py_ssize_t len = PyTuple_Size(args); if (len<2 || len > 7) { PyErr_SetString(PyExc_TypeError, "LV_ITEM tuple has invalid size"); *************** *** 418,422 **** pItem->mask |= LVIF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = strlen(pItem->pszText)+1; } if (len<6) return TRUE; --- 419,423 ---- pItem->mask |= LVIF_TEXT; pItem->pszText = PyString_AsString(ob); ! pItem->cchTextMax = PyWin_SAFE_DOWNCAST(strlen(pItem->pszText)+1, ssize_t, int); } if (len<6) return TRUE; *************** *** 483,487 **** PyObject *ob; pItem->mask = 0; ! int len = PyTuple_Size(args); if (len... [truncated message content] |
From: Mark H. <mha...@us...> - 2007-06-03 12:32:11
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2147 Modified Files: PyWinTypes.h PyWinTypesmodule.cpp Log Message: Let PyWinLong_FromVoidPtr take a const pointer. Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PyWinTypesmodule.cpp 27 May 2007 17:32:14 -0000 1.29 --- PyWinTypesmodule.cpp 3 Jun 2007 12:32:09 -0000 1.30 *************** *** 557,561 **** } ! PyObject *PyWinLong_FromVoidPtr(void *ptr) { #ifdef _WIN64 --- 557,561 ---- } ! PyObject *PyWinLong_FromVoidPtr(const void *ptr) { #ifdef _WIN64 Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** PyWinTypes.h 29 May 2007 12:28:45 -0000 1.42 --- PyWinTypes.h 3 Jun 2007 12:32:09 -0000 1.43 *************** *** 188,191 **** --- 188,198 ---- PYWINTYPES_EXPORT BOOL PyWinObject_AsWriteBuffer(PyObject *ob, void **buf, DWORD *buf_len, BOOL bNoneOk=FALSE); + // an 'int' version (but aren't 'int' and 'DWORD' the same size? + // Maybe a signed-ness issue? + inline BOOL PyWinObject_AsReadBuffer(PyObject *ob, void **buf, int *buf_len, BOOL bNoneOk=FALSE) + { + return PyWinObject_AsReadBuffer(ob, buf, (DWORD *)buf_len, bNoneOk); + } + /* ANSI/Unicode Support */ /* If UNICODE defined, will be a BSTR - otherwise a char * *************** *** 240,244 **** // Substitute for Python's inconsistent PyLong_AsVoidPtr PYWINTYPES_EXPORT BOOL PyWinLong_AsVoidPtr(PyObject *ob, void **pptr); ! PYWINTYPES_EXPORT PyObject *PyWinLong_FromVoidPtr(void *ptr); /* --- 247,251 ---- // Substitute for Python's inconsistent PyLong_AsVoidPtr PYWINTYPES_EXPORT BOOL PyWinLong_AsVoidPtr(PyObject *ob, void **pptr); ! PYWINTYPES_EXPORT PyObject *PyWinLong_FromVoidPtr(const void *ptr); /* |
From: Roger U. <ru...@us...> - 2007-06-03 09:46:38
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12200/com/win32com/src/include Modified Files: PythonCOM.h Log Message: Fix pointer cast to int warning Index: PythonCOM.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PythonCOM.h 14 Mar 2006 12:12:44 -0000 1.24 --- PythonCOM.h 3 Jun 2007 09:46:37 -0000 1.25 *************** *** 199,203 **** virtual int setattr(char *name, PyObject *v); virtual PyObject *repr(); ! virtual int compare(PyObject *other) {return (int)this-int(other);} // These iter are a little special, in that returning NULL means // use the implementation in the type --- 199,209 ---- virtual int setattr(char *name, PyObject *v); virtual PyObject *repr(); ! virtual int compare(PyObject *other) { ! if (this == other) ! return 0; ! if (this < other) ! return -1; ! return 1; ! } // These iter are a little special, in that returning NULL means // use the implementation in the type |
From: Roger U. <ru...@us...> - 2007-06-03 09:40:56
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10018/com/win32com/src/extensions Modified Files: PySTGMEDIUM.cpp Log Message: Fix some 64-bit HANDLE issues Index: PySTGMEDIUM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PySTGMEDIUM.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PySTGMEDIUM.cpp 24 May 2007 06:01:04 -0000 1.7 --- PySTGMEDIUM.cpp 3 Jun 2007 09:40:56 -0000 1.8 *************** *** 31,49 **** ps->Close(); // ensure any old data clean switch (tymed) { ! case TYMED_GDI: ! if (!PyInt_Check(ob) || !PyLong_Check(ob)) ! return PyErr_Format(PyExc_TypeError, "tymed value of %d requires an integer handle", tymed); ! ps->medium.hBitmap = (HBITMAP)PyInt_AsLong(ob); break; ! case TYMED_MFPICT: ! if (!PyInt_Check(ob) || !PyLong_Check(ob)) ! return PyErr_Format(PyExc_TypeError, "tymed value of %d requires an integer handle", tymed); ! ps->medium.hMetaFilePict = (HMETAFILEPICT)PyInt_AsLong(ob); break; ! case TYMED_ENHMF: ! if (!PyInt_Check(ob) || !PyLong_Check(ob)) ! return PyErr_Format(PyExc_TypeError, "tymed value of %d requires an integer handle", tymed); ! ps->medium.hEnhMetaFile = (HENHMETAFILE)PyInt_AsLong(ob); break; case TYMED_HGLOBAL: { const void * buf = NULL; --- 31,55 ---- ps->Close(); // ensure any old data clean switch (tymed) { ! case TYMED_GDI:{ ! HBITMAP htmp; ! if (!PyWinObject_AsHANDLE(ob, (HANDLE *)&htmp)) ! return NULL; ! ps->medium.hBitmap = htmp; break; ! } ! case TYMED_MFPICT:{ ! HMETAFILEPICT htmp; ! if (!PyWinObject_AsHANDLE(ob, (HANDLE *)&htmp)) ! return NULL; ! ps->medium.hMetaFilePict = htmp; break; ! } ! case TYMED_ENHMF:{ ! HENHMETAFILE htmp; ! if (!PyWinObject_AsHANDLE(ob, (HANDLE *)&htmp)) ! return NULL; ! ps->medium.hEnhMetaFile = htmp; break; + } case TYMED_HGLOBAL: { const void * buf = NULL; *************** *** 141,151 **** assert(pDest->tymed==0 && pDest->pUnkForRelease==0 && pDest->hGlobal == 0); switch (medium.tymed) { - // we can't just copy these handles, and there is no easy way I see - // to generically duplicate them. There is a CopyStgMedium function, - // but is part of IE, not of OLE. case TYMED_GDI: ! PyErr_SetString(PyExc_ValueError, "don't know how to copy these objects"); ! return FALSE; ! // is it ok to just copy these handles? pDest->hBitmap = medium.hBitmap; break; --- 147,153 ---- assert(pDest->tymed==0 && pDest->pUnkForRelease==0 && pDest->hGlobal == 0); switch (medium.tymed) { case TYMED_GDI: ! // Receiving app that is performing Paste operation takes ownership of the handle and ! // is responsible for freeing it (usually by calling ReleaseStgMedium) pDest->hBitmap = medium.hBitmap; break; |
From: Roger U. <ru...@us...> - 2007-06-03 01:35:16
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29476/com/win32comext/shell/src Modified Files: shell.cpp Log Message: Move PY_SSIZE_T_CLEAN to top of includes Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** shell.cpp 2 Jun 2007 08:18:27 -0000 1.55 --- shell.cpp 3 Jun 2007 01:35:16 -0000 1.56 *************** *** 13,16 **** --- 13,19 ---- ***/ + // Any python API functions that use 's#' format must use Py_ssize_t for length + #define PY_SSIZE_T_CLEAN + #include "shell_pch.h" #include "EmptyVC.h" *************** *** 47,53 **** #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. - // Any python API functions that use 's#' format must use Py_ssize_t for length - #define PY_SSIZE_T_CLEAN - // We should not be using this! #define OleSetOleError PyCom_BuildPyException --- 50,53 ---- |