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

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

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
g, inBuffer As String) As Boolean

    Dim hEvent   As Long
    Dim cbRet    As Long
    Dim ovlp  As OVERLAPPED
    
    Dim result As Long
    Dim cbIn As Long
    cbIn = 5
    
    hEvent = CreateEvent(0, 1, 0, vbNullString)
    If hEvent = 0 Then
        Bind = False
        MsgBox "err bind"
        Exit Function
     End If

    ovlp.hEvent = hEvent

''((0x8000) << 16) | ((0) << 14) | ((7) << 2) | (0))
Const IOCTL_PROTOCOL_BIND = &H8000001C
    result = DeviceIoControlAsString(hVxD, _
                             IOCTL_PROTOCOL_BIND, _
                            ByVal inBuffer, _
                             cbIn, _
                             ByVal inBuffer, _
                             cbIn, _
                             cbRet, _
                             ovlp)

    If (result = 0) Then
        Call GetOverlappedResult(hVxD, ovlp, cbRet, True)
    End If
    
    Call CloseHandle(hEvent)
    Bind = True
End Function


Function QueryPacket(ByVal hVxD As Long, ByVal ioctl As Long, ByVal cbIn As Long, ByVal cbOut As Long) As Long
    Dim hEvent  As Long
    Dim cbRet As Long
    Dim ovlp  As OVERLAPPED
    Dim result As Long
   
    hEvent = CreateEvent(0, 1, 0, vbNullString)
    If hEvent = 0 Then
        Q
  • 上一篇资讯: 如何映射/中断网络磁盘
  • 网学推荐

    免费论文

    原创论文

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