Handling power state changes RRS feed

  • Question

  • I have developed a kernel mode callout driver loosley based on the WFP sample in the 6001 DDK 9started from the sample to get an understanding then went on to create something that fit my needs). My implementation uses the inspect-clone-reinject method to alter packets, and alterations are done in a worker thread signalled by an event.

    When switching power states (say, the machine is attempting to go to sleep), the thread does not stop operating, it just keeps waiting on the event and at times even attempts to process some packets (this generally happens as soon as the sleep occurs, which seems plausible). The unload function is not called in this situation.

    For NDIS6 miniport drivers, power transitions are well defined but it does not seem that WFP has something similar. How is it possible to kill a thread when such a power transition occurs?

    The service start type (in registry) is set to 3 (if that helps).

    Thursday, December 16, 2010 10:38 AM