Commit 09cd2787 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

advapi32: Initialize more fields in LsaQueryInformationPolicy(PolicyDnsDomainInformation).

parent 652090f5
......@@ -160,9 +160,8 @@ static void test_sysinfo(void)
ok(hr == S_OK, "got %#x\n", hr);
IDispatch_Release(dispatch);
hr = IADsADSystemInfo_get_UserName(sysinfo, &bstr);
todo_wine
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NONE_MAPPED), "got %#x\n", hr);
hr = IADsADSystemInfo_get_ComputerName(sysinfo, &bstr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_CANT_ACCESS_DOMAIN_INFO), "got %#x\n", hr);
if (hr != S_OK)
{
skip("Computer is not part of a domain, skipping the tests\n");
......@@ -171,7 +170,7 @@ todo_wine
}
SysFreeString(bstr);
hr = IADsADSystemInfo_get_ComputerName(sysinfo, &bstr);
hr = IADsADSystemInfo_get_UserName(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
if (hr == S_OK) SysFreeString(bstr);
......
......@@ -763,16 +763,38 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
break;
case PolicyDnsDomainInformation: /* 12 (0xc) */
{
/* Only the domain name is valid for the local computer.
* All other fields are zero.
*/
PPOLICY_DNS_DOMAIN_INFO pinfo;
struct di
{
POLICY_DNS_DOMAIN_INFO info;
SID sid;
WCHAR domain_name[MAX_COMPUTERNAME_LENGTH + 1];
WCHAR dns_domain_name[MAX_COMPUTERNAME_LENGTH + 1];
WCHAR dns_forest_name[MAX_COMPUTERNAME_LENGTH + 1];
};
DWORD dwSize;
struct di *xdi;
pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name));
xdi = heap_alloc_zero(sizeof(*xdi));
if (!xdi) return STATUS_NO_MEMORY;
TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
dwSize = MAX_COMPUTERNAME_LENGTH + 1;
if (GetComputerNameW(xdi->domain_name, &dwSize))
{
xdi->info.Name.Buffer = xdi->domain_name;
xdi->info.Name.Length = dwSize * sizeof(WCHAR);
xdi->info.Name.MaximumLength = (dwSize + 1) * sizeof(WCHAR);
TRACE("setting Name to %s\n", debugstr_w(xdi->info.Name.Buffer));
}
*Buffer = pinfo;
/* FIXME: also set DnsDomainName and DnsForestName */
if (ADVAPI_GetComputerSid(&xdi->sid))
{
xdi->info.Sid = &xdi->sid;
TRACE("setting SID to %s\n", debugstr_sid(&xdi->sid));
}
*Buffer = xdi;
}
break;
case PolicyAuditLogInformation:
......
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