[ros-diffs] [fireball] 27137: - Fix a bug with querying registry values (a typo, spotted/fixed by Herve). - Fix a problem when a device, which was already in the list is freed and memory corruption is introduced.

fireball at svn.reactos.org fireball at svn.reactos.org
Mon Jun 11 15:35:42 CEST 2007


Author: fireball
Date: Mon Jun 11 17:35:42 2007
New Revision: 27137

URL: http://svn.reactos.org/svn/reactos?rev=27137&view=rev
Log:
- Fix a bug with querying registry values (a typo, spotted/fixed by Herve).
- Fix a problem when a device, which was already in the list is freed and memory corruption is introduced.

Modified:
    trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c?rev=27137&r1=27136&r2=27137&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Mon Jun 11 17:35:42 2007
@@ -331,7 +331,7 @@
   UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\" REGSTR_PATH_SYSTEMENUM "\\" REGSTR_KEY_ROOTENUM);
   UNICODE_STRING SubKeyName;
   WCHAR DevicePath[MAX_PATH + 1];
-  RTL_QUERY_REGISTRY_TABLE QueryTable[4];
+  RTL_QUERY_REGISTRY_TABLE QueryTable[5];
   PPNPROOT_DEVICE Device = NULL;
   HANDLE KeyHandle = INVALID_HANDLE_VALUE;
   HANDLE SubKeyHandle = INVALID_HANDLE_VALUE;
@@ -502,9 +502,9 @@
         QueryTable[2].QueryRoutine = QueryBinaryValueCallback;
         QueryTable[2].Name = L"BasicConfigVector";
         QueryTable[2].EntryContext = &Buffer1;
-        QueryTable[2].QueryRoutine = QueryBinaryValueCallback;
-        QueryTable[2].Name = L"BootConfig";
-        QueryTable[2].EntryContext = &Buffer2;
+        QueryTable[3].QueryRoutine = QueryBinaryValueCallback;
+        QueryTable[3].Name = L"BootConfig";
+        QueryTable[3].EntryContext = &Buffer2;
 
         Status = RtlQueryRegistryValues(
           RTL_REGISTRY_HANDLE,
@@ -526,8 +526,8 @@
           &DeviceExtension->DeviceListHead,
           &Device->ListEntry);
         DeviceExtension->DeviceListCount++;
-        Device = NULL;
       }
+      Device = NULL;
 
       Index2++;
     }




More information about the Ros-diffs mailing list