H
hpd
Unregistered / Unconfirmed
GUEST, unregistred user!
function TForm1.BindNic(hVxd: THandle; Ndis: string): Boolean;<br>var<br> hEvent: THandle;<br> cbRet: DWORD;<br> ovlp: POVERLAPPED;<br> cbIn: DWORD;<br> RetVal: boolean;<br> inbuffer: PAnsiChar;<br> errorcode,temp: Dword;<br>begin<br> hEvent:= CreateEvent(nil, True, false, nil);<br> new(ovlp);<br> ovlp.Internal := 0;<br> ovlp.InternalHigh:= 0;<br> ovlp.Offset:=0;<br> ovlp.OffsetHigh:=0;<br> ovlp.hEvent:=hEvent ;<br> cbIn:= 5;<br> inbuffer:=PChar(ndis);<br><br> RetVal:= DeviceIoControl (hVxd, IOCTL_PROTOCOL_BIND, inbuffer, cbIn, inbuffer, cbIn, cbRet, ovlp);<br> ErrorCode:=getlasterror();<br><br>-------------------- <br>RetVal总是得到false, <br>ErrorCode=87 <br>查手册87意为参数错误. <br>其中ioctl_protocol_bind=$8000001c <br><br>请大虾出手!!!