[pywin32-checkins] pywin32/win32/src/win32net win32netmisc.cpp,1.12,1.13
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-10-21 06:14:11
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7666/win32/src/win32net Modified Files: win32netmisc.cpp Log Message: Finish the excise of the atl unicode conversion macros. Index: win32netmisc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmisc.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32netmisc.cpp 29 Aug 2005 09:51:45 -0000 1.12 --- win32netmisc.cpp 21 Oct 2005 06:14:04 -0000 1.13 *************** *** 12,17 **** #include "stddef.h" - #include "atlbase.h" - #define SI0_ENTRY(name, t, r) { _T(#name), t, offsetof(SHARE_INFO_0, shi0_##name), r } // @object PySHARE_INFO_0|A dictionary holding the infomation in a Win32 SHARE_INFO_0 structure. --- 12,15 ---- *************** *** 281,288 **** **************************************************************************************************************/ // Old style before we got more flexible info levels. ! static PyObject *PyNetShareEnum1(char *szServerName) { - USES_CONVERSION; - DWORD dwLevel = 1; DWORD dwMaxLen = MAX_PREFERRED_LENGTH; --- 279,284 ---- **************************************************************************************************************/ // Old style before we got more flexible info levels. ! static PyObject *PyNetShareEnum1(WCHAR *szServerName) { DWORD dwLevel = 1; DWORD dwMaxLen = MAX_PREFERRED_LENGTH; *************** *** 297,301 **** { Py_BEGIN_ALLOW_THREADS ! Errno = NetShareEnum(A2W(szServerName),dwLevel,(LPBYTE *)&lpBuffer,dwMaxLen,&dwCount,&dwMaxCount,&dwResume); Py_END_ALLOW_THREADS --- 293,297 ---- { Py_BEGIN_ALLOW_THREADS ! Errno = NetShareEnum(szServerName,dwLevel,(LPBYTE *)&lpBuffer,dwMaxLen,&dwCount,&dwMaxCount,&dwResume); Py_END_ALLOW_THREADS *************** *** 310,314 **** do { ! PyObject *t_ob = Py_BuildValue("(sis)",W2A(p_nr->shi1_netname),p_nr->shi1_type,W2A(p_nr->shi1_remark)); int listerr = PyList_Append(pRetlist,t_ob); // append our PyNETRESOURCE obj...Append does an INCREF! --- 306,313 ---- do { ! PyObject *t_ob = Py_BuildValue("(NiN)", ! PyWinObject_FromWCHAR(p_nr->shi1_netname), ! p_nr->shi1_type, ! PyWinObject_FromWCHAR(p_nr->shi1_remark)); int listerr = PyList_Append(pRetlist,t_ob); // append our PyNETRESOURCE obj...Append does an INCREF! *************** *** 355,360 **** // @pyparmalt1 string|serverName||The name of the server on which the call should execute, or None for the local computer. // @comm If the old style is used, the result is a list of [(shareName, type, remarks), ...] ! if (PyArg_ParseTuple(args, "z:NetShareEnum",&szServerName)) ! return PyNetShareEnum1(szServerName); PyErr_Clear(); // Use new style --- 354,366 ---- // @pyparmalt1 string|serverName||The name of the server on which the call should execute, or None for the local computer. // @comm If the old style is used, the result is a list of [(shareName, type, remarks), ...] ! if (PyArg_ParseTuple(args, "z:NetShareEnum",&szServerName)) { ! WCHAR *wServerName = NULL; ! if (szServerName && !PyWin_String_AsWCHAR(szServerName, -1, &wServerName)) ! return NULL; ! PyObject *ret = PyNetShareEnum1(wServerName); ! if (wServerName) ! PyWinObject_FreeString(wServerName); ! return ret; ! } PyErr_Clear(); // Use new style |