diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c index 6f51f9df574..f2fcc0701b0 100644 --- a/dlls/advapi32/lsa.c +++ b/dlls/advapi32/lsa.c @@ -763,16 +763,24 @@ NTSTATUS WINAPI LsaQueryInformationPolicy( break; case PolicyDnsDomainInformation: /* 12 (0xc) */ { - struct di + struct { POLICY_DNS_DOMAIN_INFO info; - SID sid; + struct + { + SID sid; + DWORD sid_subauthority[3]; + } domain_sid; WCHAR domain_name[MAX_COMPUTERNAME_LENGTH + 1]; WCHAR dns_domain_name[MAX_COMPUTERNAME_LENGTH + 1]; WCHAR dns_forest_name[MAX_COMPUTERNAME_LENGTH + 1]; - }; + } *xdi; + struct + { + SID sid; + DWORD sid_subauthority[3]; + } computer_sid; DWORD dwSize; - struct di *xdi; xdi = heap_alloc_zero(sizeof(*xdi)); if (!xdi) return STATUS_NO_MEMORY; @@ -788,10 +796,11 @@ NTSTATUS WINAPI LsaQueryInformationPolicy( /* FIXME: also set DnsDomainName and DnsForestName */ - if (ADVAPI_GetComputerSid(&xdi->sid)) + dwSize = sizeof(xdi->domain_sid); + if (ADVAPI_GetComputerSid(&computer_sid.sid) && GetWindowsAccountDomainSid(&computer_sid.sid, &xdi->domain_sid.sid, &dwSize)) { - xdi->info.Sid = &xdi->sid; - TRACE("setting SID to %s\n", debugstr_sid(&xdi->sid)); + xdi->info.Sid = &xdi->domain_sid.sid; + TRACE("setting SID to %s\n", debugstr_sid(&xdi->domain_sid.sid)); } *Buffer = xdi; diff --git a/include/winbase.h b/include/winbase.h index e47c87a544e..9c7908acb5b 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2245,6 +2245,7 @@ WINBASEAPI BOOL WINAPI GetVolumePathNameW(LPCWSTR,LPWSTR,DWORD); WINBASEAPI BOOL WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR,LPSTR,DWORD,PDWORD); WINBASEAPI BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD); #define GetVolumePathNamesForVolumeName WINELIB_NAME_AW(GetVolumePathNamesForVolumeName) +WINADVAPI BOOL WINAPI GetWindowsAccountDomainSid(PSID,PSID,DWORD*); WINBASEAPI UINT WINAPI GetWindowsDirectoryA(LPSTR,UINT); WINBASEAPI UINT WINAPI GetWindowsDirectoryW(LPWSTR,UINT); #define GetWindowsDirectory WINELIB_NAME_AW(GetWindowsDirectory)