On Mon Dec 8 21:38:51 2025 +0000, Alexander Morozov wrote:
Thank you for your reply. Device ID is saved in wine_device for all PDOs instead of saving it in root_pnp_device only for root devices. Saving IDs for all devices is needed to avoid sending IRP when a driver does not expect to receive it. `if (!wine_device->instance_id)` is used to check if a device is PDO. It is a behavior documented in MSDN for some Io* functions (IoGetDeviceProperty, IoRegisterDeviceInterface, IoOpenDeviceRegistryKey) to return an error when they are not called with PDO. Sorry for the lateness again, I set this aside for regression season and then forgot about it...
Device ID is saved in wine_device for all PDOs instead of saving it in root_pnp_device only for root devices. Saving IDs for all devices is needed to avoid sending IRP when a driver does not expect to receive it.
I really don't think it makes sense to shortcut the process like this; it looks very fragile and it's hard to follow. I think it'd be better to leave root devices implemented like all other devices, without knowledge of wine_device internals.
`if (!wine_device->instance_id)` is used to check if a device is PDO. It is a behavior documented in MSDN for some Io\* functions (IoGetDeviceProperty, IoRegisterDeviceInterface, IoOpenDeviceRegistryKey) to return an error when they are not called with PDO.
I see. That should really be a separate change though, since it's a functional change not related, and given that it's not exactly obvious I'd probably appreciate a comment on the relevant functions. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8015#note_129841