Commit ae459e13 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Properly L2-encode the NetBIOS scope ID in DeviceIo_VNB, so

ipconfig.exe and winipcfg.exe display it.
parent cb759ba9
...@@ -957,12 +957,26 @@ static BOOL DeviceIo_VNB(DWORD dwIoControlCode, ...@@ -957,12 +957,26 @@ static BOOL DeviceIo_VNB(DWORD dwIoControlCode,
if (NO_ERROR == error) if (NO_ERROR == error)
{ {
info->nodeType = (WORD)fixedInfo->NodeType; info->nodeType = (WORD)fixedInfo->NodeType;
info->scopeLen = max(strlen(fixedInfo->ScopeId) + 1, info->scopeLen = min(strlen(fixedInfo->ScopeId) + 1,
sizeof(info->scope) - 1); sizeof(info->scope) - 2);
memcpy(info->scope, fixedInfo->ScopeId, memcpy(info->scope + 1, fixedInfo->ScopeId,
info->scopeLen); info->scopeLen);
info->scope[info->scopeLen] = '\0'; info->scope[info->scopeLen + 1] = '\0';
/* FIXME: gotta L2-encode the scope ID */ {
/* convert into L2-encoded version */
char *ptr, *lenPtr;
for (ptr = info->scope + 1; *ptr &&
ptr - info->scope < sizeof(info->scope); )
{
for (lenPtr = ptr - 1, *lenPtr = 0;
*ptr && *ptr != '.' &&
ptr - info->scope < sizeof(info->scope);
ptr++)
*lenPtr += 1;
ptr++;
}
}
/* could set DNS servers here too, but since /* could set DNS servers here too, but since
* ipconfig.exe and winipcfg.exe read these from the * ipconfig.exe and winipcfg.exe read these from the
* registry, there's no point */ * registry, there's no point */
......
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