Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello

I developed a Printer port monitor for virtual printer. I am installing it using script that stop spooler service and make entries in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\<port name=""> and start the spooler service. If everything goes fine then the Port will be created. Then I install my printer on that port using INF.

I compiled port monitor DLL for 32bit and 64bit environment. The complete installation script was working with XP and Win 7 (both 32 and 64 bit).
But when I try to install in Win 7 sp1 it gives me error of "operation could not be completed (error 0x00000704) The specified port is unknown".

I thought that this issue occurs while creating a port. So i tried to install port monitor manually as said in following link

http://msdn.microsoft.com/en-us/library/windows/hardware/ff551668%28v=vs.85%29.aspx

But it also fails; I checked the application log and find the following error

"The print spooler failed to load a plug-in module Printer.dll, error code 0x7e. See the event user data for context information."

so this shows that the problem with the port monitor DLL. I developed the DLL in VS2010 in C++ language with Print API. I compiled the DLL for 32bit and 64bit by selecting the Platform x64(for 64bit) and win32(for 32bit). Is there any other compile configuration for win7 sp1?

I searched about this and found the following article but for real printer.

http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/unable-to-print-to-any-printer-error-0x7e/723a7032-c245-e011-9575-d8d385dcbb12


I need help to solve this issue for win7 sp1 print port monitor.


Thank you.
Jaydeep Jadav
Posted

1 solution

I don't know if you're still looking for this, but to benefit others who are in the same boat, I will say what I've found here...

This also got broken in Server 2008 R2 SP1, likely for the same reason. What has happened is that apparently the dirid 66002 was somehow invalidated, so specifying 66002 as the destination directory for your port monitor files in the INF file causes them to be copied to the C:\ directory instead. Then when it tries to access the port monitor module, you get error 126 (module not found) because the module is not in the system32 directory.

To fix this, you have to change the destination dirid in your printer INF file for your port monitor files to 11 (System32 directory).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900