PSERVICE_CALLBACK_ROUTINE callback function

A function driver calls the class service callback in its ISR dispatch completion routine. The class service callback transfers input data from the input data buffer of a device to the class data queue.

Syntax


PSERVICE_CALLBACK_ROUTINE ClassServiceCallback;

VOID ClassServiceCallback(
  _In_    PVOID NormalContext,
  _In_    PVOID SystemArgument1,
  _In_    PVOID SystemArgument2,
  _Inout_ PVOID SystemArgument3
)
{ ... }

Parameters

NormalContext [in]

Pointer to the class device object.

SystemArgument1 [in]

Pointer to the first keyboard input data packet in the input data buffer of the port device.

SystemArgument2 [in]

Pointer to the keyboard input data packet that immediately follows the last data packet in the input data buffer of the port device.

SystemArgument3 [in, out]

Pointer to the number of keyboard input data packets that are transferred by the routine.

Return value

This callback function does not return a value.

Remarks

Keyboard Class Service Callback

Here is the definition of the keyboard class service callback routine.

Kbdclass uses an IOCTL_INTERNAL_KEYBOARD_CONNECT request to connect its class service callback to a keyboard device. In this call, the driver sets its implementation in a CONNECT_DATA structure.


/*
DeviceObject [in] 
Pointer to the class device object.

InputDataStart [in] 
Pointer to the first keyboard input data packet in the input data buffer of the port device.

InputDataEnd [in] 
Pointer to the keyboard input data packet that immediately follows the last data packet in the input data buffer of the port device.

InputDataConsumed [in, out] 
Pointer to the number of keyboard input data packets that are transferred by the routine.

*/
VOID KeyboardClassServiceCallback(
  _In_    PDEVICE_OBJECT       DeviceObject,
  _In_    PKEYBOARD_INPUT_DATA InputDataStart,
  _In_    PKEYBOARD_INPUT_DATA InputDataEnd,
  _Inout_ PULONG               InputDataConsumed
);

KeyboardClassServiceCallback transfers input data from the input buffer of the device to the class data queue. This routine is called by the ISR dispatch completion routine of the function driver.

KeyboardClassServiceCallback can be supplemented by a filter service callback that is provided by an upper-level keyboard filter driver. A filter service callback filters the keyboard data that is transferred to the class data queue. For example, the filter service callback can delete, transform, or insert data. Kbfiltr, the sample filter driver in code gallery, includes KbFilter_ServiceCallback, which is a template for a keyboard filter service callback.

Mouse Class Service Callback

Here is the MouseClassServiceCallback routine is the class service callback routine that is provided by Mouclass. The driver uses an IOCTL_INTERNAL_MOUSE_CONNECT request to connect its class service callback to a mouse device. In this call, the driver sets its implementation in a CONNECT_DATA structure.


/*
DeviceObject [in] 
Pointer to the class device object.

InputDataStart [in] 
Pointer to the first mouse input data packet in the input buffer of the port device.

InputDataEnd [in] 
Pointer to the mouse input data packet that immediately follows the last data packet in the input data buffer of the port device.

InputDataConsumed [in, out] 
Pointer to the number of mouse input data packets that are transferred by the routine.

*/
VOID MouseClassServiceCallback(
  _In_    PDEVICE_OBJECT    DeviceObject,
  _In_    PMOUSE_INPUT_DATA InputDataStart,
  _In_    PMOUSE_INPUT_DATA InputDataEnd,
  _Inout_ PULONG            InputDataConsumed
);
);

MouseClassServiceCallback transfers input data from the input buffer of the device to the class data queue. This routine is called by the ISR dispatch completion routine of the function driver.

MouseClassServiceCallback can be supplemented by a filter service callback that is provided by an upper-level mouse filter driver. A filter service callback can filter the mouse data that is transferred to the class data queue. For example, the filter service callback can delete, transform, or insert data. Moufiltr, the sample filter driver in the WDK, includes MouFilter_ServiceCallback, which is a template for a filter service callback.

Requirements

Target platform

Header

Kbdmou.h

IRQL

DISPATCH_LEVEL

See also

KEYBOARD_INPUT_DATA
MOUSE_INPUT_DATA
CONNECT_DATA

 

 

Send comments about this topic to Microsoft

Show: