Export (0) Print
Expand All
Expand Minimize

IoRegisterBootDriverCallback routine

The IoRegisterBootDriverCallback routine registers a BOOT_DRIVER_CALLBACK_FUNCTION routine to be called during the initialization of a boot-start driver and its dependent DLLs.

Syntax


PVOID IoRegisterBootDriverCallback(
  _In_      PBOOT_DRIVER_CALLBACK_FUNCTION CallbackFunction,
  _In_opt_  PVOID CallbackContext
);

Parameters

CallbackFunction [in]

A pointer to the BOOT_DRIVER_CALLBACK_FUNCTION routine to be called when initializing a boot-start driver or DLL.

CallbackContext [in, optional]

A driver-defined context to be passed to the BOOT_DRIVER_CALLBACK_FUNCTION routine pointed to by CallbackFunction.

Return value

A handle that represents the registration. This handle must be supplied as an input parameter in the call to the IoUnRegisterBootDriverCallback routine that unregisters the BOOT_DRIVER_CALLBACK_FUNCTION routine.

Remarks

Boot-start drivers must call IoUnRegisterBootDriverCallback and pass the returned handle to unregister the boot-start driver callback before Windows unloads them.

Boot Driver Callback

A boot-start driver's BOOT_DRIVER_CALLBACK_FUNCTION routine can monitor boot-start driver initialization events and return data to the kernel to enable the kernel to decide whether to initialize each boot-start driver. The function prototype to register a boot-start driver callback routine is as follows.


typedef
VOID
BOOT_DRIVER_CALLBACK_FUNCTION (
    _in_opt_ PVOID CallbackContext,
    _in_ BDCB_CALLBACK_TYPE CallbackType,
    _in_opt_ PBDCB_IMAGE_INFORMATION CallbackTypeContext
    );

The boot-start callback parameters are as follows:

CallbackContext

The value that the driver passed as the CallbackContext parameter to IoRegisterBootDriverCallback when it registered this BOOT_DRIVER_CALLBACK_FUNCTION routine.

CallbackType

A BDCB_CALLBACK_TYPE enumeration value that either identifies the status of boot-start driver initialization or indicates that a boot-start driver is about to be initialized.

CallbackTypeContext

A pointer to a structure that contains information that is specific to the type of callback. The structure type depends on the value passed for CallbackType, as shown in the following table.

Value of CallbackTypeCorresponding structure to use

BdCbStatusUpdate

BDCB_STATUS_UPDATE_TYPE

BdCbInitializeImage

BDCB_CLASSIFICATION

 

Return Value

If the BOOT_DRIVER_CALLBACK_FUNCTION routine returns STATUS_SUCCESS, the boot-start driver was able to perform all necessary actions in response to the specific callback.

Any error returned from a status update callback is treated as fatal and leads to a system bug check.

If an initialize image callback returns an error, the driver's image is treated as unknown.

Remarks

To be notified of boot-start driver initialization operations, an early launch anti-malware (ELAM) driver can call IoRegisterBootDriverCallback to register a BOOT_DRIVER_CALLBACK_FUNCTION routine.

Requirements

Version

Available starting with Windows 8.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

Any level

See also

IoUnRegisterBootDriverCallback
BDCB_CALLBACK_TYPE

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft