Hi
I am working with a WDF driver controlling 1 or more adapters. The driver itself is loaded once and then it makes a WDFDEVICE for each adapter it is controlling. This works fine, but I have a problem when one of the adapters is shut down or updated.
Example 1: I have 2 adapters named A0 and A1. If I update adapter A0, windows shuts down both A0 and A1 before the adapters are updated. In that way the WDF framework is cleaned up nicely.
Example 2: For the same adapters. If I update adapter A1, windows does only shutdown A1 leaving A0 untouched and the WDF framework is not cleaned. This means that all the resources allocated for A1 before the update is not deleted. Again this means that when A1 is loaded again it fails because of the name collision i.e. the name is not removed when the adapter is shut down.
My questions are:
- Is there way to force windows to always shut down all adapters controlled by the driver?
- Is there a way to manually delete all the objects allocated by the WDF framework?
Regards
Bent
Are these pnp instances? If yes, why give them fixed names and instead use device. interfaces . Regardless, when a1 is deleted for update, its name should go away with the deletion. All resources are rooted per wdfdevice, so when a1 goes away, all if its resources and state go away with it. A0 doesn’t matter.
d
Bent from my Phone
From: xxxxx@napatech.commailto:xxxxx
Sent: ?7/?5/?2013 8:56 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Manually cleanup of WDF framework
Hi
I am working with a WDF driver controlling 1 or more adapters. The driver itself is loaded once and then it makes a WDFDEVICE for each adapter it is controlling. This works fine, but I have a problem when one of the adapters is shut down or updated.
Example 1: I have 2 adapters named A0 and A1. If I update adapter A0, windows shuts down both A0 and A1 before the adapters are updated. In that way the WDF framework is cleaned up nicely.
Example 2: For the same adapters. If I update adapter A1, windows does only shutdown A1 leaving A0 untouched and the WDF framework is not cleaned. This means that all the resources allocated for A1 before the update is not deleted. Again this means that when A1 is loaded again it fails because of the name collision i.e. the name is not removed when the adapter is shut down.
My questions are:
1. Is there way to force windows to always shut down all adapters controlled by the driver?
2. Is there a way to manually delete all the objects allocated by the WDF framework?
Regards
Bent
—
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>
@Doron You are right, but that is not what happens. When the a1 driver is updated and restarted it fails due to a NAME_COLLISION eventhough the name should have been erased by the framwork. Only when both instances of the driver is closed, it works as expected. Also if a1 is manually disabled and enabled this occur.
Off cause I can have done something wrong. I am not a very skilled driver writer.
Regards
Bent
xxxxx@napatech.com wrote:
@Doron You are right, but that is not what happens. When the a1 driver is updated and restarted it fails due to a NAME_COLLISION eventhough the name should have been erased by the framwork.
The name cannot be erased until the device is removed, and the device
cannot be removed until the last open handle is closed. Does the driver
create BOTH names when it comes up? That would cause the results you’re
seeing.
Off cause…
You mean “Of course”. Call me a pedant if you wish, but I think it’s
beneficial to correct misunderstood idioms.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.