阅读:1895回复:6
USB无线网卡驱动状态栏图标控制问题
现在在做一个无线USB网卡的驱动,遇到一个问题,网卡进入休眠状态后(D3),拔卡,结果状态栏的网卡图标还在,想问下,这个状态栏图标状态是谁控制的,是驱动还是操作系统,如何才能改变其状态,是否需要在驱动中设置某个值让操作系统知道网卡的状态,具体是哪个值,谢谢
|
|
沙发#
发布于:2008-05-14 13:08
状态应该是驱动控制. MiniportPnPEventNotify可以检测到拔除的消息,然后通知系统.
|
|
板凳#
发布于:2008-05-14 13:44
我的意思是说具体是靠哪个标志位,或者是通过哪个函数的调用去通知系统呢。
另:MiniportPnPEventNotify好像在xp以下系统好像是不支持的 |
|
地板#
发布于:2008-05-14 16:44
对.xp下ndis5.1才可以.
NdisDevicePnPEventSurpriseRemoved <---- MiniportPnPEventNotify( IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_DEVICE_PNP_EVENT PnPEvent, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, ); Parameters PnPEvent An event code that describes the Plug and Play event as one of the following: NdisDevicePnPEventSurpriseRemoved Indicates that the specified adapter has been unexpectedly removed from the system. NdisDevicePnPEventPowerProfileChanged Indicates that the power profile of the host system has changed. |
|
地下室#
发布于:2008-05-14 17:05
虽然我知道了这个通知事件,可是我不知道在响应这个事件的时候,在这个函数里该调用哪个函数或者设置哪个标志位才能使状态栏的图标消失啊,还请楼上的或是知道的朋友告知,谢谢
|
|
5楼#
发布于:2008-05-14 17:46
NdisMIndicateStatus(MiniportAdapterHandle,
NDIS_STATUS_MEDIA_DISCONNECT, NULL, 0); NdisMIndicateStatusComplete(MiniportAdapterHandle); |
|
6楼#
发布于:2008-05-14 20:40
问题解决,谢谢
|
|