zhaoyanghong
驱动小牛
驱动小牛
  • 注册日期2004-11-13
  • 最后登录2008-08-05
  • 粉丝0
  • 关注0
  • 积分341分
  • 威望92点
  • 贡献值0点
  • 好评度91点
  • 原创分0分
  • 专家分0分
阅读:1006回复:2

passthru 结构问题

楼主#
更多 发布于:2004-12-28 21:32
请教:
   我看了微软的passthru,通过NDIS.H 中的小端口结构和协议结构
实现对小端口和协议层的支持。通过ADPAT结构来保存小端口和协议的句柄。请教 NdisIMGetDeviceContext函数的详细说明?

snowStart
驱动老牛
驱动老牛
  • 注册日期2004-04-06
  • 最后登录2011-06-02
  • 粉丝0
  • 关注0
  • 积分95分
  • 威望19点
  • 贡献值177点
  • 好评度1点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-12-29 08:44
DDK里面有呀

NdisIMGetDeviceContext
NdisIMGetDeviceContext allows an NDIS intermediate driver's MiniportInitialize function to access the device context area allocated by its ProtocolBindAdapter function.

NDIS_HANDLE
  NdisIMGetDeviceContext(
    IN NDIS_HANDLE  MiniportAdapterHandle
    );
Parameters
MiniportAdapterHandle
Specifies the handle input to MiniportInitialize.
Return Value
NdisIMGetDeviceContext returns access to the device context area for the virtual NIC identified by MiniportAdapterHandle, or it returns NULL if the driver's ProtocolBindAdapter function did not allocate such a device context area.

Headers
Declared in Ndis.h. Include Ndis.h.

Comments
An NDIS intermediate driver's MiniportInitialize function calls NdisIMGetDeviceContext to access the device context area for the virtual NIC it is initializing. Usually, the memory for such an area is provided by the intermediate driver's ProtocolBindAdapter function, which calls NdisIMInitializeDeviceInstanceEx with a pointer to this area, thereby causing the driver's MiniportInitialize function to be called. However, an intermediate driver is not required to have such a context area.

On return from NdisIMGetDeviceContext, MiniportInitialize sets up the driver-defined state for the virtual NIC with whatever information the intermediate driver writer intends to be useful to still higher level protocols that bind themselves subsequently to its virtual NIC.

Still higher level NDIS protocols bound to the same virtual NIC subsequently can access this device context area by calling NdisIMGetBindingContext from their ProtocolBindAdapter functions.

Callers of NdisIMGetDeviceContext can be running at IRQL <= DISPATCH_LEVEL. Typically, NDIS calls MiniportInitialize functions at IRQL PASSIVE_LEVEL.

学习,关注,交流中... [email=fengyu@163.com]Email:snowstarth@163.com[/email] [url]http://bbs.zndev.com/?a=snowStart[/url]
zhaoyanghong
驱动小牛
驱动小牛
  • 注册日期2004-11-13
  • 最后登录2008-08-05
  • 粉丝0
  • 关注0
  • 积分341分
  • 威望92点
  • 贡献值0点
  • 好评度91点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-12-29 08:52
谢谢!我在MSDN中未找到,忘了看DDK Help!
游客

返回顶部