IPortableDeviceUnitsStream::SeekInUnits method

The SeekInUnits method performs a seek on a stream, based on alternate units.

Syntax


virtual [local] HRESULT STDMETHODCALLTYPE SeekInUnits(
  [in]             LARGE_INTEGER dlibMove,
  [in]             WPD_STREAM_UNITS units,
  [in]             DWORD dwOrigin,
  [out, optional]  ULARGE_INTEGER *plibNewPosition
);

Parameters

dlibMove [in]

The displacement to add to the location indicated by the dwOrigin parameter. The units for the displacement are specified by units. If dwOrigin is STREAM_SEEK_SET, this is interpreted as an unsigned value rather than a signed value.

units [in]

The units of the dlibMove and plibNewPosition parameters. See WPD_STREAM_UNITS for more details.

dwOrigin [in]

The origin for the displacement specified in dlibMove. The origin can be the beginning of the file (STREAM_SEEK_SET), the current seek pointer (STREAM_SEEK_CUR), or the end of the file (STREAM_SEEK_END). For more information about values, see the STREAM_SEEK enumeration.

plibNewPosition [out, optional]

A pointer to the location where this method writes the value of the new seek pointer from the beginning of the stream. The units are given by units. You can set this pointer to NULL. In this case, this method does not provide the new seek pointer.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The seek pointer was successfully adjusted.

STG_E_INVALIDPOINTER

Indicates that the [out] parameter plibNewPosition points to invalid memory, because plibNewPosition is not read.

STG_E_INVALIDFUNCTION

The dwUnits or dwOrigin parameter contains an invalid value, or the dlibMove parameter contains a bad offset value. For example, the result of the seek pointer is a negative offset value.

 

Examples

The following example uses SeekInUnits to seek forward 57 frames. The description of IPortableDeviceUnitsStream contains an example that demonstrates the retrieval of this interface. .


// Seek forward by 57 frames.
CComPtr<IPortableDeviceUnitsStream> pUnitsStream;
HRESULT hr = pUnitsStream->SeekInUnits(57, WPD_STREAM_UNITS_FRAMES, STREAM_SEEK_CUR, NULL);


Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

None supported [desktop apps | Windows Store apps]

Header

PortableDeviceAPI.h

Library

PortableDeviceGUIDs.lib

See also

IPortableDeviceUnitsStream
WPD_STREAM_UNITS

 

 

Community Additions

ADD
Show:
© 2014 Microsoft