IPortableDeviceUnitsStream::SeekInUnits method (portabledeviceapi.h)

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

Syntax

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

Parameters

[in] dlibMove

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.

[in] units

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

[in] dwOrigin

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.

[out, optional] plibNewPosition

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 code Description
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.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header portabledeviceapi.h
Library PortableDeviceGUIDs.lib

See also

IPortableDeviceUnitsStream

WPD_STREAM_UNITS