Writes a specified number of bytes from a buffer to the specified file.

#define INCL_DOSFILEMGR
#include <os2.h>

HFILE     hFile;               /*  File handle from DosOpen. */
PVOID     pBuffer;             /*  Address of the buffer that contains the data to write. */
ULONG     cbWrite;             /*  Number of bytes to write. */
PULONG    pcbActual;           /*  Address of the variable to receive the number of bytes actually written. */
FHLOCK    fhFileHandleLockID;  /*  The filehandle lockid obtained from DosProtectOpen. */
APIRET    ulrc;                /*  Return Code. */

ulrc = DosProtectWrite(hFile, pBuffer, cbWrite,
         pcbActual, fhFileHandleLockID);


[Back] [Next]