Author: ekohl
Date: Wed Jun 7 22:27:34 2017
New Revision: 74948
URL:
http://svn.reactos.org/svn/reactos?rev=74948&view=rev
Log:
[NETAPI32]
- Implement NetServerDiskEnum, NetServerGetInfo and NetServerSetInfo. These functions call
their counterparts in the server service.
- The new NetServerGetInfo function is disabled because its server side
(NetrServerGetInfo) must be implemented before we can replace the Wine implemenation
without loss of functionality.
Modified:
trunk/reactos/dll/win32/netapi32/netapi32.c
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/srvsvc.c
Modified: trunk/reactos/dll/win32/netapi32/netapi32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.c [iso-8859-1] Wed Jun 7 22:27:34 2017
@@ -80,24 +80,6 @@
FIXME("Stub (%s %d %p %d %p %p %d %s %s)\n",
debugstr_w(ServerName), Level, Bufptr, PrefMaxlen, EntriesRead, totalentries,
servertype, debugstr_w(domain), debugstr_w(FirstNameToReturn));
-
- return ERROR_NO_BROWSER_SERVERS_FOUND;
-}
-
-/************************************************************
- * NetServerDiskEnum (NETAPI32.@)
- */
-NET_API_STATUS WINAPI NetServerDiskEnum(
- LMSTR ServerName,
- DWORD Level,
- LPBYTE *Bufptr,
- DWORD PrefMaxlen,
- LPDWORD EntriesRead,
- LPDWORD totalentries,
- LPDWORD Resume_Handle)
-{
- FIXME("Stub (%s %d %p %d %p %p %p)\n", debugstr_w(ServerName),
- Level, Bufptr, PrefMaxlen, EntriesRead, totalentries, Resume_Handle);
return ERROR_NO_BROWSER_SERVERS_FOUND;
}
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 22:27:34 2017
@@ -211,7 +211,7 @@
@ stdcall NetServerEnum(wstr long ptr long ptr ptr long wstr ptr)
@ stdcall NetServerEnumEx(wstr long ptr long ptr ptr long wstr wstr)
@ stdcall NetServerGetInfo(wstr long ptr)
-@ stub NetServerSetInfo
+@ stdcall NetServerSetInfo(wstr long ptr ptr)
@ stub NetServerTransportAdd
@ stub NetServerTransportAddEx
@ stub NetServerTransportDel
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 22:27:34 2017
@@ -234,6 +234,126 @@
NET_API_STATUS
WINAPI
+NetServerDiskEnum(
+ _In_ LMSTR servername,
+ _In_ DWORD level,
+ _Out_ LPBYTE *bufptr,
+ _In_ DWORD prefmaxlen,
+ _Out_ LPDWORD entriesread,
+ _Out_ LPDWORD totalentries,
+ _Inout_ LPDWORD resume_handle)
+{
+ DISK_ENUM_CONTAINER EnumContainer;
+ NET_API_STATUS status;
+
+ TRACE("NetServerDiskEnum(%s %lu %p %lu %p %p %p)\n",
+ debugstr_w(servername), level, bufptr, prefmaxlen,
+ entriesread, totalentries, resume_handle);
+
+ EnumContainer.EntriesRead = 0;
+ EnumContainer.Buffer = NULL;
+
+ RpcTryExcept
+ {
+ status = NetrServerDiskEnum(servername,
+ level,
+ &EnumContainer,
+ prefmaxlen,
+ totalentries,
+ resume_handle);
+
+ if (EnumContainer.Buffer != NULL)
+ {
+ *bufptr = (LPBYTE)EnumContainer.Buffer;
+ }
+ else
+ {
+ *bufptr = NULL;
+ }
+
+ if (EnumContainer.EntriesRead > 0)
+ {
+ *entriesread = EnumContainer.EntriesRead - 1;
+ }
+ else
+ {
+ *entriesread = 0;
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+#if 0
+NET_API_STATUS
+WINAPI
+NetServerGetInfo(
+ LMSTR servername,
+ DWORD level,
+ LPBYTE *bufptr)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetServerGetInfo(%s %lu %p)\n",
+ debugstr_w(servername), level, bufptr);
+
+ *bufptr = NULL;
+
+ RpcTryExcept
+ {
+ status = NetrServerGetInfo(servername,
+ level,
+ (LPSERVER_INFO)bufptr);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+#endif
+
+
+NET_API_STATUS
+WINAPI
+NetServerSetInfo(
+ _In_ LPWSTR servername,
+ _In_ DWORD level,
+ _In_ LPBYTE buf,
+ _Out_ LPDWORD parm_err)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetServerSetInfo(%s %lu %p %p)\n",
+ debugstr_w(servername), level, buf, parm_err);
+
+ RpcTryExcept
+ {
+ status = NetrServerSetInfo(servername,
+ level,
+ (LPSERVER_INFO)&buf,
+ parm_err);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
NetSessionDel(
_In_ LMSTR servername,
_In_ LMSTR UncClientName,