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.

123 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1995-2001 Microsoft Corporation
  3. Module Name:
  4. efisbent.h
  5. Abstract:
  6. EFI boot entry and EFI boot options abstractions.
  7. Author:
  8. Vijay Jayaseelan (vijayj@microsoft.com) 14 Feb 2001
  9. Revision History:
  10. None.
  11. --*/
  12. #pragma once
  13. #include <sbentry.h>
  14. #if defined(EFI_NVRAM_ENABLED)
  15. //
  16. // EFI boot entry abstraction
  17. //
  18. typedef struct _EFI_OS_BOOT_ENTRY {
  19. OS_BOOT_ENTRY OsBootEntry;
  20. PBOOT_ENTRY NtBootEntry;
  21. } EFI_OS_BOOT_ENTRY, *PEFI_OS_BOOT_ENTRY;
  22. //
  23. // EFI boot options abstraction
  24. //
  25. typedef struct _EFI_OS_BOOT_OPTIONS {
  26. OS_BOOT_OPTIONS OsBootOptions;
  27. PBOOT_OPTIONS NtBootOptions;
  28. PBOOT_ENTRY_LIST NtBootEntries;
  29. } EFI_OS_BOOT_OPTIONS, *PEFI_OS_BOOT_OPTIONS;
  30. //
  31. // EFI_OS_BOOT_ENTRY Methods
  32. //
  33. POS_BOOT_ENTRY
  34. EFIOSBECreate(
  35. IN PBOOT_ENTRY Entry,
  36. IN POS_BOOT_OPTIONS Container
  37. );
  38. VOID
  39. EFIOSBEDelete(
  40. IN POS_BOOT_ENTRY This
  41. );
  42. BOOLEAN
  43. EFIOSBEFlush(
  44. IN POS_BOOT_ENTRY This
  45. );
  46. //
  47. // EFI_OS_BOOT_OPTIONS Methods
  48. //
  49. POS_BOOT_OPTIONS
  50. EFIOSBOCreate(
  51. VOID
  52. );
  53. BOOLEAN
  54. EFIOSBOFlush(
  55. IN POS_BOOT_OPTIONS This
  56. );
  57. VOID
  58. EFIOSBODelete(
  59. IN POS_BOOT_OPTIONS This
  60. );
  61. POS_BOOT_ENTRY
  62. EFIOSBOAddNewBootEntry(
  63. IN POS_BOOT_OPTIONS This,
  64. IN PCWSTR FriendlyName,
  65. IN PCWSTR OsLoaderVolumeName,
  66. IN PCWSTR OsLoaderPath,
  67. IN PCWSTR BootVolumeName,
  68. IN PCWSTR BootPath,
  69. IN PCWSTR OsLoadOptions
  70. );
  71. BOOLEAN
  72. EFIOSBEFillNtBootEntry(
  73. IN PEFI_OS_BOOT_ENTRY Entry
  74. );
  75. BOOL
  76. EnablePrivilege(
  77. IN PTSTR PrivilegeName,
  78. IN BOOL Enable
  79. );
  80. #define IS_BOOT_ENTRY_ACTIVE(_be) \
  81. (((_be)->Attributes & BOOT_ENTRY_ATTRIBUTE_ACTIVE) != 0)
  82. #define IS_BOOT_ENTRY_WINDOWS(_be) \
  83. (((_be)->Attributes & BOOT_ENTRY_ATTRIBUTE_WINDOWS) != 0)
  84. #define IS_BOOT_ENTRY_REMOVABLE_MEDIA(_be) \
  85. (((_be)->Attributes & BOOT_ENTRY_ATTRIBUTE_REMOVABLE_MEDIA) != 0)
  86. #define ADD_OFFSET(_p,_o) (PVOID)((PUCHAR)(_p) + (_p)->_o)
  87. #define ADD_BYTE_OFFSET(_p,_o) (PVOID)((PUCHAR)(_p) + (_o))
  88. #endif // for EFI_NVRAM_ENABLED