INtime SDK Help
WriteFile (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > WriteFile (iwin32)

Writes the specified number of bytes to the given file.

BOOLEAN WriteFile(
    HANDLE hFile,
    LPCVOID lpBuffer,
    DWORD nNumberOfBytesToWrite,
    LPDWORD lpNumberOfBytesWritten,
    LPOVERLAPPED lpOverlapped


Handle to the file to write to. The file handle must be created with GENERIC_WRITE access to the file.
Pointer to the buffer that contains the data to write to the file.
Number of bytes to write to the file.

A value of zero specifies a null write operation. A null write operation does not write any bytes but does cause the time stamp to change. WriteFile does not truncate the file.

Pointer to the number of bytes written by this function call. WriteFile sets this value to zero before taking action or checking errors.
Set to NULL.


Accessing the output buffer while a write operation is using the buffer may corrupt the data written from that buffer. Applications must not read from, write to, reallocate, or free the output buffer that a write operation is using until the write operation completes.

Return Values

0 (zero)
Failure. For extended error information, see GetLastError.


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/winbase.h windows.h iwin32.lib


This function operates in the real-time portion of your application.

See Also

CreateFile, ReadFile, iwin32 API, iwin32 Overview