Update of /cvsroot/pywin32/pywin32/win32/src/win32net
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23340/win32/src/win32net
Modified Files:
win32net.h win32netfile.cpp win32netmodule.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: win32netmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmodule.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** win32netmodule.cpp 12 Sep 2006 08:22:29 -0000 1.23
--- win32netmodule.cpp 24 May 2007 06:01:06 -0000 1.24
***************
*** 279,291 ****
DWORD level;
BOOL ok = FALSE;
! DWORD resumeHandle = 0;
DWORD numRead, i;
! PyObject *list;
BYTE *buf = NULL;
DWORD totalEntries = 0;
! if (!PyArg_ParseTuple(args, "Oi|ii", &obServer, &level, &resumeHandle, &dwPrefLen))
return NULL;
if (!PyWinObject_AsWCHAR(obServer, &szServer, TRUE))
goto done;
if (!FindNET_STRUCT(level, pInfos, &pInfo))
--- 279,293 ----
DWORD level;
BOOL ok = FALSE;
! DWORD_PTR resumeHandle = 0;
DWORD numRead, i;
! PyObject *list, *obResumeHandle = Py_None;
BYTE *buf = NULL;
DWORD totalEntries = 0;
! if (!PyArg_ParseTuple(args, "Oi|Oi", &obServer, &level, &obResumeHandle, &dwPrefLen))
return NULL;
if (!PyWinObject_AsWCHAR(obServer, &szServer, TRUE))
goto done;
+ if (obResumeHandle != Py_None && !PyWinLong_AsDWORD_PTR(obResumeHandle, &resumeHandle))
+ goto done;
if (!FindNET_STRUCT(level, pInfos, &pInfo))
***************
*** 313,317 ****
}
resumeHandle = err==0 ? 0 : resumeHandle;
! ret = Py_BuildValue("Oll", list, totalEntries, resumeHandle);
Py_DECREF(list);
ok = TRUE;
--- 315,319 ----
}
resumeHandle = err==0 ? 0 : resumeHandle;
! ret = Py_BuildValue("OlN", list, totalEntries, PyWinObject_FromDWORD_PTR(resumeHandle));
Py_DECREF(list);
ok = TRUE;
***************
*** 336,345 ****
DWORD level;
BOOL ok = FALSE;
! DWORD resumeHandle = 0;
DWORD numRead, i;
PyObject *list;
BYTE *buf = NULL;
DWORD totalEntries = 0;
! if (!PyArg_ParseTuple(args, "OOi|ii", &obServer, &obGroup, &level, &resumeHandle, &dwPrefLen))
return NULL;
if (!PyWinObject_AsWCHAR(obServer, &szServer, TRUE))
--- 338,348 ----
DWORD level;
BOOL ok = FALSE;
! DWORD_PTR resumeHandle = 0;
! PyObject *obResumeHandle = Py_None;
DWORD numRead, i;
PyObject *list;
BYTE *buf = NULL;
DWORD totalEntries = 0;
! if (!PyArg_ParseTuple(args, "OOi|Oi", &obServer, &obGroup, &level, &obResumeHandle, &dwPrefLen))
return NULL;
if (!PyWinObject_AsWCHAR(obServer, &szServer, TRUE))
***************
*** 349,352 ****
--- 352,358 ----
goto done;
+ if (obResumeHandle != Py_None && !PyWinLong_AsDWORD_PTR(obResumeHandle, &resumeHandle))
+ goto done;
+
if (!FindNET_STRUCT(level, pInfos, &pInfo))
goto done;
***************
*** 367,371 ****
}
resumeHandle = err==0 ? 0 : resumeHandle;
! ret = Py_BuildValue("Oll", list, totalEntries, resumeHandle);
Py_DECREF(list);
ok = TRUE;
--- 373,377 ----
}
resumeHandle = err==0 ? 0 : resumeHandle;
! ret = Py_BuildValue("OlN", list, totalEntries, PyWinObject_FromDWORD_PTR(resumeHandle));
Py_DECREF(list);
ok = TRUE;
Index: win32netfile.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netfile.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** win32netfile.cpp 29 Aug 2005 09:51:45 -0000 1.5
--- win32netfile.cpp 24 May 2007 06:01:06 -0000 1.6
***************
*** 38,42 ****
DWORD dwEntriesRead= 0;
DWORD dwTotalEntries = 0;
! DWORD dwResumeHandle = 0;
DWORD i;
--- 38,42 ----
DWORD dwEntriesRead= 0;
DWORD dwTotalEntries = 0;
! DWORD_PTR resumeHandle;
DWORD i;
***************
*** 65,69 ****
Py_BEGIN_ALLOW_THREADS
nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl,
! (LPBYTE*)&pBuf2, buff_len, &dwEntriesRead, &dwTotalEntries, &dwResumeHandle);
Py_END_ALLOW_THREADS
--- 65,69 ----
Py_BEGIN_ALLOW_THREADS
nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl,
! (LPBYTE*)&pBuf2, buff_len, &dwEntriesRead, &dwTotalEntries, &resumeHandle);
Py_END_ALLOW_THREADS
***************
*** 98,102 ****
nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl,
(LPBYTE*)&pBuf3, buff_len, &dwEntriesRead,
! &dwTotalEntries, &dwResumeHandle);
Py_END_ALLOW_THREADS
--- 98,102 ----
nStatus = NetFileEnum(server_name, base_path, user_name, info_lvl,
(LPBYTE*)&pBuf3, buff_len, &dwEntriesRead,
! &dwTotalEntries, &resumeHandle);
Py_END_ALLOW_THREADS
Index: win32net.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32net.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** win32net.h 29 Jul 2005 01:33:08 -0000 1.5
--- win32net.h 24 May 2007 06:01:06 -0000 1.6
***************
*** 32,39 ****
// Helpers functions that take a function pointer
! typedef DWORD (__stdcall *PFNSIMPLEENUM)(LPCWSTR, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD );
PyObject *PyDoSimpleEnum(PyObject *self, PyObject *args, PFNSIMPLEENUM pfn, char *fnname, PyNET_STRUCT *pInfos);
! typedef DWORD (__stdcall *PFNNAMEDENUM)(LPCWSTR, LPCWSTR, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, LPDWORD );
PyObject *PyDoNamedEnum(PyObject *self, PyObject *args, PFNNAMEDENUM pfn, char *fnname, PyNET_STRUCT *pInfos);
--- 32,39 ----
// Helpers functions that take a function pointer
! typedef DWORD (__stdcall *PFNSIMPLEENUM)(LPCWSTR, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, PDWORD_PTR );
PyObject *PyDoSimpleEnum(PyObject *self, PyObject *args, PFNSIMPLEENUM pfn, char *fnname, PyNET_STRUCT *pInfos);
! typedef DWORD (__stdcall *PFNNAMEDENUM)(LPCWSTR, LPCWSTR, DWORD, LPBYTE *, DWORD, LPDWORD, LPDWORD, PDWORD_PTR);
PyObject *PyDoNamedEnum(PyObject *self, PyObject *args, PFNNAMEDENUM pfn, char *fnname, PyNET_STRUCT *pInfos);
|