[pywin32-checkins] pywin32/win32/src/win32net win32net.h,1.3,1.4 win32netmodule.cpp,1.18,1.19
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-06-08 01:34:33
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20006/src/win32net Modified Files: win32net.h win32netmodule.cpp Log Message: Add NetGetJoinInformation and related constants. Index: win32netmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmodule.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** win32netmodule.cpp 13 Jan 2005 00:10:26 -0000 1.18 --- win32netmodule.cpp 8 Jun 2005 01:34:25 -0000 1.19 *************** *** 39,42 **** --- 39,44 ---- #include "assert.h" + NetGetJoinInformationfunc pfnNetGetJoinInformation=NULL; + /*****************************************************************************/ /* error helpers */ *************** *** 940,943 **** --- 942,975 ---- } + // @pymethod <o PyUnicode>, int|win32net|NetGetJoinInformation|Retrieves join status information for the specified computer. + static PyObject *PyNetGetJoinInformation(PyObject *self, PyObject *args) + { + PyObject *obServer = Py_None; + WCHAR *server = NULL;; + WCHAR *result = NULL; + PyObject *ret = NULL; + NET_API_STATUS err; + NETSETUP_JOIN_STATUS status; + if (!PyArg_ParseTuple(args, "|O:NetGetJoinInformation", &obServer)) + return NULL; + if (pfnNetGetJoinInformation==NULL){ + PyErr_SetString(PyExc_NotImplementedError,"NetGetJoinInformation does not exist on this platform"); + goto done; + } + if (!PyWinObject_AsWCHAR(obServer, &server, TRUE)) + goto done; + Py_BEGIN_ALLOW_THREADS + err = (*pfnNetGetJoinInformation)(server, &result, &status); + Py_END_ALLOW_THREADS + if (err) { + ReturnNetError("NetGetJoinInformation", err); + goto done; + } + ret = Py_BuildValue("Nl", PyWinObject_FromWCHAR(result), status); + done: + PyWinObject_FreeWCHAR(server); + NetApiBufferFree(result); + return ret; + } /************************************************************************************************************* ** *************** *** 1014,1017 **** --- 1046,1050 ---- // @module win32net|A module encapsulating the Windows Network API. static struct PyMethodDef win32net_functions[] = { + {"NetGetJoinInformation", PyNetGetJoinInformation, 1}, // @pymeth NetGetJoinInformation|Retrieves join status information for the specified computer. {"NetGroupGetInfo", PyNetGroupGetInfo, 1}, // @pymeth NetGroupGetInfo|Retrieves information about a particular group on a server. {"NetGroupGetUsers", PyNetGroupGetUsers, 1}, // @pymeth NetGroupGetUsers|Enumerates the users in a group. *************** *** 1120,1124 **** if (hmodule==NULL) hmodule=LoadLibrary(_T("netapi32")); ! if (hmodule!=NULL) pfnNetValidateName=(NetValidateNamefunc)GetProcAddress(hmodule,"NetValidateName"); } --- 1153,1159 ---- if (hmodule==NULL) hmodule=LoadLibrary(_T("netapi32")); ! if (hmodule!=NULL) { pfnNetValidateName=(NetValidateNamefunc)GetProcAddress(hmodule,"NetValidateName"); + pfnNetGetJoinInformation=(NetGetJoinInformationfunc)GetProcAddress(hmodule,"NetGetJoinInformation"); + } } Index: win32net.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32net.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32net.h 12 Jan 2005 07:38:10 -0000 1.3 --- win32net.h 8 Jun 2005 01:34:24 -0000 1.4 *************** *** 63,64 **** --- 63,67 ---- typedef NET_API_STATUS (NET_API_FUNCTION *NetValidateNamefunc)(LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR, NETSETUP_NAME_TYPE); extern NetValidateNamefunc pfnNetValidateName; + + typedef NET_API_STATUS (NET_API_FUNCTION *NetGetJoinInformationfunc)(LPCWSTR, LPWSTR *, PNETSETUP_JOIN_STATUS); + extern NetGetJoinInformationfunc pfnNetGetJoinInformation; |