ReactOS 0.4.15-dev-8422-g6219a1a
bcd.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BcdElementType
 
struct  BcdObjectType
 
struct  _BCD_ELEMENT_HEADER
 
struct  _BCD_PACKED_ELEMENT
 
struct  _BCD_ELEMENT
 
struct  _BCD_DEVICE_OPTION
 
struct  _BCD_OBJECT_DESCRIPTION
 

Macros

#define BCD_CLASS_LIBRARY   0x01
 
#define BCD_CLASS_APPLICATION   0x02
 
#define BCD_CLASS_DEVICE   0x03
 
#define BCD_CLASS_OEM   0x05
 
#define BCD_TYPE_DEVICE   0x01
 
#define BCD_TYPE_STRING   0x02
 
#define BCD_TYPE_OBJECT   0x03
 
#define BCD_TYPE_OBJECT_LIST   0x04
 
#define BCD_TYPE_INTEGER   0x05
 
#define BCD_TYPE_BOOLEAN   0x06
 
#define BCD_TYPE_INTEGER_LIST   0x07
 
#define BCD_IMAGE_TYPE_FIRMWARE   0x01
 
#define BCD_IMAGE_TYPE_BOOT_APP   0x02
 
#define BCD_IMAGE_TYPE_NTLDR   0x03
 
#define BCD_IMAGE_TYPE_REAL_MODE   0x04
 
#define BCD_APPLICATION_TYPE_FWBOOTMGR   0x01
 
#define BCD_APPLICATION_TYPE_BOOTMGR   0x02
 
#define BCD_APPLICATION_TYPE_OSLOADER   0x03
 
#define BCD_APPLICATION_TYPE_RESUME   0x04
 
#define BCD_APPLICATION_TYPE_MEMDIAG   0x05
 
#define BCD_APPLICATION_TYPE_NTLDR   0x06
 
#define BCD_APPLICATION_TYPE_SETUPLDR   0x07
 
#define BCD_APPLICATION_TYPE_BOOTSECTOR   0x08
 
#define BCD_APPLICATION_TYPE_STARTUPCOM   0x09
 
#define BCD_OBJECT_TYPE_APPLICATION   0x01
 
#define BCD_OBJECT_TYPE_INHERIT   0x02
 
#define BCD_OBJECT_TYPE_DEVICE   0x03
 
#define BCD_ENUMERATE_FLAG_DEEP   0x04
 
#define BCD_ENUMERATE_FLAG_DEVICES   0x08
 
#define BCD_ENUMERATE_FLAG_IN_ORDER   0x10
 

Typedefs

typedef enum BcdLibraryElementTypes BcdLibraryElementTypes
 
typedef enum BcdOSLoaderElementTypes BcdOSLoaderElementTypes
 
typedef enum BcdBootMgrElementTypes BcdBootMgrElementTypes
 
typedef enum _BcdResumeElementTypes BcdResumeElementTypes
 
typedef enum _BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY
 
typedef enum BcdStartupElementTypes BcdStartupElementTypes
 
typedef struct _BCD_ELEMENT_HEADER BCD_ELEMENT_HEADER
 
typedef struct _BCD_ELEMENT_HEADERPBCD_ELEMENT_HEADER
 
typedef struct _BCD_PACKED_ELEMENT BCD_PACKED_ELEMENT
 
typedef struct _BCD_PACKED_ELEMENTPBCD_PACKED_ELEMENT
 
typedef struct _BCD_ELEMENT BCD_ELEMENT
 
typedef struct _BCD_ELEMENTPBCD_ELEMENT
 
typedef struct _BCD_DEVICE_OPTION BCD_DEVICE_OPTION
 
typedef struct _BCD_DEVICE_OPTIONPBCD_DEVICE_OPTION
 
typedef struct _BCD_OBJECT_DESCRIPTION BCD_OBJECT_DESCRIPTION
 
typedef struct _BCD_OBJECT_DESCRIPTIONPBCD_OBJECT_DESCRIPTION
 

Enumerations

enum  BcdLibraryElementTypes {
  BcdLibraryDevice_ApplicationDevice = 0x11000001 , BcdLibraryString_ApplicationPath = 0x12000002 , BcdLibraryString_Description = 0x12000004 , BcdLibraryString_PreferredLocale = 0x12000005 ,
  BcdLibraryObjectList_InheritedObjects = 0x14000006 , BcdLibraryInteger_TruncatePhysicalMemory = 0x15000007 , BcdLibraryObjectList_RecoverySequence = 0x14000008 , BcdLibraryBoolean_AutoRecoveryEnabled = 0x16000009 ,
  BcdLibraryIntegerList_BadMemoryList = 0x1700000a , BcdLibraryBoolean_AllowBadMemoryAccess = 0x1600000b , BcdLibraryInteger_FirstMegabytePolicy = 0x1500000c , BcdLibraryInteger_RelocatePhysicalMemory = 0x1500000D ,
  BcdLibraryInteger_AvoidLowPhysicalMemory = 0x1500000E , BcdLibraryBoolean_DebuggerEnabled = 0x16000010 , BcdLibraryInteger_DebuggerType = 0x15000011 , BcdLibraryInteger_SerialDebuggerPortAddress = 0x15000012 ,
  BcdLibraryInteger_SerialDebuggerPort = 0x15000013 , BcdLibraryInteger_SerialDebuggerBaudRate = 0x15000014 , BcdLibraryInteger_1394DebuggerChannel = 0x15000015 , BcdLibraryString_UsbDebuggerTargetName = 0x12000016 ,
  BcdLibraryBoolean_DebuggerIgnoreUsermodeExceptions = 0x16000017 , BcdLibraryInteger_DebuggerStartPolicy = 0x15000018 , BcdLibraryString_DebuggerBusParameters = 0x12000019 , BcdLibraryInteger_DebuggerNetHostIP = 0x1500001A ,
  BcdLibraryInteger_DebuggerNetPort = 0x1500001B , BcdLibraryBoolean_DebuggerNetDhcp = 0x1600001C , BcdLibraryString_DebuggerNetKey = 0x1200001D , BcdLibraryBoolean_EmsEnabled = 0x16000020 ,
  BcdLibraryInteger_EmsPort = 0x15000022 , BcdLibraryInteger_EmsBaudRate = 0x15000023 , BcdLibraryString_LoadOptionsString = 0x12000030 , BcdLibraryBoolean_DisplayAdvancedOptions = 0x16000040 ,
  BcdLibraryBoolean_DisplayOptionsEdit = 0x16000041 , BcdLibraryDevice_BsdLogDevice = 0x11000043 , BcdLibraryString_BsdLogPath = 0x12000044 , BcdLibraryBoolean_PreserveBsdLog = 0x16000045 ,
  BcdLibraryBoolean_GraphicsModeDisabled = 0x16000046 , BcdLibraryInteger_ConfigAccessPolicy = 0x15000047 , BcdLibraryBoolean_DisableIntegrityChecks = 0x16000048 , BcdLibraryBoolean_AllowPrereleaseSignatures = 0x16000049 ,
  BcdLibraryString_FontPath = 0x1200004A , BcdLibraryInteger_SiPolicy = 0x1500004B , BcdLibraryInteger_FveBandId = 0x1500004C , BcdLibraryBoolean_ConsoleExtendedInput = 0x16000050 ,
  BcdLibraryInteger_GraphicsResolution = 0x15000052 , BcdLibraryInteger_DisplayMessage = 0x15000065 , BcdLibraryInteger_DisplayMessageOverride = 0x15000066 , BcdLibraryInteger_UndocumentedMagic = 0x15000075 ,
  BcdLibraryBoolean_RestartOnFailure = 0x16000053 , BcdLibraryBoolean_GraphicsForceHighestMode = 0x16000054 , BcdLibraryBoolean_IsolatedExecutionContext = 0x16000060 , BcdLibraryBoolean_BootUxDisable = 0x1600006C ,
  BcdLibraryBoolean_BootShutdownDisabled = 0x16000074 , BcdLibraryIntegerList_AllowedInMemorySettings = 0x17000077 , BcdLibraryBoolean_ForceFipsCrypto = 0x16000079 , BcdLibraryBoolean_MobileGraphics = 0x1600007A
}
 
