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.

150 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. bootx86.h
  5. Abstract:
  6. Code to do
  7. Author:
  8. Sunil Pai (sunilp) 26-Oct-1993
  9. Revision History:
  10. --*/
  11. #define FLEXBOOT_SECTION1 "[flexboot]"
  12. #define FLEXBOOT_SECTION2 "[boot loader]"
  13. #define FLEXBOOT_SECTION3 "[multiboot]"
  14. #define BOOTINI_OS_SECTION "[operating systems]"
  15. #define TIMEOUT "timeout"
  16. #define DEFAULT "default"
  17. #define CRLF "\r\n"
  18. #define EQUALS "="
  19. #define WBOOT_INI L"boot.ini"
  20. #define WBOOT_INI_BAK L"bootini.bak"
  21. //
  22. // Use this to keep track of boot.ini entries
  23. // that previously contained 'signatured' entries
  24. // since we convert them to multi... enties when
  25. // we initially read the boot.ini. Rather than
  26. // work backwards, we'll just use this struct
  27. // to re-match the boot.ini entries when we're
  28. // about to write it out, thus giving us a shortcut
  29. // to determining which boot.ini entries need to
  30. // have the 'signature' entry.
  31. //
  32. typedef struct _SIGNATURED_PARTITIONS {
  33. struct _SIGNATURED_PARTITIONS *Next;
  34. //
  35. // What's the original boot.ini entry with that contained
  36. // the signature?
  37. //
  38. PWSTR SignedString;
  39. //
  40. // What's the boot.ini entry after we've converted it into
  41. // a 'multi' string?
  42. //
  43. PWSTR MultiString;
  44. } SIGNATURED_PARTITIONS;
  45. extern SIGNATURED_PARTITIONS SignedBootVars;
  46. //
  47. // Public routines
  48. //
  49. BOOLEAN
  50. Spx86InitBootVars(
  51. OUT PWSTR **BootVars,
  52. OUT PWSTR *Default,
  53. OUT PULONG Timeout
  54. );
  55. BOOLEAN
  56. Spx86FlushBootVars(
  57. IN PWSTR **BootVars,
  58. IN ULONG Timeout,
  59. IN PWSTR Default
  60. );
  61. VOID
  62. SpLayBootCode(
  63. IN PDISK_REGION CColonRegion
  64. );
  65. #if defined(REMOTE_BOOT)
  66. BOOLEAN
  67. Spx86FlushRemoteBootVars(
  68. IN PDISK_REGION TargetRegion,
  69. IN PWSTR **BootVars,
  70. IN PWSTR Default
  71. );
  72. #endif // defined(REMOTE_BOOT)
  73. //
  74. // Private routines
  75. //
  76. VOID
  77. SppProcessBootIni(
  78. IN PCHAR BootIni,
  79. OUT PWSTR **BootVars,
  80. OUT PWSTR *Default,
  81. OUT PULONG Timeout
  82. );
  83. PCHAR
  84. SppNextLineInSection(
  85. IN PCHAR p
  86. );
  87. PCHAR
  88. SppFindSectionInBootIni(
  89. IN PCHAR p,
  90. IN PCHAR Section
  91. );
  92. BOOLEAN
  93. SppProcessLine(
  94. IN PCHAR Line,
  95. IN OUT PCHAR Key,
  96. IN OUT PCHAR Value,
  97. IN OUT PCHAR RestOfLine
  98. );
  99. BOOLEAN
  100. SppNextToken(
  101. PCHAR p,
  102. PCHAR *pBegin,
  103. PCHAR *pEnd
  104. );
  105. //
  106. // NEC98
  107. //
  108. PUCHAR
  109. SpCreateBootiniImage(
  110. OUT PULONG FileSize
  111. );
  112. //
  113. // NEC98
  114. //
  115. BOOLEAN
  116. SppReInitializeBootVars_Nec98(
  117. OUT PWSTR **BootVars,
  118. OUT PWSTR *Default,
  119. OUT PULONG Timeout
  120. );