[NTOSKRNL]
[reactos.git] / reactos / ntoskrnl / config / cmconfig.c
index 7aae14d..a0f66ac 100644 (file)
@@ -16,6 +16,7 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 CmpInitializeRegistryNode(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
                           IN HANDLE NodeHandle,
                           OUT PHANDLE NewHandle,
@@ -66,7 +67,12 @@ CmpInitializeRegistryNode(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
 
         /* Convert it to Unicode */
         RtlInitEmptyUnicodeString(&KeyName, Buffer, sizeof(Buffer));
-        RtlAnsiStringToUnicodeString(&KeyName, &TempString, FALSE);
+        Status = RtlAnsiStringToUnicodeString(&KeyName, &TempString, FALSE);
+        if (!NT_SUCCESS(Status))
+        {
+            NtClose(KeyHandle);
+            return Status;
+        }
 
         /* Create the key */
         ParentHandle = KeyHandle;
@@ -195,6 +201,7 @@ CmpInitializeRegistryNode(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
                           IN HANDLE ParentHandle,
                           IN INTERFACE_TYPE InterfaceType,
@@ -219,7 +226,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
             {
                 /* EISA */
                 case EisaAdapter:
-                    
+
                     /* Fixup information */
                     Interface = Eisa;
                     Bus = CmpTypeCount[EisaAdapter]++;
@@ -227,7 +234,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
 
                 /* Turbo-channel */
                 case TcAdapter:
-                    
+
                     /* Fixup information */
                     Interface = TurboChannel;
                     Bus = CmpTypeCount[TurboChannel]++;
@@ -235,7 +242,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
 
                 /* ISA, PCI, etc busses */
                 case MultiFunctionAdapter:
-                    
+
                     /* Check if we have an  identifier */
                     if (Component->Identifier)
                     {
@@ -250,7 +257,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
                                 break;
                             }
                         }
-                        
+
                         /* Fix up information */
                         Interface = CmpMultifunctionTypes[i].InterfaceType;
                         Bus = CmpMultifunctionTypes[i].Count++;
@@ -259,7 +266,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
 
                 /* SCSI Bus */
                 case ScsiAdapter:
-                    
+
                     /* Fix up */
                     Interface = Internal;
                     Bus = CmpTypeCount[ScsiAdapter]++;
@@ -272,7 +279,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
                     break;
             }
         }
-        
+
         /* Dump information on the component */
 
         /* Setup the hardware node */
@@ -283,7 +290,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
                                            Bus,
                                            DeviceIndexTable);
         if (!NT_SUCCESS(Status)) return Status;
-        
+
         /* Check for children */
         if (CurrentEntry->Child)
         {
@@ -299,18 +306,19 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
                 return Status;
             }
         }
-        
+
         /* Get to the next entry */
         NtClose(NewHandle);
         CurrentEntry = CurrentEntry->Sibling;
     }
-    
+
     /* We're done */
     return STATUS_SUCCESS;
 }
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {
     NTSTATUS Status;
@@ -390,8 +398,3 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
     NtClose(KeyHandle);
     return Status;
 }
-
-
-
-
-