xref: /reactos/base/setup/lib/bootcode.h (revision 40462c92)
1 /*
2  * PROJECT:     ReactOS Setup Library
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     BootCode support functions.
5  * COPYRIGHT:   Copyright 2020 Hermes Belusca-Maito
6  */
7 
8 #pragma once
9 
10 #ifdef SECTORSIZE
11 #undef SECTORSIZE
12 #endif
13 #define SECTORSIZE 512
14 
15 typedef struct _BOOTCODE
16 {
17     PVOID BootCode;
18     ULONG Length;
19 } BOOTCODE, *PBOOTCODE;
20 
21 NTSTATUS
22 ReadBootCodeByHandle(
23     IN OUT PBOOTCODE BootCodeInfo,
24     IN HANDLE FileHandle,
25     IN ULONG Length OPTIONAL);
26 
27 NTSTATUS
28 ReadBootCodeFromFile(
29     IN OUT PBOOTCODE BootCodeInfo,
30     IN PUNICODE_STRING FilePath,
31     IN ULONG Length OPTIONAL);
32 
33 VOID
34 FreeBootCode(
35     IN OUT PBOOTCODE BootCodeInfo);
36 
37 /* EOF */
38