Share via


PD_DeviceIoControl (Windows Embedded CE 6.0)

1/6/2010

This function sends a control code directly to a specified device driver, causing the corresponding device to perform the specified operation.

Syntax

DWORD PD_DeviceIoControl(
  DWORD dwPartitionId, 
  DWORD dwCode, 
  PBYTE pInBuf, 
  DWORD nInBufSize, 
  PBYTE pOutBuf, 
  DWORD nOutBufSize, 
  PDWORD pBytesReturned
);

Parameters

  • dwPartitionId
    [in] Handle to the device that performs the operation. This handle is returned by the CreateFile function.
  • dwCode
    [in] Control code for the operation. This value identifies the operation to be performed and the type of device. Define I.O controls with the CTL_CODE macro. These control codes can then be advertised, and an application can use these control codes with the DeviceIoControl function to perform the driver-specific functions.
  • pInBuf
    [in] Long pointer to a buffer that contains the data required to perform the operation.

    This parameter can be set to NULL if dwCode specifies an operation that does not require input data.

  • nInBufSize
    [in] Size, in bytes, of the buffer pointed to by pInBuffer.
  • pOutBuf
    [out] Long pointer to a buffer that receives output data.

    This parameter can be set to NULL if dwCode specifies an operation that does not produce output data.

  • nOutBufSize
    [in] Size, in bytes, of the buffer pointed to by pOutBuffer.
  • pBytesReturned
    [out] Long pointer to a variable that receives the size, in bytes, of the data stored in the buffer pointed to by pOutBuffer.

    This parameter cannot be set to NULL. Even when an operation produces no output data and pOutBuffer can be set to NULL, this function uses the variable pointed to by this parameter. After such an operation, the value of the variable is without meaning.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

When passed parameters such as DISK_IOCTL_GETINFO, this function does not change the dwBytesReturned parameter. The IOCTL_GETINFO I/O control codes return the information to the input buffer specified by pOutBuf. This function sets dwBytesReturned only when the control code writes to the output buffer. Many other DISK_IOCTL_GET* I/O control codes return this information in the input buffer, as well.

Windows Embedded CE adds zeros to a file name that contains less than 4 hexadecimal digits. For example, Windows Embedded CE renames the MyFile34.tmp file to MyFile0034.tmp.

Requirements

Header partdrv.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Partition Manager Functions
CreateFile

Other Resources

DeviceIoControl