enum  BcdOSLoaderElementTypes {
  BcdOSLoaderDevice_OSDevice = 0x21000001 , BcdOSLoaderString_SystemRoot = 0x22000002 , BcdOSLoaderObject_AssociatedResumeObject = 0x23000003 , BcdOSLoaderBoolean_DetectKernelAndHal = 0x26000010 ,
  BcdOSLoaderString_KernelPath = 0x22000011 , BcdOSLoaderString_HalPath = 0x22000012 , BcdOSLoaderString_DbgTransportPath = 0x22000013 , BcdOSLoaderInteger_NxPolicy = 0x25000020 ,
  BcdOSLoaderInteger_PAEPolicy = 0x25000021 , BcdOSLoaderBoolean_WinPEMode = 0x26000022 , BcdOSLoaderBoolean_DisableCrashAutoReboot = 0x26000024 , BcdOSLoaderBoolean_UseLastGoodSettings = 0x26000025 ,
  BcdOSLoaderBoolean_AllowPrereleaseSignatures = 0x26000027 , BcdOSLoaderBoolean_NoLowMemory = 0x26000030 , BcdOSLoaderInteger_RemoveMemory = 0x25000031 , BcdOSLoaderInteger_IncreaseUserVa = 0x25000032 ,
  BcdOSLoaderBoolean_UseVgaDriver = 0x26000040 , BcdOSLoaderBoolean_DisableBootDisplay = 0x26000041 , BcdOSLoaderBoolean_DisableVesaBios = 0x26000042 , BcdOSLoaderBoolean_DisableVgaMode = 0x26000043 ,
  BcdOSLoaderInteger_ClusterModeAddressing = 0x25000050 , BcdOSLoaderBoolean_UsePhysicalDestination = 0x26000051 , BcdOSLoaderInteger_RestrictApicCluster = 0x25000052 , BcdOSLoaderBoolean_UseLegacyApicMode = 0x26000054 ,
  BcdOSLoaderInteger_X2ApicPolicy = 0x25000055 , BcdOSLoaderBoolean_UseBootProcessorOnly = 0x26000060 , BcdOSLoaderInteger_NumberOfProcessors = 0x25000061 , BcdOSLoaderBoolean_ForceMaximumProcessors = 0x26000062 ,
  BcdOSLoaderBoolean_ProcessorConfigurationFlags = 0x25000063 , BcdOSLoaderBoolean_MaximizeGroupsCreated = 0x26000064 , BcdOSLoaderBoolean_ForceGroupAwareness = 0x26000065 , BcdOSLoaderInteger_GroupSize = 0x25000066 ,
  BcdOSLoaderInteger_UseFirmwarePciSettings = 0x26000070 , BcdOSLoaderInteger_MsiPolicy = 0x25000071 , BcdOSLoaderInteger_SafeBoot = 0x25000080 , BcdOSLoaderBoolean_SafeBootAlternateShell = 0x26000081 ,
  BcdOSLoaderBoolean_BootLogInitialization = 0x26000090 , BcdOSLoaderBoolean_VerboseObjectLoadMode = 0x26000091 , BcdOSLoaderBoolean_KernelDebuggerEnabled = 0x260000a0 , BcdOSLoaderBoolean_DebuggerHalBreakpoint = 0x260000a1 ,
  BcdOSLoaderBoolean_UsePlatformClock = 0x260000A2 , BcdOSLoaderBoolean_ForceLegacyPlatform = 0x260000A3 , BcdOSLoaderInteger_TscSyncPolicy = 0x250000A6 , BcdOSLoaderBoolean_EmsEnabled = 0x260000B0 ,
  BcdOSLoaderInteger_ForceFailure = 0x250000C0 , BcdOSLoaderInteger_DriverLoadFailurePolicy = 0x250000C1 , BcdOSLoaderInteger_BootMenuPolicy = 0x250000C2 , BcdOSLoaderBoolean_AdvancedOptionsOneTime = 0x260000C3 ,
  BcdOSLoaderBoolean_OptionsEditOneTime = 0x260000C4 , BcdOSLoaderInteger_BootStatusPolicy = 0x250000E0 , BcdOSLoaderBoolean_DisableElamDrivers = 0x260000E1 , BcdOSLoaderInteger_HypervisorLaunchType = 0x250000F0 ,
  BcdOSLoaderBoolean_HypervisorDebuggerEnabled = 0x260000F2 , BcdOSLoaderInteger_HypervisorDebuggerType = 0x250000F3 , BcdOSLoaderInteger_HypervisorDebuggerPortNumber = 0x250000F4 , BcdOSLoaderInteger_HypervisorDebuggerBaudrate = 0x250000F5 ,
  BcdOSLoaderInteger_HypervisorDebugger1394Channel = 0x250000F6 , BcdOSLoaderInteger_BootUxPolicy = 0x250000F7 , BcdOSLoaderString_HypervisorDebuggerBusParams = 0x220000F9 , BcdOSLoaderInteger_HypervisorNumProc = 0x250000FA ,
  BcdOSLoaderInteger_HypervisorRootProcPerNode = 0x250000FB , BcdOSLoaderBoolean_HypervisorUseLargeVTlb = 0x260000FC , BcdOSLoaderInteger_HypervisorDebuggerNetHostIp = 0x250000FD , BcdOSLoaderInteger_HypervisorDebuggerNetHostPort = 0x250000FE ,
  BcdOSLoaderInteger_TpmBootEntropyPolicy = 0x25000100 , BcdOSLoaderString_HypervisorDebuggerNetKey = 0x22000110 , BcdOSLoaderBoolean_HypervisorDebuggerNetDhcp = 0x26000114 , BcdOSLoaderInteger_HypervisorIommuPolicy = 0x25000115 ,
  BcdOSLoaderInteger_XSaveDisable = 0x2500012b
}
 
enum  BcdBootMgrElementTypes {
  BcdBootMgrObjectList_DisplayOrder = 0x24000001 , BcdBootMgrObjectList_BootSequence = 0x24000002 , BcdBootMgrObject_DefaultObject = 0x23000003 , BcdBootMgrInteger_Timeout = 0x25000004 ,
  BcdBootMgrBoolean_AttemptResume = 0x26000005 , BcdBootMgrObject_ResumeObject = 0x23000006 , BcdBootMgrObjectList_ToolsDisplayOrder = 0x24000010 , BcdBootMgrBoolean_DisplayBootMenu = 0x26000020 ,
  BcdBootMgrBoolean_NoErrorDisplay = 0x26000021 , BcdBootMgrDevice_BcdDevice = 0x21000022 , BcdBootMgrString_BcdFilePath = 0x22000023 , BcdBootMgrBoolean_ProcessCustomActionsFirst = 0x26000028 ,
  BcdBootMgrIntegerList_CustomActionsList = 0x27000030 , BcdBootMgrBoolean_PersistBootSequence = 0x26000031
}
 
enum  _BcdResumeElementTypes {
  Reserved1 = 0x21000001 , Reserved2 = 0x22000002 , BcdResumeBoolean_UseCustomSettings = 0x26000003 , BcdResumeDevice_AssociatedOsDevice = 0x21000005 ,
  BcdResumeBoolean_DebugOptionEnabled = 0x26000006 , BcdResumeInteger_BootMenuPolicy = 0x25000008
}
 
enum  _BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY {
  DisplayAllFailures , IgnoreAllFailures , IgnoreShutdownFailures , IgnoreBootFailures ,
  IgnoreCheckpointFailures , DisplayShutdownFailures , DisplayBootFailures , DisplayCheckpointFailures
}
 
enum  BcdStartupElementTypes { BcdStartupBoolean_PxeSoftReboot = 0x26000001 , BcdStartupString_PxeApplicationName = 0x22000002 }
 

Functions

NTSTATUS BcdOpenStoreFromFile (_In_ PUNICODE_STRING FileName, _In_ PHANDLE StoreHandle)
 
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)
 
NTSTATUS BcdOpenObject (_In_ HANDLE BcdHandle, _In_ PGUID ObjectId, _Out_ PHANDLE ObjectHandle)
 
NTSTATUS BcdDeleteElement (_In_ HANDLE ObjectHandle, _In_ ULONG Type)
 
NTSTATUS BcdEnumerateAndUnpackElements (_In_ HANDLE BcdHandle, _In_ HANDLE ObjectHandle, _Out_opt_ PBCD_ELEMENT Elements, _Inout_ PULONG ElementSize, _Out_ PULONG ElementCount)
 
NTSTATUS BiGetObjectDescription (_In_ HANDLE ObjectHandle, _Out_ PBCD_OBJECT_DESCRIPTION Description)
 

Macro Definition Documentation

◆ BCD_APPLICATION_TYPE_BOOTMGR

#define BCD_APPLICATION_TYPE_BOOTMGR   0x02

Definition at line 35 of file bcd.h.

◆ BCD_APPLICATION_TYPE_BOOTSECTOR

#define BCD_APPLICATION_TYPE_BOOTSECTOR   0x08

Definition at line 41 of file bcd.h.

◆ BCD_APPLICATION_TYPE_FWBOOTMGR

#define BCD_APPLICATION_TYPE_FWBOOTMGR   0x01

Definition at line 34 of file bcd.h.

◆ BCD_APPLICATION_TYPE_MEMDIAG

#define BCD_APPLICATION_TYPE_MEMDIAG   0x05

Definition at line 38 of file bcd.h.

◆ BCD_APPLICATION_TYPE_NTLDR

#define BCD_APPLICATION_TYPE_NTLDR   0x06

