2015-03-25 8:41 GMT+01:00 Michael Van Canneyt <mich...@freepascal.org>: >> ---------------------- code --------------- >> procedure TBurpClient.Run; >> begin >> fOurProcess.Options := [poUsePipes] + [poNoConsole]; >> fOurProcess.Execute; >> while True do >> begin >> // make sure we have room >> fMemStream.SetSize(fBytesRead + READ_BYTES); >> >> // try reading it >> fNumBytes := fOurProcess.Output.Read((fMemStream.Memory + >> fBytesRead)^, READ_BYTES); >> if fNumBytes > 0 then // All read() calls will block, except the final >> one. > > > I am not sure this is always correct. Various versions of windows work > differently in this regard; > zero (0) may be a valid return value. I suggest you check > fOurProcess.IsRunning to break the loop.
Thank you, I will try it. But debugging I can see the problem is not in the loop. In Windows XP fNumBytes is always zero: fNumBytes := fOurProcess.Output.Read((fMemStream.Memory + fBytesRead)^, READ_BYTES); so it seems the Read of fOurProcess.Output is not giving the expected results. In Windows 7 it's ok. Antonio -- Antonio Sanguigni alias slapshot ---------------------------------------------------------------------- Servizi informatici Windows e GNU/Linux- http://www.pieroni.biz GioveLUG (Linux User Group) - http://www.giovelug.org _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal