Author: ekohl
Date: Wed Jun 7 23:35:09 2017
New Revision: 74949
URL:
http://svn.reactos.org/svn/reactos?rev=74949&view=rev
Log:
[NETAPI32]
Implement NetServerTransportAdd, NetServerTransportAddEx, NetServerTransportDel and
NetServertransportEnum. These functions call their counterparts in the server service.
Modified:
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/srvsvc.c
Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Wed Jun 7 23:35:09 2017
@@ -212,10 +212,10 @@
@ stdcall NetServerEnumEx(wstr long ptr long ptr ptr long wstr wstr)
@ stdcall NetServerGetInfo(wstr long ptr)
@ stdcall NetServerSetInfo(wstr long ptr ptr)
-@ stub NetServerTransportAdd
-@ stub NetServerTransportAddEx
-@ stub NetServerTransportDel
-@ stub NetServerTransportEnum
+@ stdcall NetServerTransportAdd(wstr long ptr)
+@ stdcall NetServerTransportAddEx(wstr long ptr)
+@ stdcall NetServerTransportDel(wstr long ptr)
+@ stdcall NetServerTransportEnum(wstr long ptr long ptr ptr ptr)
@ stub NetServiceControl
@ stub NetServiceEnum
@ stub NetServiceGetInfo
Modified: trunk/reactos/dll/win32/netapi32/srvsvc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/srvsvc.…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/srvsvc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/srvsvc.c [iso-8859-1] Wed Jun 7 23:35:09 2017
@@ -354,6 +354,159 @@
NET_API_STATUS
WINAPI
+NetServerTransportAdd(
+ _In_ LPWSTR servername,
+ _In_ DWORD level,
+ _In_ LPBYTE bufptr)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetServerTransportAdd(%s %lu %p)\n",
+ debugstr_w(servername), level, bufptr);
+
+ RpcTryExcept
+ {
+ status = NetrServerTransportAdd(servername,
+ level,
+ (LPSERVER_TRANSPORT_INFO_0)bufptr);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetServerTransportAddEx(
+ _In_ LPWSTR servername,
+ _In_ DWORD level,
+ _In_ LPBYTE bufptr)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetServerTransportAddEx(%s %lu %p)\n",
+ debugstr_w(servername), level, bufptr);
+
+ RpcTryExcept
+ {
+ status = NetrServerTransportAddEx(servername,
+ level,
+ (LPTRANSPORT_INFO)bufptr);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetServerTransportDel(
+ _In_ LPWSTR servername,
+ _In_ DWORD level,
+ _In_ LPBYTE bufptr)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetServerTransportDel(%s %lu %p)\n",
+ debugstr_w(servername), level, bufptr);
+
+ RpcTryExcept
+ {
+ status = NetrServerTransportDel(servername,
+ level,
+ (LPSERVER_TRANSPORT_INFO_0)bufptr);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetServerTransportEnum(
+ _In_ LPWSTR servername,
+ _In_ DWORD level,
+ _Out_ LPBYTE *bufptr,
+ _In_ DWORD prefmaxlen,
+ _Out_ LPDWORD entriesread,
+ _Out_ LPDWORD totalentries,
+ _Inout_ LPDWORD resume_handle)
+{
+ SERVER_XPORT_ENUM_STRUCT EnumStruct;
+ SERVER_XPORT_INFO_0_CONTAINER Level0Container = {0, NULL};
+ SERVER_XPORT_INFO_1_CONTAINER Level1Container = {0, NULL};
+ NET_API_STATUS status;
+
+ TRACE("NetServerTransportEnum(%s %lu %p %lu %p %p %p)\n",
+ debugstr_w(servername), level, bufptr, prefmaxlen,
+ entriesread, totalentries, resume_handle);
+
+ EnumStruct.Level = level;
+ switch (level)
+ {
+ case 0:
+ EnumStruct.XportInfo.Level0 = &Level0Container;
+ break;
+
+ case 1:
+ EnumStruct.XportInfo.Level1 = &Level1Container;
+ break;
+ }
+
+ RpcTryExcept
+ {
+ status = NetrServerTransportEnum(servername,
+ &EnumStruct,
+ prefmaxlen,
+ totalentries,
+ resume_handle);
+
+ switch (level)
+ {
+ case 0:
+ if (EnumStruct.XportInfo.Level0->Buffer != NULL)
+ {
+ *bufptr = (LPBYTE)EnumStruct.XportInfo.Level0->Buffer;
+ *entriesread = EnumStruct.XportInfo.Level0->EntriesRead;
+ }
+ break;
+
+ case 1:
+ if (EnumStruct.XportInfo.Level1->Buffer != NULL)
+ {
+ *bufptr = (LPBYTE)EnumStruct.XportInfo.Level1->Buffer;
+ *entriesread = EnumStruct.XportInfo.Level1->EntriesRead;
+ }
+ break;
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
NetSessionDel(
_In_ LMSTR servername,
_In_ LMSTR UncClientName,