[pywin32-checkins] pywin32/win32/src/win32net win32netmodule.cpp,1.12,1.13
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2004-03-07 00:10:52
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8411 Modified Files: win32netmodule.cpp Log Message: Wrap out Enum function in a win32 exception handler, to prevent a bad resume handle from crashing Python (now it will raise a win32 error with ERROR_INVALID_PARAMETER Index: win32netmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmodule.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32netmodule.cpp 7 Apr 2003 12:46:32 -0000 1.12 --- win32netmodule.cpp 6 Mar 2004 23:55:39 -0000 1.13 *************** *** 325,331 **** goto done; ! Py_BEGIN_ALLOW_THREADS ! err = (*pfn)(szServer, level, &buf, dwPrefLen, &numRead, &totalEntries, &resumeHandle); ! Py_END_ALLOW_THREADS if (err!=0 && err != ERROR_MORE_DATA) { ReturnNetError(fnname,err); --- 325,342 ---- goto done; ! Py_BEGIN_ALLOW_THREADS ! /* Bad resume handles etc can cause access violations here - catch them. */ ! __try { ! err = (*pfn)(szServer, level, &buf, dwPrefLen, &numRead, &totalEntries, &resumeHandle); ! } ! #if defined(__MINGW32__) || defined(MAINWIN) ! catch(...) ! #else ! __except( EXCEPTION_EXECUTE_HANDLER ) ! #endif ! { ! err = ERROR_INVALID_PARAMETER; ! } ! Py_END_ALLOW_THREADS if (err!=0 && err != ERROR_MORE_DATA) { ReturnNetError(fnname,err); |