As Thomas said, ProtocolUnbindAdapter only happens when the stack is torn down, or (on Vista/Win7 only) when an NDIS6 component is paused.
Your understanding is correct – NdisDeregisterProtocol will (indirectly) cause ProtocolUnbindAdapter to be invoked for all bindings. As will removing the miniport. You should see ProtocolUnbindAdapter called for every successful binding you had.
Note that shutting down the system does *not* cause all the drivers to be unloaded. The NIC gets a small notification, and then the system just powers off. Putting the system to sleep *may* unbind your protocol, depending on whether your protocol is “power-aware”.
A reliable way to test this path is to disable the physical NIC. You can do it manually in devmgmt.msc. If you want to get more serious about stressing it, you can use “devcon.exe” from the WDK to write a quick batch script that disables/enables the NIC in a loop.
And of course, buying a $USD 15 USB NIC and physically yanking it out is the most dramatic way to go. 
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Monday, March 28, 2011 3:39 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] NDIS, ProtocolUnbindAdapterHandler
Well, I just think about unloading NDIS driver. As I read in MSDN I have to call NdisCloseAdapter from ProtocolUnbindAdapterHandler. Ok, it doesn’t say when ProtocolUnbindAdapterHandler will be called. But NdisProt example looks strange for me: they just call NdisDeregisterProtocol from driver’s Unload function. Assuming that NdisProt is correct example, NdisDeregisterProtocol must call (probably indirectly) to ProtocolUnbindAdapterHandler, else resources allocated by NDIS driver bindings will not be freed.
Hm, do I described the situation good enough?
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