Alexandre Julliard : netapi32: Added support for more info levels in NetWkstaGetInfo.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 7 15:02:30 CST 2007


Module: wine
Branch: master
Commit: 6782d2b49018aa6ac7eb28094c3f64ef5156a5a5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6782d2b49018aa6ac7eb28094c3f64ef5156a5a5

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Mar  7 18:05:57 2007 +0100

netapi32: Added support for more info levels in NetWkstaGetInfo.

---

 dlls/netapi32/wksta.c |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/dlls/netapi32/wksta.c b/dlls/netapi32/wksta.c
index 5774344..ad4b704 100644
--- a/dlls/netapi32/wksta.c
+++ b/dlls/netapi32/wksta.c
@@ -489,7 +489,10 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LPWSTR servername, DWORD level,
     switch (level)
     {
         case 100:
+        case 101:
+        case 102:
         {
+            static const WCHAR lanroot[] = {'c',':','\\','l','a','n','m','a','n',0};  /* FIXME */
             DWORD computerNameLen, domainNameLen, size;
             WCHAR computerName[MAX_COMPUTERNAME_LENGTH + 1];
             LSA_OBJECT_ATTRIBUTES ObjectAttributes;
@@ -512,28 +515,31 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LPWSTR servername, DWORD level,
                 LsaQueryInformationPolicy(PolicyHandle,
                  PolicyAccountDomainInformation, (PVOID*)&DomainInfo);
                 domainNameLen = lstrlenW(DomainInfo->DomainName.Buffer) + 1;
-                size = sizeof(WKSTA_INFO_100) + computerNameLen * sizeof(WCHAR)
-                 + domainNameLen * sizeof(WCHAR);
+                size = sizeof(WKSTA_INFO_102) + computerNameLen * sizeof(WCHAR)
+                    + domainNameLen * sizeof(WCHAR) + sizeof(lanroot);
                 ret = NetApiBufferAllocate(size, (LPVOID *)bufptr);
                 if (ret == NERR_Success)
                 {
-                    PWKSTA_INFO_100 info = (PWKSTA_INFO_100)*bufptr;
+                    /* INFO_100 and INFO_101 structures are subsets of INFO_102 */
+                    PWKSTA_INFO_102 info = (PWKSTA_INFO_102)*bufptr;
                     OSVERSIONINFOW verInfo;
 
-                    info->wki100_platform_id = PLATFORM_ID_NT;
-                    info->wki100_computername = (LPWSTR)(*bufptr +
-                     sizeof(WKSTA_INFO_100));
-                    memcpy(info->wki100_computername, computerName,
+                    info->wki102_platform_id = PLATFORM_ID_NT;
+                    info->wki102_computername = (LPWSTR)(*bufptr +
+                     sizeof(WKSTA_INFO_102));
+                    memcpy(info->wki102_computername, computerName,
                      computerNameLen * sizeof(WCHAR));
-                    info->wki100_langroup = (LPWSTR)(*bufptr +
-                     sizeof(WKSTA_INFO_100) + computerNameLen * sizeof(WCHAR));
-                    memcpy(info->wki100_langroup, DomainInfo->DomainName.Buffer,
+                    info->wki102_langroup = info->wki102_computername + computerNameLen;
+                    memcpy(info->wki102_langroup, DomainInfo->DomainName.Buffer,
                      domainNameLen * sizeof(WCHAR));
+                    info->wki102_lanroot = info->wki102_langroup + domainNameLen;
+                    memcpy(info->wki102_lanroot, lanroot, sizeof(lanroot));
                     memset(&verInfo, 0, sizeof(verInfo));
                     verInfo.dwOSVersionInfoSize = sizeof(verInfo);
                     GetVersionExW(&verInfo);
-                    info->wki100_ver_major = verInfo.dwMajorVersion;
-                    info->wki100_ver_minor = verInfo.dwMinorVersion;
+                    info->wki102_ver_major = verInfo.dwMajorVersion;
+                    info->wki102_ver_minor = verInfo.dwMinorVersion;
+                    info->wki102_logged_on_users = 1;
                 }
                 LsaFreeMemory(DomainInfo);
                 LsaClose(PolicyHandle);




More information about the wine-cvs mailing list