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
);

Parameters

hFile
Handle to the file to write to. The file handle must be created with GENERIC_WRITE access to the file.
lpBuffer
Pointer to the buffer that contains the data to write to the file.
nNumberOfBytesToWrite
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.

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

Remarks

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

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

Requirements

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

Note

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

See Also

CreateFile, ReadFile, iwin32 API, iwin32 Overview