Microsoft Windows CE 3.0  

IDirectSoundBuffer::Unlock

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The IDirectSoundBuffer::Unlockmethod releases a locked sound buffer.

HRESULT Unlock(
LPVOID
lpvAudioPtr1
,
DWORD
dwAudioBytes1
,
LPVOID
lpvAudioPtr2
,
DWORD
dwAudioBytes2
);

Parameters

lpvAudioPtr1
Address of the value retrieved in the lplpvAudioPtr1parameter of the IDirectSoundBuffer::Lockmethod.
dwAudioBytes1
Number of bytes actually written to the lpvAudioPtr1parameter. It should not exceed the number of bytes returned by the IDirectSoundBuffer::Lockmethod.
lpvAudioPtr2
Address of the value retrieved in the lplpvAudioPtr2parameter of the IDirectSoundBuffer::Lockmethod.
dwAudioBytes2
Number of bytes actually written to the lpvAudioPtr2parameter. It should not exceed the number of bytes returned by the IDirectSoundBuffer::Lockmethod.

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:

Remarks

An application must pass both pointers, lpvAudioPtr1and lpvAudioPtr2, returned by the IDirectSoundBuffer::Lockmethod to ensure the correct pairing of IDirectSoundBuffer::Lockand IDirectSoundBuffer::Unlock. The second pointer is needed even if 0 bytes were written to the second pointer.

Applications must pass the number of bytes actually written to the two pointers in the parameters dwAudioBytes1and dwAudioBytes2.

Make sure the sound buffer does not remain locked for long periods of time.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. dsound.h   dsound.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

IDirectSoundBuffer, IDirectSoundBuffer::GetCurrentPosition, IDirectSoundBuffer::Lock