首页
社区
课程
招聘
[求助]PassThru中NdisWrapper的疑问
发表于: 2013-1-18 20:45 4571

[求助]PassThru中NdisWrapper的疑问

2013-1-18 20:45
4571
DriverEntry里如果注册协议失败,会
{.....
        NdisIMDeregisterLayeredMiniport(DriverHandle);
        NdisTerminateWrapper(NdisWrapperHandle, NULL);
.....
}

而PtUnload:
{.....
    PtUnloadProtocol();
    NdisIMDeregisterLayeredMiniport(DriverHandle);
    // !并没有NdisTerminateWrapper(NdisWrapperHandle, NULL);
.....
}

这里是不是示例疏忽了?

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 225
活跃值: (349)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
首先你要清楚,你调用的例程是ndis4的还是ndis5的
2013-1-18 20:58
0
雪    币: 284
活跃值: (3624)
能力值: ( LV5,RANK:75 )
在线值:
发帖
回帖
粉丝
3
从代码来看,NdisMInitializeWrapper和NdisTerminateWrapper应该NDIS4、5都要用到。
2013-1-18 21:08
0
雪    币: 284
活跃值: (3624)
能力值: ( LV5,RANK:75 )
在线值:
发帖
回帖
粉丝
4
假定是NDIS5,PtUnload里没有NdisTerminateWrapper(NdisWrapperHandle, NULL);还是和DriverEntry里的相悖。
2013-1-18 21:11
0
雪    币: 8835
活跃值: (2404)
能力值: ( LV12,RANK:760 )
在线值:
发帖
回帖
粉丝
5
MSDN有云

Remarks

From its DriverEntry function, a miniport driver calls NdisMInitializeWrapper to notify NDIS that the driver is about to register itself as a miniport driver. After NdisMInitializeWrapper successfully returns, the miniport driver calls either NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport to register its entry points with NDIS.

If a miniport driver's call to NdisMRegisterMiniport or NdisIMRegisterLayeredMiniport does not return NDIS_STATUS_SUCCESS, the miniport driver must call NdisTerminateWrapper. Calling NdisTerminateWrapper causesNDIS to clean up the resources that it allocated when the miniport driver called NdisMInitializeWrapper.
2013-1-18 21:34
0
雪    币: 284
活跃值: (3624)
能力值: ( LV5,RANK:75 )
在线值:
发帖
回帖
粉丝
6
那PtUnload里应该调用NdisTerminateWrapper,示例忘了
2013-1-18 22:02
0
游客
登录 | 注册 方可回帖
返回
//