And, you have, of course, confirmed that this piece of kernel code is wrong, and that DevMgr/Cfgapi/SetupApi are doing the right thing, right?
So if I was to reverse engineer ntoskrnl I wouldn't discover that it was actually doing the same thing as the un-"fixed" code, right?
Best regards,
Alex Ionescu