usbsamp, EvtDeviceReleaseHardware

Hello!

I have been playing around with the usbsamp KMDF sample application and I have a question. What is the expected behavior when unplugging my USB device?

When I unplug my device now an assert in UsbSamp_EvtDeviceReleaseHardware() fails:

status = WdfUsbTargetDeviceSelectConfig(pDeviceContext->WdfUsbTargetDevice,
WDF_NO_OBJECT_ATTRIBUTES,
&configParams);
ASSERT(NT_SUCCESS(status));

The value of status after unplugging the device is STATUS_DEVICE_POWER_FAILURE (0xC000009D). Is this to be expected? Or is my device (or code) misbehaving?

Regards,
Mattias

The ASSERT is incorrect and should be removed, I will have the sample updated. Deconfiguring the device during ReleaseHardware has questionable value to begin with in my opinion, you could easily get rid of the WdfUsbTargetDeviceSelectConfig in this callback.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mattias Br?ndstr?m
Sent: Thursday, October 25, 2007 7:35 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] usbsamp, EvtDeviceReleaseHardware

Hello!

I have been playing around with the usbsamp KMDF sample application and I have a question. What is the expected behavior when unplugging my USB device?

When I unplug my device now an assert in UsbSamp_EvtDeviceReleaseHardware() fails:

status = WdfUsbTargetDeviceSelectConfig(pDeviceContext->WdfUsbTargetDevice,
WDF_NO_OBJECT_ATTRIBUTES,
&configParams);
ASSERT(NT_SUCCESS(status));

The value of status after unplugging the device is STATUS_DEVICE_POWER_FAILURE (0xC000009D). Is this to be expected? Or is my device (or code) misbehaving?

Regards,
Mattias


NTDEV is sponsored by OSR

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