Commit a3bcaca4 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

advapi32: Use GetWindowsAccountDomainSid() to retrieve the domain SID.

parent 8889c862
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment