当前位置: 网学 > 编程文档 > VB > 正文

使用VB截获WIN98系列下的IP数据包

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
ueryPacket = False
        MsgBox "err bind"
        Exit Function
     End If
   
   ovlp.Internal = 0
   ovlp.InternalHigh = 0
   ovlp.offset = 0
   ovlp.OffsetHigh = 0
   ovlp.hEvent = hEvent
    
''    ioc = &H80000018
    result = DeviceIoControl(hVxD, ioctl, InBuff(0), cbIn, InBuff(0), cbOut, cbRet, ovlp)
    If result = 0 Then
        If (GetLastError() = ERROR_IO_PENDING) Then
             MsgBox "Ok0"
        Else
            Call CloseHandle(hEvent)
            Exit Function
        End If
        If (0 = GetOverlappedResult(hVxD, ovlp, cbRet, 0)) Then
            If (GetLastError() = ERROR_IO_INCOMPLETE) Then
                MsgBox "ok2"
            Else
                Call CloseHandle(hEvent)
                Exit Function
            End If
        End If
        
        result = GetOverlappedResult(hVxD, ovlp, cbRet, 1)
    End If

    QueryPacket = cbRet
End Function



Function QueryOid(hVxD As Long, ulOid As Long, ulLength As Long) As Long
    Dim cbIn  As Long
    cbIn = 14 + ulLength
    Dim cbRet As Long
    Dim OidData As PACKET_OID_DATA
    OidData.Oid = ulOid
    OidData.Length = ulLength
    OidData.data = 0
    
    Dim ioctl As Long
    Const OID_802_3_PERMANENT_ADDRESS = &H1010101
    Const IOCTL_PROTOCOL_QUERY_OID = &H80000000
    Const IOCTL_PROTOCOL_STATISTICS = &H80000008
    
    If ulOid >= OID_802_3_PERMANENT_ADDRESS Then
        ioctl = IOCTL_PROTOCOL_QUERY_OID
    Else
    &
  • 上一篇资讯: 如何映射/中断网络磁盘
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号