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


  • Administrator
  • Hero Member
  • *****
  • Posts: 1526
[Bug] GetDefaultPrinter, printing and logged-in users (part 2)
« on: November 18, 2017, 12:32:41 pm »
Even if you somehow fixed the issue described in the previous part here you're not completely done with this problem. Some flags will be incorrectly returned for such printers. "So what? It's just some flags, no big deal." - some of you may ask. But let's see where it'll lead us. Calling GetPrinter function will fail with some vague error code about wrong level. So it won't fill the buffer provided. If a program calling this API doesn't check its return code for success, it'll try to work with potentially uninitialized buffer most likely crashing the process. So yeah, it is a big deal.

So what's the problem? The problem is there is another list of devices stored here HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices. And yeah, this list should also be filled just like the one in the previous blogpost.

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