Definition at line 39 of file bcd.h.

◆ BCD_APPLICATION_TYPE_OSLOADER

#define BCD_APPLICATION_TYPE_OSLOADER   0x03

Definition at line 36 of file bcd.h.

◆ BCD_APPLICATION_TYPE_RESUME

#define BCD_APPLICATION_TYPE_RESUME   0x04

Definition at line 37 of file bcd.h.

◆ BCD_APPLICATION_TYPE_SETUPLDR

#define BCD_APPLICATION_TYPE_SETUPLDR   0x07

Definition at line 40 of file bcd.h.

◆ BCD_APPLICATION_TYPE_STARTUPCOM

#define BCD_APPLICATION_TYPE_STARTUPCOM   0x09

Definition at line 42 of file bcd.h.

◆ BCD_CLASS_APPLICATION

#define BCD_CLASS_APPLICATION   0x02

Definition at line 17 of file bcd.h.

◆ BCD_CLASS_DEVICE

#define BCD_CLASS_DEVICE   0x03

Definition at line 18 of file bcd.h.

◆ BCD_CLASS_LIBRARY

#define BCD_CLASS_LIBRARY   0x01

Definition at line 16 of file bcd.h.

◆ BCD_CLASS_OEM

#define BCD_CLASS_OEM   0x05

Definition at line 19 of file bcd.h.

◆ BCD_ENUMERATE_FLAG_DEEP

#define BCD_ENUMERATE_FLAG_DEEP   0x04

Definition at line 315 of file bcd.h.

◆ BCD_ENUMERATE_FLAG_DEVICES

#define BCD_ENUMERATE_FLAG_DEVICES   0x08

Definition at line 316 of file bcd.h.

◆ BCD_ENUMERATE_FLAG_IN_ORDER

#define BCD_ENUMERATE_FLAG_IN_ORDER   0x10

Definition at line 317 of file bcd.h.

◆ BCD_IMAGE_TYPE_BOOT_APP

#define BCD_IMAGE_TYPE_BOOT_APP   0x02

Definition at line 30 of file bcd.h.

◆ BCD_IMAGE_TYPE_FIRMWARE

#define BCD_IMAGE_TYPE_FIRMWARE   0x01

Definition at line 29 of file bcd.h.

◆ BCD_IMAGE_TYPE_NTLDR

#define BCD_IMAGE_TYPE_NTLDR   0x03

Definition at line 31 of file bcd.h.

◆ BCD_IMAGE_TYPE_REAL_MODE

#define BCD_IMAGE_TYPE_REAL_MODE   0x04

Definition at line 32 of file bcd.h.

◆ BCD_OBJECT_TYPE_APPLICATION

#define BCD_OBJECT_TYPE_APPLICATION   0x01

Definition at line 44 of file bcd.h.

◆ BCD_OBJECT_TYPE_DEVICE

#define BCD_OBJECT_TYPE_DEVICE   0x03

Definition at line 46 of file bcd.h.

◆ BCD_OBJECT_TYPE_INHERIT

#define BCD_OBJECT_TYPE_INHERIT   0x02

Definition at line 45 of file bcd.h.

◆ BCD_TYPE_BOOLEAN

#define BCD_TYPE_BOOLEAN   0x06

Definition at line 26 of file bcd.h.

◆ BCD_TYPE_DEVICE

#define BCD_TYPE_DEVICE   0x01

Definition at line 21 of file bcd.h.

◆ BCD_TYPE_INTEGER

#define BCD_TYPE_INTEGER   0x05

Definition at line 25 of file bcd.h.

◆ BCD_TYPE_INTEGER_LIST

#define BCD_TYPE_INTEGER_LIST   0x07

Definition at line 27 of file bcd.h.

◆ BCD_TYPE_OBJECT

#define BCD_TYPE_OBJECT   0x03

Definition at line 23 of file bcd.h.

◆ BCD_TYPE_OBJECT_LIST

#define BCD_TYPE_OBJECT_LIST   0x04

Definition at line 24 of file bcd.h.

◆ BCD_TYPE_STRING

#define BCD_TYPE_STRING   0x02

Definition at line 22 of file bcd.h.

Typedef Documentation

◆ BCD_DEVICE_OPTION

◆ BCD_ELEMENT

◆ BCD_ELEMENT_HEADER

◆ BCD_OBJECT_DESCRIPTION

◆ BCD_PACKED_ELEMENT

◆ BcdBootMgrElementTypes

◆ BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY

◆ BcdLibraryElementTypes

◆ BcdOSLoaderElementTypes

◆ BcdResumeElementTypes

◆ BcdStartupElementTypes

◆ PBCD_DEVICE_OPTION

◆ PBCD_ELEMENT

◆ PBCD_ELEMENT_HEADER

◆ PBCD_OBJECT_DESCRIPTION

◆ PBCD_PACKED_ELEMENT

Enumeration Type Documentation

◆ _BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY

Enumerator
DisplayAllFailures 
IgnoreAllFailures 
IgnoreShutdownFailures 
IgnoreBootFailures 
IgnoreCheckpointFailures 
DisplayShutdownFailures 
DisplayBootFailures 
DisplayCheckpointFailures 

Definition at line 209 of file bcd.h.

