sirroom
驱动大牛
驱动大牛
  • 注册日期2001-07-30
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望11点
  • 贡献值1点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:993回复:0

关于ptunload,再来一篇。

楼主#
更多 发布于:2002-05-22 17:04
回应的第 1-10 项留言
Message 1 in thread
寄件者:matts lee (matts_lee@hotmail.com)
主旨:Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-12 23:32:42 PST
 

I built XP\'s passthru sample with W2k and XP DDKs to test whether it
would be unload if I uninstall the driver. Whether I built the driver
with NDIS40_MINIPORT=1 or NDIS50_MINIPORT=1, the driver won\'t unload
after it\'s uninstall. It wasn\'t unload whether I used notify object
DLL.

I\'ve read posts in the past and they indicated the problem exists with
W2k\'s passthru sample but it was fixed with XP\'s sample.

Do I miss something here or something else?

Thanks,
Matts
Post a follow-up to this message

Message 2 in thread
寄件者:Eliyas Yakub (eliyasy@microsoft.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-13 08:16:03 PST
 

As far as notify unload issue is concerned the fix is made in the OS - not
in the sample. So just using the XP passthru wouldn\'t help.

-Eliyas

\"matts lee\" <matts_lee@hotmail.com> wrote in message
news:f8728f83.0205122232.50c0c418@posting.google.com...
> I built XP\'s passthru sample with W2k and XP DDKs to test whether it
> would be unload if I uninstall the driver. Whether I built the driver
> with NDIS40_MINIPORT=1 or NDIS50_MINIPORT=1, the driver won\'t unload
> after it\'s uninstall. It wasn\'t unload whether I used notify object
> DLL.
>
> I\'ve read posts in the past and they indicated the problem exists with
> W2k\'s passthru sample but it was fixed with XP\'s sample.
>
> Do I miss something here or something else?
>
> Thanks,
> Matts
Post a follow-up to this message

Message 3 in thread
寄件者:matts lee (matts_lee@hotmail.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-14 11:59:42 PST
 

Hi Eliyas,

Sorry for the confusion here. My problem is the driver, not the notify
object dll, won\'t unload after uninstall.

Please see my response to Stephen\'s reply.

Thanks,
Matts

\"Eliyas Yakub\" <eliyasy@microsoft.com> wrote in message news:<#jowiCp#BHA.2164@tkmsftngp04>...
> As far as notify unload issue is concerned the fix is made in the OS - not
> in the sample. So just using the XP passthru wouldn\'t help.
>
> -Eliyas
>
> \"matts lee\" <matts_lee@hotmail.com> wrote in message
> news:f8728f83.0205122232.50c0c418@posting.google.com...
> > I built XP\'s passthru sample with W2k and XP DDKs to test whether it
> > would be unload if I uninstall the driver. Whether I built the driver
> > with NDIS40_MINIPORT=1 or NDIS50_MINIPORT=1, the driver won\'t unload
> > after it\'s uninstall. It wasn\'t unload whether I used notify object
> > DLL.
> >
> > I\'ve read posts in the past and they indicated the problem exists with
> > W2k\'s passthru sample but it was fixed with XP\'s sample.
> >
> > Do I miss something here or something else?
> >
> > Thanks,
> > Matts
Post a follow-up to this message

Message 4 in thread
寄件者:Stephan Wolf (stewo68@hotmail.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-14 02:16:06 PST
 

The IM *driver* should unload as soon as all virtual Miniports of the
driver have been halted (MiniportHalt). Check if all virtual Miniports
that have been initialized (MiniportInitialize) are actually halted.

The Notify Object DLL won\'t unload due to a problem in W2K, see
http://www.pcausa.com/resources/qandis2k.htm and do a search for
CoFreeUnusedLibraries().

Stephan
---
On 12 May 2002 23:32:41 -0700, matts_lee@hotmail.com (matts lee)
wrote:

>I built XP\'s passthru sample with W2k and XP DDKs to test whether it
>would be unload if I uninstall the driver. Whether I built the driver
>with NDIS40_MINIPORT=1 or NDIS50_MINIPORT=1, the driver won\'t unload
>after it\'s uninstall. It wasn\'t unload whether I used notify object
>DLL.
>
>I\'ve read posts in the past and they indicated the problem exists with
>W2k\'s passthru sample but it was fixed with XP\'s sample.
>
>Do I miss something here or something else?
>
>Thanks,
>Matts
Post a follow-up to this message

Message 5 in thread
寄件者:matts lee (matts_lee@hotmail.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-14 11:57:13 PST
 

Hi Stephan,

There\'s only one NIC bind to my IM. I watched that MiniportHalt() is
called. However, after uninstall, run !drivers from windbg shows that
my IM is there. Reinstall the driver and driver\'s DriverEntry() is not
call and only  ProtocolBindAdpater() is called. I\'ve used XP\'s DDK
sample and the result is the same.

According what I read from the past post and your reply, it seems not
a problem. But base the information I got, I can\'t figure out what\'s
long with it.
Do I need to call NdisDeregisterProtocol() when the last
ProtocolUnbindAdpater() is called? This is what PtUnload() does in
XP\'s passthru sample.

Thanks,
Matts

stewo68@hotmail.com (Stephan Wolf) wrote in message news:<3ce0d73d.12710897@news.t-online.de>...
> The IM *driver* should unload as soon as all virtual Miniports of the
> driver have been halted (MiniportHalt). Check if all virtual Miniports
> that have been initialized (MiniportInitialize) are actually halted.
>
> The Notify Object DLL won\'t unload due to a problem in W2K, see
> http://www.pcausa.com/resources/qandis2k.htm and do a search for
> CoFreeUnusedLibraries().
>
> Stephan
> ---
> On 12 May 2002 23:32:41 -0700, matts_lee@hotmail.com (matts lee)
> wrote:
>
> >I built XP\'s passthru sample with W2k and XP DDKs to test whether it
> >would be unload if I uninstall the driver. Whether I built the driver
> >with NDIS40_MINIPORT=1 or NDIS50_MINIPORT=1, the driver won\'t unload
> >after it\'s uninstall. It wasn\'t unload whether I used notify object
> >DLL.
> >
> >I\'ve read posts in the past and they indicated the problem exists with
> >W2k\'s passthru sample but it was fixed with XP\'s sample.
> >
> >Do I miss something here or something else?
> >
> >Thanks,
> >Matts
Post a follow-up to this message

Message 6 in thread
寄件者:Stephan Wolf (stewo68@hotmail.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-14 13:07:09 PST
 

Yes, from the DDK docs:

\"NdisDeregisterProtocol
[..]
Registered protocol drivers call NdisDeregisterProtocol in any of the
following circumstances:
[..] the ProtocolUnbindAdapter function has been called to release the
driver\'s last remaining binding.\"

Stephan
---
On 14 May 2002 11:57:12 -0700, matts_lee@hotmail.com (matts lee)
wrote:

>Hi Stephan,
>
>There\'s only one NIC bind to my IM. I watched that MiniportHalt() is
>called. However, after uninstall, run !drivers from windbg shows that
>my IM is there. Reinstall the driver and driver\'s DriverEntry() is not
>call and only  ProtocolBindAdpater() is called. I\'ve used XP\'s DDK
>sample and the result is the same.
>
>According what I read from the past post and your reply, it seems not
>a problem. But base the information I got, I can\'t figure out what\'s
>long with it.
>Do I need to call NdisDeregisterProtocol() when the last
>ProtocolUnbindAdpater() is called? This is what PtUnload() does in
>XP\'s passthru sample.
>
>Thanks,
>Matts
>
>stewo68@hotmail.com (Stephan Wolf) wrote in message news:<3ce0d73d.12710897@news.t-online.de>...
>> The IM *driver* should unload as soon as all virtual Miniports of the
>> driver have been halted (MiniportHalt). Check if all virtual Miniports
>> that have been initialized (MiniportInitialize) are actually halted.
>>
>> The Notify Object DLL won\'t unload due to a problem in W2K, see
>> http://www.pcausa.com/resources/qandis2k.htm and do a search for
>> CoFreeUnusedLibraries().
>>
>> Stephan
>> ---
>> On 12 May 2002 23:32:41 -0700, matts_lee@hotmail.com (matts lee)
>> wrote:
>>
>> >I built XP\'s passthru sample with W2k and XP DDKs to test whether it
>> >would be unload if I uninstall the driver. Whether I built the driver
>> >with NDIS40_MINIPORT=1 or NDIS50_MINIPORT=1, the driver won\'t unload
>> >after it\'s uninstall. It wasn\'t unload whether I used notify object
>> >DLL.
>> >
>> >I\'ve read posts in the past and they indicated the problem exists with
>> >W2k\'s passthru sample but it was fixed with XP\'s sample.
>> >
>> >Do I miss something here or something else?
>> >
>> >Thanks,
>> >Matts
Post a follow-up to this message

Message 7 in thread
寄件者:Maxim S. Shatskih (maxim@storagecraft.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-16 00:31:08 PST
 

> \"NdisDeregisterProtocol
> [..]
> Registered protocol drivers call NdisDeregisterProtocol in any of the
> following circumstances:
> [..] the ProtocolUnbindAdapter function has been called to release the
> driver\'s last remaining binding.\"

Again strange.
What if ProtocolUnbindAdapter were due to lower miniport instances
being stopped?
If NdisDeregisterProtocol will be called - then restarting the
miniports will not cause rebind, which is a bit strange.

    Max
Post a follow-up to this message

Message 8 in thread
寄件者:Maxim S. Shatskih (maxim@storagecraft.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-16 00:31:08 PST
 

> Do I need to call NdisDeregisterProtocol() when the last
> ProtocolUnbindAdpater() is called?

Why?
ProtocolUnbindAdapter calls are usually scheduled by
NdisDeregisterProtocol.
Maybe it is a better idea to call NdisDeregisterProtocol from
_miniport_ unload routine?

    Max
Post a follow-up to this message

Message 9 in thread
寄件者:Stephan Wolf (stewo68@hotmail.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-16 17:19:02 PST
 

Sure. You are right. This is what I do in my (MUX) IMs because NDIS
will actually *unload* the driver even if there are still some active
*protocol* bindings (which IMHO is a bug in NDIS).

Note that AFAIK the *system* considers an IM as if it were only a
Miniport driver, ie. the protocol part is not handled by the system
but only by NDIS.

Stephan
---
On Wed, 15 May 2002 23:11:20 +0400, \"Maxim S. Shatskih\"
<maxim@storagecraft.com> wrote:

>> Do I need to call NdisDeregisterProtocol() when the last
>> ProtocolUnbindAdpater() is called?
>
>Why?
>ProtocolUnbindAdapter calls are usually scheduled by
>NdisDeregisterProtocol.
>Maybe it is a better idea to call NdisDeregisterProtocol from
>_miniport_ unload routine?
>
>    Max
Post a follow-up to this message

Message 10 in thread
寄件者:Maxim S. Shatskih (maxim@storagecraft.com)
主旨:Re: Ndis IM driver not unload from memory in W2k
新闻群组:microsoft.public.development.device.drivers
View this article only
日期:2002-05-17 18:08:13 PST
 

> Note that AFAIK the *system* considers an IM as if it were only a
> Miniport driver, ie. the protocol part is not handled by the system
> but only by NDIS.

Surely, since protocols have no device objects and not registered
neither in the IO manager nor in PnP, they are registered in NDIS
only.
So, for IM, only the miniport edge is known to the OS and PnP, and
unload will be called (it is called by PnP and not NDIS itself) for
miniport only.

Nevertheless, there is NdisIMAssociateMiniport. It would be
interesting to get information from MS about for what this association
is used by NDIS. NDIS4 had no such an association.

    Max
Post a follow-up to this message

 


看了半天,试了一会儿,偶也没发现用程序ptunload的好办法。
在mphalt中似乎会一直死在那里。

谁对这个问题有好的办法啊?
111
游客

返回顶部