Author: tkreuzer
Date: Tue Feb 18 19:53:48 2014
New Revision: 62249
URL:
http://svn.reactos.org/svn/reactos?rev=62249&view=rev
Log:
[NTOSKRNL]
Fix returned symbolic links in IoGetDeviceInterfaces.
Modified:
trunk/reactos/ntoskrnl/io/iomgr/deviface.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/deviface…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] Tue Feb 18 19:53:48 2014
@@ -466,7 +466,7 @@
goto cleanup;
}
- /* Enumerate subkeys (ie the different device objets) */
+ /* Enumerate subkeys (i.e. the different device objects) */
while (TRUE)
{
Status = ZwEnumerateKey(
@@ -729,14 +729,17 @@
Status = STATUS_UNSUCCESSFUL;
goto cleanup;
}
- KeyName.Length = KeyName.MaximumLength = (USHORT)bip->DataLength - 4 *
sizeof(WCHAR);
- KeyName.Buffer = &((PWSTR)bip->Data)[4];
+ KeyName.Length = KeyName.MaximumLength = (USHORT)bip->DataLength;
+ KeyName.Buffer = (PWSTR)bip->Data;
+
+ /* Fixup the prefix (from "\\?\") */
+ RtlCopyMemory(KeyName.Buffer, L"\\??\\", 4 * sizeof(WCHAR));
/* Add new symbolic link to symbolic link list */
if (ReturnBuffer.Length + KeyName.Length + sizeof(WCHAR) >
ReturnBuffer.MaximumLength)
{
PWSTR NewBuffer;
- ReturnBuffer.MaximumLength = (USHORT)max(ReturnBuffer.MaximumLength * 2,
+ ReturnBuffer.MaximumLength = (USHORT)max(ReturnBuffer.MaximumLength *
sizeof(WCHAR),
(USHORT)(ReturnBuffer.Length +
KeyName.Length +
2 * sizeof(WCHAR)));