Leaked source code of windows server 2003
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.

124 lines
2.3 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. PEFI_DRIVER_ENTRY_LIST DriverEntries;
  30. } EFI_OS_BOOT_OPTIONS, *PEFI_OS_BOOT_OPTIONS;
  31. //
  32. // EFI_OS_BOOT_ENTRY Methods
  33. //
  34. POS_BOOT_ENTRY
  35. EFIOSBECreate(
  36. IN PBOOT_ENTRY Entry,
  37. IN POS_BOOT_OPTIONS Container
  38. );
  39. VOID
  40. EFIOSBEDelete(
  41. IN POS_BOOT_ENTRY This
  42. );
  43. BOOLEAN
  44. EFIOSBEFlush(
  45. IN POS_BOOT_ENTRY This
  46. );
  47. //
  48. // EFI_OS_BOOT_OPTIONS Methods
  49. //
  50. POS_BOOT_OPTIONS
  51. EFIOSBOCreate(
  52. VOID
  53. );
  54. BOOLEAN
  55. EFIOSBOFlush(
  56. IN POS_BOOT_OPTIONS This
  57. );
  58. VOID
  59. EFIOSBODelete(
  60. IN POS_BOOT_OPTIONS This
  61. );
  62. POS_BOOT_ENTRY
  63. EFIOSBOAddNewBootEntry(
  64. IN POS_BOOT_OPTIONS This,
  65. IN PCWSTR FriendlyName,
  66. IN PCWSTR OsLoaderVolumeName,
  67. IN PCWSTR OsLoaderPath,
  68. IN PCWSTR BootVolumeName,
  69. IN PCWSTR BootPath,
  70. IN PCWSTR OsLoadOptions
  71. );
  72. BOOLEAN
  73. EFIOSBEFillNtBootEntry(
  74. IN PEFI_OS_BOOT_ENTRY Entry
  75. );
  76. BOOL
  77. EnablePrivilege(
  78. IN PTSTR PrivilegeName,
  79. IN BOOL Enable
  80. );
  81. #define IS_BOOT_ENTRY_ACTIVE(_be) \
  82. (((_be)->Attributes & BOOT_ENTRY_ATTRIBUTE_ACTIVE) != 0)
  83. #define IS_BOOT_ENTRY_WINDOWS(_be) \
  84. (((_be)->Attributes & BOOT_ENTRY_ATTRIBUTE_WINDOWS) != 0)
  85. #define IS_BOOT_ENTRY_REMOVABLE_MEDIA(_be) \
  86. (((_be)->Attributes & BOOT_ENTRY_ATTRIBUTE_REMOVABLE_MEDIA) != 0)
  87. #define ADD_OFFSET(_p,_o) (PVOID)((PUCHAR)(_p) + (_p)->_o)
  88. #define ADD_BYTE_OFFSET(_p,_o) (PVOID)((PUCHAR)(_p) + (_o))
  89. #endif // for EFI_NVRAM_ENABLED