Platform SDK: DirectX

IDirectSoundCaptureBuffer::Unlock

The IDirectSoundCaptureBuffer::Unlock method unlocks the buffer.

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

Parameters

lpvAudioPtr1
Address of the value retrieved in the lplpvAudioPtr1 parameter of the IDirectSoundCaptureBuffer::Lock method.
dwAudioBytes1
Number of bytes actually read from the lpvAudioPtr1 parameter. It should not exceed the number of bytes returned by the IDirectSoundCaptureBuffer::Lock method.
lpvAudioPtr2
Address of the value retrieved in the lplpvAudioPtr2 parameter of the IDirectSoundCaptureBuffer::Lock method.
dwAudioBytes2
Number of bytes actually read from the lpvAudioPtr2 parameter. It should not exceed the number of bytes returned by the IDirectSoundCaptureBuffer::Lock method.

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 values:

DSERR_INVALIDPARAM
DSERR_INVALIDCALL

Remarks

An application must pass both pointers, lpvAudioPtr1 and lpvAudioPtr2, returned by the IDirectSoundCaptureBuffer::Lock method to ensure the correct pairing of IDirectSoundCaptureBuffer::Lock and IDirectSoundCaptureBuffer::Unlock. The second pointer is needed even if zero bytes were written to the second pointer.

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

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

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dsound.h.
  Import Library: Use dsound.lib.