mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
- Implement IDirectSoundCaptureBuffer8::Lock, IDirectSoundCaptureBuffer8::Unlock
- Fix pin handle leakage svn path=/trunk/; revision=43941
This commit is contained in:
parent
f2a66752bc
commit
c1198f3164
2 changed files with 49 additions and 10 deletions
|
@ -274,16 +274,50 @@ HRESULT
|
||||||
WINAPI
|
WINAPI
|
||||||
IDirectSoundCaptureBufferImpl_Lock(
|
IDirectSoundCaptureBufferImpl_Lock(
|
||||||
LPDIRECTSOUNDCAPTUREBUFFER8 iface,
|
LPDIRECTSOUNDCAPTUREBUFFER8 iface,
|
||||||
DWORD dwReadCusor,
|
DWORD dwOffset,
|
||||||
DWORD dwReadBytes,
|
DWORD dwBytes,
|
||||||
LPVOID* lplpvAudioPtr1,
|
LPVOID* ppvAudioPtr1,
|
||||||
LPDWORD lpdwAudioBytes1,
|
LPDWORD pdwAudioBytes1,
|
||||||
LPVOID* lplpvAudioPtr2,
|
LPVOID* ppvAudioPtr2,
|
||||||
LPDWORD lpdwAudioBytes2,
|
LPDWORD pdwAudioBytes2,
|
||||||
DWORD dwFlags )
|
DWORD dwFlags )
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
LPCDirectSoundCaptureBufferImpl This = (LPCDirectSoundCaptureBufferImpl)CONTAINING_RECORD(iface, CDirectSoundCaptureBufferImpl, lpVtbl);
|
||||||
return DSERR_INVALIDPARAM;
|
|
||||||
|
DPRINT("This %p dwOffset %u dwBytes %u ppvAudioPtr1 %p pdwAudioBytes1 %p ppvAudioPtr2 %p pdwAudioBytes2 %p dwFlags %x This->BufferSize %u\n",
|
||||||
|
This, dwOffset, dwBytes, ppvAudioPtr1, pdwAudioBytes1, ppvAudioPtr2, pdwAudioBytes2, dwFlags, This->BufferSize);
|
||||||
|
|
||||||
|
if (dwFlags == DSBLOCK_ENTIREBUFFER)
|
||||||
|
{
|
||||||
|
*ppvAudioPtr1 = (LPVOID)This->Buffer;
|
||||||
|
*pdwAudioBytes1 = This->BufferSize;
|
||||||
|
if (ppvAudioPtr2)
|
||||||
|
*ppvAudioPtr2 = NULL;
|
||||||
|
if (pdwAudioBytes2)
|
||||||
|
*pdwAudioBytes2 = 0;
|
||||||
|
|
||||||
|
return DS_OK;
|
||||||
|
}
|
||||||
|
else if (dwFlags & DSBLOCK_FROMWRITECURSOR)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED
|
||||||
|
return DSERR_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ASSERT(dwOffset < This->BufferSize);
|
||||||
|
ASSERT(dwBytes < This->BufferSize);
|
||||||
|
ASSERT(dwBytes + dwOffset <= This->BufferSize);
|
||||||
|
|
||||||
|
*ppvAudioPtr1 = This->Buffer + dwOffset;
|
||||||
|
*pdwAudioBytes1 = dwBytes;
|
||||||
|
if (ppvAudioPtr2)
|
||||||
|
*ppvAudioPtr2 = NULL;
|
||||||
|
if (pdwAudioBytes2)
|
||||||
|
*pdwAudioBytes2 = 0;
|
||||||
|
|
||||||
|
return DS_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT
|
HRESULT
|
||||||
|
@ -369,8 +403,7 @@ IDirectSoundCaptureBufferImpl_Unlock(
|
||||||
LPVOID lpvAudioPtr2,
|
LPVOID lpvAudioPtr2,
|
||||||
DWORD dwAudioBytes2 )
|
DWORD dwAudioBytes2 )
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
return DS_OK;
|
||||||
return DSERR_INVALIDPARAM;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT
|
HRESULT
|
||||||
|
|
|
@ -76,6 +76,12 @@ PrimaryDirectSoundBuffer8Impl_fnRelease(
|
||||||
|
|
||||||
if (!ref)
|
if (!ref)
|
||||||
{
|
{
|
||||||
|
if (This->hPin)
|
||||||
|
{
|
||||||
|
/* close pin handle */
|
||||||
|
CloseHandle(This->hPin);
|
||||||
|
}
|
||||||
|
/* free primary buffer */
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue