curex
驱动牛犊
驱动牛犊
  • 注册日期2006-03-14
  • 最后登录2009-06-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望6点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
阅读:1240回复:1

NdisReadNetworkAddress 出错?

楼主#
更多 发布于:2007-07-02 00:20

 我用下面的代码在协议驱动里面读网卡的地址,不知道为什么    NdisReadNetworkAddress
在2000下就返回status Unsucess,XP下面就直接蓝苹了

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      //打开注册表
    NdisOpenProtocolConfiguration(&status,&ConfigHanlde,&open->AdapterName);

    if (status != NDIS_STATUS_SUCCESS || ConfigHanlde == NULL)
    {
        DebugPrint(("NdisOpenProtocolConfiguration faild"));

        Irp->IoStatus.Information = 0;    
        Irp->IoStatus.Status = status;
        IoCompleteRequest (Irp, IO_NO_INCREMENT);
        IoDecrement(open);
        return status;
    }

      NdisReadNetworkAddress(&status,&NetworkAddress,&NetworkAddressLength,ConfigHanlde);

    if ((status == NDIS_STATUS_SUCCESS) && (NetworkAddressLength == NUIO_MAC_ADDR_LEN))
    {
        ETH_COPY_NETWORK_ADDRESS(CurrentAddress,NetworkAddress);
       }

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Windbg显示的结果是:

KERNEL_MODE_EXCEPTION_NOT_HANDLED_M (1000008e)
This is a very common bugcheck.  Usually the exception address pinpoints
the driver/function that caused the problem.  Always note this address
as well as the link date of the driver/image that contains this address.
Some common problems are exception code 0x80000003.  This means a hard
coded breakpoint or assertion was hit, but this system was booted
/NODEBUG.  This is not supposed to happen as developers should never have
hardcoded breakpoints in retail code, but ...
If this happens, make sure a debugger gets connected, and the
system is booted /DEBUG.  This will let us see why this breakpoint is
happening.
Arguments:
Arg1: c0000005, The exception code that was not handled
Arg2: f98c53c5, The address that the exception occurred at
Arg3: f7edf994, Trap Frame
Arg4: 00000000
zhaock
驱动太牛
驱动太牛
  • 注册日期2002-01-26
  • 最后登录2018-06-02
  • 粉丝3
  • 关注2
  • 积分73328分
  • 威望362317点
  • 贡献值1点
  • 好评度226点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2007-07-02 14:11
把!analyze -v的结果贴上来,贴全
游客

返回顶部