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.3 KiB

  1. /*++
  2. Copyright (c) 1995-2001 Microsoft Corporation
  3. Module Name:
  4. bootient.h
  5. Abstract:
  6. Boot.ini boot options and boot entry abstractions
  7. Author:
  8. Revision History:
  9. None.
  10. --*/
  11. #pragma once
  12. #include <sbentry.h>
  13. //
  14. // Boot.ini extra section abstraction
  15. //
  16. typedef struct _BOI_SECTION *PBOI_SECTION;
  17. typedef struct _BOI_SECTION {
  18. PBOI_SECTION Next;
  19. TCHAR Name[MAX_PATH];
  20. PTSTR Contents;
  21. DWORD Size;
  22. } BOI_SECTION;
  23. //
  24. // Boot.ini boot entry abstraction
  25. //
  26. typedef struct _BOI_OS_BOOT_ENTRY {
  27. OS_BOOT_ENTRY OsBootEntry;
  28. } BOI_OS_BOOT_ENTRY, *PBOI_OS_BOOT_ENTRY;
  29. //
  30. // Boot.ini boot options abstraction
  31. //
  32. typedef struct _BOI_OS_BOOT_OPTIONS {
  33. OS_BOOT_OPTIONS OsBootOptions;
  34. TCHAR BootIniPath[MAX_PATH];
  35. PBOI_SECTION Sections;
  36. ULONG NextEntryId;
  37. } BOI_OS_BOOT_OPTIONS, *PBOI_OS_BOOT_OPTIONS;
  38. //
  39. // BOI_OS_SECTION Methods
  40. //
  41. PBOI_SECTION
  42. BOISectionCreate(
  43. IN PCTSTR SectionData
  44. );
  45. VOID
  46. BOISectionDelete(
  47. IN PBOI_SECTION This
  48. );
  49. __inline
  50. PCTSTR
  51. BOISectionGetName(
  52. IN PBOI_SECTION This
  53. )
  54. {
  55. return (This) ? This->Name : NULL;
  56. }
  57. //
  58. // BOI_OS_BOOT_ENTRY Methods
  59. //
  60. POS_BOOT_ENTRY
  61. BOIOSBECreate(
  62. IN ULONG Id,
  63. IN PCTSTR EntryLine,
  64. IN PBOI_OS_BOOT_OPTIONS Container
  65. );
  66. VOID
  67. BOIOSBEDelete(
  68. IN POS_BOOT_ENTRY This
  69. );
  70. BOOLEAN
  71. BOIOSBEFlush(
  72. IN POS_BOOT_ENTRY This
  73. );
  74. //
  75. // BOI_OS_BOOT_OPTIONS Methods
  76. //
  77. POS_BOOT_OPTIONS
  78. BOIOSBOCreate(
  79. IN PCTSTR BootIniPath,
  80. IN BOOLEAN OpenExisting
  81. );
  82. BOOLEAN
  83. BOIOSBOFlush(
  84. IN POS_BOOT_OPTIONS This
  85. );
  86. VOID
  87. BOIOSBODelete(
  88. IN POS_BOOT_OPTIONS This
  89. );
  90. POS_BOOT_ENTRY
  91. BOIOSBOAddNewBootEntry(
  92. IN POS_BOOT_OPTIONS This,
  93. IN PCTSTR FriendlyName,
  94. IN PCTSTR OsLoaderVolumeName,
  95. IN PCTSTR OsLoaderPath,
  96. IN PCTSTR BootVolumeName,
  97. IN PCTSTR BootPath,
  98. IN PCTSTR OsLoadOptions
  99. );
  100. __inline
  101. PBOI_SECTION
  102. BOIOSGetFirstSection(
  103. IN PBOI_OS_BOOT_OPTIONS This
  104. )
  105. {
  106. return (This) ? (This->Sections) : NULL;
  107. }
  108. __inline
  109. PBOI_SECTION
  110. BOIOSGetNextSection(
  111. IN PBOI_OS_BOOT_OPTIONS This,
  112. IN PBOI_SECTION Section
  113. )
  114. {
  115. return (This && Section) ? (Section->Next) : NULL;
  116. }