Re: newbie: I/O with nasm



ArarghMail603NOSPAM@xxxxxxxxxxxxxxxxx wrote:

Windows Readfile & WriteFile (from MSDN):

BOOL ReadFile(
HANDLE hFile, // handle to file
LPVOID lpBuffer, // data buffer
DWORD nNumberOfBytesToRead, // number of bytes to read
LPDWORD lpNumberOfBytesRead, // number of bytes read
LPOVERLAPPED lpOverlapped // overlapped buffer
);

BOOL WriteFile(
HANDLE hFile, // handle to file
LPCVOID lpBuffer, // data buffer
DWORD nNumberOfBytesToWrite, // number of bytes to write
LPDWORD lpNumberOfBytesWritten, // number of bytes written
LPOVERLAPPED lpOverlapped // overlapped buffer
);
<snip>

There we go! Always nice to hear from somebody who's not afraid to RTFM! Myself, between "too lazy" and "too down on MS", I haven't learned much Windows code.

Now, if Windows is what TK is looking for, we've got something to go on. I don't know what "overlapped buffer" means. "When in doubt, push 0" usually(?) works. And we still need to figure out the "hfile" for stdin and stdout...

TK still hasn't said "what OS". His header indicates "Mac", in which case *none* of this crap will work. Nasm's Mac support ("-f macho") is still in beta, so that probably isn't it. (if anyone *has* an x86 Mac, we could use some "testers"!)

Thanks for the feedback, Arargh! We really *need* a little "signal" to go with the "noise" around here!

Best,
Frank
.



Relevant Pages

  • A question on mailslot
    ... LPVOID lpBuffer, ... DWORD nNumberOfBytesToRead, ... LPDWORD lpNumberOfBytesRead, ... Any suggestion for handling this situation? ...
    (microsoft.public.win32.programmer.networks)
  • A question on reading mailslot
    ... LPVOID lpBuffer, ... DWORD nNumberOfBytesToRead, ... LPDWORD lpNumberOfBytesRead, ... Any suggestion for handling this situation. ...
    (microsoft.public.win32.programmer.kernel)