Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23340/win32/src
Modified Files:
PyACL.cpp PyDEVMODE.cpp PyIID.cpp PyLARGE_INTEGER.cpp
PySECURITY_DESCRIPTOR.cpp PySID.cpp PySecurityObjects.h
PyTime.cpp PyWinObjects.h PyWinTypes.h _winxptheme.i dbi.cpp
odbc.cpp win32api_display.cpp win32clipboardmodule.cpp
win32consolemodule.cpp win32credmodule.cpp win32crypt.i
win32file.i win32gui.i win32rasmodule.cpp win32security.i
win32security_sspi.cpp
Log Message:
Another pass at getting things working on x64. This change incorporates
most of Sidnei's work on the AMD64 branch, and updates most of the other
win32 and win32com modules that haven't already had 64bit love from Roger
(thanks guys!). Note this is not complete - among the outstanding issues
are fixing 's#' format strings (but most of the tests *do* pass on x64,
and the ones which don't fail for 'vista environment' reasons rather
than x64 reasons)
Index: PyWinObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PyWinObjects.h 11 Jan 2007 13:13:48 -0000 1.11
--- PyWinObjects.h 24 May 2007 06:01:05 -0000 1.12
***************
*** 89,93 ****
PyTime(DATE t);
! PyTime(long t);
PyTime(const SYSTEMTIME &t);
PyTime(const FILETIME &t);
--- 89,93 ----
PyTime(DATE t);
! PyTime(time_t t);
PyTime(const SYSTEMTIME &t);
PyTime(const FILETIME &t);
Index: PySECURITY_DESCRIPTOR.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** PySECURITY_DESCRIPTOR.cpp 4 Dec 2006 04:56:08 -0000 1.18
--- PySECURITY_DESCRIPTOR.cpp 24 May 2007 06:01:05 -0000 1.19
***************
*** 83,87 ****
PyObject *PyWinMethod_NewSECURITY_DESCRIPTOR(PyObject *self, PyObject *args)
{
! int descriptor_len = SECURITY_DESCRIPTOR_MIN_LENGTH;
if (PyArg_ParseTuple(args, "|l:SECURITY_DESCRIPTOR", &descriptor_len)){
PyObject *ret=new PySECURITY_DESCRIPTOR(descriptor_len);
--- 83,87 ----
PyObject *PyWinMethod_NewSECURITY_DESCRIPTOR(PyObject *self, PyObject *args)
{
! Py_ssize_t descriptor_len = SECURITY_DESCRIPTOR_MIN_LENGTH;
if (PyArg_ParseTuple(args, "|l:SECURITY_DESCRIPTOR", &descriptor_len)){
PyObject *ret=new PySECURITY_DESCRIPTOR(descriptor_len);
***************
*** 98,105 ****
PyObject *obsd = NULL;
PSECURITY_DESCRIPTOR psd;
// @pyparmalt1 buffer|data||A buffer (eg, a string) with the raw bytes for the security descriptor.
if (!PyArg_ParseTuple(args, "O:SECURITY_DESCRIPTOR", &obsd))
return NULL;
! if (PyObject_AsReadBuffer(obsd, (const void **)&psd, &descriptor_len)==-1){
PyErr_SetString(PyExc_TypeError,"Object has no data buffer");
return NULL;
--- 98,106 ----
PyObject *obsd = NULL;
PSECURITY_DESCRIPTOR psd;
+ Py_ssize_t buf_len;
// @pyparmalt1 buffer|data||A buffer (eg, a string) with the raw bytes for the security descriptor.
if (!PyArg_ParseTuple(args, "O:SECURITY_DESCRIPTOR", &obsd))
return NULL;
! if (PyObject_AsReadBuffer(obsd, (const void **)&psd, &buf_len)==-1){
PyErr_SetString(PyExc_TypeError,"Object has no data buffer");
return NULL;
***************
*** 699,706 ****
static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = {
! (getreadbufferproc)PySECURITY_DESCRIPTOR::getreadbuf,
! (getwritebufferproc)0,
! (getsegcountproc)PySECURITY_DESCRIPTOR::getsegcount,
! (getcharbufferproc)0,
};
--- 700,707 ----
static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = {
! PySECURITY_DESCRIPTOR::getreadbuf,
! 0,
! PySECURITY_DESCRIPTOR::getsegcount,
! 0,
};
***************
*** 736,740 ****
};
! PySECURITY_DESCRIPTOR::PySECURITY_DESCRIPTOR(unsigned cb /*= 0*/)
{
ob_type = &PySECURITY_DESCRIPTORType;
--- 737,741 ----
};
! PySECURITY_DESCRIPTOR::PySECURITY_DESCRIPTOR(Py_ssize_t cb /*= 0*/)
{
ob_type = &PySECURITY_DESCRIPTORType;
***************
*** 786,790 ****
}
! /*static*/ int PySECURITY_DESCRIPTOR::getreadbuf(PyObject *self, int index, const void **ptr)
{
if ( index != 0 ) {
--- 787,791 ----
}
! /*static*/ Py_ssize_t PySECURITY_DESCRIPTOR::getreadbuf(PyObject *self, Py_ssize_t index, void **ptr)
{
if ( index != 0 ) {
***************
*** 798,802 ****
}
! /*static*/ int PySECURITY_DESCRIPTOR::getsegcount(PyObject *self, int *lenp)
{
if ( lenp )
--- 799,803 ----
}
! /*static*/ Py_ssize_t PySECURITY_DESCRIPTOR::getsegcount(PyObject *self, Py_ssize_t *lenp)
{
if ( lenp )
Index: win32api_display.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32api_display.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** win32api_display.cpp 1 Apr 2007 13:07:41 -0000 1.4
--- win32api_display.cpp 24 May 2007 06:01:05 -0000 1.5
***************
*** 176,180 ****
{
char *name, *value;
! int valuelen;
name=PyString_AsString(obname);
if (name==NULL)
--- 176,180 ----
{
char *name, *value;
! Py_ssize_t valuelen;
name=PyString_AsString(obname);
if (name==NULL)
Index: win32consolemodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** win32consolemodule.cpp 11 Dec 2006 12:18:24 -0000 1.9
--- win32consolemodule.cpp 24 May 2007 06:01:05 -0000 1.10
***************
*** 966,969 ****
--- 966,974 ----
}
+ #ifndef _WIN32_WINNT_LONGHORN
+ // 'reserved' ReadConsole param is defined as a PCONSOLE_READCONSOLE_CONTROL
+ // in Vista's SDK. If no such def exists, assume it's still 'void *'
+ # define PCONSOLE_READCONSOLE_CONTROL void *
+ #endif
// @pymethod <o PyUNICODE>|PyConsoleScreenBuffer|ReadConsole|Reads characters from the console input buffer
PyObject *PyConsoleScreenBuffer::PyReadConsole(PyObject *self, PyObject *args, PyObject *kwargs)
***************
*** 980,984 ****
if (buf==NULL)
return PyErr_Format(PyExc_MemoryError, "ReadConsole: Unable to allocate buffer of %d bytes", nbrtoread*sizeof(WCHAR));
! if (!ReadConsole(((PyConsoleScreenBuffer *)self)->m_handle, (LPVOID)buf, nbrtoread, &nbrread, reserved))
PyWin_SetAPIError("ReadConsole");
else
--- 985,989 ----
if (buf==NULL)
return PyErr_Format(PyExc_MemoryError, "ReadConsole: Unable to allocate buffer of %d bytes", nbrtoread*sizeof(WCHAR));
! if (!ReadConsole(((PyConsoleScreenBuffer *)self)->m_handle, (LPVOID)buf, nbrtoread, &nbrread, (PCONSOLE_READCONSOLE_CONTROL)reserved))
PyWin_SetAPIError("ReadConsole");
else
***************
*** 1173,1177 ****
if (!PyWinObject_AsCOORD(obcoord, &pcoord, FALSE))
return NULL;
! buf=(WORD *)malloc(len*sizeof(WCHAR));
if (buf==NULL)
return PyErr_Format(PyExc_MemoryError,"Unable to unicode buffer of %d characters", len);
--- 1178,1182 ----
if (!PyWinObject_AsCOORD(obcoord, &pcoord, FALSE))
return NULL;
! buf=(WCHAR *)malloc(len*sizeof(WCHAR));
if (buf==NULL)
return PyErr_Format(PyExc_MemoryError,"Unable to unicode buffer of %d characters", len);
Index: PySecurityObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySecurityObjects.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PySecurityObjects.h 26 Jul 2004 06:47:16 -0000 1.11
--- PySecurityObjects.h 24 May 2007 06:01:05 -0000 1.12
***************
*** 60,64 ****
BOOL SetSD(PSECURITY_DESCRIPTOR psd);
! PySECURITY_DESCRIPTOR(unsigned cb = 0);
PySECURITY_DESCRIPTOR(PSECURITY_DESCRIPTOR psd);
~PySECURITY_DESCRIPTOR(void);
--- 60,64 ----
BOOL SetSD(PSECURITY_DESCRIPTOR psd);
! PySECURITY_DESCRIPTOR(Py_ssize_t cb = 0);
PySECURITY_DESCRIPTOR(PSECURITY_DESCRIPTOR psd);
~PySECURITY_DESCRIPTOR(void);
***************
*** 71,76 ****
static PyObject *getattr(PyObject *self, char *name);
static int setattr(PyObject *self, char *name, PyObject *v);
! static int getreadbuf(PyObject *self, int index, const void **ptr);
! static int getsegcount(PyObject *self, int *lenp);
static PyObject *Initialize(PyObject *self, PyObject *args);
--- 71,76 ----
static PyObject *getattr(PyObject *self, char *name);
static int setattr(PyObject *self, char *name, PyObject *v);
! static Py_ssize_t getreadbuf(PyObject *self, Py_ssize_t index, void **ptr);
! static Py_ssize_t getsegcount(PyObject *self, Py_ssize_t *lenp);
static PyObject *Initialize(PyObject *self, PyObject *args);
***************
*** 119,124 ****
static PyObject *getattr(PyObject *self, char *name);
static int setattr(PyObject *self, char *name, PyObject *v);
! static int getreadbuf(PyObject *self, int index, const void **ptr);
! static int getsegcount(PyObject *self, int *lenp);
static PyObject *Initialize(PyObject *self, PyObject *args);
--- 119,124 ----
static PyObject *getattr(PyObject *self, char *name);
static int setattr(PyObject *self, char *name, PyObject *v);
! static Py_ssize_t getreadbuf(PyObject *self, Py_ssize_t index, void **ptr);
! static Py_ssize_t getsegcount(PyObject *self, Py_ssize_t *lenp);
static PyObject *Initialize(PyObject *self, PyObject *args);
Index: win32security.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** win32security.i 7 Jan 2007 03:52:18 -0000 1.36
--- win32security.i 24 May 2007 06:01:06 -0000 1.37
***************
*** 6,10 ****
%{
! #define _WIN32_WINNT 0x0500 // We are 2k specific
%}
--- 6,10 ----
%{
! #define _WIN32_WINNT 0x0501 // We are 2k specific
%}
Index: win32security_sspi.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security_sspi.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** win32security_sspi.cpp 13 Feb 2006 14:42:35 -0000 1.6
--- win32security_sspi.cpp 24 May 2007 06:01:06 -0000 1.7
***************
*** 18,22 ****
//
////////////////////////////////////////////////////////////////////////
! int PySecBufferDesc_sq_length(PyObject *self)
{
PSecBufferDesc psecbufferdesc=((PySecBufferDesc *)self)->GetSecBufferDesc();
--- 18,22 ----
//
////////////////////////////////////////////////////////////////////////
! Py_ssize_t PySecBufferDesc_sq_length(PyObject *self)
{
PSecBufferDesc psecbufferdesc=((PySecBufferDesc *)self)->GetSecBufferDesc();
***************
*** 24,28 ****
}
! PyObject *PySecBufferDesc_sq_item(PyObject *self, int i)
{
PySecBufferDesc *This=(PySecBufferDesc *)self;
--- 24,28 ----
}
! PyObject *PySecBufferDesc_sq_item(PyObject *self, Py_ssize_t i)
{
PySecBufferDesc *This=(PySecBufferDesc *)self;
***************
*** 36,40 ****
}
! int PySecBufferDesc_sq_ass_item(PyObject *self, int i, PyObject *ob)
{
if (ob==NULL){
--- 36,40 ----
}
! int PySecBufferDesc_sq_ass_item(PyObject *self, Py_ssize_t i, PyObject *ob)
{
if (ob==NULL){
***************
*** 424,428 ****
PySecBuffer *This=(PySecBuffer *)self;
char *name, *value;
! int valuelen;
name=PyString_AsString(obname);
if (name==NULL)
--- 424,428 ----
PySecBuffer *This=(PySecBuffer *)self;
char *name, *value;
! Py_ssize_t valuelen;
name=PyString_AsString(obname);
if (name==NULL)
***************
*** 432,436 ****
return -1;
PSecBuffer psecbuffer=This->GetSecBuffer();
! if (valuelen>(int)This->maxbufsize){
PyErr_Format(PyExc_ValueError, "Data size (%d) greater than allocated buffer size (%d)",valuelen, This->maxbufsize);
return -1;
--- 432,436 ----
return -1;
PSecBuffer psecbuffer=This->GetSecBuffer();
! if (valuelen>(Py_ssize_t)This->maxbufsize){
PyErr_Format(PyExc_ValueError, "Data size (%d) greater than allocated buffer size (%d)",valuelen, This->maxbufsize);
return -1;
Index: PySID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PySID.cpp 27 Oct 2005 12:26:00 -0000 1.11
--- PySID.cpp 24 May 2007 06:01:05 -0000 1.12
***************
*** 12,16 ****
{
void *buf = NULL;
! int bufSize = 32;
// @pyparm int|bufSize|32|Size for the SID buffer
if (!PyArg_ParseTuple(args, "|i:SID", &bufSize)) {
--- 12,16 ----
{
void *buf = NULL;
! int bufSize = 32; // xxxxxx64 - should be Py_ssize_t - but passed as 'i'
// @pyparm int|bufSize|32|Size for the SID buffer
if (!PyArg_ParseTuple(args, "|i:SID", &bufSize)) {
***************
*** 35,39 ****
return NULL;
}
! int numSubs = PySequence_Length(obSubs);
if (numSubs>8) {
PyErr_SetString(PyExc_TypeError, "sub authorities sequence size must be <= 8");
--- 35,39 ----
return NULL;
}
! Py_ssize_t numSubs = PySequence_Length(obSubs);
if (numSubs>8) {
PyErr_SetString(PyExc_TypeError, "sub authorities sequence size must be <= 8");
***************
*** 51,55 ****
}
PSID pNew;
! if (!AllocateAndInitializeSid(&sid_ia, numSubs, sub0, sub1, sub2, sub3, sub4, sub5, sub6, sub7, &pNew))
return PyWin_SetAPIError("AllocateAndInitializeSid");
return new PySID(pNew);
--- 51,55 ----
}
PSID pNew;
! if (!AllocateAndInitializeSid(&sid_ia, (BYTE)numSubs, sub0, sub1, sub2, sub3, sub4, sub5, sub6, sub7, &pNew))
return PyWin_SetAPIError("AllocateAndInitializeSid");
return new PySID(pNew);
***************
*** 191,198 ****
static PyBufferProcs PySID_as_buffer = {
! (getreadbufferproc)PySID::getreadbuf,
! (getwritebufferproc)0,
! (getsegcountproc)PySID::getsegcount,
! (getcharbufferproc)0,
};
--- 191,198 ----
static PyBufferProcs PySID_as_buffer = {
! PySID::getreadbuf,
! 0,
! PySID::getsegcount,
! 0,
};
***************
*** 278,282 ****
}
! /*static*/ int PySID::getreadbuf(PyObject *self, int index, const void **ptr)
{
if ( index != 0 ) {
--- 278,282 ----
}
! /*static*/ Py_ssize_t PySID::getreadbuf(PyObject *self, Py_ssize_t index, void **ptr)
{
if ( index != 0 ) {
***************
*** 290,294 ****
}
! /*static*/ int PySID::getsegcount(PyObject *self, int *lenp)
{
if ( lenp )
--- 290,294 ----
}
! /*static*/ Py_ssize_t PySID::getsegcount(PyObject *self, Py_ssize_t *lenp)
{
if ( lenp )
Index: PyWinTypes.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** PyWinTypes.h 7 May 2007 03:41:21 -0000 1.38
--- PyWinTypes.h 24 May 2007 06:01:05 -0000 1.39
***************
*** 15,18 ****
--- 15,32 ----
#include "windows.h"
+ // See PEP-353 - this is the "official" test...
+ #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+ // 2.3 and before have no Py_ssize_t
+ typedef int Py_ssize_t;
+ #define PyInt_FromSsize_t PyInt_FromLong
+ #define PyInt_AsSsize_t PyInt_AsLong
+ #define PY_SSIZE_T_MAX INT_MAX
+ #define PY_SSIZE_T_MIN INT_MIN
+ #endif
+
+ // This only enables runtime checks in debug builds - so we use
+ // our own so we can enable it always should we desire...
+ #define PyWin_SAFE_DOWNCAST Py_SAFE_DOWNCAST
+
// Lars: for WAVEFORMATEX
#include "mmsystem.h"
***************
*** 144,148 ****
PYWINTYPES_EXPORT BOOL PyWinObject_AsWCHAR(PyObject *stringObject, WCHAR **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL);
// And free it when finished.
! PYWINTYPES_EXPORT void PyWinObject_FreeWCHAR(BSTR pResult);
// Given a PyObject (string, Unicode, etc) create a "char *" with the value
--- 158,177 ----
PYWINTYPES_EXPORT BOOL PyWinObject_AsWCHAR(PyObject *stringObject, WCHAR **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL);
// And free it when finished.
! PYWINTYPES_EXPORT void PyWinObject_FreeWCHAR(WCHAR *pResult);
!
! // As of Python 2.6, Python switched to 'wchar_t' for unicode. Some old
! // win32 structures that still use 'unsigned short' now fail from C++ with
! // VS8 so we provide a couple of helpers.
! #if PY_VERSION_HEX >= 0x02060000 && _MSC_VER > 1500
! inline BOOL PyWinObject_AsWCHAR(PyObject *stringObject, unsigned short **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL)
! {
! return PyWinObject_AsWCHAR(stringObject, (WCHAR **)pResult, bNoneOK, pResultLen);
! }
! inline void PyWinObject_FreeWCHAR(unsigned short *pResult)
! {
! PyWinObject_FreeWCHAR((WCHAR *)pResult);
! }
! #endif
!
// Given a PyObject (string, Unicode, etc) create a "char *" with the value
***************
*** 203,206 ****
--- 232,240 ----
PYWINTYPES_EXPORT void PyWinObject_FreeString(WCHAR *str);
+ // Pointers.
+ // Substitute for Python's inconsistent PyLong_AsVoidPtr
+ PYWINTYPES_EXPORT BOOL PyWinLong_AsVoidPtr(PyObject *ob, void **pptr);
+ PYWINTYPES_EXPORT PyObject *PyWinLong_FromVoidPtr(void *ptr);
+
/*
** LARGE_INTEGER objects
***************
*** 245,248 ****
--- 279,298 ----
BOOL PyLong_AsI64(PyObject *val, __int64 *lval);
+ // A DWORD_PTR and ULONG_PTR appear to mean "integer long enough to hold a pointer"
+ // 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) {
+ return PyWinLong_AsVoidPtr(ob, (void **)r);
+ }
+
+ inline PyObject *PyWinObject_FromDWORD_PTR(DWORD_PTR v) {
+ return PyLong_FromVoidPtr((void *)v);
+ }
+ inline BOOL PyWinLong_AsDWORD_PTR(PyObject *ob, DWORD_PTR *r) {
+ return PyWinLong_AsVoidPtr(ob, (void **)r);
+ }
+
// Some boolean helpers for Python 2.2 and earlier
#if (PY_VERSION_HEX < 0x02030000 && !defined(PYWIN_NO_BOOL_FROM_LONG))
***************
*** 338,345 ****
PYWINTYPES_EXPORT BOOL PyWinObject_AsDWORDArray(PyObject *obdwords, DWORD **pdwords, DWORD *item_cnt, BOOL bNoneOk=TRUE);
- // Substitute for Python's inconsistent PyLong_AsVoidPtr
- PYWINTYPES_EXPORT BOOL PyWinLong_AsVoidPtr(PyObject *ob, void **pptr);
- PYWINTYPES_EXPORT PyObject *PyWinLong_FromVoidPtr(void *ptr);
-
// Conversion for resource id/name and class atom
PYWINTYPES_EXPORT BOOL PyWinObject_AsResourceIdA(PyObject *ob, char **presource_id, BOOL bNoneOK = FALSE);
--- 388,391 ----
***************
*** 355,358 ****
--- 401,411 ----
// WPARAM and LPARAM conversion
PYWINTYPES_EXPORT BOOL PyWinObject_AsPARAM(PyObject *ob, WPARAM *pparam);
+ inline PyObject *PyWinObject_FromPARAM(WPARAM param) {
+ return PyWinObject_FromULONG_PTR(param);
+ }
+ inline PyObject *PyWinObject_FromPARAM(LPARAM param) {
+ return PyWinObject_FromULONG_PTR(param);
+ }
+
// RECT conversions
Index: win32gui.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** win32gui.i 7 May 2007 06:00:30 -0000 1.106
--- win32gui.i 24 May 2007 06:01:06 -0000 1.107
***************
*** 755,759 ****
}
! BOOL CALLBACK PyDlgProcHDLG(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
BOOL rc = FALSE;
--- 755,759 ----
}
! INT_PTR CALLBACK PyDlgProcHDLG(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
BOOL rc = FALSE;
***************
*** 1722,1729 ****
return NULL;
switch (index) {
! // @comm If index is GWL_WNDPROC, then the value parameter
// must be a callable object (or a dictionary) to use as the
// new window procedure.
! case GWL_WNDPROC:
{
if (!PyCallable_Check(ob) && !PyDict_Check(ob)) {
--- 1722,1729 ----
return NULL;
switch (index) {
! // @comm If index is GWLP_WNDPROC, then the value parameter
// must be a callable object (or a dictionary) to use as the
// new window procedure.
! case GWLP_WNDPROC:
{
if (!PyCallable_Check(ob) && !PyDict_Check(ob)) {
***************
*** 1733,1737 ****
PyObject *key = PyWinLong_FromHANDLE(hwnd);
! PyObject *value = Py_BuildValue("ON", ob, PyWinLong_FromVoidPtr((void *)GetWindowLongPtr(hwnd, GWL_WNDPROC)));
PyDict_SetItem(g_HWNDMap, key, value);
Py_DECREF(value);
--- 1733,1737 ----
PyObject *key = PyWinLong_FromHANDLE(hwnd);
! PyObject *value = Py_BuildValue("ON", ob, PyWinLong_FromVoidPtr((void *)GetWindowLongPtr(hwnd, GWLP_WNDPROC)));
PyDict_SetItem(g_HWNDMap, key, value);
Py_DECREF(value);
***************
*** 1852,1856 ****
LRESULT rc;
! DWORD dwresult;
Py_BEGIN_ALLOW_THREADS
rc = SendMessageTimeout(hwnd, msg, wparam, lparam, flags, timeout, &dwresult);
--- 1852,1856 ----
LRESULT rc;
! DWORD_PTR dwresult;
Py_BEGIN_ALLOW_THREADS
rc = SendMessageTimeout(hwnd, msg, wparam, lparam, flags, timeout, &dwresult);
***************
*** 1861,1865 ****
// If the timeout period expires, a pywintypes.error exception will be thrown,
// with zero as the error code. See the Microsoft documentation for more information.
! return Py_BuildValue("Ni", PyWinLong_FromVoidPtr((void *)rc), dwresult);
}
%}
--- 1861,1865 ----
// If the timeout period expires, a pywintypes.error exception will be thrown,
// with zero as the error code. See the Microsoft documentation for more information.
! return Py_BuildValue("NN", PyWinLong_FromVoidPtr((void *)rc), PyWinObject_FromDWORD_PTR(dwresult));
}
%}
***************
*** 4431,4435 ****
#ifndef MS_WINCE
! %typemap (python, in) MENUITEMINFO *INPUT (int target_size){
if (0 != PyObject_AsReadBuffer($source, (const void **)&$target, &target_size))
return NULL;
--- 4431,4435 ----
#ifndef MS_WINCE
! %typemap (python, in) MENUITEMINFO *INPUT (Py_ssize_t target_size){
if (0 != PyObject_AsReadBuffer($source, (const void **)&$target, &target_size))
return NULL;
***************
*** 4438,4442 ****
}
! %typemap (python,in) MENUITEMINFO *BOTH(int target_size) {
if (0 != PyObject_AsWriteBuffer($source, (void **)&$target, &target_size))
return NULL;
--- 4438,4442 ----
}
! %typemap (python,in) MENUITEMINFO *BOTH(Py_ssize_t target_size) {
if (0 != PyObject_AsWriteBuffer($source, (void **)&$target, &target_size))
return NULL;
***************
*** 4445,4449 ****
}
! %typemap (python, in) MENUINFO *INPUT (int target_size){
if (0 != PyObject_AsReadBuffer($source, (const void **)&$target, &target_size))
return NULL;
--- 4445,4449 ----
}
! %typemap (python, in) MENUINFO *INPUT (Py_ssize_t target_size){
if (0 != PyObject_AsReadBuffer($source, (const void **)&$target, &target_size))
return NULL;
***************
*** 4452,4456 ****
}
! %typemap (python,in) MENUINFO *BOTH(int target_size) {
if (0 != PyObject_AsWriteBuffer($source, (void **)&$target, &target_size))
return NULL;
--- 4452,4456 ----
}
! %typemap (python,in) MENUINFO *BOTH(Py_ssize_t target_size) {
if (0 != PyObject_AsWriteBuffer($source, (void **)&$target, &target_size))
return NULL;
***************
*** 4557,4561 ****
PyObject *obMenu, *obInfo;
HMENU hmenu;
! int cbInfo;
MENUINFO *pInfo;
BOOL result;
--- 4557,4561 ----
PyObject *obMenu, *obInfo;
HMENU hmenu;
! Py_ssize_t cbInfo;
MENUINFO *pInfo;
BOOL result;
***************
*** 4594,4598 ****
PyObject *obMenu, *obInfo;
HMENU hmenu;
! int cbInfo;
MENUINFO *pInfo;
BOOL result;
--- 4594,4598 ----
PyObject *obMenu, *obInfo;
HMENU hmenu;
! Py_ssize_t cbInfo;
MENUINFO *pInfo;
BOOL result;
Index: win32rasmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32rasmodule.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** win32rasmodule.cpp 1 Oct 2004 00:07:52 -0000 1.8
--- win32rasmodule.cpp 24 May 2007 06:01:06 -0000 1.9
***************
*** 13,17 ****
#ifndef WINVER
! #define WINVER 0x400
#endif
--- 13,23 ----
#ifndef WINVER
! // hrm - the RASEAPUSERIDENTITY structures on the Vista SDK now want
! // a WINVER > 0x500.
! # ifdef _WIN64
! # define WINVER 0x501
! # else
! # define WINVER 0x400
! # endif
#endif
Index: win32credmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32credmodule.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** win32credmodule.cpp 27 Dec 2006 04:41:15 -0000 1.4
--- win32credmodule.cpp 24 May 2007 06:01:06 -0000 1.5
***************
*** 46,50 ****
PyObject *obKeyword, *obValue, *args;
const void *value;
! int valuelen;
BOOL ret;
ZeroMemory(attr, sizeof(CREDENTIAL_ATTRIBUTE));
--- 46,50 ----
PyObject *obKeyword, *obValue, *args;
const void *value;
! Py_ssize_t valuelen;
BOOL ret;
ZeroMemory(attr, sizeof(CREDENTIAL_ATTRIBUTE));
***************
*** 380,384 ****
// @flag CertCredential|String containing the SHA1 hash of user's certificate
case CertCredential:{
! int hashlen;
char *hash;
if (PyString_AsStringAndSize(obcredential, &hash, &hashlen)==-1)
--- 380,384 ----
// @flag CertCredential|String containing the SHA1 hash of user's certificate
case CertCredential:{
! Py_ssize_t hashlen;
char *hash;
if (PyString_AsStringAndSize(obcredential, &hash, &hashlen)==-1)
Index: PyTime.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PyTime.cpp 26 Aug 2006 08:26:37 -0000 1.17
--- PyTime.cpp 24 May 2007 06:01:05 -0000 1.18
***************
*** 60,63 ****
--- 60,65 ----
if ( PyNumber_Check(timeOb) )
{
+ // XXX - should possibly check for long_long, as sizeof(time_t) > sizeof(long)
+ // on x64
long t = PyInt_AsLong(timeOb);
if ( t == -1 )
***************
*** 66,70 ****
PyErr_BadArgument();
} else
! result = new PyTime(t);
}
else if ( PySequence_Check(timeOb) )
--- 68,72 ----
PyErr_BadArgument();
} else
! result = new PyTime((time_t)t);
}
else if ( PySequence_Check(timeOb) )
***************
*** 129,133 ****
PyObject *PyWinTimeObject_FromLong(long t)
{
! return new PyTime(t);
}
--- 131,135 ----
PyObject *PyWinTimeObject_FromLong(long t)
{
! return new PyTime((time_t)t);
}
***************
*** 391,395 ****
}
! PyTime::PyTime(long t)
{
ob_type = &PyTimeType;
--- 393,397 ----
}
! PyTime::PyTime(time_t t)
{
ob_type = &PyTimeType;
Index: _winxptheme.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/_winxptheme.i,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** _winxptheme.i 8 Nov 2004 02:57:43 -0000 1.1
--- _winxptheme.i 24 May 2007 06:01:05 -0000 1.2
***************
*** 300,304 ****
// @pyswig int|GetThemeAppProperties|Returns the app property flags that control theming
! long GetThemeAppProperties();
// @pyswig |EnableTheming|Enables or disables themeing for the current user
--- 300,304 ----
// @pyswig int|GetThemeAppProperties|Returns the app property flags that control theming
! DWORD GetThemeAppProperties();
// @pyswig |EnableTheming|Enables or disables themeing for the current user
Index: win32crypt.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32crypt.i,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** win32crypt.i 16 Jan 2007 19:04:21 -0000 1.3
--- win32crypt.i 24 May 2007 06:01:06 -0000 1.4
***************
*** 17,21 ****
BOOL PyWinObject_AsDATA_BLOB(PyObject *ob, DATA_BLOB *b)
{
! return PyObject_AsReadBuffer(ob, (const void **)(&b->pbData), (int *)(&b->cbData))==0;
}
--- 17,25 ----
BOOL PyWinObject_AsDATA_BLOB(PyObject *ob, DATA_BLOB *b)
{
! Py_ssize_t cb;
! if (PyObject_AsReadBuffer(ob, (const void **)(&b->pbData), &cb)!=0)
! return FALSE;
! b->cbData = PyWin_SAFE_DOWNCAST(cb, Py_ssize_t, int);
! return TRUE;
}
Index: PyLARGE_INTEGER.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyLARGE_INTEGER.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PyLARGE_INTEGER.cpp 28 Jun 2004 03:37:59 -0000 1.10
--- PyLARGE_INTEGER.cpp 24 May 2007 06:01:05 -0000 1.11
***************
*** 200,205 ****
PyLongObject *PyLong_Normalize(register PyLongObject *v)
{
! int j = ABS(v->ob_size);
! register int i = j;
while (i > 0 && v->ob_digit[i-1] == 0)
--- 200,205 ----
PyLongObject *PyLong_Normalize(register PyLongObject *v)
{
! Py_ssize_t j = ABS(v->ob_size);
! register Py_ssize_t i = j;
while (i > 0 && v->ob_digit[i-1] == 0)
***************
*** 221,225 ****
register PyLongObject *v;
__int64 x, prev;
! int i, sign;
if (vv == NULL || !PyLong_Check(vv)) {
--- 221,225 ----
register PyLongObject *v;
__int64 x, prev;
! Py_ssize_t i, sign;
if (vv == NULL || !PyLong_Check(vv)) {
Index: odbc.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** odbc.cpp 24 May 2006 08:40:41 -0000 1.17
--- odbc.cpp 24 May 2007 06:01:05 -0000 1.18
***************
*** 15,23 ****
#include <string.h>
! #include <windows.h>
#include <sql.h>
#include <sqlext.h>
- #include <Python.h>
#include <import.h>
--- 15,22 ----
#include <string.h>
! #include <pywintypes.h>
#include <sql.h>
#include <sqlext.h>
#include <import.h>
***************
*** 30,33 ****
--- 29,36 ----
#endif
+ #ifdef _WIN64
+ # define mktime _mktime32
+ #endif
+
/* Python 1.5.2 doesn't have PyObject_New
PyObject_NEW is not *quite* as safe, but seem to work fine
***************
*** 76,81 ****
typedef struct _in {
struct _in *next;
! long len;
! long sqlBytesAvailable;
bool bPutData;
char bind_area[1];
--- 79,84 ----
typedef struct _in {
struct _in *next;
! SQLLEN len;
! SQLLEN sqlBytesAvailable;
bool bPutData;
char bind_area[1];
***************
*** 533,537 ****
ob->bind_area,
vsize,
! &ob->rcode)))
{
cursorError(cur, "BIND");
--- 536,540 ----
ob->bind_area,
vsize,
! (SQLLEN *)&ob->rcode)))
{
cursorError(cur, "BIND");
***************
*** 641,647 ****
}
! static long NTS = SQL_NTS;
! static InputBinding *initInputBinding(cursorObject *cur, int len)
{
InputBinding *ib = (InputBinding *)malloc(sizeof(InputBinding) + len);
--- 644,650 ----
}
! static SQLLEN NTS = SQL_NTS;
! static InputBinding *initInputBinding(cursorObject *cur, Py_ssize_t len)
{
InputBinding *ib = (InputBinding *)malloc(sizeof(InputBinding) + len);
***************
*** 723,727 ****
static int ibindNull(cursorObject*cur, int column)
{
! static SDWORD nl;
/* apparently, ODBC does not read the last parameter
until EXEC time, i.e., after this function is
--- 726,730 ----
static int ibindNull(cursorObject*cur, int column)
{
! static SQLLEN nl;
/* apparently, ODBC does not read the last parameter
until EXEC time, i.e., after this function is
***************
*** 761,765 ****
TIMESTAMP_STRUCT *dt = (TIMESTAMP_STRUCT*) ib->bind_area ;
! struct tm *gt = localtime(&val);
dt->year = 1900 + gt->tm_year;
--- 764,768 ----
TIMESTAMP_STRUCT *dt = (TIMESTAMP_STRUCT*) ib->bind_area ;
! struct tm *gt = localtime((const time_t *)&val);
dt->year = 1900 + gt->tm_year;
***************
*** 793,797 ****
{
const char *val = PyString_AsString(item);
! int len = PyObject_Length(item);
InputBinding *ib = initInputBinding(cur, len);
--- 796,800 ----
{
const char *val = PyString_AsString(item);
! Py_ssize_t len = PyObject_Length(item);
InputBinding *ib = initInputBinding(cur, len);
***************
*** 856,860 ****
{
const char *val = PyString_AsString(item);
! int len = strlen(val);
InputBinding *ib = initInputBinding(cur, len);
--- 859,863 ----
{
const char *val = PyString_AsString(item);
! size_t len = strlen(val);
InputBinding *ib = initInputBinding(cur, len);
***************
*** 898,904 ****
static int ibindUnicode(cursorObject *cur, int column, PyObject *item)
{
! const WCHAR *wval = PyUnicode_AsUnicode(item);
! int nchars = PyUnicode_GetSize(item);
! int nbytes = nchars * sizeof(WCHAR);
InputBinding *ib = initInputBinding(cur, nbytes);
--- 901,907 ----
static int ibindUnicode(cursorObject *cur, int column, PyObject *item)
{
! const WCHAR *wval = (WCHAR *)PyUnicode_AsUnicode(item);
! Py_ssize_t nchars = PyUnicode_GetSize(item);
! Py_ssize_t nbytes = nchars * sizeof(WCHAR);
InputBinding *ib = initInputBinding(cur, nbytes);
***************
*** 1060,1064 ****
{
short vtype;
! unsigned long vsize;
char name[256];
int pos = 1;
--- 1063,1067 ----
{
short vtype;
! SQLULEN vsize;
char name[256];
int pos = 1;
***************
*** 1224,1228 ****
rc = SQLPutData(cur->hstmt, pInputBinding->bind_area, 0);
}
! for (size_t i = 0; i < putTimes && rc == SQL_SUCCESS; i++)
{
rc = SQLPutData(cur->hstmt, (void*)(&pInputBinding->bind_area[i * 1024]), 1024);
--- 1227,1232 ----
rc = SQLPutData(cur->hstmt, pInputBinding->bind_area, 0);
}
! size_t i;
! for (i = 0; i < putTimes && rc == SQL_SUCCESS; i++)
{
rc = SQLPutData(cur->hstmt, (void*)(&pInputBinding->bind_area[i * 1024]), 1024);
***************
*** 1253,1259 ****
PyObject *rv = 0;
PyObject *rows = 0;
! long t;
int n_columns = 0;
! long n_rows = 0;
if (attemptReconnect(cur))
--- 1257,1263 ----
PyObject *rv = 0;
PyObject *rows = 0;
! SQLLEN t;
int n_columns = 0;
! SQLLEN n_rows = 0;
if (attemptReconnect(cur))
***************
*** 1404,1408 ****
}
! rv = PyInt_FromLong(n_rows);
Cleanup:
free(sqlbuf);
--- 1408,1412 ----
}
! rv = PyInt_FromSsize_t(n_rows);
Cleanup:
free(sqlbuf);
***************
*** 1459,1462 ****
--- 1463,1467 ----
/* rc = GetData( ... , bind_area + offset, vsize - offset, &rcode ) */
+ SQLLEN rcode;
Py_BEGIN_ALLOW_THREADS
rc = SQLGetData(cur->hstmt,
***************
*** 1465,1469 ****
(char *)ob->bind_area + cbRead,
ob->vsize - cbRead,
! &ob->rcode);
Py_END_ALLOW_THREADS
if (unsuccessful(rc))
--- 1470,1475 ----
(char *)ob->bind_area + cbRead,
ob->vsize - cbRead,
! &rcode);
! ob->rcode = PyWin_SAFE_DOWNCAST(rcode, SQLLEN, long);
Py_END_ALLOW_THREADS
if (unsuccessful(rc))
***************
*** 1671,1680 ****
char *p;
char buf[255];
! char *firstEqualsSign;
! char *firstSlash;
char dsn[MAX_STR];
char uid[MAX_STR];
char pwd[MAX_STR];
! short connectionStringLength;
firstEqualsSign = strchr(c, '=');
--- 1677,1686 ----
char *p;
char buf[255];
! const char *firstEqualsSign;
! const char *firstSlash;
char dsn[MAX_STR];
char uid[MAX_STR];
char pwd[MAX_STR];
! size_t connectionStringLength;
firstEqualsSign = strchr(c, '=');
Index: win32file.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** win32file.i 14 May 2007 17:10:11 -0000 1.79
--- win32file.i 24 May 2007 06:01:06 -0000 1.80
***************
*** 1185,1189 ****
Py_END_ALLOW_THREADS
PyObject *rc = Py_BuildValue("ilNN", errCode, bytes,
! PyWinLong_FromVoidPtr((void *)key),
PyWinObject_FromQueuedOVERLAPPED(pOverlapped));
return rc;
--- 1185,1189 ----
Py_END_ALLOW_THREADS
PyObject *rc = Py_BuildValue("ilNN", errCode, bytes,
! PyWinObject_FromULONG_PTR(key),
PyWinObject_FromQueuedOVERLAPPED(pOverlapped));
return rc;
***************
*** 3246,3254 ****
if (bSuccess){
obcert_member=PySequence_GetItem(obcert,2);
if (PyString_AsStringAndSize(obcert_member,
(char **)&((*ppec)->pCertBlob->pbData),
! (int *) &((*ppec)->pCertBlob->cbData))==-1){
PyErr_SetString(PyExc_TypeError,"Third item of ENCRYPTION_CERTIFICATE must be a string containing encoded certificate data");
bSuccess=FALSE;
}
Py_DECREF(obcert_member);
--- 3246,3257 ----
if (bSuccess){
obcert_member=PySequence_GetItem(obcert,2);
+ Py_ssize_t cbData;
if (PyString_AsStringAndSize(obcert_member,
(char **)&((*ppec)->pCertBlob->pbData),
! &cbData)==-1){
PyErr_SetString(PyExc_TypeError,"Third item of ENCRYPTION_CERTIFICATE must be a string containing encoded certificate data");
bSuccess=FALSE;
+ } else {
+ (*ppec)->pCertBlob->cbData = PyWin_SAFE_DOWNCAST(cbData, Py_ssize_t, DWORD);
}
Py_DECREF(obcert_member);
***************
*** 3322,3330 ****
ZeroMemory((*ppech)->pHash,sizeof(EFS_HASH_BLOB));
obhash_item=PySequence_GetItem(obhash,1);
if (PyString_AsStringAndSize(obhash_item,
(char **)&((*ppech)->pHash->pbData),
! (int *) &((*ppech)->pHash->cbData))==-1){
PyErr_SetString(PyExc_TypeError,"Second item of ENCRYPTION_CERTIFICATE_HASH tuple must be a string containing encoded certificate data");
bSuccess=FALSE;
}
Py_DECREF(obhash_item);
--- 3325,3336 ----
ZeroMemory((*ppech)->pHash,sizeof(EFS_HASH_BLOB));
obhash_item=PySequence_GetItem(obhash,1);
+ Py_ssize_t cbData;
if (PyString_AsStringAndSize(obhash_item,
(char **)&((*ppech)->pHash->pbData),
! &cbData)==-1){
PyErr_SetString(PyExc_TypeError,"Second item of ENCRYPTION_CERTIFICATE_HASH tuple must be a string containing encoded certificate data");
bSuccess=FALSE;
+ } else {
+ (*ppech)->pHash->cbData = PyWin_SAFE_DOWNCAST(cbData, Py_ssize_t, DWORD);
}
Py_DECREF(obhash_item);
***************
*** 3527,3531 ****
HANDLE h;
BYTE *buf;
! int buflen;
DWORD bytes_requested, bytes_read;
BOOL bAbort,bProcessSecurity;
--- 3533,3537 ----
HANDLE h;
BYTE *buf;
! Py_ssize_t buflen;
DWORD bytes_requested, bytes_read;
BOOL bAbort,bProcessSecurity;
***************
*** 3616,3620 ****
HANDLE h;
BYTE *buf;
! int buflen;
DWORD bytes_to_write, bytes_written;
BOOL bAbort, bProcessSecurity;
--- 3622,3626 ----
HANDLE h;
BYTE *buf;
! Py_ssize_t buflen;
DWORD bytes_to_write, bytes_written;
BOOL bAbort, bProcessSecurity;
Index: win32clipboardmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** win32clipboardmodule.cpp 16 Jan 2007 16:55:51 -0000 1.16
--- win32clipboardmodule.cpp 24 May 2007 06:01:05 -0000 1.17
***************
*** 903,907 ****
// to the new memory.
const void * buf = NULL;
! int bufSize = 0;
if (PyObject_AsReadBuffer(obhandle,&buf,&bufSize)==-1)
--- 903,907 ----
// to the new memory.
const void * buf = NULL;
! Py_ssize_t bufSize = 0;
if (PyObject_AsReadBuffer(obhandle,&buf,&bufSize)==-1)
Index: PyACL.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyACL.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** PyACL.cpp 29 Jul 2005 01:33:08 -0000 1.15
--- PyACL.cpp 24 May 2007 06:01:05 -0000 1.16
***************
*** 987,991 ****
PyACL *This = (PyACL *)self;
PyObject *obexpl=NULL, *obexpl_list=NULL;
! unsigned long expl_cnt=0, expl_ind=0;
DWORD err;
if (!PyArg_ParseTuple(args, "O:SetEntriesInAcl", &obexpl_list))
--- 987,991 ----
PyACL *This = (PyACL *)self;
PyObject *obexpl=NULL, *obexpl_list=NULL;
! Py_ssize_t expl_cnt=0, expl_ind=0;
DWORD err;
if (!PyArg_ParseTuple(args, "O:SetEntriesInAcl", &obexpl_list))
***************
*** 996,1000 ****
}
expl_cnt=PySequence_Length(obexpl_list);
! DWORD bytes_allocated=expl_cnt*sizeof(EXPLICIT_ACCESS_W);
pexpl_start = (PEXPLICIT_ACCESS_W)malloc(bytes_allocated);
ZeroMemory(pexpl_start,bytes_allocated);
--- 996,1000 ----
}
expl_cnt=PySequence_Length(obexpl_list);
! Py_ssize_t bytes_allocated=expl_cnt*sizeof(EXPLICIT_ACCESS_W);
pexpl_start = (PEXPLICIT_ACCESS_W)malloc(bytes_allocated);
ZeroMemory(pexpl_start,bytes_allocated);
***************
*** 1013,1017 ****
pexpl++;
}
! err = ::SetEntriesInAclW(expl_cnt,pexpl_start,This->GetACL(),&new_acl);
if (err!=ERROR_SUCCESS){
PyWin_SetAPIError("SetEntriesInAcl",err);
--- 1013,1018 ----
pexpl++;
}
! err = ::SetEntriesInAclW(PyWin_SAFE_DOWNCAST(expl_cnt, Py_ssize_t, ULONG),
! pexpl_start,This->GetACL(),&new_acl);
if (err!=ERROR_SUCCESS){
PyWin_SetAPIError("SetEntriesInAcl",err);
Index: PyIID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PyIID.cpp 26 May 2004 08:31:44 -0000 1.7
--- PyIID.cpp 24 May 2007 06:01:05 -0000 1.8
***************
*** 22,26 ****
if (isBytes) {
const void *buf;
! int cb;
if (!PyObject_CheckReadBuffer(obIID))
return PyErr_Format(PyExc_TypeError, "object must be a read-buffer to read the CLSID bytes");
--- 22,26 ----
if (isBytes) {
const void *buf;
! Py_ssize_t cb;
if (!PyObject_CheckReadBuffer(obIID))
return PyErr_Format(PyExc_TypeError, "object must be a read-buffer to read the CLSID bytes");
***************
*** 131,135 ****
}
! static int getreadbuf(PyObject *self, int index, const void **ptr)
{
if ( index != 0 ) {
--- 131,135 ----
}
! static Py_ssize_t getreadbuf(PyObject *self, Py_ssize_t index, void **ptr)
{
if ( index != 0 ) {
***************
*** 143,147 ****
}
! static int getsegcount(PyObject *self, int *lenp)
{
if ( lenp )
--- 143,147 ----
}
! static Py_ssize_t getsegcount(PyObject *self, Py_ssize_t *lenp)
{
if ( lenp )
***************
*** 151,158 ****
static PyBufferProcs PyIID_as_buffer = {
! (getreadbufferproc)getreadbuf,
! (getwritebufferproc)0,
! (getsegcountproc)getsegcount,
! (getcharbufferproc)0,
};
--- 151,158 ----
static PyBufferProcs PyIID_as_buffer = {
! getreadbuf,
! 0,
! getsegcount,
! 0,
};
Index: dbi.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** dbi.cpp 7 Oct 2004 03:41:49 -0000 1.8
--- dbi.cpp 24 May 2007 06:01:05 -0000 1.9
***************
*** 26,29 ****
--- 26,33 ----
#include "dbi.h"
+ #ifdef _WIN64
+ # define ctime _ctime32
+ #endif
+
typedef struct
{
Index: PyDEVMODE.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PyDEVMODE.cpp 13 May 2006 12:16:39 -0000 1.5
--- PyDEVMODE.cpp 24 May 2007 06:01:05 -0000 1.6
***************
*** 278,282 ****
{
char *name, *value;
! int valuelen;
name=PyString_AsString(obname);
if (name==NULL)
--- 278,282 ----
{
char *name, *value;
! Py_ssize_t valuelen;
name=PyString_AsString(obname);
if (name==NULL)
|