Hi All,
I got an assignment that make one of our company’s Bluetooth game controller supports XInput. So far, the solution is to have a virtual root bus enumerator to listen to the BT HID game controller. When it arrives, the bus driver creates one XUSB wired device. Will this work? Is there any other alternative way to achieve that easily and stably?
Thanks,
Marshall
Why not install your driver as the fdo for the hidclass pdo that hidclass enumerates (the hwid would be HID\XXXX, noy BTHENUM\XXXXX). This way your driver only loads when your device is present and you don’t have to do anyhting complicated
d
Bent from my phone
From: xxxxx@hotmail.commailto:xxxxx
Sent: ?12/?1/?2014 5:55 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Bluetooth game controller supports XInput
Hi All,
I got an assignment that make one of our company’s Bluetooth game controller supports XInput. So far, the solution is to have a virtual root bus enumerator to listen to the BT HID game controller. When it arrives, the bus driver creates one XUSB wired device. Will this work? Is there any other alternative way to achieve that easily and stably?
Thanks,
Marshall
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
Hi Doron,
If I install the driver as the fdo for the hidclass pdo, how can I make it as an XInput device? The XInput device here means that the game can call the XInput APIs to communicate with the device.
Thanks,
Marshall
How would you expose it as a xinput device in your root enumerated device proposal?
d
Bent from my phone
From: xxxxx@hotmail.commailto:xxxxx
Sent: ?12/?1/?2014 7:29 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Hi Doron,
If I install the driver as the fdo for the hidclass pdo, how can I make it as an XInput device? The XInput device here means that the game can call the XInput APIs to communicate with the device.
Thanks,
Marshall
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
Hi Doron,
Like what toaster bus sample does, I would build up the PDO/FDO of the XUSB device which class guid is {D61CA365-5AF4-4486-998B-9DB4734C6CA3} when the BT HID arrives. And pass the faked USB descriptors to the host. Would that work?
Thanks,
Marshall
You can do exactly the same as the fdo for the hid enumerated device
d
Bent from my phone
From: xxxxx@hotmail.commailto:xxxxx
Sent: ?12/?1/?2014 7:47 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Hi Doron,
Like what toaster bus sample does, I would build up the PDO/FDO of the XUSB device which class guid is {D61CA365-5AF4-4486-998B-9DB4734C6CA3} when the BT HID arrives. And pass the faked USB descriptors to the host. Would that work?
Thanks,
Marshall
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
That’s great! I will give it a try and follow this up if it works.
Thanks a lot.
Hi Doron,
As the FDO for the hid enumerated device, like what Toaster bus driver does, I need to call the following code in the AddDevice, right? Here the device object is HID device not the bus, is that Ok to do that? Then, I can call the Bus_PlugInHardware. Is that the right way to go?
WDF_CHILD_LIST_CONFIG_INIT(&config,
sizeof(PDO_IDENTIFICATION_DESCRIPTION),
Bus_EvtDeviceListCreatePdo // callback to create a child device.
);
config.EvtChildListIdentificationDescriptionDuplicate =
Bus_EvtChildListIdentificationDescriptionDuplicate;
config.EvtChildListIdentificationDescriptionCompare =
Bus_EvtChildListIdentificationDescriptionCompare;
config.EvtChildListIdentificationDescriptionCleanup =
Bus_EvtChildListIdentificationDescriptionCleanup;
WdfFdoInitSetDefaultChildListConfig(DeviceInit,
&config,
WDF_NO_OBJECT_ATTRIBUTES);
That is fine. You don’t need a bus driver though. If you install your driver as a lower filter and the xinput as the fdo, all of the usb emulation you do in your toaster pdo you can put in the filter
d
Bent from my phone
From: xxxxx@hotmail.commailto:xxxxx
Sent: ?12/?2/?2014 5:37 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Hi Doron,
As the FDO for the hid enumerated device, like what Toaster bus driver does, I need to call the following code in the AddDevice, right? Here the device object is HID device not the bus, is that Ok to do that? Then, I can call the Bus_PlugInHardware. Is that the right way to go?
WDF_CHILD_LIST_CONFIG_INIT(&config,
sizeof(PDO_IDENTIFICATION_DESCRIPTION),
Bus_EvtDeviceListCreatePdo // callback to create a child device.
);
config.EvtChildListIdentificationDescriptionDuplicate =
Bus_EvtChildListIdentificationDescriptionDuplicate;
config.EvtChildListIdentificationDescriptionCompare =
Bus_EvtChildListIdentificationDescriptionCompare;
config.EvtChildListIdentificationDescriptionCleanup =
Bus_EvtChildListIdentificationDescriptionCleanup;
WdfFdoInitSetDefaultChildListConfig(DeviceInit,
&config,
WDF_NO_OBJECT_ATTRIBUTES);
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
Hi Doron,
I’m a little confused here:
-
You said it can be installed as the lower filter. I’m not quite clear where the lower filter should be? Can I install it as the FDO of the HID game controller?
-
How can I create the XInput device in the driver? Should I do exact the same thing as the toaster bus driver does? Or I simply need to create a raw PDO and handle the USB enumeration?
Looking forward to your suggestion,
Thanks,
Marshall
Your original design was to enumerate PDO to load the xinput USB HID miniport from your toaster driver, so the PDO translated USB request into something else (HID over Bluetooth). What I am saying is that you don’t need that level complexity, instead you can have this
Xinput USB miniport <- FDO
|
Your lower filter driver <- device lower filter
|
HID enumerated PDO (the controller PDO)
You don’t need to enumerate anything, you need to write an INF which installs Xinput miniport as the FDO and your driver as the filter matching to the Bluetooth controller HID PDO HWID. Your filter turns USB commands into Bluetooth commands
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, December 02, 2014 6:22 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Hi Doron,
I’m a little confused here:
-
You said it can be installed as the lower filter. I’m not quite clear where the lower filter should be? Can I install it as the FDO of the HID game controller?
-
How can I create the XInput device in the driver? Should I do exact the same thing as the toaster bus driver does? Or I simply need to create a raw PDO and handle the USB enumeration?
Looking forward to your suggestion,
Thanks,
Marshall
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Ok, it seems a little bit clear for me now.
- Xinput USB miniport will be installed by the Windows Update so I don’t need to install it in the INF. Is that right?
- The Bluetooth controller HID PDO you mentioned here is the Bluetooth HID Device in the device manager, isn’t it? I saw the HID-compliant game controller is under that device.
- Install my driver as the lower filter, how can create the PDO for the XInput device? Is it as same as the code to create the RAW PDO device? Is there any sample code for reference?
Thanks,
Marshall
- no, your INF would need to reference the driver the way I suggested it
2 yes
3 you don’t need another PDO, everything can be in the same stack
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, December 02, 2014 11:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Ok, it seems a little bit clear for me now.
- Xinput USB miniport will be installed by the Windows Update so I don’t need to install it in the INF. Is that right?
- The Bluetooth controller HID PDO you mentioned here is the Bluetooth HID Device in the device manager, isn’t it? I saw the HID-compliant game controller is under that device.
- Install my driver as the lower filter, how can create the PDO for the XInput device? Is it as same as the code to create the RAW PDO device? Is there any sample code for reference?
Thanks,
Marshall
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Thanks a lot for your suggestion, Doron. Regarding to the item 3, I’m still not quite clear the way to create the PDO for XInput. Can I simply call WdfDeviceCreate to create that PDO without doing any other extra work? Is there any existing sample codes in the WDK to create such PDO?
Marshall
You don’t need to create another pdo
d
Bent from my phone
From: xxxxx@hotmail.commailto:xxxxx
Sent: ?12/?3/?2014 1:00 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Thanks a lot for your suggestion, Doron. Regarding to the item 3, I’m still not quite clear the way to create the PDO for XInput. Can I simply call WdfDeviceCreate to create that PDO without doing any other extra work? Is there any existing sample codes in the WDK to create such PDO?
Marshall
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
Hi Doron,
I am investigating the way that uses the dynamic enumeration of the bus driver. I can create the PDO of the XBOX controller device successfully. But I see a yellow exclamation mark on the device node in the Device Manager. I thought it’s because of the fact that the system tries to load the driver XUSB and it requires something that I didn’t pass. I tried to handle the internal IO control for both the bus FDO and the XUSB pdo but I don’t see that’s called back. Can you help suggest how I can proceed this?
VOID
Bthxbus_EvtInternalDeviceControl(
IN WDFQUEUE Queue,
IN WDFREQUEST Request,
IN size_t OutputBufferLength,
IN size_t InputBufferLength,
IN ULONG IoControlCode
)
{
NTSTATUS status = STATUS_SUCCESS;
WDFDEVICE hDevice = NULL;
UNREFERENCED_PARAMETER(OutputBufferLength);
UNREFERENCED_PARAMETER(InputBufferLength);
BthxTraceFuncEntry();
hDevice = WdfIoQueueGetDevice(Queue);
switch (IoControlCode)
{
case IOCTL_INTERNAL_USB_SUBMIT_URB:
BthxTrace(TRACE_LEVEL_VERBOSE, BTHX_PDO, “IOCTL_INTERNAL_USB_SUBMIT_URB arrives”);
break;
default:
BthxTrace(TRACE_LEVEL_VERBOSE, BTHX_PDO, “The internal control code is 0x%x”, IoControlCode);
break;
}
WdfRequestComplete(Request, status);
BthxTraceFuncExit();
}
Marshall wrote:
I am investigating the way that uses the dynamic enumeration of the bus driver. I can create
the PDO of the XBOX controller device successfully. But I see a yellow exclamation mark on
the device node in the Device Manager.
What hardwre ID did you use when creating your PDO? How did you determine the right one to use?
I thought it’s because of the fact that the system tries to load the driver XUSB and it
requires something that I didn’t pass.
Does it load XUSB or doesn’t it? You don’t have to “think” that, you can go look it up. What error does it say in Device Manager?
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Hi Tim,
The hardware ID is set as below. I checked the device node in the device manager and the hardware ids are set correctly.
#define BTHXUSB_HARDWARE_IDS \
L"USB\VID_045E&PID_028E&REV_0114\0USB\VID_045E&PID_028E\0"
It loads the XUSB driver but starting the device failed due to unknown reason. I paste the setupapi.dev.log here for your reference.
>> [Device Install (Hardware initiated) - USB\VID_045E&PID_028E\1&1a590e2c&0&00]
>> Section start 2014/12/08 14:14:03.975
dvi: {Build Driver List} 14:14:03.975
dvi: Searching for compatible ID(s):
dvi: usb\ms_comp_xusb10
dvi: usb\class_ff&subclass_5d&prot_01
dvi: usb\class_ff&subclass_5d
dvi: usb\class_ff
dvi: Created Driver Node:
dvi: HardwareID - USB\MS_COMP_XUSB10
dvi: InfName - C:\WINDOWS\System32\DriverStore\FileRepository\xusb22.inf_amd64_21b73d10ffde6bfb\xusb22.inf
dvi: DevDesc - Xbox 360 Controller for Windows
dvi: Section - CC_Install
dvi: Rank - 0x00ff2000
dvi: Signer Score - INBOX
dvi: DrvDate - 03/17/2014
dvi: Version - 6.3.9600.17054
dvi: {Build Driver List - exit(0x00000000)} 14:14:04.006
dvi: {DIF_SELECTBESTCOMPATDRV} 14:14:04.006
dvi: No class installer for ‘Blooth_HID_XUsb_00’
dvi: No CoInstallers found
dvi: Default installer: Enter 14:14:04.006
dvi: {Select Best Driver}
dvi: Class GUID of device changed to: {d61ca365-5af4-4486-998b-9db4734c6ca3}.
dvi: Selected:
dvi: Description - [Xbox 360 Controller for Windows]
dvi: InfFile - [c:\windows\system32\driverstore\filerepository\xusb22.inf_amd64_21b73d10ffde6bfb\xusb22.inf]
dvi: Section - [CC_Install]
dvi: {Select Best Driver - exit(0x00000000)}
dvi: Default installer: Exit
dvi: {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 14:14:04.021
ndv: {Core Device Install} 14:14:04.021
sto: {Configure Driver Package: C:\WINDOWS\System32\DriverStore\FileRepository\xusb22.inf_amd64_21b73d10ffde6bfb\xusb22.inf}
sto: Driver Package = xusb22.inf_amd64_21b73d10ffde6bfb
sto: Flags = 0x00020000
sto: Source Filter = usb\ms_comp_xusb10
inf: Driver package defines classes.
inf: Class GUID = {d61ca365-5af4-4486-998b-9db4734c6ca3}
inf: Class Status = Configurable
idb: {Configure Device Setup Class: {d61ca365-5af4-4486-998b-9db4734c6ca3}}
idb: Updating existing class.
idb: Class Name = XnaComposite
idb: {Configure Device Setup Class: exit(0x00000000)}
inf: {Configure Driver: Xbox 360 Controller for Windows}
inf: Manufacturer = Microsoft
inf: Section Name = CC_Install
inf: {Add Service: xusb22}
inf: Start Type = 3
inf: Service Type = 1
inf: Error Control = 0
inf: Image Path = \SystemRoot\System32\drivers\xusb22.sys
inf: Display Name = Xbox 360 Wireless Receiver Driver Service 22
inf: Updated service ‘xusb22’.
inf: {Add Service: exit(0x00000000)}
inf: Hardware Id = USB\MS_COMP_XUSB10
inf: {Configure Driver Configuration: CC_Install}
inf: Service Name = xusb22
inf: Config Flags = 0x00000000
inf: {Configure Driver Configuration: exit(0x00000000)}
inf: {Configure Driver: exit(0x00000000)}
flq: Copying ‘C:\WINDOWS\System32\DriverStore\FileRepository\xusb22.inf_amd64_21b73d10ffde6bfb\x64\xusb22.sys’ to ‘C:\WINDOWS\System32\drivers\xusb22.sys’.
cpy: Existing file ‘C:\WINDOWS\System32\drivers\xusb22.sys’ remains unchanged.
sto: {Configure Driver Package: exit(0x00000000)}
dvi: Install Device: Configuring device (xusb22.inf:usb\ms_comp_xusb10,CC_Install). 14:14:04.240
dvi: Install Device: Configuring device completed. 14:14:04.256
dvi: Install Device: Starting device. 14:14:04.256
dvi: Install Device: Starting device completed. 14:14:04.334
! dvi: Device not started (unknown reason): Device has no problem.
ndv: {Core Device Install - exit(0x00000000)} 14:14:04.334
<<< Section end 2014/12/08 14:14:04.350
<<< [Exit status: SUCCESS]
Thanks,
Marshall
xxxxx@hotmail.com wrote:
The hardware ID is set as below. I checked the device node in the device manager and the hardware ids are set correctly.
#define BTHXUSB_HARDWARE_IDS \
L"USB\VID_045E&PID_028E&REV_0114\0USB\VID_045E&PID_028E\0"
It loads the XUSB driver but starting the device failed due to unknown reason. I paste the setupapi.dev.log here for your reference.
The implication from this is that it expects the device to be a
composite device, with multiple interfaces. Are you simulating the
entire device descriptor and configuration descriptor of a real controller?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Add io handlers for all major types. A usb specific query interface might also be failing.
d
Bent from my phone
From: xxxxx@hotmail.commailto:xxxxx
Sent: ?12/?9/?2014 4:48 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Bluetooth game controller supports XInput
Hi Tim,
The hardware ID is set as below. I checked the device node in the device manager and the hardware ids are set correctly.
#define BTHXUSB_HARDWARE_IDS <br> L"USB\VID_045E&PID_028E&REV_0114\0USB\VID_045E&PID_028E\0"
It loads the XUSB driver but starting the device failed due to unknown reason. I paste the setupapi.dev.log here for your reference.
>>> [Device Install (Hardware initiated) - USB\VID_045E&PID_028E\1&1a590e2c&0&00]
>>> Section start 2014/12/08 14:14:03.975
dvi: {Build Driver List} 14:14:03.975
dvi: Searching for compatible ID(s):
dvi: usb\ms_comp_xusb10
dvi: usb\class_ff&subclass_5d&prot_01
dvi: usb\class_ff&subclass_5d
dvi: usb\class_ff
dvi: Created Driver Node:
dvi: HardwareID - USB\MS_COMP_XUSB10
dvi: InfName - C:\WINDOWS\System32\DriverStore\FileRepository\xusb22.inf_amd64_21b73d10ffde6bfb\xusb22.inf
dvi: DevDesc - Xbox 360 Controller for Windows
dvi: Section - CC_Install
dvi: Rank - 0x00ff2000
dvi: Signer Score - INBOX
dvi: DrvDate - 03/17/2014
dvi: Version - 6.3.9600.17054
dvi: {Build Driver List - exit(0x00000000)} 14:14:04.006
dvi: {DIF_SELECTBESTCOMPATDRV} 14:14:04.006
dvi: No class installer for ‘Blooth_HID_XUsb_00’
dvi: No CoInstallers found
dvi: Default installer: Enter 14:14:04.006
dvi: {Select Best Driver}
dvi: Class GUID of device changed to: {d61ca365-5af4-4486-998b-9db4734c6ca3}.
dvi: Selected:
dvi: Description - [Xbox 360 Controller for Windows]
dvi: InfFile - [c:\windows\system32\driverstore\filerepository\xusb22.inf_amd64_21b73d10ffde6bfb\xusb22.inf]
dvi: Section - [CC_Install]
dvi: {Select Best Driver - exit(0x00000000)}
dvi: Default installer: Exit
dvi: {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 14:14:04.021
ndv: {Core Device Install} 14:14:04.021
sto: {Configure Driver Package: C:\WINDOWS\System32\DriverStore\FileRepository\xusb22.inf_amd64_21b73d10ffde6bfb\xusb22.inf}
sto: Driver Package = xusb22.inf_amd64_21b73d10ffde6bfb
sto: Flags = 0x00020000
sto: Source Filter = usb\ms_comp_xusb10
inf: Driver package defines classes.
inf: Class GUID = {d61ca365-5af4-4486-998b-9db4734c6ca3}
inf: Class Status = Configurable
idb: {Configure Device Setup Class: {d61ca365-5af4-4486-998b-9db4734c6ca3}}
idb: Updating existing class.
idb: Class Name = XnaComposite
idb: {Configure Device Setup Class: exit(0x00000000)}
inf: {Configure Driver: Xbox 360 Controller for Windows}
inf: Manufacturer = Microsoft
inf: Section Name = CC_Install
inf: {Add Service: xusb22}
inf: Start Type = 3
inf: Service Type = 1
inf: Error Control = 0
inf: Image Path = \SystemRoot\System32\drivers\xusb22.sys
inf: Display Name = Xbox 360 Wireless Receiver Driver Service 22
inf: Updated service ‘xusb22’.
inf: {Add Service: exit(0x00000000)}
inf: Hardware Id = USB\MS_COMP_XUSB10
inf: {Configure Driver Configuration: CC_Install}
inf: Service Name = xusb22
inf: Config Flags = 0x00000000
inf: {Configure Driver Configuration: exit(0x00000000)}
inf: {Configure Driver: exit(0x00000000)}
flq: Copying ‘C:\WINDOWS\System32\DriverStore\FileRepository\xusb22.inf_amd64_21b73d10ffde6bfb\x64\xusb22.sys’ to ‘C:\WINDOWS\System32\drivers\xusb22.sys’.
cpy: Existing file ‘C:\WINDOWS\System32\drivers\xusb22.sys’ remains unchanged.
sto: {Configure Driver Package: exit(0x00000000)}
dvi: Install Device: Configuring device (xusb22.inf:usb\ms_comp_xusb10,CC_Install). 14:14:04.240
dvi: Install Device: Configuring device completed. 14:14:04.256
dvi: Install Device: Starting device. 14:14:04.256
dvi: Install Device: Starting device completed. 14:14:04.334
! dvi: Device not started (unknown reason): Device has no problem.
ndv: {Core Device Install - exit(0x00000000)} 14:14:04.334
<<< Section end 2014/12/08 14:14:04.350
<<< [Exit status: SUCCESS]
Thanks,
Marshall
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>