如何通过 .inf 文件将上层过滤器驱动程序注册到所有打印机类(AddReg 部分)

发布于 2024-09-15 06:47:05 字数 806 浏览 3 评论 0原文

我有一个过滤器驱动程序(类似于以下内容):

NTSTATUS MyFilterFunction (
    __in PDEVICE_OBJECT DeviceObject,
    __in PIRP Irp
){
    NTSTATUS status = STATUS_SUCCESS;
    // do the filtering
    DbgPrint("Filtering with 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;
}

我已经制作了 inf 文件将过滤器附加到打印机类驱动程序堆栈。
问题在于,打印时,函数 DbgPrint 在 DebugView 中不输出任何内容,就好像它从未被调用过一样。
请注意,我使用网络打印机,而不是连接到机器的本地打印机。

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 with 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文