Nil und @rOverlapped ist sicherlich ein Tippfehler oder?
if not ReadFile(MyHandle, ReceiveBuffer, 1024, nil, @rOverlapped) then
Also sollte ich es so machen?
Delphi-Quellcode:
while not Terminated do
begin
HandleBuffer[0] := rOverlapped.hEvent;
HandleBuffer[1] := wOverlapped.hEvent;
Return := MsgWaitForMultipleObjects (Handles, HandleBuffer, False,
2000, QS_ALLINPUT);
if Terminated then exit;
Case Return of
WAIT_OBJECT_0 : begin
if ReadFile (MyHandle, ReceiveBuffer, 1024, ReceivedBytes, @rOverlapped) then
begin
ResetEvent(rOverlapped.hEvent);
rOverlapped.Offset := 0;
rOverlapped.OffsetHigh := 0;
if ReceivedBytes > 0 then
begin
end;
end;
...
Muss ich mal probieren aber steht dann in den ReceivedBytes nicht wieder 1024 drinne?