FS_WriteFile(
PIOREQ pir
)
Operations that write to a normal file are handled through FS_WriteFile. This routine handles the Win32 function: WriteFile(); and INT 21h functions: 15h, 22h, 28h, and 40h.
Processing Option Values:
Any combination of the following options may be specified. |
|
Value | Meaning |
---|---|
R0_NO_CACHE | File data should be written directly to the disk without going through the cache. |
R0_SWAPPER_CALL | This read operation is issued for the swapfile by the memory manager. Any FSD that allows paging to be done through it needs to observe some special rules to make the system work smoothly. These have already been described in section 8.3.4 of this document. |
R0_MM_READ_WRITE | This flag is passed in to indicate a write operation to a memory-mapped file. The FSD needs to treat these operations in a special manner as described in section 8.3.5. |
ir_error | Returns status of the operation ( 0 if no error, errorcode otherwise ). |
ir_length | Returns number of bytes actually written. |
ir_pos | Returns the new file position. |
A write of 0 bytes to the file, (ir_length = 0), is used to set the end of file position. The FSD should truncate or extend the file to the passed file position.
This operation may take place asynchronously, and it is recommended that the implementation of this function be async when ever possible. To do this, the function may return STATUS_PENDING to allow the caller to continue processing while the operation completes. If STATUS_PENDING is returned, the Complete_Async() service in the IFSMGR must be called when the operation completes. The address of the I/O request packet must be passed to identify the completed request.