[pywin32-checkins] pywin32/win32/src win32rasmodule.cpp,1.9,1.10
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2007-07-12 07:40:26
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12498/win32/src Modified Files: win32rasmodule.cpp Log Message: 64bit changes Index: win32rasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32rasmodule.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32rasmodule.cpp 24 May 2007 06:01:06 -0000 1.9 --- win32rasmodule.cpp 12 Jul 2007 07:40:26 -0000 1.10 *************** *** 64,68 **** strcpy(buf,"No error message is available"); /* strip trailing cr/lf */ ! int end = strlen(buf)-1; if (end>1 && (buf[end-1]=='\n' || buf[end-1]=='\r')) buf[end-1] = '\0'; --- 64,68 ---- strcpy(buf,"No error message is available"); /* strip trailing cr/lf */ ! size_t end = strlen(buf)-1; if (end>1 && (buf[end-1]=='\n' || buf[end-1]=='\r')) buf[end-1] = '\0'; *************** *** 202,210 **** // @prop integer|reserved| else if (strcmp(name, "reserved")==0) ! return PyInt_FromLong(py->m_ext.reserved); #if (WINVER >= 0x500) // @prop integer|reserved1| else if (strcmp(name, "reserved1")==0) ! return PyInt_FromLong( py->m_ext.reserved1); // @prop <o RASEAPINFO>|RasEapInfo| else if (strcmp(name, "RasEapInfo")==0) { --- 202,210 ---- // @prop integer|reserved| else if (strcmp(name, "reserved")==0) ! return PyWinObject_FromULONG_PTR(py->m_ext.reserved); #if (WINVER >= 0x500) // @prop integer|reserved1| else if (strcmp(name, "reserved1")==0) ! return PyWinObject_FromULONG_PTR(py->m_ext.reserved1); // @prop <o RASEAPINFO>|RasEapInfo| else if (strcmp(name, "RasEapInfo")==0) { *************** *** 300,306 **** } char *dest; ! int size = PyObject_Length(ob); int dest_size; ! for (int num=0;num<size;num++) { switch (num) { #define GET_BUF_AND_SIZE(name) dest=p->name;dest_size=sizeof(p->name)/sizeof(p->name[0]) --- 300,306 ---- } char *dest; ! size_t size = PyObject_Length(ob); int dest_size; ! for (size_t num=0;num<size;num++) { switch (num) { #define GET_BUF_AND_SIZE(name) dest=p->name;dest_size=sizeof(p->name)/sizeof(p->name[0]) *************** *** 356,360 **** if (obHandleMap) { // NOTE: As we hold the thread lock, assume noone else can mod this dict. ! PyObject *key = PyInt_FromLong((long)hrasconn); if (key==NULL) return; handler = PyDict_GetItem( obHandleMap, key ); --- 356,360 ---- if (obHandleMap) { // NOTE: As we hold the thread lock, assume noone else can mod this dict. ! PyObject *key = PyWinLong_FromVoidPtr(hrasconn); if (key==NULL) return; handler = PyDict_GetItem( obHandleMap, key ); *************** *** 397,410 **** PyRasCreatePhonebookEntry( PyObject *self, PyObject *args ) { - int hwnd; DWORD rc; LPTSTR fileName = NULL; ! if (!PyArg_ParseTuple(args, "i|s:CreatePhoneBookEntry", ! &hwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName )) // @pyparm string|fileName|None|Specifies the filename of the phonebook entry. Currently this is ignored. return NULL; ! if (hwnd != 0 && !IsWindow((HWND)hwnd)) return ReturnError("The first parameter must be a valid window handle", "<CreatePhonebookEntry param conversion>"); ! if ((rc=RasCreatePhonebookEntry((HWND)hwnd, fileName ))) return ReturnRasError("RasCreatePhonebookEntry",rc); // @pyseeapi RasCreatePhonebookEntry Py_INCREF(Py_None); --- 397,413 ---- PyRasCreatePhonebookEntry( PyObject *self, PyObject *args ) { DWORD rc; LPTSTR fileName = NULL; ! PyObject *obhwnd; ! if (!PyArg_ParseTuple(args, "O|s:CreatePhoneBookEntry", ! &obhwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName )) // @pyparm string|fileName|None|Specifies the filename of the phonebook entry. Currently this is ignored. return NULL; ! HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) ! return NULL; ! if (hwnd != 0 && !IsWindow(hwnd)) return ReturnError("The first parameter must be a valid window handle", "<CreatePhonebookEntry param conversion>"); ! if ((rc=RasCreatePhonebookEntry(hwnd, fileName ))) return ReturnRasError("RasCreatePhonebookEntry",rc); // @pyseeapi RasCreatePhonebookEntry Py_INCREF(Py_None); *************** *** 445,449 **** notType = 1; } else if (PyInt_Check(obCallback)) { ! pNotification = (LPVOID)PyInt_AsLong(obCallback); notType = 0xFFFFFFFF; } else --- 448,453 ---- notType = 1; } else if (PyInt_Check(obCallback)) { ! if (!PyWinLong_AsVoidPtr(obCallback, &pNotification)) ! return NULL; notType = 0xFFFFFFFF; } else *************** *** 486,502 **** PyRasEditPhonebookEntry( PyObject *self, PyObject *args ) { - int hwnd; DWORD rc; LPTSTR fileName; LPTSTR entryName; ! if (!PyArg_ParseTuple(args, "izs:EditPhoneBookEntry", ! &hwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName, // @pyparm string|fileName||Specifies the filename of the phonebook entry, or None. Currently this is ignored. &entryName )) // @pyparm string|entryName|None|Specifies the name of the phonebook entry to edit return NULL; ! if (hwnd != 0 && !IsWindow((HWND)hwnd)) return ReturnError("The first parameter must be a valid window handle", "<EditPhonebookEntry param parsing>"); Py_BEGIN_ALLOW_THREADS ! rc=RasEditPhonebookEntry((HWND)hwnd, fileName, entryName ); Py_END_ALLOW_THREADS if (rc) --- 490,509 ---- PyRasEditPhonebookEntry( PyObject *self, PyObject *args ) { DWORD rc; LPTSTR fileName; LPTSTR entryName; ! PyObject *obhwnd; ! if (!PyArg_ParseTuple(args, "Ozs:EditPhoneBookEntry", ! &obhwnd, // @pyparm int|hWnd||Handle to the parent window of the dialog box. &fileName, // @pyparm string|fileName||Specifies the filename of the phonebook entry, or None. Currently this is ignored. &entryName )) // @pyparm string|entryName|None|Specifies the name of the phonebook entry to edit return NULL; ! HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) ! return NULL; ! if (hwnd != 0 && !IsWindow(hwnd)) return ReturnError("The first parameter must be a valid window handle", "<EditPhonebookEntry param parsing>"); Py_BEGIN_ALLOW_THREADS ! rc=RasEditPhonebookEntry(hwnd, fileName, entryName ); Py_END_ALLOW_THREADS if (rc) *************** *** 605,612 **** PyRasGetConnectStatus( PyObject *self, PyObject *args ) { - HRASCONN hras; DWORD rc; ! if (!PyArg_ParseTuple(args, "i:GetConnectStatus", ! &hras )) // @pyparm int|hrasconn||Handle to the RAS session. return NULL; RASCONNSTATUS cs; --- 612,622 ---- PyRasGetConnectStatus( PyObject *self, PyObject *args ) { DWORD rc; ! PyObject *obras; ! if (!PyArg_ParseTuple(args, "O:GetConnectStatus", ! &obras )) // @pyparm int|hrasconn||Handle to the RAS session. ! return NULL; ! HRASCONN hras; ! if (!PyWinObject_AsHANDLE(obras, (HANDLE *)&hras)) return NULL; RASCONNSTATUS cs; |