I was wondering if anyone could point me at some reasons why an NDIS IM
driver could hang when I go to manually uninstall it from the Local Area
Connection Properties (where it was manually installed in the first place)?
I am using the “James” version of the NDIS IM example from here:
http://www.wd-3.com/archive/ExtendingPassthru2.htm
I had seen failure-to-unload behavior like this in the past, and the
*apparent* cause was that I was subtly corrupting the stack with some inline
asm where I put a dword onto the stack and didn’t remove it before I
returned from a function (still not really sure how it worked since you’d
think the saved EIP would be completely out of whack). But I fixed that and
didn’t see this behavior again until recently.
Nowadays I have isolated this problem to the following: If I set
the decision = true in the *FilterPacket* function (thus telling the
function who called FilterPacket() not to indicate the packet up, thus
dropping it, it won’t unload. If I don’t try to drop the packets, it will
unload. To make it a little more complicated, I can load it up and unload it
right away, but if I load it up, send a packet to be filtered, and then try
to unload, that’s when it will fail.
Here is the output from WinDbg on a successful unload:
*******************************************
INFO:–> ::SysNotifyBindingPath, dwChangeFlag 0x00000002
INFO:–> ::SysNotifyBindingPath path enable
INFO:PathToken
<ms_passthru->PCI\VEN_14E4&DEV_4312&SUBSYS_00071028&REV_01\4&360A6DE&0&00E1>
INFO:–> ::SysNotifyBindingPath, dwChangeFlag 0x00000002
INFO:–> ::SysNotifyBindingPath path enable
INFO:PathToken
<ms_passthru->PCI\VEN_14E4&DEV_1600&SUBSYS_01CC1028&REV_02\4&378EDFA4&0&00E2>
INFO:–> ::SysNotifyBindingPath, dwChangeFlag 0x00000002
INFO:–> ::SysNotifyBindingPath path enable
INFO:PathToken <ms_passthru->ROOT\NET\0000>
INFO:–> ::SysNotifyComponent dwChangeFlag 0x00080002
INFO:–> ::ApplyRegistryChanges
INFO:–> ::ApplyRegistryChanges default 4
INFO:–> ::ApplyRegistryChanges exit
PtPnPHandler: Adapt 862ACCB8, Event 2
==> PtUnbindAdapter: Adapt 862ACCB8
==>MiniportHalt: Adapt 862ACCB8
CloseAdapterComplete: Adapt 862ACCB8, Status 0
<== MiniportHalt: pAdapt 862ACCB8
<== PtUnbindAdapter: Adapt 862ACCB8
PtPnPHandler: Adapt 861D8518, Event 2
==> PtUnbindAdapter: Adapt 861D8518
==>MiniportHalt: Adapt 861D8518
CloseAdapterComplete: Adapt 861D8518, Status 0
<== MiniportHalt: pAdapt 861D8518
<== PtUnbindAdapter: Adapt 861D8518
PtUnloadProtocol: done!
PtUnload: entered
PtUnloadProtocol: done!
PtUnload: done!
INFO:–> ::ApplyPnpChanges
INFO:DNE is in filter class
INFO: is not set
INFO:Adding other IMs…
INFO:NetTransport: Ndisuio
INFO:NetTransport: RasPppoe
INFO:NetTransport: Tcpip
INFO:NetTransport: NdisWan
INFO:NetTransport: NetBT
INFO:0000 is a node
INFO:No RootDevice: 0000
INFO:0001 is a node
INFO:–keep settings to 0001
INFO: UpperBind: {Tcpip}
INFO: RootDevice {60E9DBFB-CAA9-469D-9C5E-6D7E8D693D56} NIC1394
INFO:0002 is a node
INFO:–keep settings to 0002
INFO: UpperBind: {NdisWan}
INFO: RootDevice {F7600427-A36D-4167-82BE-87D42CCD52E9} AsyncMac
INFO:0003 is a node
INFO:–keep settings to 0003
INFO: UpperBind: {NdisWan}
INFO: RootDevice {67F8C768-D35F-4EBF-B6D4-A141AE50BDA9} Rasl2tp
INFO:0004 is a node
INFO:–keep settings to 0004
INFO: UpperBind: {NdisWan}
INFO: RootDevice {30D710C5-884A-4DDC-AD0F-4946FF3F055F} PptpMiniport
INFO:0005 is a node
INFO:–keep settings to 0005
INFO: UpperBind: {NdisWan}
INFO: RootDevice {19FD3F2E-0ED8-4611-B5ED-E86EF078E59A} RasPppoe
INFO:0006 is a node
INFO:–keep settings to 0006
INFO: UpperBind: {NdisWan}
INFO: RootDevice {8537FD13-6F99-4691-AA42-96727D0070E5} Raspti
INFO:0007 is a leaf
INFO:0008 is a node
INFO:–keep settings to 0008
INFO: UpperBind: {Tcpip}
INFO: RootDevice {9CCB311B-3326-46F7-BFE0-0CD1B8C7FFF5} PSched
INFO: RootDevice {01437611-D309-47CD-A9B7-7BA0F3D5F8FC} DNE
INFO: RootDevice NdisWanIp
INFO:0009 is a leaf
INFO:0010 is a node
INFO:–keep settings to 0010
INFO: UpperBind: {VMnetBridge,RasPppoe,Ndisuio,Tcpip}
INFO: RootDevice {88C444BC-E250-4CA7-851D-8B7CC6113540} PSched
INFO: RootDevice {5EFE6A26-71DE-4251-98D5-6AF1E528D794} DNE
INFO: RootDevice {1EE4A082-73D6-4C68-B295-86BAA298ACBF} BCM43XX
INFO:0011 is a leaf
INFO:0012 is a node
INFO:–keep settings to 0012
INFO: UpperBind: {VMnetBridge,RasPppoe,Ndisuio,Tcpip}
INFO: RootDevice {912B93A3-4599-41CE-AEDD-0BEC593244FE} PSched
INFO: RootDevice {9FC3E02C-C1C7-49D7-9C8E-DE1914DBDE02} DNE
INFO: RootDevice {FF736D39-8192-4676-ADA4-936B6AD72837} b57w2k
INFO:0013 is a leaf
INFO:0014 is a node
INFO:–keep settings to 0014
INFO: UpperBind: {VMnetBridge,RasPppoe,Ndisuio,Tcpip}
INFO: RootDevice {53AAB423-53EE-4BC9-B61B-30ECEFCCCE80} PSched
INFO: RootDevice {38B89128-1DAA-4652-917C-604D6A181AB0} DNE
INFO: RootDevice {FD5933BC-B80D-4FA8-996D-E34E611CDA67} CVirtA
INFO:0015 is a leaf
INFO:0016 is a leaf
INFO:0017 is a leaf
INFO:0018 is a leaf
INFO:0022 is a node
INFO:–keep settings to 0022
INFO: UpperBind: {RasPppoe,Ndisuio,Tcpip}
INFO: RootDevice {AC3109C9-1051-43B5-A02F-1BBD540D13D0} VMnetAdapter
INFO:0023 is a node
INFO:–keep settings to 0023
INFO: UpperBind: {RasPppoe,Ndisuio,Tcpip}
INFO: RootDevice {A6C53BFF-3872-4C05-84FC-DF7071F22757} VMnetAdapter
INFO:0024 is a node
INFO:–keep settings to 0024
INFO: UpperBind: {Tcpip}
INFO: RootDevice {82B97891-11FD-4A49-B3BE-CAA48A73F3CF} NIC1394
INFO:OrderIM: success changed=0
INFO:–> ::ApplyPnpChanges exit
INFO:DllCanUnloadNow hr=1
Here is the output from WinDbg on an unsuccessful unload:
Non-IP abort
INFO:–> ::SysNotifyBindingPath, dwChangeFlag 0x00000002
INFO:–> ::SysNotifyBindingPath path enable
INFO:PathToken
<ms_passthru->PCI\VEN_14E4&DEV_4312&SUBSYS_00071028&REV_01\4&360A6DE&0&00E1>
INFO:–> ::SysNotifyBindingPath, dwChangeFlag 0x00000002
INFO:–> ::SysNotifyBindingPath path enable
INFO:PathToken
<ms_passthru->PCI\VEN_14E4&DEV_1600&SUBSYS_01CC1028&REV_02\4&378EDFA4&0&00E2>
INFO:–> ::SysNotifyBindingPath, dwChangeFlag 0x00000002
INFO:–> ::SysNotifyBindingPath path enable
INFO:PathToken <ms_passthru->ROOT\NET\0000>
INFO:–> ::SysNotifyComponent dwChangeFlag 0x00080002
INFO:–> ::ApplyRegistryChanges
INFO:–> ::ApplyRegistryChanges default 4
INFO:–> ::ApplyRegistryChanges exit
PtPnPHandler: Adapt 85E13178, Event 2
==> PtUnbindAdapter: Adapt 85E13178
==>MiniportHalt: Adapt 85E13178
CloseAdapterComplete: Adapt 85E13178, Status 0
<== MiniportHalt: pAdapt 85E13178
<== PtUnbindAdapter: Adapt 85E13178
PtPnPHandler: Adapt 86424AF8, Event 2
==> PtUnbindAdapter: Adapt 86424AF8
==>MiniportHalt: Adapt 86424AF8
CloseAdapterComplete: Adapt 86424AF8, Status 0
<== MiniportHalt: pAdapt 86424AF8
<== PtUnbindAdapter: Adapt 86424AF8
PtUnloadProtocol: done!
PtUnload: entered
PtUnloadProtocol: done!
PtUnload: done!
*******************************************
Note, it doesn’t hang the entire system, it just hangs the interface to the
Local Area Connection Properties window, which eventually then makes the
system take a long time to shutdown (but it will eventually shut down of
its own volition)
Any help for what would cause something to not unload would be super
appreciated.
Billy Volta Esq.</ms_passthru-></ms_passthru-></ms_passthru-></ms_passthru-></ms_passthru-></ms_passthru->