Getting my printer driver DLL to be used.
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