SwDeviceCreate returns 0x800700b7 when open an existed device
MSDN: When a client app calls SwDeviceCreate for a software device that was previously marked for SwDeviceLifetimeParentPresent, SwDeviceCreate succeeds if there are no open software device handles for the device (only one handle can be open for a device). A client app can then regain control over a persistent software device for the purposes of updating properties and interfaces or changing the lifetime.
But after I set idd software device to SwDeviceLifetimeParentPresent, and then call SwDeviceCreate again with same createInfo, it returns 0x800700b7, which means object already exist. This result is not what MSDN said.
Even I can't remove the persist software device manually, it's always enumerated again after removed from device manager.
Sorry, I'm not familiar with Windows drivers.
When a client app calls SwDeviceCreate for a software device that was previously marked for SwDeviceLifetimeParentPresent,
I can't even understand why SwDeviceCreate can be passed a Non-Null software device handle.
I see phSwDevice is a pure output for SwDeviceCreate. SwDeviceSetLifetime requires a software device handle to set the lifetime.
Is it possible for you to call SwDeviceSetLifetime after SwDeviceCreate?
SwDeviceCreate failed and the out of phSwDevice handle is null, but SwDeviceSetLifetime requires that handle. The software device is abandoned and can not recreated again, even can not be removed completely in windows safemode.
https://github.com/fufesou/RustDeskIddDriver/releases/tag/v0.4
SwDeviceLifetimeParentPresent works fine for me.
I cannot understand why SwDeviceCreate returns 0x800700b7.
https://github.com/microsoft/Windows-driver-samples/issues/858#issuecomment-1515080567
The most likely reason is that, as he said, another running process holds the SwDevice handle.
https://github.com/fufesou/RustDeskIddDriver/assets/13586388/960f34f0-f32b-4123-8530-679df42dce89