- CmpInitializeMachineDependentConfiguration: Finish up by using the same code as...
authorAlex Ionescu <aionescu@gmail.com>
Thu, 10 May 2007 21:40:39 +0000 (21:40 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Thu, 10 May 2007 21:40:39 +0000 (21:40 +0000)
svn path=/trunk/; revision=26686

reactos/ntoskrnl/config/i386/cmhardwr.c

index a63e47a..6d728c2 100644 (file)
@@ -646,55 +646,55 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
 \r
             /* Close the bios information handle */\r
             NtClose(BiosHandle);\r
+        }\r
 \r
-            /* Get the BIOS Version */\r
-            if (CmpGetBiosVersion(BaseAddress, 16* PAGE_SIZE, Buffer))\r
+        /* Get the BIOS Version */\r
+        if (CmpGetBiosVersion(BaseAddress, 16* PAGE_SIZE, Buffer))\r
+        {\r
+            /* Start at the beginning of our buffer */\r
+            CurrentVersion = BiosVersion;\r
+            do\r
             {\r
-                /* Start at the beginning of our buffer */\r
-                CurrentVersion = BiosVersion;\r
-                do\r
-                {\r
-                    /* Convert to Unicode */\r
-                    RtlInitAnsiString(&TempString, Buffer);\r
-                    RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE);\r
+                /* Convert to Unicode */\r
+                RtlInitAnsiString(&TempString, Buffer);\r
+                RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE);\r
 \r
-                    /* Calculate the length of this string and copy it in */\r
-                    Length = Data.Length + sizeof(UNICODE_NULL);\r
-                    RtlMoveMemory(CurrentVersion, Data.Buffer, Length);\r
+                /* Calculate the length of this string and copy it in */\r
+                Length = Data.Length + sizeof(UNICODE_NULL);\r
+                RtlMoveMemory(CurrentVersion, Data.Buffer, Length);\r
 \r
-                    /* Free the unicode string */\r
-                    RtlFreeUnicodeString(&Data);\r
+                /* Free the unicode string */\r
+                RtlFreeUnicodeString(&Data);\r
 \r
-                    /* Update the total length and see if we're out of space */\r
-                    TotalLength += Length;\r
-                    if (TotalLength + 256 + sizeof(UNICODE_NULL) > PAGE_SIZE)\r
-                    {\r
-                        /* One more string would push us out, so stop here */\r
-                        break;\r
-                    }\r
+                /* Update the total length and see if we're out of space */\r
+                TotalLength += Length;\r
+                if (TotalLength + 256 + sizeof(UNICODE_NULL) > PAGE_SIZE)\r
+                {\r
+                    /* One more string would push us out, so stop here */\r
+                    break;\r
+                }\r
 \r
-                    /* Go to the next string inside the multi-string buffer */\r
-                    CurrentVersion += Length;\r
+                /* Go to the next string inside the multi-string buffer */\r
+                CurrentVersion += Length;\r
 \r
-                    /* Query the next BIOS Version */\r
-                } while (CmpGetBiosVersion(NULL, 0, Buffer));\r
+                /* Query the next BIOS Version */\r
+            } while (CmpGetBiosVersion(NULL, 0, Buffer));\r
 \r
-                /* Check if we found any strings at all */\r
-                if (TotalLength)\r
-                {\r
-                    /* Add the final null-terminator */\r
-                    *(PWSTR)CurrentVersion = UNICODE_NULL;\r
-                    TotalLength += sizeof(UNICODE_NULL);\r
+            /* Check if we found any strings at all */\r
+            if (TotalLength)\r
+            {\r
+                /* Add the final null-terminator */\r
+                *(PWSTR)CurrentVersion = UNICODE_NULL;\r
+                TotalLength += sizeof(UNICODE_NULL);\r
 \r
-                    /* Write the BIOS Version to the registry */\r
-                    RtlInitUnicodeString(&ValueName, L"SystemBiosVersion");\r
-                    Status = NtSetValueKey(SystemHandle,\r
-                                           &ValueName,\r
-                                           0,\r
-                                           REG_MULTI_SZ,\r
-                                           BiosVersion,\r
-                                           TotalLength);\r
-                }\r
+                /* Write the BIOS Version to the registry */\r
+                RtlInitUnicodeString(&ValueName, L"SystemBiosVersion");\r
+                Status = NtSetValueKey(SystemHandle,\r
+                                       &ValueName,\r
+                                       0,\r
+                                       REG_MULTI_SZ,\r
+                                       BiosVersion,\r
+                                       TotalLength);\r
             }\r
         }\r
 \r
@@ -741,6 +741,56 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
             RtlFreeUnicodeString(&Data);\r
         }\r
 \r
+        /* Get the Video BIOS Version */\r
+        if (CmpGetBiosVersion(BaseAddress, 8* PAGE_SIZE, Buffer))\r
+        {\r
+            /* Start at the beginning of our buffer */\r
+            CurrentVersion = BiosVersion;\r
+            do\r
+            {\r
+                /* Convert to Unicode */\r
+                RtlInitAnsiString(&TempString, Buffer);\r
+                RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE);\r
+\r
+                /* Calculate the length of this string and copy it in */\r
+                Length = Data.Length + sizeof(UNICODE_NULL);\r
+                RtlMoveMemory(CurrentVersion, Data.Buffer, Length);\r
+\r
+                /* Free the unicode string */\r
+                RtlFreeUnicodeString(&Data);\r
+\r
+                /* Update the total length and see if we're out of space */\r
+                TotalLength += Length;\r
+                if (TotalLength + 256 + sizeof(UNICODE_NULL) > PAGE_SIZE)\r
+                {\r
+                    /* One more string would push us out, so stop here */\r
+                    break;\r
+                }\r
+\r
+                /* Go to the next string inside the multi-string buffer */\r
+                CurrentVersion += Length;\r
+\r
+                /* Query the next BIOS Version */\r
+            } while (CmpGetBiosVersion(NULL, 0, Buffer));\r
+\r
+            /* Check if we found any strings at all */\r
+            if (TotalLength)\r
+            {\r
+                /* Add the final null-terminator */\r
+                *(PWSTR)CurrentVersion = UNICODE_NULL;\r
+                TotalLength += sizeof(UNICODE_NULL);\r
+\r
+                /* Write the BIOS Version to the registry */\r
+                RtlInitUnicodeString(&ValueName, L"VideoBiosVersion");\r
+                Status = NtSetValueKey(SystemHandle,\r
+                                       &ValueName,\r
+                                       0,\r
+                                       REG_MULTI_SZ,\r
+                                       BiosVersion,\r
+                                       TotalLength);\r
+            }\r
+        }\r
+\r
         /* Unmap the section */\r
         ZwUnmapViewOfSection(NtCurrentProcess(), BaseAddress);\r
     }\r