用Delphi和wincap包中PacketReceivePacket函数接包时出现内存泄漏。
这是扫描什么原因?
var
recvbuf: array[0..1024*250 - 1] of char;
if not PacketSetBuff(lpAdapter,250*1024) then
begin
ShowMessage(Format('PacketSetBuff Error: %d',[GetLastError()]));
exit;
end;
if not PacketSetReadTimeout(lpAdapter,1) then
ShowMessage('Warning: Unable to set the timeout');
lppacketr := PacketAllocatePacket();
if lppacketr = nil then
begin
ShowMessage(Format('PacketAllocatePacket receive Error: %d',[GetLastError()]));
exit;
end;
PacketInitPacket(lppacketr,@recvbuf,sizeof(recvbuf));
while true do
begin
if not PacketReceivePacket(lpAdapter,lppacketr,true) then exit;
end;
用Delphi和wincap包中PacketReceivePacket函数接包时出现内存泄漏。
这是什么原因?
阅读(454) | 评论(0) | 转发(0) |