how to register a upper filter driver to all printers class via .inf file (AddReg section)
I have a filter driver (similar to following):
NTSTATUS MyFilterFunction (
__in PDEVICE_OBJECT DeviceObject,
__in PIRP Irp
){
NTSTATUS status = STATUS_SUCCESS;
// do the filtering
DbgPrint("Filtering w开发者_运维百科ith MyFilterFunction");
return status;
}
NTSTATUS DriverEntry (
__in PDRIVER_OBJECT DriverObject,
__in PUNICODE_STRING RegistryPath
){
NTSTATUS status = STATUS_SUCCESS;
DriverObject->MajorFunction[IRP_MJ_CREATE] = MyFilterFunction
return status;
}
I have made this inf file to attach the filter to printers-class drivers-stack.
The problem is that when printing, the function DbgPrint does not output anything in DebugView, as if it's never called. Note that I use a network printer, not a local printer attached to the machine.
精彩评论