积极答复者
HOOK EnumPrinters——hide the other printers

问题
-
I want control the printers list, make it just show my printer.
I try to hook the EnumPrinters of winspool.drv global by the open source Mhook library, but it just effective in my Demo and the WPS office,noneffective in the Application of Windows such as Notepad.exe、IE。
And I discover my hook is effective in Notepad and IE, but it still could show all the printers even if I just return my printer in the EnumPrinters。
Is there other method to enumerate the printers after the EnumPrinters in Notepad.exe ?
Who can help me? thank you very much.
- 已编辑 monotone_st 2014年6月26日 10:20
答案
-
Hi,
How did you write the hook code? Do you mean that when you hook EnumPrinters, you can get the speficied printer in your demo but get all the available printers in Notepad and IE? If like this, how about tring to use GetPrinter function instead of EnumPrinters, which retrieves information about a specified printer.
May
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 May Wang - MSFT 2014年7月4日 6:08
全部回复
-
Hi,
How did you write the hook code? Do you mean that when you hook EnumPrinters, you can get the speficied printer in your demo but get all the available printers in Notepad and IE? If like this, how about tring to use GetPrinter function instead of EnumPrinters, which retrieves information about a specified printer.
May
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 May Wang - MSFT 2014年7月4日 6:08
-
I am also stuck with this problem for a while.
There are two dll prncache and prnfldr which are server and client. The server fills the cache. and notepad and IE picks up the list from there.
But the problem remains the same the server also uses EnumPrinters but that does not work.