WriteToFile PROC

Writes contents of a buffer to an output file.

Call args:  EAX = an open file handle
            EDX = offset of the buffer
            ECX = maximum number of bytes to write

Return arg: 
If CF = 0, EAX contains the number of bytes written. 
If CF = 1, EAX contains a system error code. Call WriteWindowsMsg 
to get a text representation of the error.

Example:
.data
BUFSIZE = 5000
buffer BYTE BUFSIZE DUP(?)
bytesWritten DWORD ?

.code
      mov  eax,fileHandle
      mov  edx,OFFSET buffer
      mov  ecx,BUFSIZE
      call WriteToFile
      jc   show_error_message
      mov  bytesWritten,eax
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)