Author: ekohl
Date: Tue Feb 24 22:15:58 2015
New Revision: 66441
URL:
http://svn.reactos.org/svn/reactos?rev=66441&view=rev
Log:
[NETAPI32]
Implement the client side of NetWkstaSetInfo and NetWkstaUserEnum.
Modified:
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/wksta.c
trunk/reactos/dll/win32/netapi32/wksta_new.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] Tue Feb 24 22:15:58 2015
@@ -254,10 +254,10 @@
@ stub NetValidatePasswordPolicy
@ stub NetValidatePasswordPolicyFree
@ stdcall NetWkstaGetInfo(wstr long ptr)
-@ stub NetWkstaSetInfo
+@ stdcall NetWkstaSetInfo(wstr long ptr ptr)
@ stub NetWkstaTransportAdd
@ stub NetWkstaTransportDel
-@ stdcall NetWkstaTransportEnum (wstr long ptr long ptr ptr ptr)
+@ stdcall NetWkstaTransportEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetWkstaUserEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetWkstaUserGetInfo(wstr long ptr)
@ stub NetWkstaUserSetInfo
Modified: trunk/reactos/dll/win32/netapi32/wksta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta.c…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] Tue Feb 24 22:15:58 2015
@@ -417,6 +417,7 @@
/************************************************************
* NetWkstaUserEnum (NETAPI32.@)
*/
+#if 0
NET_API_STATUS WINAPI
NetWkstaUserEnum(LMSTR servername, DWORD level, LPBYTE* bufptr,
DWORD prefmaxlen, LPDWORD entriesread,
@@ -426,6 +427,7 @@
level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
return ERROR_INVALID_PARAMETER;
}
+#endif
/************************************************************
* NetpGetComputerName (NETAPI32.@)
Modified: trunk/reactos/dll/win32/netapi32/wksta_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta_n…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/wksta_new.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/wksta_new.c [iso-8859-1] Tue Feb 24 22:15:58 2015
@@ -171,7 +171,7 @@
NET_API_STATUS
WINAPI
NetWkstaGetInfo(
- LMSTR servername,
+ LPWSTR servername,
DWORD level,
LPBYTE *bufptr)
{
@@ -194,4 +194,102 @@
return status;
}
+
+NET_API_STATUS
+WINAPI
+NetWkstaSetInfo(
+ LPWSTR servername,
+ DWORD level,
+ LPBYTE buffer,
+ LPDWORD parm_err)
+{
+ NET_API_STATUS status;
+
+ RpcTryExcept
+ {
+ status = NetrWkstaSetInfo(servername,
+ level,
+ (LPWKSTA_INFO)buffer,
+ parm_err);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetWkstaUserEnum(
+ LMSTR servername,
+ DWORD level,
+ LPBYTE *bufptr,
+ DWORD prefmaxlen,
+ LPDWORD entriesread,
+ LPDWORD totalentries,
+ LPDWORD resumehandle)
+{
+ WKSTA_USER_ENUM_STRUCT UserEnumInfo;
+ WKSTA_USER_INFO_0_CONTAINER Level0;
+ WKSTA_USER_INFO_1_CONTAINER Level1;
+ NET_API_STATUS status;
+
+ TRACE("(%s, %d, %p, %d, %p, %p, %p): stub!\n", debugstr_w(servername),
+ level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
+
+ UserEnumInfo.Level = level;
+ switch (level)
+ {
+ case 0:
+ UserEnumInfo.WkstaUserInfo.Level0 = &Level0;
+ UserEnumInfo.WkstaUserInfo.Level0->EntriesRead = 0;
+ UserEnumInfo.WkstaUserInfo.Level0->Buffer = NULL;
+ break;
+
+ case 1:
+ UserEnumInfo.WkstaUserInfo.Level1 = &Level1;
+ UserEnumInfo.WkstaUserInfo.Level1->EntriesRead = 0;
+ UserEnumInfo.WkstaUserInfo.Level1->Buffer = NULL;
+ break;
+
+ default:
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ RpcTryExcept
+ {
+ status = NetrWkstaUserEnum(servername,
+ &UserEnumInfo,
+ prefmaxlen,
+ totalentries,
+ resumehandle);
+ if (status == NERR_Success || status == ERROR_MORE_DATA)
+ {
+ switch (level)
+ {
+ case 0:
+ *bufptr = (LPBYTE)UserEnumInfo.WkstaUserInfo.Level0->Buffer;
+ *entriesread = UserEnumInfo.WkstaUserInfo.Level0->EntriesRead;
+ break;
+
+ case 1:
+ *bufptr = (LPBYTE)UserEnumInfo.WkstaUserInfo.Level1->Buffer;
+ *entriesread = UserEnumInfo.WkstaUserInfo.Level1->EntriesRead;
+ break;
+ }
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
/* EOF */