Battery miniclass driver: DriverEntry routine

The DriverEntry routine initializes the miniclass driver.

Driver-specific entry points

The miniclass driver's DriverEntry routine sets up the following driver-specific entry points:

Here's a sample code that initializes these entry points for a hypothetical NewBatt miniclass driver:

DriverObject->DriverUnload = NewBattUnload;
DriverObject->DriverExtension->AddDevice = NewBattAddDevice; 
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NewBattDispatchDeviceControl;
DriverObject->MajorFunction[IRP_MJ_CREATE] = NewBattDispatchCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = NewBattDispatchClose;
DriverObject->MajorFunction[IRP_MJ_PNP] = NewBattDispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] = NewBattDispatchPower;
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = NewBattSystemControl;

Since battery-specific state information is unknown until the PnP Manager calls the miniclass driver's AddDevice routine, the DriverEntry routine doesn't initialize any such state. Device-specific initialization is performed in the AddDevice routine.

Additional routine-specific requirements

For more information on routine-specific requirements, see the following topics: