Provides read-only access to DMA content via an octet-stream.
This method must be supported in every implementation of this interface.
Syntax
DmaRC IdmaStream::ReadStreamData (
pDmaBinary pBuffer,
DmaUInteger32 ulBytesToRead,
pDmaUInteger32 pulBytesRead)
Parameters
Name | Mode | Description |
pBuffer | output | A pointer to the buffer to be read into |
ulBytesToRead | input | Number of bytes to read from the stream |
pulBytesRead | output | Pointer to number of bytes actually read. |
Reads the designated number of bytes into the buffer. The supplied buffer must be at least ulBytesToRead bytes in size.
Number of bytes read is returned in pulBytesRead, even if an error is returned. The seek pointer is adjusted by the number of bytes actually read.
If the end of stream is reached during the read, the number of bytes actually read may be less than requested and the result code DMARC_SHORT_READ is returned.
Return Values
Name | Description |
DMARC_BAD_PARAMETER | (E_INVALIDARG) Invalid input parameter. |
DMARC_DEVICE_ERROR | An error has occurred reading or writing a hardware device. |
DMARC_OK | (S_OK) Success. |
DMARC_SHORT_READ | (Warning) End of stream was encountered before the requested number of bytes was read. |
Support for this method is optional.
Syntax
DmaRC IdmaStream::SetStreamPosition (
DmaInt64 liDisplacement,
DmaInteger32 lRelativeTo,
pDmaUInt64 puliNewPosition)
Parameters
Name | Mode | Description |
liDisplacement | input | Number of bytes of displacement |
lRelativeTo | input | DMA_REL_CURRENT if displacement is to be treated relative to the current position of the stream, DMA_REL_BEGINNING if it is relative to the beginning of the stream, or DMA_REL_END if it is relative to the end of the stream. |
puliNewPosition | output | Pointer to value of the seek pointer, May be omitted, indicating client is not interested in this value |
Adjusts the location of the seek pointer on the stream. The seek pointer can be moved relative to its current position, set to an absolute location (relative to beginning of the stream) ), or set relative to the end of the stream
If liDisplacement is greater then zero, the seek pointer is positioned toward the end of the stream. If liDisplacement is less then zero, the seek pointer is positioned toward the beginning of the stream. The seek pointer cannot be moved beyond the end of the stream or before the beginning of the stream. Attempting to do so will result in the seek pointer being set to either the beginning of the stream or the end of the stream.
If the stream cannot be positioned as requested, the error DMARC_POSITION_NOT_ALLOWED should be returned. For example, the stream may be "forward only" and the combination of liDisplacement and lRelativeTo may reference a point in the stream which has already been passed.
Return Values
Name | Description |
DMARC_BAD_PARAMETER | (E_INVALIDARG) Invalid input parameter. |
DMARC_DEVICE_ERROR | An error has occurred reading or writing a hardware device. |
DMARC_NOT_SUPPORTED | This method is not supported in the context of this session or object. |
DMARC_OK | (S_OK) Success. |
DMARC_POSITION_NOT_ALLOWED | The stream cannot be positioned as requested. |