Update of /cvsroot/pywin32/pywin32/win32/src/win32net
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18346/win32/src/win32net
Modified Files:
win32netfile.cpp win32netmisc.cpp win32netmodule.cpp
Log Message:
Add NetServerComputerNameAdd and NetServerComputerNameDel,
autoduck fixes
Index: win32netmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmodule.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** win32netmodule.cpp 29 Jul 2005 01:33:08 -0000 1.20
--- win32netmodule.cpp 29 Aug 2005 09:51:45 -0000 1.21
***************
*** 1049,1052 ****
--- 1049,1055 ----
extern PyObject * PyNetValidateName(PyObject *self, PyObject *args);
+ extern PyObject * PyNetServerComputerNameAdd(PyObject *self, PyObject *args);
+ extern PyObject * PyNetServerComputerNameDel(PyObject *self, PyObject *args);
+
/* List of functions exported by this module */
// @module win32net|A module encapsulating the Windows Network API.
***************
*** 1126,1129 ****
--- 1129,1134 ----
{"NetFileGetInfo", PyNetFileGetInfo, 1}, // @pymeth NetFileGetInfo|Get info about files open on the server.
{"NetStatisticsGet", PyNetStatisticsGet, 1}, // @pymeth NetStatisticsGet|Return server or workstation stats
+ {"NetServerComputerNameAdd",PyNetServerComputerNameAdd,1}, // @pymeth NetServerComputerNameAdd|Adds an extra network name for a server
+ {"NetServerComputerNameDel",PyNetServerComputerNameDel,1}, // @pymeth NetServerComputerNameDel|Deletes an emulated computer name created by <om win32net.PyNetServerComputerNameAdd>
#if WINVER >= 0x0500
{"NetValidateName", PyNetValidateName, 1}, // @pymeth NetValidateName|Verify that computer/domain name is valid for given context
Index: win32netfile.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netfile.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** win32netfile.cpp 13 Jan 2005 06:29:32 -0000 1.4
--- win32netfile.cpp 29 Aug 2005 09:51:45 -0000 1.5
***************
*** 142,146 ****
}
! // @pymethod (dict,...)|win32net|NetFileClose|Closes an open network resource on a server
PyObject *
PyNetFileClose(PyObject *self, PyObject *args)
--- 142,146 ----
}
! // @pymethod |win32net|NetFileClose|Closes an open network resource on a server
PyObject *
PyNetFileClose(PyObject *self, PyObject *args)
Index: win32netmisc.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmisc.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** win32netmisc.cpp 29 Jul 2005 01:33:08 -0000 1.11
--- win32netmisc.cpp 29 Aug 2005 09:51:45 -0000 1.12
***************
*** 1270,1273 ****
--- 1270,1332 ----
}
+
+
+ // @pymethod |win32net|NetServerComputerNameAdd|Adds an additional network name for a server
+ // @rdesc Returns none on success
+ PyObject * PyNetServerComputerNameAdd(PyObject *self, PyObject *args)
+ {
+ // @pyparm string/<o PyUnicode>|ServerName||Name of server that will receive additional name
+ // @pyparm string/<o PyUnicode>|EmulatedDomainName||Domain under which to add the new server name, can be None
+ // @pyparm string/<o PyUnicode>|EmulatedServerName||New network name that server will respond to
+ NET_API_STATUS err;
+ WCHAR *servername=NULL, *domain=NULL, *newname=NULL;
+ PyObject *observername, *obdomain, *obnewname;
+ PyObject *ret=NULL;
+ if (!PyArg_ParseTuple(args,"OOO", &observername, &obdomain, &obnewname))
+ return NULL;
+ if (PyWinObject_AsWCHAR(observername, &servername, FALSE)
+ &&PyWinObject_AsWCHAR(obdomain, &domain, TRUE)
+ &&PyWinObject_AsWCHAR(obnewname, &newname, FALSE)){
+ err=NetServerComputerNameAdd(servername, domain, newname);
+ if (err==NERR_Success){
+ Py_INCREF(Py_None);
+ ret=Py_None;
+ }
+ else
+ ReturnNetError("NetServerComputerNameAdd", err);
+ }
+ PyWinObject_FreeWCHAR(servername);
+ PyWinObject_FreeWCHAR(domain);
+ PyWinObject_FreeWCHAR(newname);
+ return ret;
+ }
+
+ // @pymethod |win32net|NetServerComputerNameDel|Removes a network name added by <om win32net.NetServerComputerNameAdd>
+ // @rdesc Returns none on success
+ PyObject * PyNetServerComputerNameDel(PyObject *self, PyObject *args)
+ {
+ // @pyparm string/<o PyUnicode>|ServerName||Name of server on which to operate
+ // @pyparm string/<o PyUnicode>|EmulatedServerName||Network name to be removed
+ NET_API_STATUS err;
+ WCHAR *servername=NULL, *newname=NULL;
+ PyObject *observername, *obnewname;
+ PyObject *ret=NULL;
+ if (!PyArg_ParseTuple(args,"OO", &observername, &obnewname))
+ return NULL;
+ if (PyWinObject_AsWCHAR(observername, &servername, FALSE)
+ &&PyWinObject_AsWCHAR(obnewname, &newname, FALSE)){
+ err=NetServerComputerNameDel(servername, newname);
+ if (err==NERR_Success){
+ Py_INCREF(Py_None);
+ ret=Py_None;
+ }
+ else
+ ReturnNetError("NetServerComputerNameDel", err);
+ }
+ PyWinObject_FreeWCHAR(servername);
+ PyWinObject_FreeWCHAR(newname);
+ return ret;
+ }
+
#if WINVER >= 0x0500
|