[pywin32-checkins] pywin32/win32/src win32apimodule.cpp,1.63,1.64
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2006-09-09 03:35:59
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7697 Modified Files: win32apimodule.cpp Log Message: Add GetModuleFileNameW Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** win32apimodule.cpp 31 Aug 2006 02:50:01 -0000 1.63 --- win32apimodule.cpp 9 Sep 2006 03:35:57 -0000 1.64 *************** *** 1394,1398 **** if (rc==0) return ReturnAPIError("GetModuleFileName"); ! return Py_BuildValue("s",buf); } --- 1394,1416 ---- if (rc==0) return ReturnAPIError("GetModuleFileName"); ! return PyString_FromString(buf); ! } ! ! // @pymethod unicode|win32api|GetModuleFileNameW|Retrieves the unicode filename of the specified module. ! static PyObject * ! PyGetModuleFileNameW(PyObject * self, PyObject * args) ! { ! int iMod; ! wchar_t buf[_MAX_PATH]; ! // @pyparm int|hModule||Specifies the handle to the module. ! if (!PyArg_ParseTuple(args, "i:GetModuleFileNameW", &iMod)) ! return (NULL); ! // @pyseeapi GetModuleFileName ! PyW32_BEGIN_ALLOW_THREADS ! long rc = ::GetModuleFileNameW( (HMODULE)iMod, buf, sizeof(buf)); ! PyW32_END_ALLOW_THREADS ! if (rc==0) ! return ReturnAPIError("GetModuleFileNameW"); ! return PyUnicode_FromUnicode(buf, wcslen(buf)); } *************** *** 4906,4909 **** --- 4924,4928 ---- {"GetLogicalDriveStrings", PyGetLogicalDriveStrings, 1}, // @pymeth GetLogicalDriveStrings|Returns a list of strings for all the drives. {"GetModuleFileName", PyGetModuleFileName,1}, // @pymeth GetModuleFileName|Retrieves the filename of the specified module. + {"GetModuleFileNameW", PyGetModuleFileNameW,1}, // @pymeth GetModuleFileNameW|Retrieves the unicode filename of the specified module. {"GetModuleHandle", PyGetModuleHandle,1}, // @pymeth GetModuleHandle|Returns the handle of an already loaded DLL. {"GetProfileSection", PyGetProfileSection,1}, // @pymeth GetProfileSection|Returns a list of entries in an INI file. |