ReactOS  0.4.14-dev-49-gfb4591c
bcd.h
Go to the documentation of this file.
1 /*
2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS Boot Configuration Data
4 * FILE: boot/environ/include/bcd.h
5 * PURPOSE: BCD Main Header
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8 
9 #ifndef _BCD_H
10 #define _BCD_H
11 
12 /* ENUMERATIONS **************************************************************/
13 
14 /* See https://msdn.microsoft.com/en-us/library/windows/desktop/aa964229(v=vs.85).aspx */
15 
16 #define BCD_CLASS_LIBRARY 0x01
17 #define BCD_CLASS_APPLICATION 0x02
18 #define BCD_CLASS_DEVICE 0x03
19 #define BCD_CLASS_OEM 0x05
20 
21 #define BCD_TYPE_DEVICE 0x01
22 #define BCD_TYPE_STRING 0x02
23 #define BCD_TYPE_OBJECT 0x03
24 #define BCD_TYPE_OBJECT_LIST 0x04
25 #define BCD_TYPE_INTEGER 0x05
26 #define BCD_TYPE_BOOLEAN 0x06
27 #define BCD_TYPE_INTEGER_LIST 0x07
28 
29 #define BCD_IMAGE_TYPE_FIRMWARE 0x01
30 #define BCD_IMAGE_TYPE_BOOT_APP 0x02
31 #define BCD_IMAGE_TYPE_NTLDR 0x03
32 #define BCD_IMAGE_TYPE_REAL_MODE 0x04
33 
34 #define BCD_APPLICATION_TYPE_FWBOOTMGR 0x01
35 #define BCD_APPLICATION_TYPE_BOOTMGR 0x02
36 #define BCD_APPLICATION_TYPE_OSLOADER 0x03
37 #define BCD_APPLICATION_TYPE_RESUME 0x04
38 #define BCD_APPLICATION_TYPE_MEMDIAG 0x05
39 #define BCD_APPLICATION_TYPE_NTLDR 0x06
40 #define BCD_APPLICATION_TYPE_SETUPLDR 0x07
41 #define BCD_APPLICATION_TYPE_BOOTSECTOR 0x08
42 #define BCD_APPLICATION_TYPE_STARTUPCOM 0x09
43 
44 #define BCD_OBJECT_TYPE_APPLICATION 0x01
45 #define BCD_OBJECT_TYPE_INHERIT 0x02
46 #define BCD_OBJECT_TYPE_DEVICE 0x03
47 
49 {
85  BcdLibraryBoolean_PreserveBsdLog = 0x16000045, /* Undocumented */
95  BcdLibraryInteger_DisplayMessage = 0x15000065, /* Undocumented */
96  BcdLibraryInteger_DisplayMessageOverride = 0x15000066, /* Undocumented */
97  BcdLibraryInteger_UndocumentedMagic = 0x15000075, /* Undocumented magic */
105  BcdLibraryBoolean_MobileGraphics = 0x1600007A /* Undocumented */
107 
109 {
158  BcdOSLoaderBoolean_OptionsEditOneTime = 0x260000C4, /* Undocumented */
180 
182 {
198 
200 {
201  Reserved1 = 0x21000001,
202  Reserved2 = 0x22000002,
208 
210 {
220 
221 /* Undocumented */
223 {
227 
228 /* DATA STRUCTURES ***********************************************************/
229 
230 typedef struct
231 {
232  union
233  {
235  struct
236  {
240  };
241  };
243 
244 typedef struct
245 {
246  union
247  {
249  union
250  {
251  struct
252  {
257  } Application;
258  struct
259  {
260  ULONG Value : 20;
262  ULONG Reserved : 4;
263  ULONG ObjectCode : 4;
264  } Inherit;
265  struct
266  {
267  ULONG Reserved:28;
268  ULONG ObjectCode : 4;
269  } Device;
270  };
271  };
272 } BcdObjectType;
273 
274 typedef struct _BCD_ELEMENT_HEADER
275 {
280 
281 typedef struct _BCD_PACKED_ELEMENT
282 {
288 
289 typedef struct _BCD_ELEMENT
290 {
294 
295 typedef struct _BCD_DEVICE_OPTION
296 {
300 
302 {
306 
307 /* FUNCTIONS ******************************************************************/
308 
309 NTSTATUS
312  _In_ PHANDLE StoreHandle
313  );
314 
315 #define BCD_ENUMERATE_FLAG_DEEP 0x04
316 #define BCD_ENUMERATE_FLAG_DEVICES 0x08
317 #define BCD_ENUMERATE_FLAG_IN_ORDER 0x10
318 
319 NTSTATUS
321  _In_ HANDLE BcdHandle,
322  _In_ HANDLE ObjectHandle,
323  _In_ ULONG RootElementType,
324  _In_ ULONG Flags,
326  _Inout_ PULONG ElementSize,
327  _Out_ PULONG ElementCountNe
328  );
329 
330 NTSTATUS
332  _In_ HANDLE BcdHandle,
333  _In_ PGUID ObjectId,
334  _Out_ PHANDLE ObjectHandle
335  );
336 
337 NTSTATUS
339  _In_ HANDLE ObjectHandle,
340  _In_ ULONG Type
341  );
342 
343 NTSTATUS
345  _In_ HANDLE BcdHandle,
346  _In_ HANDLE ObjectHandle,
347  _Out_opt_ PBCD_ELEMENT Elements,
348  _Inout_ PULONG ElementSize,
349  _Out_ PULONG ElementCount
350  );
351 
352 NTSTATUS
354  _In_ HANDLE ObjectHandle,
356  );
357 
358 #endif
struct _BCD_DEVICE_OPTION BCD_DEVICE_OPTION
ULONG Version
Definition: bcd.h:276
enum _BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY
struct _BCD_OBJECT_DESCRIPTION BCD_OBJECT_DESCRIPTION
Type
Definition: Type.h:6
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
BcdStartupElementTypes
Definition: bcd.h:222
enum _BcdResumeElementTypes BcdResumeElementTypes
#define ANYSIZE_ARRAY
Definition: typedefs.h:45
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS BcdOpenStoreFromFile(_In_ PUNICODE_STRING FileName, _In_ PHANDLE StoreHandle)
Definition: bcd.c:1322
_BcdResumeElementTypes
Definition: bcd.h:199
ULONG ObjectCode
Definition: bcd.h:256
_BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY
Definition: bcd.h:209
struct _BCD_ELEMENT BCD_ELEMENT
NTSTATUS BcdOpenObject(_In_ HANDLE BcdHandle, _In_ PGUID ObjectId, _Out_ PHANDLE ObjectHandle)
Definition: bcd.c:506
static const WCHAR Description[]
Definition: oid.c:1266
NTSTATUS BcdEnumerateAndUnpackElements(_In_ HANDLE BcdHandle, _In_ HANDLE ObjectHandle, _Out_opt_ PBCD_ELEMENT Elements, _Inout_ PULONG ElementSize, _Out_ PULONG ElementCount)
Definition: bcd.c:1241
struct _BCD_PACKED_ELEMENT * NextEntry
Definition: bcd.h:283
struct _BCD_ELEMENT * PBCD_ELEMENT
ULONG SubType
Definition: bcd.h:237
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ULONG Value
Definition: bcd.h:260
struct _BCD_PACKED_ELEMENT * PBCD_PACKED_ELEMENT
ULONG ClassCode
Definition: bcd.h:261
#define _Out_
Definition: no_sal2.h:323
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
ULONG ImageCode
Definition: bcd.h:254
BL_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: bcd.h:298
Definition: bcd.h:202
PBCD_ELEMENT_HEADER Header
Definition: bcd.h:291
#define _Out_opt_
Definition: no_sal2.h:339
ULONG Format
Definition: bcd.h:238
NTSTATUS BiGetObjectDescription(_In_ HANDLE ObjectHandle, _Out_ PBCD_OBJECT_DESCRIPTION Description)
Definition: bcd.c:1178
ULONG ApplicationCode
Definition: bcd.h:253
BcdBootMgrElementTypes
Definition: bcd.h:181
#define _Inout_
Definition: no_sal2.h:244
BcdOSLoaderElementTypes
Definition: bcd.h:108
unsigned char UCHAR
Definition: xmlstorage.h:181
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
NTSTATUS BiEnumerateElements(_In_ HANDLE BcdHandle, _In_ HANDLE ObjectHandle, _In_ ULONG RootElementType, _In_ ULONG Flags, _Out_opt_ PBCD_PACKED_ELEMENT Elements, _Inout_ PULONG ElementSize, _Out_ PULONG ElementCountNe)
Definition: bcd.c:804
struct _BCD_OBJECT_DESCRIPTION * PBCD_OBJECT_DESCRIPTION
struct _BCD_PACKED_ELEMENT BCD_PACKED_ELEMENT
#define _In_
Definition: no_sal2.h:204
struct _BCD_ELEMENT_HEADER BCD_ELEMENT_HEADER
ULONG Class
Definition: bcd.h:239
GUID AssociatedEntry
Definition: bcd.h:297
struct _BCD_ELEMENT_HEADER * PBCD_ELEMENT_HEADER
ULONG Reserved
Definition: bcd.h:255
NTSTATUS BcdDeleteElement(_In_ HANDLE ObjectHandle, _In_ ULONG Type)
Definition: bcd.c:560
ULONG PackedValue
Definition: bcd.h:248
unsigned int * PULONG
Definition: retypes.h:1
ULONG PackedValue
Definition: bcd.h:234
Definition: bcd.h:201
struct _BCD_DEVICE_OPTION * PBCD_DEVICE_OPTION
unsigned int ULONG
Definition: retypes.h:1
PUCHAR Body
Definition: bcd.h:292
BcdElementType RootType
Definition: bcd.h:284
BcdLibraryElementTypes
Definition: bcd.h:48