Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19745/win32/src
Modified Files:
Tag: AMD64
PyDEVMODE.cpp PyIID.cpp PySECURITY_DESCRIPTOR.cpp PySID.cpp
PyTime.cpp PyUnicode.cpp PyWinTypes.h dbi.cpp odbc.cpp
win32api_display.cpp win32clipboardmodule.cpp
win32credmodule.cpp win32security_sspi.cpp
Log Message:
- Initial work on AMD64 support
Index: dbi.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -d -r1.8 -r1.8.2.1
*** dbi.cpp 7 Oct 2004 03:41:49 -0000 1.8
--- dbi.cpp 21 Dec 2006 23:17:16 -0000 1.8.2.1
***************
*** 92,96 ****
{
long l = PyInt_AsLong(dbiValue(o));
! return PyString_FromStringAndSize(ctime(&l), 24); /* less \n */
}
--- 92,96 ----
{
long l = PyInt_AsLong(dbiValue(o));
! return PyString_FromStringAndSize(ctime((const time_t *)&l), 24); /* less \n */
}
Index: win32credmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32credmodule.cpp,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** win32credmodule.cpp 8 Sep 2006 06:49:55 -0000 1.2
--- win32credmodule.cpp 21 Dec 2006 23:17:16 -0000 1.2.2.1
***************
*** 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));
***************
*** 421,425 ****
// @flag CertCredential|String containing the SHA1 hash of user's certificate
case CertCredential:{
! int hashlen;
char *hash;
if (PyString_AsStringAndSize(obcredential, &hash, &hashlen)==-1)
--- 421,425 ----
// @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.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** PyTime.cpp 26 Aug 2006 08:26:37 -0000 1.17
--- PyTime.cpp 21 Dec 2006 23:17:16 -0000 1.17.2.1
***************
*** 410,414 ****
/* "Normal" Win32 handling */
m_time = 0;
! struct tm *ptm = localtime(&t);
if (ptm != NULL) { // otherwise an invalid integer
--- 410,414 ----
/* "Normal" Win32 handling */
m_time = 0;
! struct tm *ptm = localtime((const time_t *)&t);
if (ptm != NULL) { // otherwise an invalid integer
Index: PyUnicode.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyUnicode.cpp,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -C2 -d -r1.21 -r1.21.2.1
*** PyUnicode.cpp 4 Jul 2005 05:39:03 -0000 1.21
--- PyUnicode.cpp 21 Dec 2006 23:17:16 -0000 1.21.2.1
***************
*** 27,31 ****
BOOL rc = TRUE;
if (PyString_Check(stringObject)) {
! int cch=PyString_Size(stringObject);
const char *buf = PyString_AsString(stringObject);
if (buf==NULL) return FALSE;
--- 27,31 ----
BOOL rc = TRUE;
if (PyString_Check(stringObject)) {
! Py_ssize_t cch=PyString_Size(stringObject);
const char *buf = PyString_AsString(stringObject);
if (buf==NULL) return FALSE;
Index: odbc.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** odbc.cpp 24 May 2006 08:40:41 -0000 1.17
--- odbc.cpp 21 Dec 2006 23:17:16 -0000 1.17.2.1
***************
*** 533,537 ****
ob->bind_area,
vsize,
! &ob->rcode)))
{
cursorError(cur, "BIND");
--- 533,537 ----
ob->bind_area,
vsize,
! (SQLLEN *)&ob->rcode)))
{
cursorError(cur, "BIND");
***************
*** 682,686 ****
ib->bind_area,
len,
! &ib->len)))
{
cursorError(cur, "input-binding");
--- 682,686 ----
ib->bind_area,
len,
! (SQLLEN *)&ib->len)))
{
cursorError(cur, "input-binding");
***************
*** 712,716 ****
ib->bind_area,
len,
! &ib->len)))
{
cursorError(cur, "input-binding");
--- 712,716 ----
ib->bind_area,
len,
! (SQLLEN *)&ib->len)))
{
cursorError(cur, "input-binding");
***************
*** 742,746 ****
0,
0,
! &nl)))
{
cursorError(cur, "input-binding");
--- 742,746 ----
0,
0,
! (SQLLEN *)&nl)))
{
cursorError(cur, "input-binding");
***************
*** 761,765 ****
TIMESTAMP_STRUCT *dt = (TIMESTAMP_STRUCT*) ib->bind_area ;
! struct tm *gt = localtime(&val);
dt->year = 1900 + gt->tm_year;
--- 761,765 ----
TIMESTAMP_STRUCT *dt = (TIMESTAMP_STRUCT*) ib->bind_area ;
! struct tm *gt = localtime((const time_t *)&val);
dt->year = 1900 + gt->tm_year;
***************
*** 781,785 ****
ib->bind_area,
len,
! &ib->len)))
{
cursorError(cur, "input-binding");
--- 781,785 ----
ib->bind_area,
len,
! (SQLLEN *)&ib->len)))
{
cursorError(cur, "input-binding");
***************
*** 814,818 ****
ib->bind_area,
len,
! &ib->len);
if (unsuccessful(rc))
{
--- 814,818 ----
ib->bind_area,
len,
! (SQLLEN *)&ib->len);
if (unsuccessful(rc))
{
***************
*** 844,848 ****
ib->bind_area,
sizeof(double),
! &ib->len)))
{
cursorError(cur, "input-binding");
--- 844,848 ----
ib->bind_area,
sizeof(double),
! (SQLLEN *)&ib->len)))
{
cursorError(cur, "input-binding");
***************
*** 886,890 ****
ib->bind_area,
len,
! &NTS);
if (unsuccessful(rc))
{
--- 886,890 ----
ib->bind_area,
len,
! (SQLLEN *)&NTS);
if (unsuccessful(rc))
{
***************
*** 931,935 ****
ib->bind_area,
nbytes,
! &NTS);
if (unsuccessful(rc))
{
--- 931,935 ----
ib->bind_area,
nbytes,
! (SQLLEN *)&NTS);
if (unsuccessful(rc))
{
***************
*** 1082,1086 ****
&nsize,
&vtype,
! &vsize,
&scale,
&nullok);
--- 1082,1086 ----
&nsize,
&vtype,
! (SQLULEN *)&vsize,
&scale,
&nullok);
***************
*** 1359,1363 ****
/* Note: multiple result sets aren't supported here, just bulk inserts... */
Py_BEGIN_ALLOW_THREADS
! SQLRowCount(cur->hstmt, &t);
Py_END_ALLOW_THREADS
n_rows += t;
--- 1359,1363 ----
/* Note: multiple result sets aren't supported here, just bulk inserts... */
Py_BEGIN_ALLOW_THREADS
! SQLRowCount(cur->hstmt, (SQLLEN *)&t);
Py_END_ALLOW_THREADS
n_rows += t;
***************
*** 1400,1404 ****
{
n_rows = 1; /* just in case it does not work */
! SQLRowCount(cur->hstmt, &n_rows);
}
}
--- 1400,1404 ----
{
n_rows = 1; /* just in case it does not work */
! SQLRowCount(cur->hstmt, (SQLLEN *)&n_rows);
}
}
***************
*** 1465,1469 ****
(char *)ob->bind_area + cbRead,
ob->vsize - cbRead,
! &ob->rcode);
Py_END_ALLOW_THREADS
if (unsuccessful(rc))
--- 1465,1469 ----
(char *)ob->bind_area + cbRead,
ob->vsize - cbRead,
! (SQLLEN *)&ob->rcode);
Py_END_ALLOW_THREADS
if (unsuccessful(rc))
Index: win32api_display.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32api_display.cpp,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** win32api_display.cpp 12 Jul 2006 11:30:01 -0000 1.3
--- win32api_display.cpp 21 Dec 2006 23:17:16 -0000 1.3.2.1
***************
*** 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: win32clipboardmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C2 -d -r1.15 -r1.15.2.1
*** win32clipboardmodule.cpp 2 Dec 2005 07:50:47 -0000 1.15
--- win32clipboardmodule.cpp 21 Dec 2006 23:17:16 -0000 1.15.2.1
***************
*** 902,906 ****
PyObject *obBuf;
const void * buf = NULL;
! int bufSize = 0;
if (!PyArg_ParseTuple(args, "iO:SetClipboardData",
&format, &obBuf))
--- 902,906 ----
PyObject *obBuf;
const void * buf = NULL;
! Py_ssize_t bufSize = 0;
if (!PyArg_ParseTuple(args, "iO:SetClipboardData",
&format, &obBuf))
Index: PyIID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -d -r1.7 -r1.7.2.1
*** PyIID.cpp 26 May 2004 08:31:44 -0000 1.7
--- PyIID.cpp 21 Dec 2006 23:17:16 -0000 1.7.2.1
***************
*** 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");
***************
*** 151,158 ****
static PyBufferProcs PyIID_as_buffer = {
! (getreadbufferproc)getreadbuf,
! (getwritebufferproc)0,
! (getsegcountproc)getsegcount,
! (getcharbufferproc)0,
};
--- 151,158 ----
static PyBufferProcs PyIID_as_buffer = {
! (readbufferproc)getreadbuf,
! (writebufferproc)0,
! (segcountproc)getsegcount,
! (charbufferproc)0,
};
Index: PyDEVMODE.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** PyDEVMODE.cpp 13 May 2006 12:16:39 -0000 1.5
--- PyDEVMODE.cpp 21 Dec 2006 23:17:16 -0000 1.5.2.1
***************
*** 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)
Index: win32security_sspi.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security_sspi.cpp,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** win32security_sspi.cpp 13 Feb 2006 14:42:35 -0000 1.6
--- win32security_sspi.cpp 21 Dec 2006 23:17:16 -0000 1.6.2.1
***************
*** 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)
Index: PySID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** PySID.cpp 27 Oct 2005 12:26:00 -0000 1.11
--- PySID.cpp 21 Dec 2006 23:17:16 -0000 1.11.2.1
***************
*** 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");
***************
*** 191,198 ****
static PyBufferProcs PySID_as_buffer = {
! (getreadbufferproc)PySID::getreadbuf,
! (getwritebufferproc)0,
! (getsegcountproc)PySID::getsegcount,
! (getcharbufferproc)0,
};
--- 191,198 ----
static PyBufferProcs PySID_as_buffer = {
! (readbufferproc)PySID::getreadbuf,
! (writebufferproc)0,
! (segcountproc)PySID::getsegcount,
! (charbufferproc)0,
};
Index: PyWinTypes.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v
retrieving revision 1.30
retrieving revision 1.30.2.1
diff -C2 -d -r1.30 -r1.30.2.1
*** PyWinTypes.h 3 Aug 2006 02:46:30 -0000 1.30
--- PyWinTypes.h 21 Dec 2006 23:17:16 -0000 1.30.2.1
***************
*** 29,32 ****
--- 29,51 ----
#endif
+ // For backwards compatibility, see PEP 353
+ #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+ typedef int Py_ssize_t;
+ #define PY_SSIZE_T_MAX INT_MAX
+ #define PY_SSIZE_T_MIN INT_MIN
+ #define readbufferproc getreadbufferproc
+ #define writebufferproc getwritebufferproc
+ #define segcountproc getsegcountproc
+ #define charbufferproc getcharbufferproc
+ #endif
+
+ #ifdef _M_AMD64
+ typedef DWORDLONG DWORD_EX;
+ #elif defined (_M_IX86)
+ typedef DWORD DWORD_EX;
+ #else
+ #error !!! Need to write code for this architecture
+ #endif
+
// *** NOTE *** FREEZE_PYWINTYPES is deprecated. It used to be used
// by the 'freeze' tool, but now py2exe etc do a far better job, and
Index: PySECURITY_DESCRIPTOR.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -d -r1.18 -r1.18.2.1
*** PySECURITY_DESCRIPTOR.cpp 4 Dec 2006 04:56:08 -0000 1.18
--- PySECURITY_DESCRIPTOR.cpp 21 Dec 2006 23:17:16 -0000 1.18.2.1
***************
*** 83,89 ****
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);
if (((PySECURITY_DESCRIPTOR *)ret)->GetSD()==NULL){
if (!PyErr_Occurred())
--- 83,89 ----
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);
if (((PySECURITY_DESCRIPTOR *)ret)->GetSD()==NULL){
if (!PyErr_Occurred())
***************
*** 699,706 ****
static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = {
! (getreadbufferproc)PySECURITY_DESCRIPTOR::getreadbuf,
! (getwritebufferproc)0,
! (getsegcountproc)PySECURITY_DESCRIPTOR::getsegcount,
! (getcharbufferproc)0,
};
--- 699,706 ----
static PyBufferProcs PySECURITY_DESCRIPTOR_as_buffer = {
! (readbufferproc)PySECURITY_DESCRIPTOR::getreadbuf,
! (writebufferproc)0,
! (segcountproc)PySECURITY_DESCRIPTOR::getsegcount,
! (charbufferproc)0,
};
|