advapi32: Use larger buffers for domain names.

Otherwise GetComputerNameExW(ComputerNamePhysicalDnsDomain) and
GetComputerNameExW(ComputerNameDnsDomain) fail if the names don't
fit into MAX_COMPUTERNAME_LENGTH characters.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-03-29 09:52:48 +08:00 committed by Alexandre Julliard
parent 40b46d900a
commit 923f7246be
1 changed files with 5 additions and 5 deletions

View File

@ -771,9 +771,9 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
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];
WCHAR domain_name[256];
WCHAR dns_domain_name[256];
WCHAR dns_forest_name[256];
} *xdi;
struct
{
@ -785,7 +785,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
xdi = heap_alloc_zero(sizeof(*xdi));
if (!xdi) return STATUS_NO_MEMORY;
dwSize = MAX_COMPUTERNAME_LENGTH + 1;
dwSize = 256;
if (GetComputerNameExW(ComputerNamePhysicalDnsDomain, xdi->domain_name, &dwSize))
{
WCHAR *dot;
@ -799,7 +799,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
TRACE("setting Name to %s\n", debugstr_w(xdi->info.Name.Buffer));
}
dwSize = MAX_COMPUTERNAME_LENGTH + 1;
dwSize = 256;
if (GetComputerNameExW(ComputerNameDnsDomain, xdi->dns_domain_name, &dwSize))
{
xdi->info.DnsDomainName.Buffer = xdi->dns_domain_name;