Getting my printer driver DLL to be used.

Bojan 0 Reputation points
2026-07-01T16:03:24.1766667+00:00

Why is my custom Print Monitor loaded and EnumPortsbeing called, but custom-made ports (e.g. CV_PORT) are still owned by “Local Monitor” and never routed through my monitor’s OpenPort/WritePort callbacks, and how can I correctly ensure ports are created and registered so they are assigned to my monitor instead of LocalMon?

I'm using Windows 11, and I've read that this can play a role.

I have a feeling that this is an OS thing and that nothing is wrong with the code as I can enumerate ports properly if I call the API myself, but if I don't do that, the OS will just call the first enumeration EnumPorts (for the size) and never call it again (for the actual port data).

Also running this - Get-PrinterPort, gives me:

CV_PORT Local Port Local Monitor

And I need CV_PORT to be assigned to my custom monitor.

Not sure what I'm doing wrong. I've got a bit of initialization code in a separate app that just calls AddMonitorW(). This will get the InitializePrintMonitor2 to run if my DLL is in System32, EnumPorts after that - but that is pretty much it.

Many thanks,

Bojan

Windows development | Windows Driver Kit (WDK)
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.