开发者

how to register a upper filter driver to all printers class via .inf file (AddReg section)

开发者 https://www.devze.com 2023-01-12 11:01 出处:网络
I have a filter driver (similar to following): NTSTATUS MyFilterFunction ( __in PDEVICE_OBJECT DeviceObject,

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消