[NTOSKRNL]
authorCameron Gutman <aicommander@gmail.com>
Wed, 28 Apr 2010 20:06:28 +0000 (20:06 +0000)
committerCameron Gutman <aicommander@gmail.com>
Wed, 28 Apr 2010 20:06:28 +0000 (20:06 +0000)
- Fix length calculation of symbolic links with reference strings attached
- Fixes opening registry keys for symbolic links with reference strings (such as audio devices)

svn path=/trunk/; revision=47056

reactos/ntoskrnl/io/iomgr/deviface.c

index 7d97336..fa1b1a3 100644 (file)
@@ -127,7 +127,7 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,
     {
         ReferenceString.Buffer[0] = L'#';
 
-        SubKeyName.Length = ReferenceString.Buffer - SubKeyName.Buffer;
+        SubKeyName.Length = (USHORT)((ULONG_PTR)(ReferenceString.Buffer) - (ULONG_PTR)SubKeyName.Buffer);
         ReferenceString.Length = SymbolicLinkName->Length - SubKeyName.Length;
     }
     else