diff options
| author | Wei Mao <[email protected]> | 2018-01-23 11:05:56 -0800 |
|---|---|---|
| committer | Wei Mao <[email protected]> | 2018-01-23 11:12:07 -0800 |
| commit | 8b17cf3d06b4e74dde2d1d83eeb75a247883f92d (patch) | |
| tree | 940d5305b20a7e478746cc24b4ba97d8b41eb2de | |
| parent | 6e7c8cb437135e55917c34cfebe1be944bbf6d3f (diff) | |
Use WdfUsbTargetDeviceCreateWithParameters for UMDF 2.25+
| -rw-r--r-- | usb/umdf2_fx2/driver/Device.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/usb/umdf2_fx2/driver/Device.c b/usb/umdf2_fx2/driver/Device.c index e7d521e3..7ceaa72c 100644 --- a/usb/umdf2_fx2/driver/Device.c +++ b/usb/umdf2_fx2/driver/Device.c @@ -424,9 +424,24 @@ Return Value: // restart. // if (pDeviceContext->UsbDevice == NULL) { + +#if UMDF_VERSION_MINOR >= 25 + WDF_USB_DEVICE_CREATE_CONFIG createParams; + + WDF_USB_DEVICE_CREATE_CONFIG_INIT(&createParams, + USBD_CLIENT_CONTRACT_VERSION_602); + + status = WdfUsbTargetDeviceCreateWithParameters( + Device, + &createParams, + WDF_NO_OBJECT_ATTRIBUTES, + &pDeviceContext->UsbDevice); +#else status = WdfUsbTargetDeviceCreate(Device, WDF_NO_OBJECT_ATTRIBUTES, &pDeviceContext->UsbDevice); +#endif + if (!NT_SUCCESS(status)) { TraceEvents(TRACE_LEVEL_ERROR, DBG_PNP, "WdfUsbTargetDeviceCreate failed with Status code %!STATUS!\n", status); |
