Re: NdisMRegisterUnloadHandler

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Stephan Wolf [MVP] (stewo68_at_hotmail.com)
Date: 11/16/04


Date: Tue, 16 Nov 2004 22:45:22 +0100

The only reasons I know of for the unload handler of an NDIS driver
not getting called is when:

- driver fails MiniportHalt() or ProtocolUnbindAdapter().

- driver has created a device object via NdisMRegisterDevice() and
fails to call NdisMDeregisterDevice() when the last miniport instance
has gone (i.e. MiniportHalt() called for the last instance).

Stephan

---
On Mon, 15 Nov 2004 01:34:23 -0800, "Steve"
<swoodberry@foursticks.com> wrote:
>I register an unload handler in my IM driver using 
>NdisMRegisterUnloadHandler.  This is done after a 
>successful call to NdisIMRegisterLayeredMiniport.
>
>The unload handler is responsible for freeing up memory 
>and resources, etc.  Sometimes when I uninstall my driver 
>the unload handler does not get called and then I get a 
>blue screen because driver verifier is not happy that my 
>driver has not freed up all of its memory!
>
>This happens sometimes on XP and a lot on w2k.
>Any ideas?


Relevant Pages

  • Re: driver unload not called...........
    ... We are porting a Ndis intermediate driver from NT to wince4.2 .we ... are using platformbuilder's emulator for testing...The soft reset on ... the emulator didnt call our unload handler .so we tried on the actual ...
    (microsoft.public.development.device.drivers)
  • Re: Driver does not unload, probably because Irp
    ... The problem is that after doing a DeviceIOControl the driver does not unload (i.e. MiniportHalt is called but Miniport unload is not). ...
    (microsoft.public.development.device.drivers)
  • Re: MiniportHandleInterrupt not queued when MiniportHalt is runnin
    ... NDIS will not call your ISR or DPC handler afterward. ... the driver is for a legacy device so standby/hibernate cause the MiniportHalt ...
    (microsoft.public.development.device.drivers)
  • Re: How can I tell when the driver starts to unload
    ... The loop is conditional ... > on a global shutdown flag, but if I try to clear the flag in the HaltHandler ... This is an odd architecture for a network miniport driver. ... The MiniportHalt routine is not called to unload a driver; ...
    (microsoft.public.development.device.drivers)
  • Driver does not unload, probably because Irp
    ... I have started porting a driver to NDIS 6.0 and have registered a device. ... The problem is that after doing a DeviceIOControl the driver does not unload (i.e. MiniportHalt is called but Miniport unload is not). ...
    (microsoft.public.development.device.drivers)