Author: ion
Date: Fri May 11 01:40:39 2007
New Revision: 26686
URL:
http://svn.reactos.org/svn/reactos?rev=26686&view=rev
Log:
- CmpInitializeMachineDependentConfiguration: Finish up by using the same code as for
System BIOS Version detection for the Video BIOS Detection. This routine should be pretty
much finished now since all required hardware keys are created.
Modified:
trunk/reactos/ntoskrnl/config/i386/cmhardwr.c
Modified: trunk/reactos/ntoskrnl/config/i386/cmhardwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/i386/cmhar…
==============================================================================
--- trunk/reactos/ntoskrnl/config/i386/cmhardwr.c (original)
+++ trunk/reactos/ntoskrnl/config/i386/cmhardwr.c Fri May 11 01:40:39 2007
@@ -646,55 +646,55 @@
/* Close the bios information handle */
NtClose(BiosHandle);
-
- /* Get the BIOS Version */
- if (CmpGetBiosVersion(BaseAddress, 16* PAGE_SIZE, Buffer))
- {
- /* Start at the beginning of our buffer */
- CurrentVersion = BiosVersion;
- do
- {
- /* Convert to Unicode */
- RtlInitAnsiString(&TempString, Buffer);
- RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE);
-
- /* Calculate the length of this string and copy it in */
- Length = Data.Length + sizeof(UNICODE_NULL);
- RtlMoveMemory(CurrentVersion, Data.Buffer, Length);
-
- /* Free the unicode string */
- RtlFreeUnicodeString(&Data);
-
- /* Update the total length and see if we're out of space */
- TotalLength += Length;
- if (TotalLength + 256 + sizeof(UNICODE_NULL) > PAGE_SIZE)
- {
- /* One more string would push us out, so stop here */
- break;
- }
-
- /* Go to the next string inside the multi-string buffer */
- CurrentVersion += Length;
-
- /* Query the next BIOS Version */
- } while (CmpGetBiosVersion(NULL, 0, Buffer));
-
- /* Check if we found any strings at all */
- if (TotalLength)
- {
- /* Add the final null-terminator */
- *(PWSTR)CurrentVersion = UNICODE_NULL;
- TotalLength += sizeof(UNICODE_NULL);
-
- /* Write the BIOS Version to the registry */
- RtlInitUnicodeString(&ValueName,
L"SystemBiosVersion");
- Status = NtSetValueKey(SystemHandle,
- &ValueName,
- 0,
- REG_MULTI_SZ,
- BiosVersion,
- TotalLength);
- }
+ }
+
+ /* Get the BIOS Version */
+ if (CmpGetBiosVersion(BaseAddress, 16* PAGE_SIZE, Buffer))
+ {
+ /* Start at the beginning of our buffer */
+ CurrentVersion = BiosVersion;
+ do
+ {
+ /* Convert to Unicode */
+ RtlInitAnsiString(&TempString, Buffer);
+ RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE);
+
+ /* Calculate the length of this string and copy it in */
+ Length = Data.Length + sizeof(UNICODE_NULL);
+ RtlMoveMemory(CurrentVersion, Data.Buffer, Length);
+
+ /* Free the unicode string */
+ RtlFreeUnicodeString(&Data);
+
+ /* Update the total length and see if we're out of space */
+ TotalLength += Length;
+ if (TotalLength + 256 + sizeof(UNICODE_NULL) > PAGE_SIZE)
+ {
+ /* One more string would push us out, so stop here */
+ break;
+ }
+
+ /* Go to the next string inside the multi-string buffer */
+ CurrentVersion += Length;
+
+ /* Query the next BIOS Version */
+ } while (CmpGetBiosVersion(NULL, 0, Buffer));
+
+ /* Check if we found any strings at all */
+ if (TotalLength)
+ {
+ /* Add the final null-terminator */
+ *(PWSTR)CurrentVersion = UNICODE_NULL;
+ TotalLength += sizeof(UNICODE_NULL);
+
+ /* Write the BIOS Version to the registry */
+ RtlInitUnicodeString(&ValueName, L"SystemBiosVersion");
+ Status = NtSetValueKey(SystemHandle,
+ &ValueName,
+ 0,
+ REG_MULTI_SZ,
+ BiosVersion,
+ TotalLength);
}
}
@@ -741,6 +741,56 @@
RtlFreeUnicodeString(&Data);
}
+ /* Get the Video BIOS Version */
+ if (CmpGetBiosVersion(BaseAddress, 8* PAGE_SIZE, Buffer))
+ {
+ /* Start at the beginning of our buffer */
+ CurrentVersion = BiosVersion;
+ do
+ {
+ /* Convert to Unicode */
+ RtlInitAnsiString(&TempString, Buffer);
+ RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE);
+
+ /* Calculate the length of this string and copy it in */
+ Length = Data.Length + sizeof(UNICODE_NULL);
+ RtlMoveMemory(CurrentVersion, Data.Buffer, Length);
+
+ /* Free the unicode string */
+ RtlFreeUnicodeString(&Data);
+
+ /* Update the total length and see if we're out of space */
+ TotalLength += Length;
+ if (TotalLength + 256 + sizeof(UNICODE_NULL) > PAGE_SIZE)
+ {
+ /* One more string would push us out, so stop here */
+ break;
+ }
+
+ /* Go to the next string inside the multi-string buffer */
+ CurrentVersion += Length;
+
+ /* Query the next BIOS Version */
+ } while (CmpGetBiosVersion(NULL, 0, Buffer));
+
+ /* Check if we found any strings at all */
+ if (TotalLength)
+ {
+ /* Add the final null-terminator */
+ *(PWSTR)CurrentVersion = UNICODE_NULL;
+ TotalLength += sizeof(UNICODE_NULL);
+
+ /* Write the BIOS Version to the registry */
+ RtlInitUnicodeString(&ValueName, L"VideoBiosVersion");
+ Status = NtSetValueKey(SystemHandle,
+ &ValueName,
+ 0,
+ REG_MULTI_SZ,
+ BiosVersion,
+ TotalLength);
+ }
+ }
+
/* Unmap the section */
ZwUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
}