Microsoft Windows CE 3.0  

DISK_IOCTL_WRITE

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Block device drivers respond to this I/O control code to service FAT file system requests to write data to the block device.

Parameters

hDevice
Handle to the block device.
dwIoControlCode
Specifies this code.
lpInBuffer
Pointer to an SG_REQstructure.
nInBufferSize
Specifies the size of SG_REQ.
lpOutBuffer
Not used.
nOutBufferSize
Not used.
lpBytesReturned
Pointer to a DWORDto receive total number of bytes returned.
lpOverlapped
Not used.

Return Values

In Windows CE 3.0 and later, this code is now called IOCTL_DISK_WRITE. When this code returns, the FAT file system expects the sr_statusmember of SG_REQto be set to either ERROR_SUCCESS if the write succeeded, or a standard error return value, otherwise. Certain errors are automatically retried, such as ERROR_BAD_UNIT if the device has been removed and ERROR_NOT_READY if the driver is in the process of shutting down or starting up. The block device driver should return ERROR_GEN_FAILURE for any unknown or unexpected errors and ERROR_WRITE_PROTECT for attempts to write to media that is write-protected.

Remarks

The FAT file system fills in the SG_REQstructure passed to the block device driver as follows:

sr_start
Starting block number.
sr_num_sec
Number of blocks to write.
sr_num_sg
Number of scatter or gather buffers, normally 1.
sr_callback
NULL.
sr_sglist[0].sb_buf
Pointer to the buffer to write blocks into. This buffer is unaligned.
sr_sglist[0].sb_len
Specifies the size of the sr_sglist[0].sb_bufbuffer, in bytes.

Remarks

If sr_num_sgis greater than 1, the block device driver should fill in additional entries in the sr_sglistarray. 

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later      
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.


 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.