[NETAPI32]
[reactos.git] / reactos / dll / win32 / netapi32 / wksta.c
index 4e5d8d6..616833c 100644 (file)
@@ -310,7 +310,12 @@ NET_API_STATUS WINAPI NetWkstaUserGetInfo(LMSTR reserved, DWORD level,
                 (lstrlenW(ui->wkui0_username) + 1) * sizeof(WCHAR),
                 (LPVOID *) bufptr);
             if (nastatus != NERR_Success)
+            {
+                NetApiBufferFree(ui);
                 return nastatus;
+            }
+            ui = (PWKSTA_USER_INFO_0) *bufptr;
+            ui->wkui0_username = (LMSTR) (*bufptr + sizeof(WKSTA_USER_INFO_0));
         }
         break;
     }
@@ -504,11 +509,11 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level,
                 ret = LsaNtStatusToWinError(NtStatus);
             else
             {
-                PPOLICY_ACCOUNT_DOMAIN_INFO DomainInfo;
+                PPOLICY_PRIMARY_DOMAIN_INFO DomainInfo;
 
                 LsaQueryInformationPolicy(PolicyHandle,
-                 PolicyAccountDomainInformation, (PVOID*)&DomainInfo);
-                domainNameLen = lstrlenW(DomainInfo->DomainName.Buffer) + 1;
+                 PolicyPrimaryDomainInformation, (PVOID*)&DomainInfo);
+                domainNameLen = lstrlenW(DomainInfo->Name.Buffer) + 1;
                 size = sizeof(WKSTA_INFO_102) + computerNameLen * sizeof(WCHAR)
                     + domainNameLen * sizeof(WCHAR) + sizeof(lanroot);
                 ret = NetApiBufferAllocate(size, (LPVOID *)bufptr);
@@ -524,7 +529,7 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level,
                     memcpy(info->wki102_computername, computerName,
                      computerNameLen * sizeof(WCHAR));
                     info->wki102_langroup = info->wki102_computername + computerNameLen;
-                    memcpy(info->wki102_langroup, DomainInfo->DomainName.Buffer,
+                    memcpy(info->wki102_langroup, DomainInfo->Name.Buffer,
                      domainNameLen * sizeof(WCHAR));
                     info->wki102_lanroot = info->wki102_langroup + domainNameLen;
                     memcpy(info->wki102_lanroot, lanroot, sizeof(lanroot));
@@ -566,4 +571,3 @@ NET_API_STATUS NET_API_FUNCTION NetGetJoinInformation(
 
     return NERR_Success;
 }
-