WriteFile (Windows CE 5.0)
This function writes data to a file. WriteFile starts writing data to the file at the position indicated by the file pointer. After the write operation has been completed, the file pointer is adjusted by the number of bytes actually written.
A RAPI version of this function exists, called CeWriteFile (RAPI).
BOOLWriteFile( HANDLEhFile, LPCVOIDlpBuffer, DWORDnNumberOfBytesToWrite, LPDWORDlpNumberOfBytesWritten, LPOVERLAPPEDlpOverlapped);
[in] Handle to the file to be written to. The file handle must have been created with GENERIC_WRITE access to the file.
[in] Pointer to the buffer containing the data to write to the file.
[in] 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. To truncate or extend a file, use the SetEndOfFile function.
[out] Pointer to the number of bytes written by this function call. WriteFile sets this value to zero before taking action or checking errors.
[in] Unsupported; set to NULL.
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
If part of the file is locked by another process and the write operation overlaps the locked portion, this function fails.
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.
OS Versions: Windows CE 1.0 and later.
Link Library: Coredll.lib.
Send Feedback on this topic to the authors