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

advapi32: Return correct short domain name.

Also remove suffix and uppercase the returned name as Windows does. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a3bcaca4
......@@ -786,11 +786,16 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
if (!xdi) return STATUS_NO_MEMORY;
dwSize = MAX_COMPUTERNAME_LENGTH + 1;
if (GetComputerNameW(xdi->domain_name, &dwSize))
if (GetComputerNameExW(ComputerNamePhysicalDnsDomain, xdi->domain_name, &dwSize))
{
WCHAR *dot;
dot = strrchrW(xdi->domain_name, '.');
if (dot) *dot = 0;
struprW(xdi->domain_name);
xdi->info.Name.Buffer = xdi->domain_name;
xdi->info.Name.Length = dwSize * sizeof(WCHAR);
xdi->info.Name.MaximumLength = (dwSize + 1) * sizeof(WCHAR);
xdi->info.Name.Length = strlenW(xdi->domain_name) * sizeof(WCHAR);
xdi->info.Name.MaximumLength = xdi->info.Name.Length + sizeof(WCHAR);
TRACE("setting Name to %s\n", debugstr_w(xdi->info.Name.Buffer));
}
......
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