[Bug] GetDefaultPrinter, printing and logged-in users

Started by fixer, June 07, 2017, 12:29:33 PM

Previous topic - Next topic

fixer

GetDefaultPrinter API and other functions (e.g. PrintDlgEx) and dialogs (Print, Print preview, Page setup) that use it don't work for non-logged-in users. The problem is it reads information from Device from HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows registry key. It's filled on interactive login and it's empty if user hasn't logged-in. So if we try to start process from another user (using API, using runas) and that user isn't logged-in, this function call will fail.

This issue was found several months ago, it wasn't fixed then. I haven't checked it since.