Disclaimer: This is for a hobby project, this isnt for work ?. I am a beginner when it comes to driver development.
I have a kmdf wdf driver that is root enumerated and behaves kind of like a bus or fdo. It creates a pdo when it gets installed via devcon for now.
After it is installed it creates a pdo. This works. But when I remove my driver the pdo does not get removed properly but keeps its registry entries and therefore becomes a non-present aka a phantom device. Since this phantom device allocates a com number this is really annoying since I always have to remove it manually. Is there a way to force the removal of a pdo? I already tried both static enumeration with wdfpdomarkmissing on EvtDeviceReleaseHardware and dynamic enumeration using WdfChildListRequestChildEject. Both of them are not working.