[pywin32-checkins] pywin32/win32/src win32apimodule.cpp,1.48,1.49
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-06-28 12:34:52
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19489 Modified Files: win32apimodule.cpp Log Message: * Release the thread-lock during GetUserNameEx, GetComputerNameEx and GetComputerObjectName * win32api.GetConsoleTitle coudl return (0, 'No Error') when the console has no title - return an empty string in this case. Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** win32apimodule.cpp 2 May 2005 03:31:11 -0000 1.48 --- win32apimodule.cpp 28 Jun 2005 12:34:37 -0000 1.49 *************** *** 734,740 **** if (!PyArg_ParseTuple (args, ":GetConsoleTitle")) return NULL; ! char title[128]; // @pyseeapi GetConsoleTitle ! if (GetConsoleTitle(title, sizeof(title))==0) return ReturnAPIError("GetConsoleTitle"); return Py_BuildValue("s", title); --- 734,740 ---- if (!PyArg_ParseTuple (args, ":GetConsoleTitle")) return NULL; ! char title[128] = ""; // @pyseeapi GetConsoleTitle ! if (GetConsoleTitle(title, sizeof(title))==0 && ::GetLastError() != 0) return ReturnAPIError("GetConsoleTitle"); return Py_BuildValue("s", title); *************** *** 769,772 **** --- 769,773 ---- PyObject *ret = NULL; ULONG nSize=0; + BOOL ok; if (!PyArg_ParseTuple (args, "i:GetComputerNameEx", &fmt)) return NULL; *************** *** 780,784 **** if (!formattedname) return PyErr_NoMemory(); ! if (!myGetComputerNameEx(fmt,formattedname,&nSize)){ PyWin_SetAPIError("GetComputerNameEx"); goto done; --- 781,788 ---- if (!formattedname) return PyErr_NoMemory(); ! PyW32_BEGIN_ALLOW_THREADS ! ok = (*myGetComputerNameEx)(fmt,formattedname,&nSize); ! PyW32_END_ALLOW_THREADS ! if (!ok){ PyWin_SetAPIError("GetComputerNameEx"); goto done; *************** *** 802,805 **** --- 806,810 ---- PyObject *ret = NULL; ULONG nSize=0; + BOOL ok; if (!PyArg_ParseTuple (args, "i:GetComputerObjectName", &fmt)) return NULL; *************** *** 813,817 **** if (!formattedname) return PyErr_NoMemory(); ! if (!myGetComputerObjectName(fmt,formattedname,&nSize)){ PyWin_SetAPIError("GetComputerObjectName"); goto done; --- 818,826 ---- if (!formattedname) return PyErr_NoMemory(); ! PyW32_BEGIN_ALLOW_THREADS ! ok = (*myGetComputerObjectName)(fmt,formattedname,&nSize); ! PyW32_END_ALLOW_THREADS ! ! if (!ok){ PyWin_SetAPIError("GetComputerObjectName"); goto done; *************** *** 849,852 **** --- 858,862 ---- PyObject *ret = NULL; ULONG nSize=0; + BOOL ok; if (!PyArg_ParseTuple (args, "i:GetUserNameEx", &fmt)) return NULL; *************** *** 860,864 **** if (!formattedname) return PyErr_NoMemory(); ! if (!myGetUserNameEx(fmt,formattedname,&nSize)){ PyWin_SetAPIError("GetUserNameEx"); goto done; --- 870,877 ---- if (!formattedname) return PyErr_NoMemory(); ! PyW32_BEGIN_ALLOW_THREADS ! ok = (*myGetUserNameEx)(fmt,formattedname,&nSize); ! PyW32_END_ALLOW_THREADS ! if (!ok){ PyWin_SetAPIError("GetUserNameEx"); goto done; |