DO_DEVICE_INITIALIZING annotation for drivers
Use the _Kernel_clear_do_init_ annotation to specify whether the annotated function is expected to clear the DO_DEVICE_INITIALIZING bit in the Flags field of the device object.
This annotation has the following syntax:
_Kernel_clear_do_init_(yes|no)
Calling a function that is annotated with _Kernel_clear_do_init_(yes) exempts the calling function from having to clear the DO_DEVICE_INITIALIZING bit.
The annotation should almost always be used in a conditional context when the function returns success, unless the annotation is applied to a function type definition. For example, in the following function type definition for the DRIVER_ADD_DEVICE function class, the annotations specify that the function cannot raise the IRQL and that the function is expected to clear the DO_DEVICE_INITIALIZING bit.
typedef
_IRQL_always_function_max_(PASSIVE_LEVEL)
_IRQL_requires_same_
_Kernel_clear_do_init_(yes)
__drv_functionClass(DRIVER_ADD_DEVICE)
NTSTATUS
DRIVER_ADD_DEVICE (
_In_ struct _DRIVER_OBJECT *DriverObject,
_In_ struct _DEVICE_OBJECT *PhysicalDeviceObject
);
typedef DRIVER_ADD_DEVICE *PDRIVER_ADD_DEVICE;