Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1990, 1991 Microsoft Corporation
  3. Module Name:
  4. init.c
  5. Abstract:
  6. This module is responsible to build any mips specific entries in
  7. the hardware tree of registry which the arc environment doesn't
  8. normally provide for.
  9. Author:
  10. Ken Reneris (kenr) 04-Aug-1992
  11. Environment:
  12. Kernel mode.
  13. Revision History:
  14. Nigel Haslock 10-Oct-1995
  15. Set up firmware version and possibly date in the registry.
  16. --*/
  17. #include "cmp.h"
  18. #define TITLE_INDEX_VALUE 0
  19. NTSTATUS
  20. CmpInitializeMachineDependentConfiguration(
  21. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  22. )
  23. /*++
  24. Routine Description:
  25. This routine creates alpha specific entries in the registry.
  26. Arguments:
  27. LoaderBlock - supplies a pointer to the LoaderBlock passed in from the
  28. OS Loader.
  29. Returns:
  30. NTSTATUS code for sucess or reason of failure.
  31. --*/
  32. {
  33. NTSTATUS Status;
  34. UNICODE_STRING KeyName;
  35. UNICODE_STRING ValueName;
  36. UNICODE_STRING ValueData;
  37. ANSI_STRING AnsiString;
  38. OBJECT_ATTRIBUTES ObjectAttributes;
  39. HANDLE ParentHandle;
  40. InitializeObjectAttributes(&ObjectAttributes,
  41. &CmRegistryMachineHardwareDescriptionSystemName,
  42. OBJ_CASE_INSENSITIVE,
  43. NULL,
  44. NULL);
  45. Status = NtOpenKey(&ParentHandle,
  46. KEY_READ,
  47. &ObjectAttributes);
  48. if (NT_SUCCESS(Status)) {
  49. RtlInitUnicodeString(&ValueName,
  50. L"SystemBiosVersion");
  51. RtlInitAnsiString(&AnsiString,
  52. &LoaderBlock->u.Alpha.FirmwareVersion[0]);
  53. RtlAnsiStringToUnicodeString(&ValueData,
  54. &AnsiString,
  55. TRUE);
  56. Status = NtSetValueKey(ParentHandle,
  57. &ValueName,
  58. TITLE_INDEX_VALUE,
  59. REG_SZ,
  60. ValueData.Buffer,
  61. ValueData.Length + sizeof(UNICODE_NULL));
  62. RtlFreeUnicodeString(&ValueData);
  63. //
  64. // If the firmware build number is included in the loader block,
  65. // then store it in the registry.
  66. //
  67. if (LoaderBlock->u.Alpha.FirmwareBuildTimeStamp[0] != 0 ) {
  68. RtlInitUnicodeString(&ValueName,
  69. L"SystemBiosDate");
  70. RtlInitAnsiString(&AnsiString,
  71. &LoaderBlock->u.Alpha.FirmwareBuildTimeStamp[0]);
  72. RtlAnsiStringToUnicodeString(&ValueData,
  73. &AnsiString,
  74. TRUE);
  75. Status = NtSetValueKey(ParentHandle,
  76. &ValueName,
  77. TITLE_INDEX_VALUE,
  78. REG_SZ,
  79. ValueData.Buffer,
  80. ValueData.Length + sizeof(UNICODE_NULL));
  81. RtlFreeUnicodeString(&ValueData);
  82. }
  83. }
  84. return STATUS_SUCCESS;
  85. }