IDirectSoundBuffer::GetCurrentPosition
HRESULT GetCurrentPosition(LPDWORD lpdwCurrentPlayCursor,
LPDWORD lpdwCurrentWriteCursor);
Retrieves the current position of the play and write cursors in the sound buffer.
·Returns DS_OK if successful, or one of the following error values otherwise:
lpdwCurrentPlayCursor
Address of a variable to contain the current play position in the DirectSoundBuffer object. This position is an offset within the sound buffer and is specified in bytes.
lpdwCurrentWriteCursor
Address of a variable to contain the current write position in the DirectSoundBuffer object. This position is an offset within the sound buffer and is specified in bytes.
The write cursor indicates the position at which it is safe to write new data to the buffer. The write cursor always leads the play cursor, typically by about 15 milliseconds worth of audio data.
It is always safe to change data that is behind the position indicated by the lpdwCurrentPlayCursor parameter.