Microsoft DirectX 9.0

IDirectSoundBuffer8::GetCurrentPosition

The GetCurrentPosition method retrieves the position of the play and write cursors in the sound buffer.

Syntax

HRESULT GetCurrentPosition(
  LPDWORD pdwCurrentPlayCursor, 
  LPDWORD pdwCurrentWriteCursor 
);

Parameters

pdwCurrentPlayCursor

Address of a variable that receives the offset, in bytes, of the play cursor. This parameter can be NULL if the value is not wanted.

pdwCurrentWriteCursor

Address of a variable that receives the offset, in bytes, of the write cursor. This parameter can be NULL if the value is not wanted.

Return Values

If the method succeeds, the return value is DS_OK.

If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

The write cursor is the point in the buffer ahead of which it is safe to write data to the buffer. Data should not be written to the part of the buffer after the play cursor and before the write cursor.

Requirements

  Header: Declared in dsound.h.

See Also