[ros-diffs] [cgutman] 48638: [NTOSKRNL] - Fix a regression in ACPI function from r48581 - Enable ACPI for testing purposes (will be disabled next commit)

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sun Aug 29 03:49:00 UTC 2010


Author: cgutman
Date: Sun Aug 29 03:48:59 2010
New Revision: 48638

URL: http://svn.reactos.org/svn/reactos?rev=48638&view=rev
Log:
[NTOSKRNL]
- Fix a regression in ACPI function from r48581
- Enable ACPI for testing purposes (will be disabled next commit)

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

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c?rev=48638&r1=48637&r2=48638&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sun Aug 29 03:48:59 2010
@@ -13,7 +13,7 @@
 #define NDEBUG
 #include <debug.h>
 
-//#define ENABLE_ACPI
+#define ENABLE_ACPI
 
 /* GLOBALS *******************************************************************/
 
@@ -2643,32 +2643,30 @@
    if (IopIsAcpiComputer())
    {
       InitializeObjectAttributes(&ObjectAttributes, &HalAcpiDevice, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hRoot, NULL);
-      Status = ZwCreateKey(&hHalAcpiDevice, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, &Disposition);
+      Status = ZwCreateKey(&hHalAcpiDevice, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
       ZwClose(hRoot);
       if (!NT_SUCCESS(Status))
          return Status;
+      InitializeObjectAttributes(&ObjectAttributes, &HalAcpiId, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hHalAcpiDevice, NULL);
+      Status = ZwCreateKey(&hHalAcpiId, KEY_CREATE_SUB_KEY | KEY_SET_VALUE, &ObjectAttributes, 0, NULL, 0, &Disposition);
+      ZwClose(hHalAcpiDevice);
+      if (!NT_SUCCESS(Status))
+          return Status;
       if (Disposition == REG_CREATED_NEW_KEY)
       {
-          InitializeObjectAttributes(&ObjectAttributes, &HalAcpiId, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hHalAcpiDevice, NULL);
-          Status = ZwCreateKey(&hHalAcpiId, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
-          ZwClose(hHalAcpiDevice);
-          if (!NT_SUCCESS(Status))
-              return Status;
           Status = ZwSetValueKey(hHalAcpiId, &DeviceDescU, 0, REG_SZ, HalAcpiDeviceDesc.Buffer, HalAcpiDeviceDesc.MaximumLength);
           if (NT_SUCCESS(Status))
               Status = ZwSetValueKey(hHalAcpiId, &HardwareIDU, 0, REG_MULTI_SZ, HalAcpiHardwareID.Buffer, HalAcpiHardwareID.MaximumLength);
+      }
+      if (NT_SUCCESS(Status))
+      {
+          InitializeObjectAttributes(&ObjectAttributes, &LogConfU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hHalAcpiId, NULL);
+          Status = ZwCreateKey(&hLogConf, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
           if (NT_SUCCESS(Status))
-          {
-              InitializeObjectAttributes(&ObjectAttributes, &LogConfU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hHalAcpiId, NULL);
-              Status = ZwCreateKey(&hLogConf, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
-              if (NT_SUCCESS(Status))
-                  ZwClose(hLogConf);
-          }
-          ZwClose(hHalAcpiId);
-          return Status;
-      }
-      ZwClose(hHalAcpiDevice);
-      return STATUS_SUCCESS;
+              ZwClose(hLogConf);
+      }
+      ZwClose(hHalAcpiId);
+      return Status;
    }
    else
    {




More information about the Ros-diffs mailing list