Microsoft Windows CE 3.0  

IDsCaptureDriverBuffer::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 IDsCaptureDriverBuffer::Unlockmethod releases a block of sound data to the driver. The driver should perform whatever actions are necessary to output the audio data to the sound device.

HRESULT Unlock(
LPVOID
pvAudio1
,
DWORD
dwLen1
,
LPVOID
pvAudio2
,
DWORD
dwLen2
);

Parameters

pvAudio1
Pointer to the beginning of the first audio block.
dwLen1
The number of bytes written to pvAudio1.
pvAudio2
Pointer to the beginning of the second audio block.
dwLen2
The number of bytes written to pvAudio2.

Return Values

Returns DS_OK if successful, or one of the following error values otherwise:

  • DSERR_INVALIDCALL
  • DSERR_INVALIDPARAM

    Remarks

    The data block is actually described by two pointers; both are required because sound buffers are circular. If the locked bytes do not wrap around the end of the buffer, the second pointer ( pvAudio2) is NULL. However, if the bytes do wrap around, then the second pointer points to the beginning of the buffer.

    Each call to IDsCaptureDriverBuffer::Unlockis preceded by a corresponding call to IDsCaptureDriverBuffer::Lock. The pointer parameters are always the same pointers as those returned by IDsCaptureDriverBuffer::Lock. However, the number of bytes unlocked may be less than the number of bytes locked if the application does not fill the locked region. See IDsCaptureDriverBuffer::Lockfor more details.

    For some devices (such as DMA-based cards that do not support hardware secondary buffers), repeated calls to IDsCaptureDriverBuffer::Lockand IDsCaptureDriverBuffer::Unlockare unnecessary. In this case, the driver should specify the DSDCAPS_DONTNEEDLOCK flag in the DSDRIVERDESCstructure returned by IDsCaptureDriver::GetDriverDescmethod. If this flag is specified, then the IDsCaptureDriverBuffer::Unlockmethod is never called by DirectSound. In that case, the IDsCaptureDriverBuffer::Unlockmethod should simply return DSERR_UNSUPPORTED.



     Last updated on Tuesday, July 13, 2004

    © 2004 Microsoft Corporation. All rights reserved.