Compartir a través de


IOCTL_DISK_GETINFO (Compact 2013)

3/26/2014

This I/O control message notifies block device drivers to return disk information. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,           // handle to device
    DWORD dwIoControlCode,    // use IOCTL_DISK_GETINFO
    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] Control code for the operation. Use IOCTL_DISK_GETINFO for this operation.
  • lpInBuffer
    Set to NULL.
  • nInBufferSize
    Set to zero.
  • lpOutBuffer
    [out] Pointer to a DISK_INFO structure.
  • nOutBufferSize
    [out] Specifies the size of the DISK_INFO structure in lpOutBuffer.
  • lpBytesReturned
    [out] Pointer to a DWORD to receive total number of bytes returned.
  • lpOverlapped
    Not used.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

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

Remarks

IOCTL_DISK_GETINFO replaces the deprecated DISK_IOCTL_GETINFO. DISK_IOCTL_GETINFO used the input buffer for output.

Requirements

Header

diskio.h

See Also

Reference

Block Driver IOCTLs
DeviceIoControl
DISK_INFO