如何通过 .inf 文件将上层过滤器驱动程序注册到所有打印机类(AddReg 部分)
我有一个过滤器驱动程序(类似于以下内容):
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论