IDiscRecorder2Ex::SendCommandSendDataToDevice method (imapi2.h)
Sends a MMC command and its associated data buffer to the recording device.
Syntax
HRESULT SendCommandSendDataToDevice(
[in] BYTE *Cdb,
[in] ULONG CdbSize,
[out] BYTE [18] SenseBuffer,
[in] ULONG Timeout,
[in] BYTE *Buffer,
[in] ULONG_IMAPI2_NONZERO BufferSize
);
Parameters
[in] Cdb
Command packet to send to the device.
[in] CdbSize
Size, in bytes, of the command packet to send. Must be between 6 and 16 bytes.
[out] SenseBuffer
Sense data returned by the recording device.
[in] Timeout
Time limit, in seconds, allowed for the send command to receive a result.
[in] Buffer
Buffer containing data associated with the send command. Must not be NULL.
[in] BufferSize
Size, in bytes, of the data buffer to send. Must not be zero.
Return value
S_OK or one of the following values can be returned on success, but other success codes may be returned as a result of implementation:
Return code | Description |
---|---|
|
The device fails the command, but returns sense data.
Value: 0x00AA0200 |
The following error codes are commonly returned on operation failure, but do not represent the only possible error values:
Return code | Description |
---|---|
|
Pointer is not valid.
Value: 0x80004003 |
|
Unspecified failure.
Value: 0x80004005 |
|
The drive does not support the GET CONFIGURATION command.
Value: 0xC0AA020C |
|
The feature page requested is not supported by the device.
Value: 0xC0AA020A |
|
Failed to allocate the required memory.
Value: 0x8007000E |
|
The feature page requested is supported, but is not marked as current.
Value: 0xC0AA020B |
|
The device failed to accept the command within the timeout period. This may be caused by the device having entered an inconsistent state, or the timeout value for the command may need to be increased.
Value: 0xC0AA020D |
|
The device reported unexpected or invalid data for a command.
Value: 0xC0AA02FF |
|
The media is inserted upside down.
Value: 0xC0AA0204 |
|
The drive reported that it is in the process of becoming ready. Please try the request again later.
Value: 0xC0AA0205 |
|
There is no media in the device.
Value: 0xC0AA0202 |
|
The media is currently being formatted. Please wait for the format to complete before attempting to use the media.
Value: 0xC0AA0206 |
|
The drive reported that it is performing a long-running operation, such as finishing a write. The drive may be unusable for a long period of time.
Value: 0xC0AA0207 |
|
The write failed because the drive did not receive data quickly enough to continue writing. Moving the source data to the local computer, reducing the write speed, or enabling a "buffer underrun free" setting may resolve this issue.
Value: 0xC0AA0300 |
|
The media is not compatible or of unknown physical format.
Value: 0xC0AA0203 |
|
The DVD structure is not present. This may be caused by incompatible drive/medium used.
Value: 0xC0AA020E |
|
The device reported that the requested mode page (and type) is not present.
Value: 0xC0AA0201 |
|
The drive reported that the combination of parameters provided in the mode page for a MODE SELECT command were not supported.
Value: 0xC0AA0208 |
|
The drive reported that the media is write protected.
Value: 0xC0AA0209 |
|
The media's speed is incompatible with the device. This may be caused by using higher or lower speed media than the range of speeds supported by the device.
Value: 0xC0AA020F |
|
The specified handle is invalid.
Value: 6 |
|
The specified network resource or device is no longer available.
Value: 55 |
|
The device associated with this recorder during the last operation has been exclusively locked, causing this operation to failed.
Value: 0xC0AA0210 |
Remarks
For details of the contents of the command packet, sense data, and input data buffer, see the latest revision of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5.
Client-defined commands (CDBs) used with this method must be between 6 and 16 bytes in length. In addition, the size of each command must match the size defined by the operation code as defined in the following table.
CDB operation code range | CDB group | Required CDB size |
---|---|---|
0x00 — 0x1F | 0 | 6 bytes |
0x20 — 0x3F | 1 | 10 bytes |
0x40 — 0x5F | 2 | 10 bytes |
0x60 — 0x7F | 3 | Will enforce standard-specified size requirements for this opcode range in the future. |
0x80 — 0x9F | 4 | 16 bytes |
0xA0 — 0xBF | 5 | 12 bytes |
0xC0 — 0xDF | 6 | Vendor Unique - Any size allowed |
0xE0 — 0xFF | 7 | Vendor Unique - Any size allowed |
Some very early devices used vendor-unique opcodes and therefore some opcodes cannot be validated in this manner. The following opcodes are still valid and only verify that the size is between 6 and 16 bytes:
0x02, 0x05, 0x06, 0x09, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x13, 0x14, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x26, 0x27, 0x29, 0x2C, 0x2D
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista, Windows XP with SP2 [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | imapi2.h |