Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19384/src
Modified Files:
win32apimodule.cpp
Log Message:
Add SetLastError
Index: win32apimodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** win32apimodule.cpp 1 Jul 2006 06:45:37 -0000 1.60
--- win32apimodule.cpp 16 Jul 2006 11:04:20 -0000 1.61
***************
*** 1306,1310 ****
}
! // @pymethod int|win32api|GetLastError|Retrieves the calling threads last error code value.
static PyObject *
PyGetLastError(PyObject * self, PyObject * args)
--- 1306,1310 ----
}
! // @pymethod int|win32api|GetLastError|Retrieves the calling thread's last error code value.
static PyObject *
PyGetLastError(PyObject * self, PyObject * args)
***************
*** 1314,1317 ****
--- 1314,1330 ----
}
+ // @pymethod int|win32api|SetLastError|Sets the calling thread's last error code value.
+ static PyObject *
+ PySetLastError(PyObject * self, PyObject * args)
+ {
+ long errVal;
+ if (!PyArg_ParseTuple(args, "k", &errVal))
+ return NULL;
+ // @pyseeapi SetLastError
+ ::SetLastError(errVal);
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
// @pymethod string|win32api|GetLogicalDriveStrings|Returns a string with all logical drives currently mapped.
static PyObject * PyGetLogicalDriveStrings (PyObject * self, PyObject *args)
***************
*** 4945,4948 ****
--- 4958,4962 ----
{"SetErrorMode", PySetErrorMode, 1}, // @pymeth SetErrorMode|Controls whether the system will handle the specified types of serious errors, or whether the process will handle them.
{"SetFileAttributes", PySetFileAttributes,1}, // @pymeth SetFileAttributes|Sets the named file's attributes.
+ {"SetLastError", PySetLastError, 1}, // @pymeth SetLastError|Sets the last error code known for the current thread.
{"SetSysColors", PySetSysColors, 1}, // @pymeth SetSysColors|Changes color of various window elements
{"SetSystemTime", PySetSystemTime, 1}, // @pymeth SetSystemTime|Sets the system time.
|