From 8b17cf3d06b4e74dde2d1d83eeb75a247883f92d Mon Sep 17 00:00:00 2001 From: Wei Mao Date: Tue, 23 Jan 2018 11:05:56 -0800 Subject: Use WdfUsbTargetDeviceCreateWithParameters for UMDF 2.25+ --- usb/umdf2_fx2/driver/Device.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); -- cgit v1.3.1