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.

1712 lines
31 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. bldr.h
  5. Abstract:
  6. This module is the header file for the NT boot loader.
  7. Author:
  8. David N. Cutler (davec) 10-May-1991
  9. Revision History:
  10. --*/
  11. #ifndef _BLDR_
  12. #define _BLDR_
  13. #include "ntos.h"
  14. #include "arccodes.h"
  15. #include "setupblk.h"
  16. #include "hdlsblk.h"
  17. #include "remboot.h"
  18. #include "oscpkt.h"
  19. #include "bootstatus.h"
  20. #include <TCHAR.H>
  21. #ifndef _PTUCHAR
  22. typedef _TUCHAR *_PTUCHAR;
  23. #endif
  24. //
  25. // DoApmAttemptReconnect does nothing on non x86 machines.
  26. // On x86 machines, it attempts an APM reconnect, and lives in initx86.c
  27. //
  28. #if defined(_X86_)
  29. VOID DoApmAttemptReconnect();
  30. #else
  31. #define DoApmAttemptReconnect()
  32. #endif
  33. //
  34. // The Alpha OS Loader and Setup Loader run in the environment of the host
  35. // firmware. This environment is restricted to a 32-bit address space and
  36. // cannot result in pointer significance greater than 32-bits. The 64-bit
  37. // OS Loader, however, is compiled using 64-bit pointers for non-firmware
  38. // interfaces and constructs data structures used to pass information to the
  39. // NT kernel using 64-bit pointers. This leads to a large number of false
  40. // pointer truncation warnings. Therefore, pointer truncation warnings are
  41. // turned off in the OS and Setup Loaders for 64-bit Alpha systems.
  42. //
  43. #if defined(_AXP64_)
  44. #pragma warning(4:4244) // turn off pointer trunction
  45. #endif
  46. //
  47. // Define boot file id.
  48. //
  49. #define BOOT_FILEID 2 // boot partition file id
  50. //
  51. // Define image type.
  52. //
  53. #if defined(_X86_)
  54. #define TARGET_IMAGE IMAGE_FILE_MACHINE_I386
  55. #endif
  56. #if defined(_ALPHA_)
  57. #if defined(_AXP64_)
  58. #define TARGET_IMAGE IMAGE_FILE_MACHINE_AXP64
  59. #else
  60. #define TARGET_IMAGE IMAGE_FILE_MACHINE_ALPHA
  61. #endif
  62. #endif
  63. #if defined(_IA64_)
  64. #define TARGET_IMAGE IMAGE_FILE_MACHINE_IA64
  65. #endif
  66. //
  67. // Make headless defines
  68. //
  69. #if defined(_X86_)
  70. #define BlIsTerminalConnected() BlTerminalConnected
  71. #endif
  72. #if defined(_ALPHA_)
  73. #if defined(_AXP64_)
  74. #define BlIsTerminalConnected() FALSE
  75. #else
  76. #define BlIsTerminalConnected() FALSE
  77. #endif
  78. #endif
  79. #if defined(_IA64_)
  80. #define BlIsTerminalConnected() BlTerminalConnected
  81. #endif
  82. BOOLEAN
  83. BlTerminalHandleLoaderFailure(
  84. VOID
  85. );
  86. //
  87. // Define size of sector.
  88. //
  89. #define SECTOR_SIZE 512 // size of disk sector
  90. #define SECTOR_SHIFT 9 // sector shift value
  91. #define STALE_GPT_PARTITION_ENTRY 0xEE // The stale MBR partition entry for GPT disks
  92. //
  93. // Define heap allocation block granularity.
  94. //
  95. #define BL_GRANULARITY 8
  96. //
  97. // Define number of entries in file table.
  98. //
  99. #define BL_FILE_TABLE_SIZE 48
  100. //
  101. // Define size of memory allocation table.
  102. //
  103. #define BL_MEMORY_TABLE_SIZE 16
  104. //
  105. // Define number of loader heap and stack pages.
  106. //
  107. #define BL_HEAP_PAGES 16
  108. #define BL_STACK_PAGES 8
  109. //
  110. // Define buffer alignment macro.
  111. //
  112. #define ALIGN_BUFFER(Buffer) (PVOID) \
  113. ((((ULONG_PTR)(Buffer) + BlDcacheFillSize - 1)) & (~((ULONG_PTR)BlDcacheFillSize - 1)))
  114. #define ALIGN_BUFFER_WITH_SIZE(Buffer, Size) (PVOID) \
  115. ((((ULONG_PTR)(Buffer) + (Size) - 1)) & (~((ULONG_PTR)(Size) - 1)))
  116. //
  117. // Useful defines for COM ports.
  118. //
  119. #define COM1_PORT (0x3f8)
  120. #define COM2_PORT (0x2f8)
  121. #define COM3_PORT (0x3e8)
  122. #define COM4_PORT (0x2e8)
  123. #define BD_150 150
  124. #define BD_300 300
  125. #define BD_600 600
  126. #define BD_1200 1200
  127. #define BD_2400 2400
  128. #define BD_4800 4800
  129. #define BD_9600 9600
  130. #define BD_14400 14400
  131. #define BD_19200 19200
  132. #define BD_57600 57600
  133. #define BD_115200 115200
  134. typedef
  135. ARC_STATUS
  136. (*PRENAME_ROUTINE)(
  137. IN ULONG FileId,
  138. IN CHAR * FIRMWARE_PTR NewName
  139. );
  140. typedef struct _BOOTFS_INFO {
  141. WCHAR * FIRMWARE_PTR DriverName;
  142. } BOOTFS_INFO, * FIRMWARE_PTR PBOOTFS_INFO;
  143. //
  144. // Device entry table structure.
  145. //
  146. typedef struct _BL_DEVICE_ENTRY_TABLE {
  147. PARC_CLOSE_ROUTINE Close;
  148. PARC_MOUNT_ROUTINE Mount;
  149. PARC_OPEN_ROUTINE Open;
  150. PARC_READ_ROUTINE Read;
  151. PARC_READ_STATUS_ROUTINE GetReadStatus;
  152. PARC_SEEK_ROUTINE Seek;
  153. PARC_WRITE_ROUTINE Write;
  154. PARC_GET_FILE_INFO_ROUTINE GetFileInformation;
  155. PARC_SET_FILE_INFO_ROUTINE SetFileInformation;
  156. PRENAME_ROUTINE Rename;
  157. PARC_GET_DIRECTORY_ENTRY_ROUTINE GetDirectoryEntry;
  158. PBOOTFS_INFO BootFsInfo;
  159. } BL_DEVICE_ENTRY_TABLE, *PBL_DEVICE_ENTRY_TABLE;
  160. //
  161. // Many functions in the boot loader take a set of paths. Every path is divided
  162. // into two parts, a "Source" and a "PathOffset".
  163. //
  164. // A source is described by the PATH_SOURCE structure. This structure contains
  165. // three parts, the device handle to use for I/O, the ARC name of the device,
  166. // and the offset off the root for that ARC device.
  167. //
  168. // The PATH_SET structures encapsulates up to three different sources. The
  169. // field AliasName optionally points to a PE namespace description of the
  170. // sources (eg \SystemRoot).
  171. //
  172. // Finally, the biggest PATH_SET structure (FULL_PATH_SET) is limited to
  173. // MAX_PATH_COUNT sources so that those using this structure can manipulate
  174. // local stack copies.
  175. //
  176. // Putting it all together, during a last known good boot the PATH_SET
  177. // describing \Winnt\System32 would be:
  178. // PathCount = 3
  179. // AliasName = \SystemRoot\
  180. // PathOffset = System32\
  181. // Source[0].DirectoryPath = \Winnt\LastGood.tmp
  182. // Source[1].DirectoryPath = \Winnt\LastGood
  183. // Source[2].DirectoryPath = \Winnt\
  184. //
  185. #define MAX_PATH_SOURCES 3
  186. typedef struct {
  187. ULONG DeviceId;
  188. LPCSTR DeviceName;
  189. PSTR DirectoryPath; // Should have trailing '\'
  190. } PATH_SOURCE, *PPATH_SOURCE;
  191. typedef struct {
  192. ULONG PathCount;
  193. LPCSTR AliasName;
  194. CHAR PathOffset[256]; // Should have trailing '\' if non-empty
  195. PATH_SOURCE Source[0];
  196. } SPARSE_PATH_SET, *PSPARSE_PATH_SET;
  197. typedef struct {
  198. ULONG PathCount;
  199. LPCSTR AliasName;
  200. CHAR PathOffset[256]; // Should have trailing '\' if non-empty
  201. PATH_SOURCE Source[MAX_PATH_SOURCES];
  202. } FULL_PATH_SET, *PFULL_PATH_SET;
  203. //
  204. // A PPATH_SET points to a path set with an undetermined count of paths. We
  205. // make this an alias of PFULL_PATH_SET so as to cut down on casting.
  206. //
  207. typedef PFULL_PATH_SET PPATH_SET;
  208. //
  209. // Define main entrypoint.
  210. //
  211. ARC_STATUS
  212. BlOsLoader (
  213. IN ULONG Argc,
  214. IN CHAR * FIRMWARE_PTR * FIRMWARE_PTR Argv,
  215. IN CHAR * FIRMWARE_PTR * FIRMWARE_PTR Envp
  216. );
  217. ARC_STATUS
  218. BlInitStdio (
  219. IN ULONG Argc,
  220. IN CHAR * FIRMWARE_PTR * FIRMWARE_PTR Argv
  221. );
  222. extern UCHAR OsLoaderVersion[];
  223. extern WCHAR OsLoaderVersionW[];
  224. extern UCHAR OsLoaderName[];
  225. extern CHAR KernelFileName[8+1+3+1];
  226. extern CHAR HalFileName[8+1+3+1];
  227. //
  228. // Define boot debugger function prototype.
  229. //
  230. VOID
  231. BdInitDebugger (
  232. IN PCHAR LoaderName,
  233. IN PVOID LoaderBase,
  234. IN PCHAR Options
  235. );
  236. extern LOGICAL BdDebuggerEnabled;
  237. VOID
  238. BdInitializeTraps (
  239. VOID
  240. );
  241. ULONG
  242. BdComPortNumber (
  243. VOID
  244. );
  245. ARC_STATUS
  246. BdPullRemoteFile(
  247. IN PCHAR FileName,
  248. IN ULONG FileAttributes,
  249. IN ULONG CreateDisposition,
  250. IN ULONG CreateOptions,
  251. IN ULONG FileId
  252. );
  253. //
  254. // Define com port I/O prototypes.
  255. //
  256. LOGICAL
  257. BlPortInitialize(
  258. IN ULONG BaudRate,
  259. IN ULONG PortNumber,
  260. IN PUCHAR PortAddress OPTIONAL,
  261. IN BOOLEAN ReInitialize,
  262. OUT PULONG BlFileId
  263. );
  264. VOID
  265. BlInitializeHeadlessPort(
  266. VOID
  267. );
  268. ULONG
  269. BlPortGetByte (
  270. IN ULONG BlFileId,
  271. OUT PUCHAR Input
  272. );
  273. VOID
  274. BlPortPutByte (
  275. IN ULONG BlFileId,
  276. IN UCHAR Output
  277. );
  278. ULONG
  279. BlPortPollByte (
  280. IN ULONG BlFileId,
  281. OUT PUCHAR Input
  282. );
  283. ULONG
  284. BlPortPollOnly (
  285. IN ULONG BlFileId
  286. );
  287. VOID
  288. BlSetHeadlessRestartBlock(
  289. IN PTFTP_RESTART_BLOCK RestartBlock
  290. );
  291. VOID
  292. BlGetHeadlessRestartBlock(
  293. IN PTFTP_RESTART_BLOCK RestartBlock,
  294. IN BOOLEAN RestartBlockValid
  295. );
  296. LOGICAL
  297. BlRetrieveBIOSRedirectionInformation();
  298. extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation;
  299. //
  300. // Define file I/O prototypes.
  301. //
  302. ARC_STATUS
  303. BlIoInitialize (
  304. VOID
  305. );
  306. ARC_STATUS
  307. BlClose (
  308. IN ULONG FileId
  309. );
  310. PBOOTFS_INFO
  311. BlGetFsInfo(
  312. IN ULONG DeviceId
  313. );
  314. ARC_STATUS
  315. BlMount (
  316. IN PCHAR MountPath,
  317. IN MOUNT_OPERATION Operation
  318. );
  319. ARC_STATUS
  320. BlOpen (
  321. IN ULONG DeviceId,
  322. IN PCHAR OpenPath,
  323. IN OPEN_MODE OpenMode,
  324. OUT PULONG FileId
  325. );
  326. ARC_STATUS
  327. BlRead (
  328. IN ULONG FileId,
  329. OUT PVOID Buffer,
  330. IN ULONG Length,
  331. OUT PULONG Count
  332. );
  333. ARC_STATUS
  334. BlReadAtOffset(
  335. IN ULONG FileId,
  336. IN ULONG Offset,
  337. IN ULONG Length,
  338. OUT PVOID Data
  339. );
  340. ARC_STATUS
  341. BlRename (
  342. IN ULONG FileId,
  343. IN PCHAR NewName
  344. );
  345. ARC_STATUS
  346. BlGetReadStatus (
  347. IN ULONG FileId
  348. );
  349. ARC_STATUS
  350. BlSeek (
  351. IN ULONG FileId,
  352. IN PLARGE_INTEGER Offset,
  353. IN SEEK_MODE SeekMode
  354. );
  355. ARC_STATUS
  356. BlWrite (
  357. IN ULONG FileId,
  358. IN PVOID Buffer,
  359. IN ULONG Length,
  360. OUT PULONG Count
  361. );
  362. ARC_STATUS
  363. BlGetFileInformation (
  364. IN ULONG FileId,
  365. IN PFILE_INFORMATION FileInformation
  366. );
  367. ARC_STATUS
  368. BlSetFileInformation (
  369. IN ULONG FileId,
  370. IN ULONG AttributeFlags,
  371. IN ULONG AttributeMask
  372. );
  373. #ifdef DBLSPACE_LEGAL
  374. VOID
  375. BlSetAutoDoubleSpace (
  376. IN BOOLEAN Enable
  377. );
  378. #endif
  379. //
  380. // Define image manipulation routine prototyupes.
  381. //
  382. #define BlLoadImage(_id_,_memtype_,_file_,_imagetype_,_base_) \
  383. BlLoadImageEx(_id_,_memtype_,_file_,_imagetype_,0,0,_base_)
  384. ARC_STATUS
  385. BlLoadImageEx(
  386. IN ULONG DeviceId,
  387. IN TYPE_OF_MEMORY MemoryType,
  388. IN PCHAR LoadFile,
  389. IN USHORT ImageType,
  390. IN OPTIONAL ULONG PreferredAlignment,
  391. IN OPTIONAL ULONG PreferredBasePage,
  392. OUT PVOID *ImageBase
  393. );
  394. ARC_STATUS
  395. BlLoadDeviceDriver(
  396. IN PPATH_SET PathSet,
  397. IN PCHAR DriverName,
  398. IN PTCHAR DriverDescription OPTIONAL,
  399. IN ULONG DriverFlags,
  400. OUT PKLDR_DATA_TABLE_ENTRY *DriverDataTableEntry
  401. );
  402. ARC_STATUS
  403. BlLoadNLSData(
  404. IN ULONG DeviceId,
  405. IN PCHAR DeviceName,
  406. IN PCHAR DirectoryPath,
  407. IN PUNICODE_STRING AnsiCodepage,
  408. IN PUNICODE_STRING OemCodepage,
  409. IN PUNICODE_STRING LanguageTable,
  410. OUT PCHAR BadFileName
  411. );
  412. ARC_STATUS
  413. BlLoadOemHalFont(
  414. IN ULONG DeviceId,
  415. IN PCHAR DeviceName,
  416. IN PCHAR DirectoryPath,
  417. IN PUNICODE_STRING OemHalFont,
  418. OUT PCHAR BadFileName
  419. );
  420. PVOID
  421. BlImageNtHeader (
  422. IN PVOID Base
  423. );
  424. ARC_STATUS
  425. BlSetupForNt(
  426. IN PLOADER_PARAMETER_BLOCK BlLoaderBlock
  427. );
  428. ARC_STATUS
  429. BlScanImportDescriptorTable (
  430. IN PPATH_SET PathSet,
  431. IN PKLDR_DATA_TABLE_ENTRY ScanEntry,
  432. IN TYPE_OF_MEMORY MemoryType
  433. );
  434. ARC_STATUS
  435. BlScanOsloaderBoundImportTable (
  436. IN PKLDR_DATA_TABLE_ENTRY ScanEntry
  437. );
  438. #if defined(_ALPHA_)
  439. ARC_STATUS
  440. BlAllocateAnyMemory (
  441. IN TYPE_OF_MEMORY MemoryType,
  442. IN ULONG BasePage,
  443. IN ULONG PageCount,
  444. OUT PULONG ActualBase
  445. );
  446. ARC_STATUS
  447. BlGeneratePalName(
  448. IN PCHAR PalFIleName
  449. );
  450. ARC_STATUS
  451. BlLoadPal(
  452. IN ULONG DeviceId,
  453. IN TYPE_OF_MEMORY MemoryType,
  454. IN PCHAR LoadPath,
  455. IN USHORT ImageType,
  456. OUT PVOID *ImageBase,
  457. IN PCHAR LoadDevice
  458. );
  459. VOID
  460. BlSetGranularityHints (
  461. IN PHARDWARE_PTE PageTableArray,
  462. IN ULONG PageTableCount
  463. );
  464. #endif
  465. #if defined(_PPC_)
  466. ARC_STATUS
  467. BlPpcInitialize (
  468. VOID
  469. );
  470. #endif // defined(_PPC)
  471. //
  472. // Define configuration allocation prototypes.
  473. //
  474. ARC_STATUS
  475. BlConfigurationInitialize (
  476. IN PCONFIGURATION_COMPONENT Parent,
  477. IN PCONFIGURATION_COMPONENT_DATA ParentEntry
  478. );
  479. //
  480. // define routines for searching the ARC firmware tree
  481. //
  482. typedef
  483. BOOLEAN
  484. (*PNODE_CALLBACK)(
  485. IN PCONFIGURATION_COMPONENT_DATA FoundComponent
  486. );
  487. BOOLEAN
  488. BlSearchConfigTree(
  489. IN PCONFIGURATION_COMPONENT_DATA Node,
  490. IN CONFIGURATION_CLASS Class,
  491. IN CONFIGURATION_TYPE Type,
  492. IN ULONG Key,
  493. IN PNODE_CALLBACK CallbackRoutine
  494. );
  495. VOID
  496. BlGetPathnameFromComponent(
  497. IN PCONFIGURATION_COMPONENT_DATA Component,
  498. OUT PCHAR ArcName
  499. );
  500. BOOLEAN
  501. BlGetPathMnemonicKey(
  502. IN PCHAR OpenPath,
  503. IN PCHAR Mnemonic,
  504. IN PULONG Key
  505. );
  506. ARC_STATUS
  507. BlGetArcDiskInformation(
  508. IN BOOLEAN XInt13Support
  509. );
  510. BOOLEAN
  511. BlReadSignature(
  512. IN PCHAR DiskName,
  513. IN BOOLEAN IsCdRom
  514. );
  515. BOOLEAN
  516. BlGetDiskSignature(
  517. IN PCHAR Name,
  518. IN BOOLEAN IsCdRom,
  519. PARC_DISK_SIGNATURE Signature
  520. );
  521. #if defined(REMOTE_BOOT)
  522. ARC_STATUS
  523. BlCheckMachineReplacement (
  524. IN PCHAR SystemDevice,
  525. IN ULONG SystemDeviceId,
  526. IN ULONGLONG NetRebootParameter,
  527. IN PUCHAR OsLoader
  528. );
  529. #endif
  530. //
  531. // Define memory allocation prototypes.
  532. //
  533. extern ULONG BlUsableBase;
  534. extern ULONG BlUsableLimit;
  535. typedef enum _ALLOCATION_POLICY {
  536. BlAllocateLowestFit,
  537. BlAllocateBestFit,
  538. BlAllocateHighestFit
  539. } ALLOCATION_POLICY, *PALLOCATION_POLICY;
  540. extern ALLOCATION_POLICY BlMemoryAllocationPolicy;
  541. extern ALLOCATION_POLICY BlHeapAllocationPolicy;
  542. VOID
  543. BlSetAllocationPolicy (
  544. IN ALLOCATION_POLICY MemoryAllocationPolicy,
  545. IN ALLOCATION_POLICY HeapAllocationPolicy
  546. );
  547. ARC_STATUS
  548. BlMemoryInitialize (
  549. VOID
  550. );
  551. ARC_STATUS
  552. BlAllocateDataTableEntry (
  553. IN PCHAR BaseDllName,
  554. IN PCHAR FullDllName,
  555. IN PVOID ImageHeader,
  556. OUT PKLDR_DATA_TABLE_ENTRY *Entry
  557. );
  558. #define BlAllocateDescriptor(_MemoryType, _BasePage, _PageCount, _ActualBase) \
  559. BlAllocateAlignedDescriptor((_MemoryType), \
  560. (_BasePage), \
  561. (_PageCount), \
  562. 1, \
  563. (_ActualBase))
  564. #if defined (_X86_)
  565. #define BlpCheckMapping(_page,_npages) MempCheckMapping (_page,_npages)
  566. #else
  567. #define BlpCheckMapping(_page,_npages) ESUCCESS
  568. #endif
  569. ARC_STATUS
  570. BlAllocateAlignedDescriptor (
  571. IN TYPE_OF_MEMORY MemoryType,
  572. IN ULONG BasePage,
  573. IN ULONG PageCount,
  574. IN ULONG Alignment,
  575. OUT PULONG ActualBase
  576. );
  577. ARC_STATUS
  578. BlFreeDescriptor (
  579. IN ULONG BasePage
  580. );
  581. PVOID
  582. BlAllocateHeapAligned (
  583. IN ULONG Size
  584. );
  585. PVOID
  586. BlAllocateHeap (
  587. IN ULONG Size
  588. );
  589. VOID
  590. BlStartConfigPrompt(
  591. VOID
  592. );
  593. BOOLEAN
  594. BlEndConfigPrompt(
  595. VOID
  596. );
  597. BOOLEAN
  598. BlCheckForLoadedDll (
  599. IN PCHAR DllName,
  600. OUT PKLDR_DATA_TABLE_ENTRY *FoundEntry
  601. );
  602. PMEMORY_ALLOCATION_DESCRIPTOR
  603. BlFindMemoryDescriptor(
  604. IN ULONG BasePage
  605. );
  606. ARC_STATUS
  607. BlInitResources(
  608. IN PCHAR StartCommand
  609. );
  610. PTCHAR
  611. BlFindMessage(
  612. IN ULONG Id
  613. );
  614. //
  615. // Define debug function to write on the display console.
  616. //
  617. VOID
  618. BlPrint(
  619. PTCHAR cp,
  620. ...
  621. );
  622. #if DBG
  623. #define DBGTRACE BlPrint
  624. #else
  625. #define DBGTRACE
  626. #endif
  627. ARC_STATUS
  628. BlGenerateDescriptor (
  629. IN PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor,
  630. IN MEMORY_TYPE MemoryType,
  631. IN ULONG BasePage,
  632. IN ULONG PageCount
  633. );
  634. VOID
  635. BlInsertDescriptor (
  636. IN PMEMORY_ALLOCATION_DESCRIPTOR NewDescriptor
  637. );
  638. #if defined (_X86_)
  639. ARC_STATUS
  640. MempCheckMapping (
  641. ULONG StartPage,
  642. ULONG NumberPages
  643. );
  644. ARC_STATUS
  645. MempRemoveMapping (
  646. ULONG StartPage,
  647. ULONG NumberPages
  648. );
  649. #endif
  650. #define BlRemoveDescriptor(_md_) RemoveEntryList(&(_md_)->ListEntry)
  651. ARC_STATUS
  652. BlGenerateDeviceNames (
  653. IN PCHAR ArcDeviceName,
  654. OUT PCHAR ArcCanonicalName,
  655. OUT OPTIONAL PCHAR NtDevicePrefix
  656. );
  657. PCHAR
  658. BlGetArgumentValue (
  659. IN ULONG Argc,
  660. IN CHAR * FIRMWARE_PTR * FIRMWARE_PTR Argv,
  661. IN PCHAR ArgumentName
  662. );
  663. PCHAR
  664. BlSetArgumentValue (
  665. IN ULONG Argc,
  666. IN CHAR * FIRMWARE_PTR * FIRMWARE_PTR Argv,
  667. IN PCHAR ArgumentName,
  668. IN PCHAR NewValue
  669. );
  670. //
  671. // Defines for doing console I/O
  672. //
  673. #define ASCII_CR 0x0d
  674. #define ASCII_LF 0x0a
  675. #define ESC 0x1B
  676. #define SGR_INVERSE 7
  677. #define SGR_INTENSE 1
  678. #define SGR_NORMAL 0
  679. extern ULONG ScreenWidth;
  680. extern ULONG ScreenHeight;
  681. //
  682. // Define I/O prototypes.
  683. //
  684. VOID
  685. BlClearScreen(
  686. VOID
  687. );
  688. VOID
  689. BlClearToEndOfScreen(
  690. VOID
  691. );
  692. VOID
  693. BlClearToEndOfLine(
  694. VOID
  695. );
  696. VOID
  697. BlPositionCursor(
  698. IN ULONG Column,
  699. IN ULONG Row
  700. );
  701. VOID
  702. BlSetInverseMode(
  703. IN BOOLEAN InverseOn
  704. );
  705. VOID
  706. BlOutputLoadMessage (
  707. IN PCHAR DeviceName,
  708. IN PCHAR FileName,
  709. IN PTCHAR FileDescription OPTIONAL
  710. );
  711. ULONG
  712. BlCountLines(
  713. IN PTCHAR Lines
  714. );
  715. //
  716. // advanced boot menu prototypes
  717. //
  718. LONG
  719. BlDoAdvancedBoot(
  720. IN ULONG MenuTitleId,
  721. IN LONG DefaultBootOption,
  722. IN BOOLEAN AutoAdvancedBoot,
  723. IN UCHAR Timeout
  724. );
  725. PTSTR
  726. BlGetAdvancedBootDisplayString(
  727. LONG BootOption
  728. );
  729. PSTR
  730. BlGetAdvancedBootLoadOptions(
  731. LONG BootOption
  732. );
  733. VOID
  734. BlDoAdvancedBootLoadProcessing(
  735. LONG BootOption
  736. );
  737. ULONG
  738. BlGetAdvancedBootOption(
  739. VOID
  740. );
  741. //
  742. // Define file structure recognition prototypes.
  743. //
  744. PBL_DEVICE_ENTRY_TABLE
  745. IsCdfsFileStructure (
  746. IN ULONG DeviceId,
  747. IN PVOID StructureContext
  748. );
  749. #ifdef DBLSPACE_LEGAL
  750. PBL_DEVICE_ENTRY_TABLE
  751. IsDblsFileStructure (
  752. IN ULONG DeviceId,
  753. IN PVOID StructureContext
  754. );
  755. #endif
  756. PBL_DEVICE_ENTRY_TABLE
  757. IsFatFileStructure (
  758. IN ULONG DeviceId,
  759. IN PVOID StructureContext
  760. );
  761. PBL_DEVICE_ENTRY_TABLE
  762. IsHpfsFileStructure (
  763. IN ULONG DeviceId,
  764. IN PVOID StructureContext
  765. );
  766. PBL_DEVICE_ENTRY_TABLE
  767. IsNtfsFileStructure (
  768. IN ULONG DeviceId,
  769. IN PVOID StructureContext
  770. );
  771. #if defined(ELTORITO)
  772. PBL_DEVICE_ENTRY_TABLE
  773. IsEtfsFileStructure (
  774. IN ULONG DeviceId,
  775. IN PVOID StructureContext
  776. );
  777. #endif
  778. PBL_DEVICE_ENTRY_TABLE
  779. IsNetFileStructure (
  780. IN ULONG DeviceId,
  781. IN PVOID StructureContext
  782. );
  783. //
  784. // Define registry prototypes
  785. //
  786. ARC_STATUS
  787. BlLoadSystemHive(
  788. IN ULONG DeviceId,
  789. IN PCHAR DeviceName,
  790. IN PCHAR DirectoryPath,
  791. IN PCHAR HiveName
  792. );
  793. ARC_STATUS
  794. BlLoadSystemHiveLog(
  795. IN ULONG DeviceId,
  796. IN PCHAR DeviceName,
  797. IN PCHAR DirectoryPath,
  798. IN PCHAR HiveName,
  799. OUT PULONG_PTR LogData
  800. );
  801. ARC_STATUS
  802. BlLoadAndScanSystemHive(
  803. IN ULONG DeviceId,
  804. IN PCHAR DeviceName,
  805. IN PCHAR DirectoryPath,
  806. IN PWSTR BootFileSystem,
  807. IN OUT BOOLEAN *LastKnownGoodBoot,
  808. OUT BOOLEAN *ServerHive,
  809. OUT PCHAR BadFileName
  810. );
  811. ARC_STATUS
  812. BlLoadAndInitSystemHive(
  813. IN ULONG DeviceId,
  814. IN PCHAR DeviceName,
  815. IN PCHAR DirectoryPath,
  816. IN PCHAR HiveName,
  817. IN BOOLEAN IsAlternate,
  818. OUT PBOOLEAN RestartSetup,
  819. OUT PBOOLEAN LogPresent
  820. );
  821. ARC_STATUS
  822. BlLoadBootDrivers(
  823. IN PPATH_SET DefaultPathSet,
  824. IN PLIST_ENTRY BootDriverListHead,
  825. OUT PCHAR BadFileName
  826. );
  827. PTCHAR
  828. BlScanRegistry(
  829. IN PWSTR BootFileSystemPath,
  830. IN OUT BOOLEAN *LastKnownGoodBoot,
  831. OUT PLIST_ENTRY BootDriverListHead,
  832. OUT PUNICODE_STRING AnsiCodepage,
  833. OUT PUNICODE_STRING OemCodepage,
  834. OUT PUNICODE_STRING LanguageTable,
  835. OUT PUNICODE_STRING OemHalFont,
  836. #ifdef _WANT_MACHINE_IDENTIFICATION
  837. OUT PUNICODE_STRING Biosinfo,
  838. #endif
  839. OUT PSETUP_LOADER_BLOCK SetupLoaderBlock,
  840. OUT BOOLEAN *ServerHive
  841. );
  842. ARC_STATUS
  843. BlAddToBootDriverList(
  844. IN PLIST_ENTRY BootDriverListHead,
  845. IN PWSTR DriverName,
  846. IN PWSTR Name,
  847. IN PWSTR Group,
  848. IN ULONG Tag,
  849. IN ULONG ErrorControl,
  850. IN BOOLEAN InsertAtHead
  851. );
  852. //
  853. // Define hibernation prototypes
  854. //
  855. ULONG
  856. BlHiberRestore (
  857. IN ULONG DriveId,
  858. OUT OPTIONAL PCHAR *BadLinkName
  859. );
  860. VOID
  861. HbAllocatePtes (
  862. IN ULONG NumberPages,
  863. OUT PVOID *PteAddress,
  864. OUT PVOID *MappedAddress
  865. );
  866. VOID
  867. HbInitRemap (
  868. PPFN_NUMBER FreeList
  869. );
  870. PVOID
  871. HbMapPte (
  872. IN ULONG PteToMap,
  873. IN PFN_NUMBER Page
  874. );
  875. PVOID
  876. HbNextSharedPage (
  877. IN ULONG PteToMap,
  878. IN PFN_NUMBER RealPage
  879. );
  880. VOID
  881. HbSetPte (
  882. IN PVOID Va,
  883. IN PHARDWARE_PTE Pte,
  884. IN ULONG Index,
  885. IN ULONG PageNumber
  886. );
  887. ULONG
  888. HbPageDisposition (
  889. IN PFN_NUMBER Page
  890. );
  891. #define HbPageNotInUse 0
  892. #define HbPageInUseByLoader 1
  893. #define HbPageInvalid 2
  894. VOID
  895. HiberSetupForWakeDispatch (
  896. VOID
  897. );
  898. typedef
  899. VOID
  900. (*PHIBER_WAKE_DISPATCH)(
  901. VOID
  902. );
  903. //
  904. // PTEs reserved for hiberfile (one set used while in
  905. // the loader, and another set provided in the kernels
  906. // memory image)
  907. //
  908. #define PTE_SOURCE 0 // Attention! These defines and
  909. #define PTE_DEST 1 // equates in ntos\boot\lib\i386\wakea.asm
  910. #define PTE_MAP_PAGE 2 // must be the same !!!
  911. #define PTE_REMAP_PAGE 3
  912. #define PTE_HIBER_CONTEXT 4
  913. #define PTE_TRANSFER_PDE 5
  914. #define PTE_WAKE_PTE 6
  915. #define PTE_DISPATCHER_START 7
  916. #define PTE_DISPATCHER_END 8
  917. #define PTE_XPRESS_DEST_FIRST 9
  918. #define PTE_XPRESS_DEST_LAST (PTE_XPRESS_DEST_FIRST + XPRESS_MAX_PAGES)
  919. // Attention: should be the same as POP_MAX_MDL_SIZE in ntos\po\pop.h !!!
  920. #define HIBER_PTES (16 + XPRESS_MAX_PAGES)
  921. extern PUCHAR HiberBuffer;
  922. extern PVOID HiberPtes;
  923. extern PUCHAR HiberVa;
  924. extern PVOID HiberIdentityVa;
  925. extern ULONG HiberPageFrames[HIBER_PTES];
  926. //
  927. // Define routines for secrets.
  928. //
  929. #define SECPKG_CRED_OWF_PASSWORD 0x00000010
  930. #if defined(REMOTE_BOOT)
  931. ARC_STATUS
  932. BlOpenRawDisk(
  933. PULONG FileId
  934. );
  935. ARC_STATUS
  936. BlCloseRawDisk(
  937. ULONG FileId
  938. );
  939. ARC_STATUS
  940. BlCheckForFreeSectors (
  941. ULONG FileId
  942. );
  943. ARC_STATUS
  944. BlReadSecret(
  945. ULONG FileId,
  946. PRI_SECRET Secret
  947. );
  948. ARC_STATUS
  949. BlWriteSecret(
  950. ULONG FileId,
  951. PRI_SECRET Secret
  952. );
  953. #endif // defined(REMOTE_BOOT)
  954. VOID
  955. BlInitializeSecret(
  956. IN PUCHAR Domain,
  957. IN PUCHAR User,
  958. IN PUCHAR LmOwfPassword1,
  959. IN PUCHAR NtOwfPassword1,
  960. #if defined(REMOTE_BOOT)
  961. IN PUCHAR LmOwfPassword2 OPTIONAL,
  962. IN PUCHAR NtOwfPassword2 OPTIONAL,
  963. #endif // defined(REMOTE_BOOT)
  964. IN PUCHAR Sid,
  965. IN OUT PRI_SECRET Secret
  966. );
  967. #if defined(REMOTE_BOOT_SECURITY)
  968. VOID
  969. BlParseSecret(
  970. IN OUT PUCHAR Domain,
  971. IN OUT PUCHAR User,
  972. IN OUT PUCHAR LmOwfPassword1,
  973. IN OUT PUCHAR NtOwfPassword1,
  974. IN OUT PUCHAR LmOwfPassword2,
  975. IN OUT PUCHAR NtOwfPassword2,
  976. IN OUT PUCHAR Sid,
  977. IN PRI_SECRET Secret
  978. );
  979. #endif // defined(REMOTE_BOOT_SECURITY)
  980. VOID
  981. BlOwfPassword(
  982. IN PUCHAR Password,
  983. IN PUNICODE_STRING UnicodePassword,
  984. IN OUT PUCHAR LmOwfPassword,
  985. IN OUT PUCHAR NtOwfPassword
  986. );
  987. //
  988. // Define external references.
  989. //
  990. extern ULONG BlConsoleOutDeviceId;
  991. extern ULONG BlConsoleInDeviceId;
  992. extern ULONG BlDcacheFillSize;
  993. extern ULONG_PTR BlHeapFree;
  994. extern ULONG_PTR BlHeapLimit;
  995. extern PLOADER_PARAMETER_BLOCK BlLoaderBlock;
  996. extern ULONG DbcsLangId;
  997. extern BOOLEAN BlRebootSystem;
  998. extern ULONG BlVirtualBias;
  999. extern BOOLEAN BlBootingFromNet;
  1000. extern BOOLEAN BlUsePae;
  1001. extern BOOLEAN BlOldKernel;
  1002. extern BOOLEAN BlKernelChecked;
  1003. extern BOOLEAN BlRestoring;
  1004. #if defined(_ALPHA_) || defined(_IA64_)
  1005. extern ULONG HiberNoMappings;
  1006. extern ULONG HiberFirstRemap;
  1007. extern ULONG HiberLastRemap;
  1008. extern BOOLEAN HiberOutOfRemap;
  1009. extern BOOLEAN HiberIoError;
  1010. #endif
  1011. //
  1012. // Special linker-defined symbols. osloader_EXPORTS is the RVA of the
  1013. // export table in the osloader.exe image.
  1014. // header is the base address of the osloader image.
  1015. //
  1016. // This allows the OsLoader to export entry points for SCSI miniport drivers.
  1017. //
  1018. #if defined(_X86_)
  1019. extern ULONG OsLoaderBase;
  1020. extern ULONG OsLoaderExports;
  1021. #endif
  1022. #if defined(_IA64_)
  1023. extern LONG_PTR OsLoaderBase;
  1024. extern LONG_PTR OsLoaderExports;
  1025. #endif
  1026. //
  1027. // Routine to get graphics characters.
  1028. //
  1029. typedef enum {
  1030. GraphicsCharDoubleRightDoubleDown = 0,
  1031. GraphicsCharDoubleLeftDoubleDown,
  1032. GraphicsCharDoubleRightDoubleUp,
  1033. GraphicsCharDoubleLeftDoubleUp,
  1034. GraphicsCharDoubleVertical,
  1035. GraphicsCharDoubleHorizontal,
  1036. #ifdef EFI
  1037. GraphicsCharFullBlock,
  1038. GraphicsCharLightShade,
  1039. #endif
  1040. GraphicsCharMax
  1041. } GraphicsChar;
  1042. _TUCHAR
  1043. GetGraphicsChar(
  1044. IN GraphicsChar WhichOne
  1045. );
  1046. _TUCHAR
  1047. TextGetGraphicsCharacter(
  1048. IN GraphicsChar WhichOne
  1049. );
  1050. //
  1051. // Control sequence introducer.
  1052. //
  1053. // On x86 machines the loaders support dbcs and so using
  1054. // 0x9b for output is no good (that value is a dbcs lead byte
  1055. // in several codepages). Escape-leftbracket is a synonym for CSI
  1056. // in the emulated ARC console on x86 (and on many ARC machines too
  1057. // but since we can't be sure all the machines out there support
  1058. // this we use the old-style csi on non-x86).
  1059. //
  1060. // We ignore this issue for characters read from the ARC console
  1061. // since we don't ask for any text to be typed in, just arrow keys,
  1062. // escape, F#, enter, etc.
  1063. //
  1064. #define ASCI_CSI_IN 0x9b
  1065. #if defined(_X86_) || defined(_IA64_)
  1066. #define ASCI_CSI_OUT TEXT("\033[") // escape-leftbracket
  1067. #else
  1068. #define ASCI_CSI_OUT TEXT("\233") // 0x9b
  1069. #endif
  1070. //
  1071. // Define OS/2 executable resource information structure.
  1072. //
  1073. #define FONT_DIRECTORY 0x8007
  1074. #define FONT_RESOURCE 0x8008
  1075. typedef struct _RESOURCE_TYPE_INFORMATION {
  1076. USHORT Ident;
  1077. USHORT Number;
  1078. LONG Proc;
  1079. } RESOURCE_TYPE_INFORMATION, *PRESOURCE_TYPE_INFORMATION;
  1080. //
  1081. // Define OS/2 executable resource name information structure.
  1082. //
  1083. typedef struct _RESOURCE_NAME_INFORMATION {
  1084. USHORT Offset;
  1085. USHORT Length;
  1086. USHORT Flags;
  1087. USHORT Ident;
  1088. USHORT Handle;
  1089. USHORT Usage;
  1090. } RESOURCE_NAME_INFORMATION, *PRESOURCE_NAME_INFORMATION;
  1091. //
  1092. // Support for reading compressed files directly (single-file MS-ZIP cabinets)
  1093. //
  1094. VOID
  1095. DecompEnableDecompression(
  1096. IN BOOLEAN Enable
  1097. );
  1098. ULONG
  1099. DecompPrepareToReadCompressedFile(
  1100. IN LPCSTR Filename,
  1101. IN ULONG FileId
  1102. );
  1103. BOOLEAN
  1104. DecompGenerateCompressedName(
  1105. IN LPCSTR Filename,
  1106. OUT LPSTR CompressedName
  1107. );
  1108. //
  1109. // Define debug logging macros and functions.
  1110. //
  1111. #if !DBG && !BLLOGENABLED
  1112. #define BlLogInitialize(_x_)
  1113. #define BlLogTerminate()
  1114. #define BlLog(_x_)
  1115. #define BlLogArcDescriptors(_x_)
  1116. #define BlLogMemoryDescriptors(_x_)
  1117. #define BlLogWaitForKeystroke()
  1118. #else
  1119. VOID
  1120. BlLogInitialize (
  1121. IN ULONG LogfileDeviceId
  1122. );
  1123. VOID
  1124. BlLogTerminate (
  1125. VOID
  1126. );
  1127. #define BlLog(_x_) BlLogPrint _x_
  1128. #define LOG_DISPLAY 0x0001
  1129. #define LOG_LOGFILE 0x0002
  1130. #define LOG_DEBUGGER 0x0004
  1131. #define LOG_WAIT 0x8000
  1132. #define LOG_ALL (LOG_DISPLAY | LOG_LOGFILE | LOG_DEBUGGER)
  1133. #define LOG_ALL_W (LOG_ALL | LOG_WAIT)
  1134. VOID
  1135. BlLogPrint (
  1136. ULONG Targets,
  1137. PCHAR Format,
  1138. ...
  1139. );
  1140. VOID
  1141. BlLogArcDescriptors (
  1142. ULONG Targets
  1143. );
  1144. VOID
  1145. BlLogMemoryDescriptors (
  1146. ULONG Targets
  1147. );
  1148. VOID
  1149. BlLogWaitForKeystroke (
  1150. VOID
  1151. );
  1152. #endif // DBG
  1153. VOID
  1154. BlWaitForReboot (
  1155. VOID
  1156. );
  1157. //
  1158. // Machine identification related functions.
  1159. //
  1160. #ifdef _WANT_MACHINE_IDENTIFICATION
  1161. #define BlLoadBiosinfoInf(id,n,d,f,i,is,bn) BlLoadFileImage(id,n,d,f,LoaderRegistryData,i,is,bn)
  1162. #endif
  1163. #define BlLoadDrvDB(id,n,d,f,i,is,bn) BlLoadFileImage(id,n,d,f,LoaderRegistryData,i,is,bn)
  1164. ARC_STATUS
  1165. BlLoadFileImage(
  1166. IN ULONG DeviceId,
  1167. IN PCHAR DeviceName,
  1168. IN PCHAR Directory,
  1169. IN PUNICODE_STRING FileName,
  1170. IN TYPE_OF_MEMORY MemoryType,
  1171. OUT PVOID *Image,
  1172. OUT PULONG ImageSize,
  1173. OUT PCHAR BadFileName
  1174. );
  1175. #if defined(_X86_)
  1176. BOOLEAN
  1177. BlFindDiskSignature(
  1178. IN PCHAR DiskName,
  1179. IN PARC_DISK_SIGNATURE Signature
  1180. );
  1181. VOID
  1182. AETerminateIo(
  1183. VOID
  1184. );
  1185. BOOLEAN
  1186. BlDetectLegacyFreeBios(
  1187. VOID
  1188. );
  1189. #endif
  1190. //
  1191. //
  1192. // N.B. We can speed up the boot time, by not
  1193. // querying the device for all the possible file systems
  1194. // for every open call. This saves approximately 30 secs
  1195. // on CD-ROM / DVD-ROM boot time. To disable this feature
  1196. // just undef CACHE_DEVINFO below
  1197. //
  1198. //
  1199. #define CACHE_DEVINFO 1
  1200. #ifdef CACHE_DEVINFO
  1201. //
  1202. // NB: make sure that the arc close now invalidates the
  1203. // device to filesystem cache entry
  1204. //
  1205. #ifdef ArcClose
  1206. ARC_STATUS
  1207. ArcCacheClose(
  1208. IN ULONG DeviceId
  1209. );
  1210. //
  1211. // Redefine the arc close
  1212. //
  1213. #undef ArcClose
  1214. #define ArcClose(_x) ArcCacheClose(_x)
  1215. //
  1216. // File system cache clearing hook
  1217. //
  1218. typedef
  1219. VOID
  1220. (*PARC_DEVICE_CLOSE_NOTIFICATION) (
  1221. IN ULONG DeviceId
  1222. );
  1223. //
  1224. // Maximum entities which can register for device close
  1225. // notification
  1226. //
  1227. #define MAX_DEVICE_CLOSE_NOTIFICATION_SIZE 5
  1228. extern PARC_DEVICE_CLOSE_NOTIFICATION
  1229. DeviceCloseNotify[MAX_DEVICE_CLOSE_NOTIFICATION_SIZE];
  1230. ARC_STATUS
  1231. ArcRegisterForDeviceClose(
  1232. PARC_DEVICE_CLOSE_NOTIFICATION FlushRoutine
  1233. );
  1234. ARC_STATUS
  1235. ArcDeRegisterForDeviceClose(
  1236. PARC_DEVICE_CLOSE_NOTIFICATION FlushRoutine
  1237. );
  1238. #endif //ArcClose
  1239. #endif // CACHE_DEVINFO
  1240. //
  1241. // progress bar functions
  1242. // (in blload.c)
  1243. //
  1244. VOID
  1245. BlUpdateBootStatus(
  1246. VOID
  1247. );
  1248. VOID
  1249. BlRedrawProgressBar(
  1250. VOID
  1251. );
  1252. VOID
  1253. BlUpdateProgressBar(
  1254. ULONG fPercentage
  1255. );
  1256. VOID
  1257. BlOutputStartupMsg(
  1258. ULONG uMsgID
  1259. );
  1260. VOID
  1261. BlOutputStartupMsgStr(
  1262. PCTSTR MsgStr
  1263. );
  1264. VOID
  1265. BlOutputTrailerMsg(
  1266. ULONG uMsgID
  1267. );
  1268. VOID
  1269. BlOutputTrailerMsgStr(
  1270. PCTSTR MsgStr
  1271. );
  1272. VOID
  1273. BlSetProgBarCharacteristics(
  1274. IN ULONG FrontCharMsgID,
  1275. IN ULONG BackCharMsgID
  1276. );
  1277. //
  1278. // The following routines are used by the loader to translate signature-based
  1279. // arcnames to scsi-based names.
  1280. //
  1281. PCONFIGURATION_COMPONENT
  1282. ScsiGetFirstConfiguredTargetComponent(
  1283. IN ULONG ScsiNumber
  1284. );
  1285. PCONFIGURATION_COMPONENT
  1286. ScsiGetNextConfiguredTargetComponent(
  1287. IN PCONFIGURATION_COMPONENT TargetComponent
  1288. );
  1289. PCONFIGURATION_COMPONENT
  1290. ScsiGetFirstConfiguredLunComponent(
  1291. IN PCONFIGURATION_COMPONENT TargetComponent
  1292. );
  1293. PCONFIGURATION_COMPONENT
  1294. ScsiGetNextConfiguredLunComponent(
  1295. IN PCONFIGURATION_COMPONENT LunComponent
  1296. );
  1297. BOOLEAN
  1298. ScsiGetDevicePath(
  1299. IN ULONG ScsiNumber,
  1300. IN PCONFIGURATION_COMPONENT TargetComponent,
  1301. IN PCONFIGURATION_COMPONENT LunComponent,
  1302. OUT PCHAR DevicePath
  1303. );
  1304. //
  1305. // Boot Status Data support functions.
  1306. //
  1307. ULONG
  1308. BlGetLastBootStatus(
  1309. IN PVOID DataHandle,
  1310. OUT BSD_LAST_BOOT_STATUS *LastBootStatus
  1311. );
  1312. VOID
  1313. BlAutoAdvancedBoot(
  1314. IN OUT PCHAR *LoadOptions,
  1315. IN BSD_LAST_BOOT_STATUS LastBootStatus,
  1316. IN ULONG AdvancedMode
  1317. );
  1318. VOID
  1319. BlWriteBootStatusFlags(
  1320. IN ULONG SystemPartitionId,
  1321. IN PUCHAR SystemDirectory,
  1322. IN BOOLEAN LastBootGood,
  1323. IN BOOLEAN LastBootShutdown
  1324. );
  1325. ARC_STATUS
  1326. BlLockBootStatusData(
  1327. IN ULONG SystemPartitionId,
  1328. IN PCHAR SystemPartition,
  1329. IN PCHAR SystemDirectory,
  1330. OUT PVOID *DataHandle
  1331. );
  1332. ARC_STATUS
  1333. BlGetSetBootStatusData(
  1334. IN PVOID DataHandle,
  1335. IN BOOLEAN Get,
  1336. IN RTL_BSD_ITEM_TYPE DataItem,
  1337. IN PVOID DataBuffer,
  1338. IN ULONG DataBufferLength,
  1339. OUT PULONG BytesReturned OPTIONAL
  1340. );
  1341. VOID
  1342. BlUnlockBootStatusData(
  1343. IN PVOID DataHandle
  1344. );
  1345. #if defined(_IA64_) || defined(_X86_)
  1346. #define EFI_PARTITION_SUPPORT 1
  1347. #endif
  1348. #if defined(_IA64_)
  1349. extern BOOLEAN BlUsePrivateDescriptor;
  1350. #endif
  1351. //
  1352. // Boot Flags. These are passed from the startup module (startup.com,
  1353. // startrom.com or any of the other flavors) to NTLDR. NTDLR will use
  1354. // this flag to control different boot options, such as, whether
  1355. // to reboot on an NTDLR failure.
  1356. //
  1357. // upon any startup / ntldr failures the machine will reboot
  1358. // instead of waiting for a key press
  1359. #define BOOTFLAG_REBOOT_ON_FAILURE 0x000000001
  1360. #endif // _BLDR_