IWriteEngine2::WriteSection method (imapi2.h)

Writes a data stream to the current recorder.

Syntax

HRESULT WriteSection(
  [in] IStream *data,
  [in] LONG    startingBlockAddress,
  [in] LONG    numberOfBlocks
);

Parameters

[in] data

An IStream interface of the data stream to write to the recorder.

[in] startingBlockAddress

Starting logical block address (LBA) of the write operation. Negative values are supported.

[in] numberOfBlocks

Number of blocks from the data stream to write.

Return value

S_OK is returned on success, but other success codes may be returned as a result of implementation. The following error codes are commonly returned on operation failure, but do not represent the only possible error values:

Return code Description
E_POINTER
Pointer is not valid.

Value: 0x80004003

E_OUTOFMEMORY
Failed to allocate the required memory.

Value: 0x8007000E

E_INVALIDARG
One or more arguments are not valid.

Value: 0x80070057

E_IMAPI_REQUEST_CANCELLED
The request was canceled.

Value: 0xC0AA0002

Remarks

Before calling this method, you must call the IWriteEngine2::put_Recorder method to specify the recording device and the IWriteEngine2::put_BytesPerSector method to specify the number of bytes to use for each sector during writing.

You should also consider calling the following methods if their default values are not appropriate for your application:

This method is synchronous. To determine the progress of the write operation, you must implement the DWriteEngine2Events interface. For examples that show how to implement an event handler in a script, see Monitoring Progress With Events.

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

See also

DWriteEngine2Events

IWriteEngine2

IWriteEngine2::CancelWrite

IWriteEngine2::get_WriteInProgress

IWriteEngine2EventArgs::get_SectorCount

IWriteEngine2EventArgs::get_StartLba