implement NetUserModalsGet

Magnus Olsen magnus at itkonsult-olsen.com
Thu Dec 15 16:45:57 CST 2005


Hi
I have implement NetUserModalsGet u can found a small program example in
msdn. for it.  ms web studio express installer using this api.

url : if some whant download the patch file. instead doing cute and past
url : http://greatlord.com/files/NetUserModalsGet.zip

bestregards
Magnus Olsen
(GreatLord ReactOS devloper)


Index: wine/dlls/netapi32/access.c
===================================================================
RCS file: /home/wine/wine/dlls/netapi32/access.c,v
retrieving revision 1.11
diff -u -r1.11 access.c
--- wine/dlls/netapi32/access.c 21 Nov 2005 11:59:27 -0000 1.11
+++ wine/dlls/netapi32/access.c 15 Dec 2005 21:35:00 -0000
@@ -551,10 +551,46 @@
 /************************************************************
  *                NetUserModalsGet  (NETAPI32.@)
  */
-NET_API_STATUS WINAPI NetUserModalsGet(LPCWSTR szServer, DWORD level,
LPBYTE *pbuffer)
+NET_API_STATUS WINAPI NetUserModalsGet(LPCWSTR servername, DWORD level,
LPBYTE *pbuffer)
 {
-    FIXME("(%s %ld %p) stub!\n", debugstr_w(szServer), level, pbuffer);
+    TRACE("(%s %ld %p)!\n", debugstr_w(servername), level, pbuffer);
-    return NERR_InternalError;
+    switch (level)
+    {
+           case 0:
+           case 1:
+           case 2:
+           case 3:
+                {
+                  LPWSTR username = NULL;
+                  DWORD  dwSize;
+                  DWORD status;
+
+                  dwSize = UNLEN + 1;
+
+                  NetApiBufferAllocate(dwSize, (LPVOID *) username);
+                  if (username == NULL)
+                  {
+                     return ERROR_ACCESS_DENIED;
+                  }
+
+                  if (!GetUserNameW(username, &dwSize))
+                  {
+                      NetApiBufferFree(username);
+                      return ERROR_ACCESS_DENIED;
+                  }
+
+                status = NetUserGetInfo(servername, username, level,
pbuffer);
+                NetApiBufferFree(username);
+                return status;
+                break;
+                }
+
+           default:
+                ERR("Invalid level %ld is specified\n", level);
+                return ERROR_ACCESS_DENIED;
+    }
+
+    return ERROR_ACCESS_DENIED;
 }

 /************************************************************







More information about the wine-patches mailing list