设为首页 加入收藏

TOP

DELPHI 小结(十)
2017-10-10 12:04:56 】 浏览:2935
Tags:DELPHI 小结
sp; // reply data size
     reserved:      word;
     data:          pointer;              // pointer to reply data buffer
     options:       tipoptioninformation; // reply options
  end;

  ticmpcreatefile = function: thandle; stdcall;
  ticmpclosehandle = function(icmphandle: thandle): boolean; stdcall;
  ticmpsendecho = function(
     icmphandle:          thandle;
     destinationaddress:  dword;
     requestdata:         pointer;
     requestsize:         word;
     requestoptions:      pipoptioninformation;
     replybuffer:         pointer;
     replysize:           dword;
     timeout:             dword
  ): dword; stdcall;

const
  size = 32;
  timeout = 1000;
var
  wsadata: twsadata;
  address: dword;                     // address of host to contact
  hostname, hostip: string;           // name and dotted ip of host to contact
  phe: phostent;                      // hostentry buffer for name lookup
  buffersize, npkts: integer;
  preqdata, pdata: pointer;
  pipe: picmpechoreply;               // icmp echo reply buffer
  ipopt: tipoptioninformation;        // ip options for packet to send
const
  icmpdll = 'icmp.dll';
var
  hicmplib: hmodule;
  icmpcreatefile : ticmpcreatefile;
  icmpclosehandle: ticmpclosehandle;
  icmpsendecho:    ticmpsendecho;
  hicmp: thandle;                     // handle for the icmp calls
begin
  // initialise winsock
  result:=true;
  if wsastartup(2,wsadata) <> 0 then begin
     result:=false;
     halt;
  end;
  // register the icmp.dll stuff
  hicmplib := loadlibrary(icmpdll);
  if hicmplib <> null then begin
    @icmpcreatefile := getprocaddress(hicmplib, 'icmpcreatefile');
    @icmpclosehandle:= getprocaddress(hicmplib, 'icmpclosehandle');
    @icmpsendecho:= getprocaddress(hicmplib, 'icmpsendecho');
    if (@icmpcreatefile = nil) or (@i
首页 上一页 7 8 9 10 11 12 13 下一页 尾页 10/13/13
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Delphi的Socket编程步骤 下一篇【Spine】Spine Runtime for Delp..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目