This information in this page is offered in the spirit of cooperation among programmers . The author hopes that he will be contacted by those who find additional bugs in the Packet sample or wish to correct inaccuracies in this page. You can download the updated sample from MS Support . I took out the cleanup routine because it was completely wrong. In the first place, it's not a good idea to reset an adapter just because an application doesn't want to use the adapter any more.
Resets are expensive operation.
An adapter is not a resource of one application or protocol in the system. Secondly, there was a race condition between the protocol and miniport during freeing of packet. There is no reliable way to do this in the existing architecture. There are plans to introduce new APIs to cancel a pending Recv. I also don't like the idea of using FsContext to save the BindApapterContext.