210{
@ DisplayShutdownFailures
Definition: bcd.h:216
@ IgnoreCheckpointFailures
Definition: bcd.h:215
@ IgnoreBootFailures
Definition: bcd.h:214
@ DisplayCheckpointFailures
Definition: bcd.h:218
@ IgnoreShutdownFailures
Definition: bcd.h:213
@ DisplayBootFailures
Definition: bcd.h:217
@ IgnoreAllFailures
Definition: bcd.h:212
@ DisplayAllFailures
Definition: bcd.h:211
enum _BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY BCDE_OSLOADER_TYPE_BOOT_STATUS_POLICY

◆ _BcdResumeElementTypes

Enumerator
Reserved1 
Reserved2 
BcdResumeBoolean_UseCustomSettings 
BcdResumeDevice_AssociatedOsDevice 
BcdResumeBoolean_DebugOptionEnabled 
BcdResumeInteger_BootMenuPolicy 

Definition at line 199 of file bcd.h.

200{
201 Reserved1 = 0x21000001,
202 Reserved2 = 0x22000002,
enum _BcdResumeElementTypes BcdResumeElementTypes
@ BcdResumeDevice_AssociatedOsDevice
Definition: bcd.h:204
@ BcdResumeBoolean_DebugOptionEnabled
Definition: bcd.h:205
@ Reserved2
Definition: bcd.h:202
@ BcdResumeInteger_BootMenuPolicy
Definition: bcd.h:206
@ BcdResumeBoolean_UseCustomSettings
Definition: bcd.h:203
@ Reserved1
Definition: bcd.h:201

◆ BcdBootMgrElementTypes

Enumerator
BcdBootMgrObjectList_DisplayOrder 
BcdBootMgrObjectList_BootSequence 
BcdBootMgrObject_DefaultObject 
BcdBootMgrInteger_Timeout 
BcdBootMgrBoolean_AttemptResume 
BcdBootMgrObject_ResumeObject 
BcdBootMgrObjectList_ToolsDisplayOrder 
BcdBootMgrBoolean_DisplayBootMenu 
BcdBootMgrBoolean_NoErrorDisplay 
BcdBootMgrDevice_BcdDevice 
BcdBootMgrString_BcdFilePath 
BcdBootMgrBoolean_ProcessCustomActionsFirst 
BcdBootMgrIntegerList_CustomActionsList 
BcdBootMgrBoolean_PersistBootSequence 

Definition at line 181 of file bcd.h.

182{
186 BcdBootMgrInteger_Timeout = 0x25000004,
192 BcdBootMgrDevice_BcdDevice = 0x21000022,
193 BcdBootMgrString_BcdFilePath = 0x22000023,
BcdBootMgrElementTypes
Definition: bcd.h:182
@ BcdBootMgrBoolean_ProcessCustomActionsFirst
Definition: bcd.h:194
@ BcdBootMgrBoolean_NoErrorDisplay
Definition: bcd.h:191
@ BcdBootMgrBoolean_AttemptResume
Definition: bcd.h:187
@ BcdBootMgrObjectList_DisplayOrder
Definition: bcd.h:183
@ BcdBootMgrObject_ResumeObject
Definition: bcd.h:188
@ BcdBootMgrBoolean_PersistBootSequence
Definition: bcd.h:196
@ BcdBootMgrString_BcdFilePath
Definition: bcd.h:193
@ BcdBootMgrBoolean_DisplayBootMenu
Definition: bcd.h:190
@ BcdBootMgrObject_DefaultObject
Definition: bcd.h:185
@ BcdBootMgrObjectList_ToolsDisplayOrder
Definition: bcd.h:189
@ BcdBootMgrIntegerList_CustomActionsList
Definition: bcd.h:195
@ BcdBootMgrInteger_Timeout
Definition: bcd.h:186
@ BcdBootMgrObjectList_BootSequence
Definition: bcd.h:184
@ BcdBootMgrDevice_BcdDevice
Definition: bcd.h:192

◆ BcdLibraryElementTypes

Enumerator
BcdLibraryDevice_ApplicationDevice 
BcdLibraryString_ApplicationPath 
BcdLibraryString_Description 
BcdLibraryString_PreferredLocale 
BcdLibraryObjectList_InheritedObjects 
BcdLibraryInteger_TruncatePhysicalMemory 
BcdLibraryObjectList_RecoverySequence 
BcdLibraryBoolean_AutoRecoveryEnabled 
BcdLibraryIntegerList_BadMemoryList 
BcdLibraryBoolean_AllowBadMemoryAccess 
BcdLibraryInteger_FirstMegabytePolicy 
BcdLibraryInteger_RelocatePhysicalMemory 
BcdLibraryInteger_AvoidLowPhysicalMemory 
BcdLibraryBoolean_DebuggerEnabled 
BcdLibraryInteger_DebuggerType 
BcdLibraryInteger_SerialDebuggerPortAddress 
BcdLibraryInteger_SerialDebuggerPort 
BcdLibraryInteger_SerialDebuggerBaudRate 
BcdLibraryInteger_1394DebuggerChannel 
BcdLibraryString_UsbDebuggerTargetName 
BcdLibraryBoolean_DebuggerIgnoreUsermodeExceptions 
BcdLibraryInteger_DebuggerStartPolicy 
BcdLibraryString_DebuggerBusParameters 
BcdLibraryInteger_DebuggerNetHostIP 
BcdLibraryInteger_DebuggerNetPort 
BcdLibraryBoolean_DebuggerNetDhcp 
BcdLibraryString_DebuggerNetKey 
BcdLibraryBoolean_EmsEnabled 
BcdLibraryInteger_EmsPort 
BcdLibraryInteger_EmsBaudRate 
BcdLibraryString_LoadOptionsString 
BcdLibraryBoolean_DisplayAdvancedOptions 
BcdLibraryBoolean_DisplayOptionsEdit 
BcdLibraryDevice_BsdLogDevice 
BcdLibraryString_BsdLogPath 
BcdLibraryBoolean_PreserveBsdLog 
BcdLibraryBoolean_GraphicsModeDisabled 
BcdLibraryInteger_ConfigAccessPolicy 
BcdLibraryBoolean_DisableIntegrityChecks 
BcdLibraryBoolean_AllowPrereleaseSignatures 
BcdLibraryString_FontPath 
BcdLibraryInteger_SiPolicy 
BcdLibraryInteger_FveBandId 
BcdLibraryBoolean_ConsoleExtendedInput 
BcdLibraryInteger_GraphicsResolution 
BcdLibraryInteger_DisplayMessage 
BcdLibraryInteger_DisplayMessageOverride 
BcdLibraryInteger_UndocumentedMagic 
BcdLibraryBoolean_RestartOnFailure 
BcdLibraryBoolean_GraphicsForceHighestMode 
BcdLibraryBoolean_IsolatedExecutionContext 
BcdLibraryBoolean_BootUxDisable 
BcdLibraryBoolean_BootShutdownDisabled 
BcdLibraryIntegerList_AllowedInMemorySettings 
BcdLibraryBoolean_ForceFipsCrypto 
BcdLibraryBoolean_MobileGraphics 

Definition at line 48 of file bcd.h.

49{
78 BcdLibraryInteger_EmsPort = 0x15000022,
84 BcdLibraryString_BsdLogPath = 0x12000044,
85 BcdLibraryBoolean_PreserveBsdLog = 0x16000045, /* Undocumented */
90 BcdLibraryString_FontPath = 0x1200004A,
91 BcdLibraryInteger_SiPolicy = 0x1500004B,
92 BcdLibraryInteger_FveBandId = 0x1500004C,
95 BcdLibraryInteger_DisplayMessage = 0x15000065, /* Undocumented */
96 BcdLibraryInteger_DisplayMessageOverride = 0x15000066, /* Undocumented */
97 BcdLibraryInteger_UndocumentedMagic = 0x15000075, /* Undocumented magic */
105 BcdLibraryBoolean_MobileGraphics = 0x1600007A /* Undocumented */
BcdLibraryElementTypes
Definition: bcd.h:49
@ BcdLibraryString_FontPath
Definition: bcd.h:90
@ BcdLibraryInteger_SiPolicy
Definition: bcd.h:91
@ BcdLibraryBoolean_GraphicsModeDisabled
Definition: bcd.h:86
@ BcdLibraryBoolean_AutoRecoveryEnabled
Definition: bcd.h:57
@ BcdLibraryInteger_GraphicsResolution
Definition: bcd.h:94
@ BcdLibraryBoolean_PreserveBsdLog
Definition: bcd.h:85
@ BcdLibraryBoolean_GraphicsForceHighestMode
Definition: bcd.h:99
@ BcdLibraryBoolean_EmsEnabled
Definition: bcd.h:77
@ BcdLibraryString_Description
Definition: bcd.h:52
@ BcdLibraryInteger_EmsBaudRate
Definition: bcd.h:79
@ BcdLibraryString_PreferredLocale
Definition: bcd.h:53
@ BcdLibraryString_DebuggerNetKey
Definition: bcd.h:76
@ BcdLibraryInteger_UndocumentedMagic
Definition: bcd.h:97
@ BcdLibraryDevice_ApplicationDevice
Definition: bcd.h:50
@ BcdLibraryInteger_DebuggerNetHostIP
Definition: bcd.h:73
@ BcdLibraryBoolean_IsolatedExecutionContext
Definition: bcd.h:100
@ BcdLibraryBoolean_DisplayOptionsEdit
Definition: bcd.h:82
@ BcdLibraryObjectList_RecoverySequence
Definition: bcd.h:56
@ BcdLibraryBoolean_MobileGraphics
Definition: bcd.h:105
@ BcdLibraryInteger_FirstMegabytePolicy
Definition: bcd.h:60
@ BcdLibraryDevice_BsdLogDevice
Definition: bcd.h:83
@ BcdLibraryInteger_DebuggerNetPort
Definition: bcd.h:74
@ BcdLibraryObjectList_InheritedObjects
Definition: bcd.h:54
@ BcdLibraryString_DebuggerBusParameters
Definition: bcd.h:72
@ BcdLibraryBoolean_BootShutdownDisabled
Definition: bcd.h:102
@ BcdLibraryInteger_DebuggerType
Definition: bcd.h:64
@ BcdLibraryBoolean_DebuggerEnabled
Definition: bcd.h:63
@ BcdLibraryString_LoadOptionsString
Definition: bcd.h:80
@ BcdLibraryBoolean_DebuggerNetDhcp
Definition: bcd.h:75
@ BcdLibraryString_BsdLogPath
Definition: bcd.h:84
@ BcdLibraryBoolean_DisableIntegrityChecks
Definition: bcd.h:88
@ BcdLibraryIntegerList_BadMemoryList
Definition: bcd.h:58
@ BcdLibraryBoolean_AllowPrereleaseSignatures
Definition: bcd.h:89
@ BcdLibraryInteger_SerialDebuggerPort
Definition: bcd.h:66
@ BcdLibraryBoolean_ConsoleExtendedInput
Definition: bcd.h:93
@ BcdLibraryInteger_DebuggerStartPolicy
Definition: bcd.h:71
@ BcdLibraryIntegerList_AllowedInMemorySettings
Definition: bcd.h:103
@ BcdLibraryInteger_1394DebuggerChannel
Definition: bcd.h:68
@ BcdLibraryBoolean_DisplayAdvancedOptions
Definition: bcd.h:81
@ BcdLibraryInteger_ConfigAccessPolicy
Definition: bcd.h:87
@ BcdLibraryInteger_AvoidLowPhysicalMemory
Definition: bcd.h:62
@ BcdLibraryInteger_DisplayMessageOverride
Definition: bcd.h:96
@ BcdLibraryBoolean_ForceFipsCrypto
Definition: bcd.h:104
@ BcdLibraryInteger_RelocatePhysicalMemory
Definition: bcd.h:61
@ BcdLibraryInteger_TruncatePhysicalMemory
Definition: bcd.h:55
@ BcdLibraryBoolean_DebuggerIgnoreUsermodeExceptions
Definition: bcd.h:70
@ BcdLibraryInteger_EmsPort
Definition: bcd.h:78
@ BcdLibraryString_UsbDebuggerTargetName
Definition: bcd.h:69
@ BcdLibraryInteger_SerialDebuggerPortAddress
Definition: bcd.h:65
@ BcdLibraryInteger_DisplayMessage
Definition: bcd.h:95
@ BcdLibraryString_ApplicationPath
Definition: bcd.h:51
@ BcdLibraryBoolean_AllowBadMemoryAccess
Definition: bcd.h:59
@ BcdLibraryInteger_SerialDebuggerBaudRate
Definition: bcd.h:67
@ BcdLibraryInteger_FveBandId
Definition: bcd.h:92
@ BcdLibraryBoolean_RestartOnFailure
Definition: bcd.h:98
@ BcdLibraryBoolean_BootUxDisable
Definition: bcd.h:101

◆ BcdOSLoaderElementTypes

Enumerator
BcdOSLoaderDevice_OSDevice 
BcdOSLoaderString_SystemRoot 
BcdOSLoaderObject_AssociatedResumeObject 
BcdOSLoaderBoolean_DetectKernelAndHal 
BcdOSLoaderString_KernelPath 
BcdOSLoaderString_HalPath 
BcdOSLoaderString_DbgTransportPath 
BcdOSLoaderInteger_NxPolicy 
BcdOSLoaderInteger_PAEPolicy 
BcdOSLoaderBoolean_WinPEMode 
BcdOSLoaderBoolean_DisableCrashAutoReboot 
BcdOSLoaderBoolean_UseLastGoodSettings 
BcdOSLoaderBoolean_AllowPrereleaseSignatures 
BcdOSLoaderBoolean_NoLowMemory 
BcdOSLoaderInteger_RemoveMemory 
BcdOSLoaderInteger_IncreaseUserVa 
BcdOSLoaderBoolean_UseVgaDriver 
BcdOSLoaderBoolean_DisableBootDisplay 
BcdOSLoaderBoolean_DisableVesaBios 
BcdOSLoaderBoolean_DisableVgaMode 
BcdOSLoaderInteger_ClusterModeAddressing 
BcdOSLoaderBoolean_UsePhysicalDestination 
BcdOSLoaderInteger_RestrictApicCluster 
BcdOSLoaderBoolean_UseLegacyApicMode 
BcdOSLoaderInteger_X2ApicPolicy 
BcdOSLoaderBoolean_UseBootProcessorOnly 
BcdOSLoaderInteger_NumberOfProcessors 
BcdOSLoaderBoolean_ForceMaximumProcessors 
BcdOSLoaderBoolean_ProcessorConfigurationFlags 
BcdOSLoaderBoolean_MaximizeGroupsCreated 
BcdOSLoaderBoolean_ForceGroupAwareness 
BcdOSLoaderInteger_GroupSize 
BcdOSLoaderInteger_UseFirmwarePciSettings 
BcdOSLoaderInteger_MsiPolicy 
BcdOSLoaderInteger_SafeBoot 
BcdOSLoaderBoolean_SafeBootAlternateShell 
BcdOSLoaderBoolean_BootLogInitialization 
BcdOSLoaderBoolean_VerboseObjectLoadMode 
BcdOSLoaderBoolean_KernelDebuggerEnabled 
BcdOSLoaderBoolean_DebuggerHalBreakpoint 
BcdOSLoaderBoolean_UsePlatformClock 
BcdOSLoaderBoolean_ForceLegacyPlatform 
BcdOSLoaderInteger_TscSyncPolicy 
BcdOSLoaderBoolean_EmsEnabled 
BcdOSLoaderInteger_ForceFailure 
BcdOSLoaderInteger_DriverLoadFailurePolicy 
BcdOSLoaderInteger_BootMenuPolicy 
BcdOSLoaderBoolean_AdvancedOptionsOneTime 
BcdOSLoaderBoolean_OptionsEditOneTime 
BcdOSLoaderInteger_BootStatusPolicy 
BcdOSLoaderBoolean_DisableElamDrivers 
BcdOSLoaderInteger_HypervisorLaunchType 
BcdOSLoaderBoolean_HypervisorDebuggerEnabled 
BcdOSLoaderInteger_HypervisorDebuggerType 
BcdOSLoaderInteger_HypervisorDebuggerPortNumber 
BcdOSLoaderInteger_HypervisorDebuggerBaudrate 
BcdOSLoaderInteger_HypervisorDebugger1394Channel 
BcdOSLoaderInteger_BootUxPolicy 
BcdOSLoaderString_HypervisorDebuggerBusParams 
BcdOSLoaderInteger_HypervisorNumProc 
BcdOSLoaderInteger_HypervisorRootProcPerNode 
BcdOSLoaderBoolean_HypervisorUseLargeVTlb 
BcdOSLoaderInteger_HypervisorDebuggerNetHostIp 
BcdOSLoaderInteger_HypervisorDebuggerNetHostPort 
BcdOSLoaderInteger_TpmBootEntropyPolicy 
BcdOSLoaderString_HypervisorDebuggerNetKey 
BcdOSLoaderBoolean_HypervisorDebuggerNetDhcp 
BcdOSLoaderInteger_HypervisorIommuPolicy 
BcdOSLoaderInteger_XSaveDisable 

Definition at line 108 of file bcd.h.

109{
110 BcdOSLoaderDevice_OSDevice = 0x21000001,
111 BcdOSLoaderString_SystemRoot = 0x22000002,
114 BcdOSLoaderString_KernelPath = 0x22000011,
115 BcdOSLoaderString_HalPath = 0x22000012,
117 BcdOSLoaderInteger_NxPolicy = 0x25000020,
118 BcdOSLoaderInteger_PAEPolicy = 0x25000021,
119 BcdOSLoaderBoolean_WinPEMode = 0x26000022,
141 BcdOSLoaderInteger_GroupSize = 0x25000066,
143 BcdOSLoaderInteger_MsiPolicy = 0x25000071,
144 BcdOSLoaderInteger_SafeBoot = 0x25000080,
158 BcdOSLoaderBoolean_OptionsEditOneTime = 0x260000C4, /* Undocumented */
BcdOSLoaderElementTypes
Definition: bcd.h:109
@ BcdOSLoaderString_HalPath
Definition: bcd.h:115
@ BcdOSLoaderObject_AssociatedResumeObject
Definition: bcd.h:112
@ BcdOSLoaderInteger_UseFirmwarePciSettings
Definition: bcd.h:142
@ BcdOSLoaderBoolean_HypervisorUseLargeVTlb
Definition: bcd.h:171
@ BcdOSLoaderInteger_GroupSize
Definition: bcd.h:141
@ BcdOSLoaderBoolean_DisableVesaBios
Definition: bcd.h:128
@ BcdOSLoaderBoolean_UsePlatformClock
Definition: bcd.h:150
@ BcdOSLoaderBoolean_HypervisorDebuggerNetDhcp
Definition: bcd.h:176
@ BcdOSLoaderBoolean_UseVgaDriver
Definition: bcd.h:126
@ BcdOSLoaderInteger_HypervisorDebuggerNetHostIp
Definition: bcd.h:172
@ BcdOSLoaderInteger_RestrictApicCluster
Definition: bcd.h:132
@ BcdOSLoaderDevice_OSDevice
Definition: bcd.h:110
@ BcdOSLoaderBoolean_DebuggerHalBreakpoint
Definition: bcd.h:149
@ BcdOSLoaderInteger_HypervisorLaunchType
Definition: bcd.h:161
@ BcdOSLoaderString_KernelPath
Definition: bcd.h:114
@ BcdOSLoaderBoolean_BootLogInitialization
Definition: bcd.h:146
@ BcdOSLoaderInteger_X2ApicPolicy
Definition: bcd.h:134
@ BcdOSLoaderBoolean_UseLegacyApicMode
Definition: bcd.h:133
@ BcdOSLoaderBoolean_DisableBootDisplay
Definition: bcd.h:127
@ BcdOSLoaderInteger_HypervisorNumProc
Definition: bcd.h:169
@ BcdOSLoaderInteger_NxPolicy
Definition: bcd.h:117
@ BcdOSLoaderBoolean_DetectKernelAndHal
Definition: bcd.h:113
@ BcdOSLoaderInteger_IncreaseUserVa
Definition: bcd.h:125
@ BcdOSLoaderInteger_DriverLoadFailurePolicy
Definition: bcd.h:155
@ BcdOSLoaderBoolean_WinPEMode
Definition: bcd.h:119
@ BcdOSLoaderBoolean_ForceGroupAwareness
Definition: bcd.h:140
@ BcdOSLoaderInteger_BootStatusPolicy
Definition: bcd.h:159
@ BcdOSLoaderBoolean_VerboseObjectLoadMode
Definition: bcd.h:147
@ BcdOSLoaderInteger_MsiPolicy
Definition: bcd.h:143
@ BcdOSLoaderInteger_HypervisorDebuggerPortNumber
Definition: bcd.h:164
@ BcdOSLoaderInteger_NumberOfProcessors
Definition: bcd.h:136
@ BcdOSLoaderBoolean_ProcessorConfigurationFlags
Definition: bcd.h:138
@ BcdOSLoaderString_HypervisorDebuggerNetKey
Definition: bcd.h:175
@ BcdOSLoaderBoolean_UseLastGoodSettings
Definition: bcd.h:121
@ BcdOSLoaderBoolean_DisableElamDrivers
Definition: bcd.h:160
@ BcdOSLoaderInteger_BootMenuPolicy
Definition: bcd.h:156
@ BcdOSLoaderBoolean_UseBootProcessorOnly
Definition: bcd.h:135
@ BcdOSLoaderBoolean_ForceMaximumProcessors
Definition: bcd.h:137
@ BcdOSLoaderBoolean_DisableCrashAutoReboot
Definition: bcd.h:120
@ BcdOSLoaderInteger_XSaveDisable
Definition: bcd.h:178
@ BcdOSLoaderInteger_ClusterModeAddressing
Definition: bcd.h:130
@ BcdOSLoaderInteger_HypervisorDebuggerNetHostPort
Definition: bcd.h:173
@ BcdOSLoaderBoolean_SafeBootAlternateShell
Definition: bcd.h:145
@ BcdOSLoaderBoolean_OptionsEditOneTime
Definition: bcd.h:158
@ BcdOSLoaderInteger_HypervisorDebuggerBaudrate
Definition: bcd.h:165
@ BcdOSLoaderInteger_BootUxPolicy
Definition: bcd.h:167
@ BcdOSLoaderBoolean_AllowPrereleaseSignatures
Definition: bcd.h:122
@ BcdOSLoaderBoolean_UsePhysicalDestination
Definition: bcd.h:131
@ BcdOSLoaderInteger_HypervisorDebuggerType
Definition: bcd.h:163
@ BcdOSLoaderInteger_HypervisorDebugger1394Channel
Definition: bcd.h:166
@ BcdOSLoaderBoolean_EmsEnabled
Definition: bcd.h:153
@ BcdOSLoaderInteger_RemoveMemory
Definition: bcd.h:124
@ BcdOSLoaderInteger_TscSyncPolicy
Definition: bcd.h:152
@ BcdOSLoaderInteger_SafeBoot
Definition: bcd.h:144
@ BcdOSLoaderInteger_TpmBootEntropyPolicy
Definition: bcd.h:174
@ BcdOSLoaderBoolean_HypervisorDebuggerEnabled
Definition: bcd.h:162
@ BcdOSLoaderBoolean_NoLowMemory
Definition: bcd.h:123
@ BcdOSLoaderInteger_HypervisorRootProcPerNode
Definition: bcd.h:170
@ BcdOSLoaderString_HypervisorDebuggerBusParams
Definition: bcd.h:168
@ BcdOSLoaderBoolean_ForceLegacyPlatform
Definition: bcd.h:151
@ BcdOSLoaderInteger_HypervisorIommuPolicy
Definition: bcd.h:177
@ BcdOSLoaderString_SystemRoot
Definition: bcd.h:111
@ BcdOSLoaderBoolean_MaximizeGroupsCreated
Definition: bcd.h:139
@ BcdOSLoaderBoolean_AdvancedOptionsOneTime
Definition: bcd.h:157
@ BcdOSLoaderBoolean_KernelDebuggerEnabled
Definition: bcd.h:148
@ BcdOSLoaderString_DbgTransportPath
Definition: bcd.h:116
@ BcdOSLoaderBoolean_DisableVgaMode
Definition: bcd.h:129
@ BcdOSLoaderInteger_ForceFailure
Definition: bcd.h:154
@ BcdOSLoaderInteger_PAEPolicy
Definition: bcd.h:118

◆ BcdStartupElementTypes

Enumerator
BcdStartupBoolean_PxeSoftReboot 
BcdStartupString_PxeApplicationName 

Definition at line 222 of file bcd.h.

223{
BcdStartupElementTypes
Definition: bcd.h:223
@ BcdStartupString_PxeApplicationName
Definition: bcd.h:225
@ BcdStartupBoolean_PxeSoftReboot
Definition: bcd.h:224

Function Documentation

◆ BcdDeleteElement()

NTSTATUS BcdDeleteElement ( _In_ HANDLE  ObjectHandle,
_In_ ULONG  Type 
)

Definition at line 560 of file bcd.c.

564{
566 HANDLE ElementsHandle, ElementHandle;
567 WCHAR TypeString[22];
568
569 /* Open the elements key */
570 Status = BiOpenKey(ObjectHandle, L"Elements", &ElementsHandle);
571 if (NT_SUCCESS(Status))
572 {
573 /* Convert the element ID into a string */
574 if (!_ultow(Type, TypeString, 16))
575 {
576 /* Failed to do so */
578 }
579 else
580 {
581 /* Open the element specifically */
582 Status = BiOpenKey(ElementsHandle, TypeString, &ElementHandle);
583 if (NT_SUCCESS(Status))
584 {
585 /* Delete it */
586 Status = BiDeleteKey(ElementHandle);
587 if (NT_SUCCESS(Status))
588 {
589 /* No point in closing the handle anymore */
590 ElementHandle = NULL;
591 }
592 }
593 else
594 {
595 /* The element doesn't exist */
597 }
598
599 /* Check if we should close the key */
600 if (ElementHandle)
601 {
602 /* Do it */
603 BiCloseKey(ElementHandle);
604 }
605 }
606 }
607
608 /* Check if we should close the elements handle */
609 if (ElementsHandle)
610 {
611 /* Do it */
612 BiCloseKey(ElementsHandle);
613 }
614
615 /* Return whatever the result was */
616 return Status;
617}
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS BiOpenKey(_In_ HANDLE ParentHandle, _In_ PWCHAR KeyName, _Out_ PHANDLE Handle)
Definition: bootreg.c:186
VOID BiCloseKey(_In_ HANDLE KeyHandle)
Definition: bootreg.c:141
NTSTATUS BiDeleteKey(_In_ HANDLE KeyHandle)
Definition: bootreg.c:892
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
#define L(x)
Definition: ntvdm.h:50
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by BmPurgeOption().

◆ BcdEnumerateAndUnpackElements()

NTSTATUS BcdEnumerateAndUnpackElements ( _In_ HANDLE  BcdHandle,
_In_ HANDLE  ObjectHandle,
_Out_opt_ PBCD_ELEMENT  Elements,
_Inout_ PULONG  ElementSize,
_Out_ PULONG  ElementCount 
)

Definition at line 1241 of file bcd.c.

1248{
1249 PVOID LocalElements;
1251 ULONG LocalElementCount, LocalElementSize;
1252
1253 /* Make sure required parameters are there */
1254 if (!(ElementSize) || !(ElementCount) || ((Elements) && (!*ElementSize)))
1255 {
1257 }
1258
1259 /* Set initial count to zero */
1260 *ElementCount = 0;
1261
1262 /* Do the initial enumeration to figure out the size required */
1263 LocalElementSize = 0;
1264 LocalElementCount = 0;
1265 Status = BiEnumerateElements(BcdHandle,
1266 ObjectHandle,
1267 0,
1271 NULL,
1272 &LocalElementSize,
1273 &LocalElementCount);
1275 {
1276 return Status;
1277 }
1278
1279 /* Now allocate a buffer large enough to hold them */
1280 LocalElements = BlMmAllocateHeap(LocalElementSize);
1281 if (!LocalElements)
1282 {
1284 }
1285
1286 /* Zero out the array and do the real enumeration this time around */
1287 RtlZeroMemory(LocalElements, LocalElementSize);
1288 Status = BiEnumerateElements(BcdHandle,
1289 ObjectHandle,
1290 0,
1294 LocalElements,
1295 &LocalElementSize,
1296 &LocalElementCount);
1297 if (!NT_SUCCESS(Status))
1298 {
1299 return Status;
1300 }
1301
1302 /* Now we know the real count */
1303 *ElementCount = LocalElementCount;
1304
1305 /* Now unpack the data */
1306 Status = BiConvertBcdElements(LocalElements,
1307 Elements,
1308 ElementSize,
1309 &LocalElementCount);
1310 if (NT_SUCCESS(Status))
1311 {
1312 /* Not all elements may have been converted */
1313 *ElementCount = LocalElementCount;
1314 }
1315
1316 /* Free the local (unpacked) buffer and return status */
1317 BlMmFreeHeap(LocalElements);
1318 return Status;
1319}
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 ElementCount)
Definition: bcd.c:804
NTSTATUS BiConvertBcdElements(_In_ PBCD_PACKED_ELEMENT Elements, _Out_opt_ PBCD_ELEMENT Buffer, _Inout_ PULONG BufferSize, _Inout_ PULONG ElementCount)
Definition: bcd.c:350
#define BCD_ENUMERATE_FLAG_DEEP
Definition: bcd.h:315
#define BCD_ENUMERATE_FLAG_DEVICES
Definition: bcd.h:316
#define BCD_ENUMERATE_FLAG_IN_ORDER
Definition: bcd.h:317
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
Definition: heapalloc.c:569
NTSTATUS BlMmFreeHeap(_In_ PVOID Buffer)
Definition: heapalloc.c:663
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Referenced by BmGetOptionList().

◆ BcdOpenObject()

NTSTATUS BcdOpenObject ( _In_ HANDLE  BcdHandle,
_In_ PGUID  ObjectId,
_Out_ PHANDLE  ObjectHandle 
)

Definition at line 506 of file bcd.c.

511{
513 GUID LocalGuid;
515 HANDLE RootObjectHandle;
516
517 /* Assume failure */
518 *ObjectHandle = NULL;
519
520 /* Initialize GUID string */
521 GuidString.Buffer = NULL;
522
523 /* Open the root "Objects" handle */
524 RootObjectHandle = NULL;
525 Status = BiOpenKey(BcdHandle, L"Objects", &RootObjectHandle);
526 if (!NT_SUCCESS(Status))
527 {
528 goto Quickie;
529 }
530
531 /* Capture the object ID and convert it into a string */
532 LocalGuid = *ObjectId;
533 Status = RtlStringFromGUID(&LocalGuid, &GuidString);
534 if (!NT_SUCCESS(Status))
535 {
536 goto Quickie;
537 }
538
539 /* Now open the key containing this object ID */
540 Status = BiOpenKey(RootObjectHandle, GuidString.Buffer, ObjectHandle);
541
542Quickie:
543 /* Free the GUID string if we had one allocated */
544 if (GuidString.Buffer)
545 {
547 }
548
549 /* Close the root handle if it was open */
550 if (RootObjectHandle)
551 {
552 BiCloseKey(RootObjectHandle);
553 }
554
555 /* Return the final status */
556 return Status;
557}
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
static PWSTR GuidString
Definition: apphelp.c:93
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)

Referenced by BiEnumerateSubElements(), BmGetEntryDescription(), BmGetOptionList(), and BmPurgeOption().

◆ BcdOpenStoreFromFile()

NTSTATUS BcdOpenStoreFromFile ( _In_ PUNICODE_STRING  FileName,
_In_ PHANDLE  StoreHandle 
)

Definition at line 1322 of file bcd.c.

1326{
1327 ULONG Length;
1331
1332 /* Assume failure */
1333 LocalHandle = NULL;
1334
1335 /* Allocate a path descriptor */
1336 Length = FileName->Length + sizeof(*FilePath);
1338 if (!FilePath)
1339 {
1340 return STATUS_NO_MEMORY;
1341 }
1342
1343 /* Initialize it */
1344 FilePath->Version = 1;
1345 FilePath->PathType = InternalPath;
1346 FilePath->Length = Length;
1347
1348 /* Copy the name and NULL-terminate it */
1349 RtlCopyMemory(FilePath->Path, FileName->Buffer, Length);
1350 FilePath->Path[Length / sizeof(WCHAR)] = UNICODE_NULL;
1351
1352 /* Open the BCD */
1354 if (NT_SUCCESS(Status))
1355 {
1356 /* Return the handle on success */
1357 *BcdHandle = LocalHandle;
1358 }
1359
1360 /* Free the descriptor and return the status */
1362 return Status;
1363}
PCWSTR FilePath
NTSTATUS BiAddStoreFromFile(_In_ PBL_FILE_PATH_DESCRIPTOR FilePath, _Out_ PHANDLE StoreHandle)
Definition: bcd.c:1143
@ InternalPath
Definition: bl.h:284
HLOCAL NTAPI LocalHandle(LPCVOID pMem)
Definition: heapmem.c:1605
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by BmOpenDataStore().

◆ BiEnumerateElements()

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 at line 804 of file bcd.c.

813{
814 HANDLE ElementsHandle, ElementHandle;
815 ULONG TotalLength, RegistryElementDataLength, RemainingLength;
817 ULONG i;
818 PVOID ElementData, SubObjectList, RegistryElementData;
819 BcdElementType ElementType;
820 PBCD_PACKED_ELEMENT PreviousElement, ElementsStart;
821 ULONG SubElementCount, SubKeyCount, SubObjectCount, ElementDataLength;
822 PWCHAR ElementName;
823 PWCHAR* SubKeys;
824
825 /* Assume failure */
826 *ElementCount = 0;
827
828 /* Initialize all locals that are checked at the end*/
829 SubKeys = NULL;
830 ElementsHandle = NULL;
831 ElementHandle = NULL;
832 ElementData = NULL;
833 RegistryElementData = NULL;
834 PreviousElement = NULL;
835 ElementName = NULL;
836 SubObjectList = NULL;
837 TotalLength = 0;
838 ElementDataLength = 0;
839 SubObjectCount = 0;
840 RemainingLength = 0;
841 ElementsStart = Elements;
842
843 /* Open the root object key's elements */
844 Status = BiOpenKey(ObjectHandle, L"Elements", &ElementsHandle);
845 if (!NT_SUCCESS(Status))
846 {
847 goto Quickie;
848 }
849
850 /* Enumerate all elements */
851 Status = BiEnumerateSubKeys(ElementsHandle, &SubKeys, &SubKeyCount);
852 if (!NT_SUCCESS(Status))
853 {
854 goto Quickie;
855 }
856
857 /* Iterate over each one */
858 for (i = 0; i < SubKeyCount; i++)
859 {
860 /* Open the element */
861 ElementName = SubKeys[i];
862 Status = BiOpenKey(ElementsHandle, ElementName, &ElementHandle);
863 if (!NT_SUCCESS(Status))
864 {
865 EfiPrintf(L"ELEMENT ERROR: %lx\r\n", Status);
866 EfiStall(100000);
867 break;
868 }
869
870 /* The name of the element is its data type */
871 ElementType.PackedValue = wcstoul(SubKeys[i], NULL, 16);
872 if (!(ElementType.PackedValue) || (ElementType.PackedValue == -1))
873 {
874 EfiPrintf(L"Value invalid\r\n");
875 BiCloseKey(ElementHandle);
876 ElementHandle = NULL;
877 continue;
878 }
879
880 /* Read the appropriate registry value type for this element */
881 Status = BiGetRegistryValue(ElementHandle,
882 L"Element",
884 ElementType.Format),
885 &RegistryElementData,
886 &RegistryElementDataLength);
887 if (!NT_SUCCESS(Status))
888 {
889 EfiPrintf(L"Element invalid\r\n");
890 break;
891 }
892
893 /* Now figure out how much space the converted element will need */
894 ElementDataLength = 0;
896 RegistryElementData,
897 RegistryElementDataLength,
898 ElementType,
899 NULL,
900 &ElementDataLength);
902 {
903 break;
904 }
905
906 /* Allocate a buffer big enough for the converted element */
907 ElementData = BlMmAllocateHeap(ElementDataLength);
908 if (!ElementData)
909 {
911 break;
912 }
913
914 /* And actually convert it this time around */
916 RegistryElementData,
917 RegistryElementDataLength,
918 ElementType,
919 ElementData,
920 &ElementDataLength);
921 if (!NT_SUCCESS(Status))
922 {
923 break;
924 }
925
926 /* Safely add space for the packed element header */
927 Status = RtlULongAdd(TotalLength,
929 &TotalLength);
930 if (!NT_SUCCESS(Status))
931 {
932 break;
933 }
934
935 /* Safely add space for the data of the element itself */
936 Status = RtlULongAdd(TotalLength, ElementDataLength, &TotalLength);
937 if (!NT_SUCCESS(Status))
938 {
939 break;
940 }
941
942 /* One more element */
943 ++*ElementCount;
944
945 /* See how much space we were given */
946 RemainingLength = *ElementSize;
947 if (RemainingLength >= TotalLength)
948 {
949 /* Set the next pointer */
950 Elements->NextEntry = (PBCD_PACKED_ELEMENT)((ULONG_PTR)ElementsStart + TotalLength);
951
952 /* Fill this one out */
953 Elements->RootType.PackedValue = RootElementType;
954 Elements->Version = 1;
955 Elements->Type = ElementType.PackedValue;
956 Elements->Size = ElementDataLength;
957
958 /* Add the data */
959 RtlCopyMemory(Elements->Data, ElementData, ElementDataLength);
960 RemainingLength -= TotalLength;
961
962 /* Move to the next element on the next pass */
963 PreviousElement = Elements;
964 Elements = Elements->NextEntry;
965 }
966 else
967 {
968 /* We're out of space */
969 RemainingLength = 0;
970 }
971
972 /* Are we enumerating devices, and is this a device? */
974 (ElementType.Format == BCD_TYPE_DEVICE))
975 {
976 /* Yep, so go inside to enumerate it */
977 Status = BiEnumerateSubElements(BcdHandle,
978 ElementData,
979 ElementType.PackedValue,
980 Flags,
981 &Elements,
982 &ElementDataLength,
983 &SubElementCount);
985 {
986 /* Safely add the length of the sub elements */
987 Status = RtlULongAdd(TotalLength,
988 ElementDataLength,
989 &TotalLength);
990 if (!NT_SUCCESS(Status))
991 {
992 break;
993 }
994
995 /* Add the sub elements to the total */
996 *ElementCount += SubElementCount;
997
998 /* See if we have enough space*/
999 if (*ElementSize >= TotalLength)
1000 {
1001 /* Were there any subelements? */
1002 if (SubElementCount)
1003 {
1004 /* Update to keep track of these new subelements */
1005 ElementDataLength = *ElementSize - TotalLength;
1006
1007 /* Link the subelements into the chain */
1008 PreviousElement = Elements;
1009 PreviousElement->NextEntry =
1010 (PBCD_PACKED_ELEMENT)((ULONG_PTR)ElementsStart +
1011 TotalLength);
1012 Elements = PreviousElement->NextEntry;
1013 }
1014 }
1015 else
1016 {
1017 /* We're out of space */
1018 ElementDataLength = 0;
1019 }
1020 }
1021 else if ((Status != STATUS_NOT_FOUND) &&
1023 {
1024 /* Fatal error trying to read the data, so fail */
1025 break;
1026 }
1027 }
1028 else if ((Flags & BCD_ENUMERATE_FLAG_DEEP) &&
1030 {
1031 /* Inherited objects are requested, so allocate a buffer for them */
1032 SubObjectList = BlMmAllocateHeap(ElementDataLength);
1033 if (!SubObjectList)
1034 {
1036 break;
1037 }
1038
1039 /* Copy the elements into the list. They are arrays of GUIDs */
1040 RtlCopyMemory(SubObjectList, ElementData, ElementDataLength);
1041 SubObjectCount = ElementDataLength / sizeof(GUID);
1042 }
1043
1044 /* Free our local buffers */
1045 BlMmFreeHeap(ElementData);
1046 BlMmFreeHeap(RegistryElementData);
1047 ElementData = NULL;
1048 RegistryElementData = NULL;
1049
1050 /* Close the key */
1051 BiCloseKey(ElementHandle);
1052 ElementHandle = NULL;
1053 ElementName = NULL;
1054 }
1055
1056 /* Did we end up here with a sub object list after successful loop parsing? */
1057 if ((i != 0) && (i == SubKeyCount) && (SubObjectList))
1058 {
1059 /* We will actually enumerate it now, at the end */
1061 SubObjectList,
1062 SubObjectCount,
1063 Flags,
1064 Elements,
1065 &RemainingLength,
1066 &SubElementCount);
1068 {
1069 /* Safely add the length of the sub elements */
1070 Status = RtlULongAdd(TotalLength, RemainingLength, &TotalLength);
1071 if ((NT_SUCCESS(Status)) && (SubElementCount))
1072 {
1073 /* Add the sub elements to the total */
1074 *ElementCount += SubElementCount;
1075
1076 /* Don't touch PreviousElement anymore */
1077 PreviousElement = NULL;
1078 }
1079 }
1080 }
1081
1082Quickie:
1083 /* Free the sub object list, if any */
1084 if (SubObjectList)
1085 {
1086 BlMmFreeHeap(SubObjectList);
1087 }
1088
1089 /* Free any local element data */
1090 if (ElementData)
1091 {
1092 BlMmFreeHeap(ElementData);
1093 }
1094
1095 /* Free any local registry data */
1096 if (RegistryElementData)
1097 {
1098 BlMmFreeHeap(RegistryElementData);
1099 }
1100
1101 /* Close the handle if still opened */
1102 if (ElementHandle)
1103 {
1104 BiCloseKey(ElementHandle);
1105 }
1106
1107 /* Terminate the last element, if any */
1108 if (PreviousElement)
1109 {
1110 PreviousElement->NextEntry = NULL;
1111 }
1112
1113 /* Close the root handle if still opened */
1114 if (ElementsHandle)
1115 {
1116 BiCloseKey(ElementsHandle);
1117 }
1118
1119 /* Set failure code if out of space */
1120 if (*ElementSize < TotalLength)
1121 {
1123 }
1124
1125 /* Other errors will send a notification error */
1127 {
1128 BiNotifyEnumerationError(ObjectHandle, ElementName, Status);
1129 }
1130
1131 /* Finally free the subkeys array */
1132 if (SubKeys)
1133 {
1134 BlMmFreeHeap(SubKeys);
1135 }
1136
1137 /* And return the required, final length and status */
1138 *ElementSize = TotalLength;
1139 return Status;
1140}
VOID BiNotifyEnumerationError(_In_ HANDLE ObjectHandle, _In_ PWCHAR ElementName, _In_ NTSTATUS Status)
Definition: bcd.c:17
ULONG BiConvertElementFormatToValueType(_In_ ULONG Format)
Definition: bcd.c:31
NTSTATUS BiEnumerateSubElements(_In_ HANDLE BcdHandle, _In_ PVOID Object, _In_ ULONG ElementType, _In_ ULONG Flags, _Out_opt_ PBCD_PACKED_ELEMENT *Elements, _Inout_ PULONG ElementSize, _Out_ PULONG ElementCount)
Definition: bcd.c:620
NTSTATUS BiConvertRegistryDataToElement(_In_ HANDLE ObjectHandle, _In_ PVOID Data, _In_ ULONG DataLength, _In_ BcdElementType ElementType, _Out_ PVOID Element, _Out_ PULONG ElementSize)
Definition: bcd.c:52
NTSTATUS BiEnumerateSubObjectElements(_In_ HANDLE BcdHandle, _Out_ PGUID SubObjectList, _In_ ULONG SubObjectCount, _In_ ULONG Flags, _Out_opt_ PBCD_PACKED_ELEMENT Elements, _Inout_ PULONG ElementSize, _Out_ PULONG ElementCount)
Definition: bcd.c:688
#define BCD_TYPE_DEVICE
Definition: bcd.h:21
struct _BCD_PACKED_ELEMENT * PBCD_PACKED_ELEMENT
NTSTATUS BiGetRegistryValue(_In_ HANDLE KeyHandle, _In_ PWCHAR ValueName, _In_ ULONG Type, _Out_ PVOID *Buffer, _Out_ PULONG ValueLength)
Definition: bootreg.c:657
VOID EfiPrintf(_In_ PWCHAR Format,...)
Definition: firmware.c:126
NTSTATUS EfiStall(_In_ ULONG StallTime)
Definition: firmware.c:1003
NTSTATUS BiEnumerateSubKeys(_In_ HANDLE KeyHandle, _Out_ PWCHAR **SubKeyList, _Out_ PULONG SubKeyCount)
Definition: bootreg.c:723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
ULONG PackedValue
Definition: bcd.h:234
ULONG Format
Definition: bcd.h:238
struct _BCD_PACKED_ELEMENT * NextEntry
Definition: bcd.h:283
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
_In_ ULONG TotalLength
Definition: usbdlib.h:158
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by BcdEnumerateAndUnpackElements(), and BiEnumerateSubElements().

◆ BiGetObjectDescription()

NTSTATUS BiGetObjectDescription ( _In_ HANDLE  ObjectHandle,
_Out_ PBCD_OBJECT_DESCRIPTION  Description 
)

Definition at line 1178 of file bcd.c.

1182{
1184 HANDLE DescriptionHandle;
1185 PULONG Data;
1186 ULONG Length;
1187
1188 /* Initialize locals */
1189 Data = NULL;
1190 DescriptionHandle = NULL;
1191
1192 /* Open the description key */
1193 Status = BiOpenKey(ObjectHandle, L"Description", &DescriptionHandle);
1194 if (NT_SUCCESS(Status))
1195 {
1196 /* It exists */
1197 Description->Valid = TRUE;
1198
1199 /* Read the type */
1200 Length = 0;
1201 Status = BiGetRegistryValue(DescriptionHandle,
1202 L"Type",
1203 REG_DWORD,
1204 (PVOID*)&Data,
1205 &Length);
1206 if (NT_SUCCESS(Status))
1207 {
1208 /* Make sure it's the length we expected it to be */
1209 if (Length == sizeof(Data))
1210 {
1211 /* Return the type that is stored there */
1212 Description->Type = *Data;
1213 }
1214 else
1215 {
1216 /* Invalid type value */
1218 }
1219 }
1220 }
1221
1222 /* Did we have a handle open? */
1223 if (DescriptionHandle)
1224 {
1225 /* Close it */
1226 BiCloseKey(DescriptionHandle);
1227 }
1228
1229 /* Did we have data allocated? */
1230 if (Data)
1231 {
1232 /* Free it */
1234 }
1235
1236 /* Return back to caller */
1237 return Status;
1238}
#define TRUE
Definition: types.h:120
static const WCHAR Description[]
Definition: oid.c:1266
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:273
#define REG_DWORD
Definition: sdbapi.c:596
uint32_t * PULONG
Definition: typedefs.h:59

Referenced by BmGetEntryDescription().