次の方法で共有


IOCTL_FLASH_GET_REGION_FREE_SPACE (Compact 2013)

3/26/2014

This I/O control message retrieves the number of free blocks in a particular region that can be used for creating new partitions. The block count retrieved accounts for bad blocks. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,          // handle to the device
    DWORD dwIoControlCode,   // use IOCTL_FLASH_GET_REGION_FREE_SPACE
    LPVOID lpInBuffer,       // pointer to input buffer
    DWORD nInBufferSize,     // input buffer size
    LPVOID lpOutBuffer,      // pointer to output buffer
    DWORD nOutBufferSize,    // output buffer size
    LPDWORD lpBytesReturned,  // number of bytes returned
    OVERLAPPED lpOverlapped,  // pointer to OVERLAPPED structure
);

Parameters

  • hDevice
    [in] Handle to the device.
  • dwIoControlCode
    [in] The control code for the operation. Use IOCTL_FLASH_GET_REGION_FREE_SPACE for this operation.
  • lpInBuffer
    [in] Pointer to a DWORD containing the region index from which to get free space.
  • nInBufferSize
    [in] Size of a DWORD.
  • lpOutBuffer
    [out] Number of free blocks available.
  • nOutBufferSize
    [out] Size of a DWORD.
  • lpBytesReturned
    Not used; set to NULL.

Return Values

Returns nonzero if successful; otherwise, returns zero.

Remarks

To get extended error information, call GetLastError. GetLastError may return other standard error messages as appropriate.

Requirements

Header

FlashMdd.h

See Also

Reference

Flash Driver MDD IOCTLs