From: Aric Stewart Subject: Re: [PATCH v5 2/2] hidclass.sys: use IoRegisterDeviceInterface Message-Id: <4177327b-1025-3a1f-d86e-7af3e2b2446a@codeweavers.com> Date: Tue, 9 Oct 2018 10:05:51 -0500 In-Reply-To: References: <682e045c-a23d-ad77-824e-14d2e1836d1b@codeweavers.com> <76b2c8eb-ae1e-713d-c218-30365d86483e@codeweavers.com> On 10/8/18 10:34 AM, Zebediah Figura wrote: > On 08/10/18 08:41, Aric Stewart wrote: >> >> >> On 10/5/18 2:53 PM, Zebediah Figura wrote: >>> On 05/10/18 08:09, Aric Stewart wrote: >>>> devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_HIDCLASS, NULL, NULL, DIGCF_DEVICEINTERFACE); >>>> if (!devinfo) >>>> @@ -138,13 +112,22 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device) >>>> FIXME( "failed to Register Device Info %x\n", GetLastError()); >>>> goto error; >>>> } >>>> - if (!SetupDiCreateDeviceInterfaceW( devinfo, &Data, &hidGuid, NULL, 0, NULL)) >>>> + SetupDiDestroyDeviceInfoList(devinfo); >>> >>> IoRegisterDeviceInterface() also calls SetupDiCreateDeviceInfo(), so do >>> we need to make any setupapi calls here at all? I see the flag >>> DICD_INHERIT_CLASSDRVS differs, but we don't implement that, and I'm not >>> entirely sure from the documentation what it's supposed to do, or >>> whether or not it's correct here or in IoRegisterDeviceInterface(). >>> >>> >> >> True, Now it does. But I still feel a bit nervous relying on that behavior in hidclass because it is wine specific behavior. If we rely on that and then ntoskrnl needs to change again in some what then we would have unintended and mysterious changes in hidclass. >> >> -aric >> >> > > MSDN says that a new class is registered if it didn't previously exist. > Regardless, I guess it shouldn't be too hard to add some tests for this. > > I have found that tests for ntoskrnl and kernel level drivers and helpers are pretty irritating to write. A quick dependency walk shows no connection between ntoskrnl and setupapi so that is wine specific. -aric