阅读:751回复:1
一个很奇怪的初级问题,给30分
我阅读了ntddk中kbdclass和kbfiltr的源代码,发现
kbd响应了IRP_MJ_FLUSH_BUFFERS,IRP_MJ_SYSTEM_CONTROL等等, 而kbfiltr却没有响应这些。感到很奇怪。 按道理,kbfiltr是kbdclass的上层过滤程序啊! |
|
沙发#
发布于:2003-07-10 19:37
>> 好歹也要响应一下,然后调用IoCallDriver往下传嘛!
当然响应了的:D 以下代码摘自kbdfiltr DriverEntry: { ... //默认地都是调用PassThrough,当然包括IRP_MJ_FLUSH_BUFFERS,IRP_MJ_SYSTEM_CONTROL for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) { DriverObject->MajorFunction = KbFilter_DispatchPassThrough; } DriverObject->MajorFunction [IRP_MJ_CREATE] = ... ... } KbFilter_DispatchPassThrough: { PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp); // // Pass the IRP to the target // IoSkipCurrentIrpStackLocation(Irp); return IoCallDriver(((PDEVICE_EXTENSION) DeviceObject->DeviceExtension)->TopOfStack, Irp); } |
|
|