Einzelnen Beitrag anzeigen
Alt 15.05.2024, 17:20   #36
leecher
Moderator
Hm, very interesting, both variants work on my physical test machine.
By failing at the loop, do you mean that the break condition (p points to an empty string) is satified on first iteration und therefore the loop isn't entered because returned pszszDeviceList is simply an empty list)?

There is another possibility that comes to my mind:
I tested the code with having the video driver disabled (so that the standard VGA driver gets used, that's the same thing that conhostf does when switching to fullscreen).
Maybe the device path is considered to be inactive when VGA mod is not (yet) turned on and therefore there also is no AllocConfig key (still doesn't explain why you can see it perfectly well in registry)?

One test would be to do IoGetDeviceInterfaces(&Interface, NULL, DEVICE_INTERFACE_INCLUDE_NONACTIVE, &pszszDeviceList) and check if you get back a valid devicec link entry there.
Just guessing.

My next step would probably be to hook up WinDbg to the machine and step into Windows' code in order to find out where this fails. MAybe it is some problem with the registry, as IoGetDeviceInterfaces also searches the registry.
leecher ist offline   Mit Zitat antworten