Commit e1413fae authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

localspl: Return 0 for the local computer.

parent 79859cb3
......@@ -251,25 +251,26 @@ static LONG copy_servername_from_name(LPCWSTR name, LPWSTR target)
ptr = strchrW(server, '\\');
serverlen = (ptr) ? ptr - server : lstrlenW(server);
/* servername is empty or to long */
/* servername is empty */
if (serverlen == 0) return 0;
TRACE("found %s\n", debugstr_wn(server, serverlen));
if (serverlen > MAX_COMPUTERNAME_LENGTH) return -serverlen;
if (target) {
memcpy(target, server, serverlen * sizeof(WCHAR));
target[serverlen] = '\0';
}
len = sizeof(buffer) / sizeof(buffer[0]);
if (GetComputerNameW(buffer, &len)) {
if ((serverlen == len) && (strncmpiW(server, buffer, len) == 0)) {
/* The requested Servername is our computername */
if (target) {
memcpy(target, server, serverlen * sizeof(WCHAR));
target[serverlen] = '\0';
}
return serverlen;
return 0;
}
}
return 0;
return serverlen;
}
/******************************************************************
......
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