Callback | Optional | Set a single data item in a single instance of a data block | |
ExecuteWmiMethod | Callback | Optional | Execute a method associated with a data block |
WmiFunctionControl | Callback | Optional | Enable and disable event notification andexpensive data block collection |
Your driver must then handle System Control IRPs in your SystemControl routine. Table 12.2 shows the various minor codes associated with this IRP.
Table 12.2 System control minor request codes
IRP_MN_REGINFO | Query a driver's registration information |
IRP_MN_QUERY_ALL_DATA | Get all instances in a given data block |
IRP_MN_QUERY_SINGLE_INSTANCE | Get a single instance in a given data block |
IRP_MN_CHANGE_SINGLE_INSTANCE | Change all data items in a given data block |
IRP_MN_CHANGE_SINGLE_ITEM | Change a single data item in a given data block |
IRP_MN_ENABLE_EVENTS | Enable event notification |
IRP_MN_DISABLE_EVENTS | Disable event notification |
IRP_MN_ENABLE_COLLECTION | Start collection of data that is expensive to collect |
IRP_MN_DISABLE_COLLECTION | Stop collection of data that is expensive to collect |
IRP_MN_EXECUTE_METHOD | Execute a method in a data block |
If you have dynamic instance names, you must process the IRP and call
For static instances, as used by Wdm3, you simply have to call
Table 12.3
IrpProcessed | Either call |
IrpNotComplete | IRP processed but an error detected, so just call |
IrpNotWMI or IrpForward | Forward to next driver: call |
Listing 12.4 shows how the
Listing 12.4 Wdm3SystemControl routine
NTSTATUS Wdm3SystemControl (IN PDEVICE_OBJECT fdo, IN PIRP Irp) {
DebugPrintMsg('Wdm3SystemControl');
PWDM3_DEVICE_EXTENSION dx = (PWDM3_DEVICE_EXTENSION)fdo->DeviceExtension;
SYSCTL_IRP_DISPOSITION disposition;
NTSTATUS status = WmiSystemControl(&dx->WmiLibInfo, fdo, Irp, &disposition);
switch(disposition) {
case IrpProcessed:
// This irp has been processed and may be completed or pending.
break;
case IrpNotCompleted:
// This irp has not been completed, but has been fully processed.