setupapi: Creating SymbolicLink value in registry as in Windows XP.
This commit is contained in:
parent
c4fb0f236e
commit
b622101ef2
|
@ -244,7 +244,7 @@ static LPWSTR SETUPDI_CreateSymbolicLinkPath(LPCWSTR instanceId,
|
||||||
/* omit length of format specifiers, but include NULL terminator: */
|
/* omit length of format specifiers, but include NULL terminator: */
|
||||||
len = lstrlenW(fmt) - 4 + 1;
|
len = lstrlenW(fmt) - 4 + 1;
|
||||||
len += lstrlenW(instanceId) + lstrlenW(guidStr);
|
len += lstrlenW(instanceId) + lstrlenW(guidStr);
|
||||||
if (ReferenceString)
|
if (ReferenceString && *ReferenceString)
|
||||||
{
|
{
|
||||||
/* space for a hash between string and reference string: */
|
/* space for a hash between string and reference string: */
|
||||||
len += lstrlenW(ReferenceString) + 1;
|
len += lstrlenW(ReferenceString) + 1;
|
||||||
|
@ -258,10 +258,10 @@ static LPWSTR SETUPDI_CreateSymbolicLinkPath(LPCWSTR instanceId,
|
||||||
/* replace '\\' with '#' after the "\\\\?\\" beginning */
|
/* replace '\\' with '#' after the "\\\\?\\" beginning */
|
||||||
for (ptr = strchrW(ret + 4, '\\'); ptr; ptr = strchrW(ptr + 1, '\\'))
|
for (ptr = strchrW(ret + 4, '\\'); ptr; ptr = strchrW(ptr + 1, '\\'))
|
||||||
*ptr = '#';
|
*ptr = '#';
|
||||||
if (ReferenceString)
|
if (ReferenceString && *ReferenceString)
|
||||||
{
|
{
|
||||||
ret[printed - 1] = '\\';
|
ret[printed] = '\\';
|
||||||
lstrcpyW(ret + printed, ReferenceString);
|
lstrcpyW(ret + printed + 1, ReferenceString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue