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

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Dmitry Timoshkov 2018-03-02 18:44:17 +08:00 committed by Alexandre Julliard
parent 8889c86297
commit a3bcaca48d
2 changed files with 17 additions and 7 deletions

View File

@ -763,16 +763,24 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
break; break;
case PolicyDnsDomainInformation: /* 12 (0xc) */ case PolicyDnsDomainInformation: /* 12 (0xc) */
{ {
struct di struct
{ {
POLICY_DNS_DOMAIN_INFO info; POLICY_DNS_DOMAIN_INFO info;
struct
{
SID sid; SID sid;
DWORD sid_subauthority[3];
} domain_sid;
WCHAR domain_name[MAX_COMPUTERNAME_LENGTH + 1]; WCHAR domain_name[MAX_COMPUTERNAME_LENGTH + 1];
WCHAR dns_domain_name[MAX_COMPUTERNAME_LENGTH + 1]; WCHAR dns_domain_name[MAX_COMPUTERNAME_LENGTH + 1];
WCHAR dns_forest_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; DWORD dwSize;
struct di *xdi;
xdi = heap_alloc_zero(sizeof(*xdi)); xdi = heap_alloc_zero(sizeof(*xdi));
if (!xdi) return STATUS_NO_MEMORY; if (!xdi) return STATUS_NO_MEMORY;
@ -788,10 +796,11 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
/* FIXME: also set DnsDomainName and DnsForestName */ /* 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; xdi->info.Sid = &xdi->domain_sid.sid;
TRACE("setting SID to %s\n", debugstr_sid(&xdi->sid)); TRACE("setting SID to %s\n", debugstr_sid(&xdi->domain_sid.sid));
} }
*Buffer = xdi; *Buffer = xdi;

View File

@ -2245,6 +2245,7 @@ WINBASEAPI BOOL WINAPI GetVolumePathNameW(LPCWSTR,LPWSTR,DWORD);
WINBASEAPI BOOL WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR,LPSTR,DWORD,PDWORD); WINBASEAPI BOOL WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR,LPSTR,DWORD,PDWORD);
WINBASEAPI BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD); WINBASEAPI BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD);
#define GetVolumePathNamesForVolumeName WINELIB_NAME_AW(GetVolumePathNamesForVolumeName) #define GetVolumePathNamesForVolumeName WINELIB_NAME_AW(GetVolumePathNamesForVolumeName)
WINADVAPI BOOL WINAPI GetWindowsAccountDomainSid(PSID,PSID,DWORD*);
WINBASEAPI UINT WINAPI GetWindowsDirectoryA(LPSTR,UINT); WINBASEAPI UINT WINAPI GetWindowsDirectoryA(LPSTR,UINT);
WINBASEAPI UINT WINAPI GetWindowsDirectoryW(LPWSTR,UINT); WINBASEAPI UINT WINAPI GetWindowsDirectoryW(LPWSTR,UINT);
#define GetWindowsDirectory WINELIB_NAME_AW(GetWindowsDirectory) #define GetWindowsDirectory WINELIB_NAME_AW(GetWindowsDirectory)