Author Topic: [Bug] GetDefaultPrinter, printing and logged-in users  (Read 1252 times)

fixer

  • Administrator
  • Hero Member
  • *****
  • Posts: 1526
[Bug] GetDefaultPrinter, printing and logged-in users
« on: June 07, 2017, 12:29:33 pm »
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.
« Last Edit: June 19, 2017, 12:07:22 pm by fixer »