13const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
14const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
15const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
16const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
17const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
18const GUID KSEVENTSETID_LoopedStreaming = {0x4682B940L, 0xC6EF, 0x11D0, {0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D}};
24 IDirectSoundCaptureBuffer8Vtbl *
lpVtbl;
72 ASSERT(
This->MixFormat.nSamplesPerSec ==
This->Format->nSamplesPerSec);
75 ASSERT(
This->MixFormat.wBitsPerSample ==
This->Format->wBitsPerSample);
79 ASSERT(MixPosition <= This->MixBufferSize);
81 if (BufferPosition ==
This->BufferSize)
87 if (MixPosition ==
This->MixBufferSize)
93 if (
This->MixFormat.nChannels !=
This->Format->nChannels)
98 MixLength =
Position.PlayOffset - MixPosition;
103 MixLength =
This->MixBufferSize - MixPosition;
183 DPRINT(
"No Interface for class %s\n", pStr);
223 if (
This->hStopEvent)
290 if (lpdwCapturePosition)
291 *lpdwCapturePosition = 0;
293 if (lpdwReadPosition)
294 *lpdwReadPosition = 0;
305 if (lpdwCapturePosition)
308 if (lpdwReadPosition)
330 if (lpdwCapturePosition)
333 if (lpdwReadPosition)
345 DWORD dwSizeAllocated,
353 if (!lpwfxFormat && !lpdwSizeWritten)
362 *lpdwSizeWritten = FormatSize;
367 if (dwSizeAllocated >= FormatSize)
373 *lpdwSizeWritten = FormatSize;
379 *lpdwSizeWritten = 0;
438 DPRINT(
"This %p dwOffset %u dwBytes %u ppvAudioPtr1 %p pdwAudioBytes1 %p ppvAudioPtr2 %p pdwAudioBytes2 %p dwFlags %x This->BufferSize %u\n",
439 This,
dwOffset, dwBytes, ppvAudioPtr1, pdwAudioBytes1, ppvAudioPtr2, pdwAudioBytes2,
dwFlags,
This->BufferSize);
444 *pdwAudioBytes1 =
This->BufferSize;
446 *ppvAudioPtr2 =
NULL;
459 *pdwAudioBytes1 = dwBytes;
461 *ppvAudioPtr2 =
NULL;
484 DPRINT(
"IDirectSoundCaptureBufferImpl_Start Flags %x\n",
dwFlags);
525 Header.PresentationTime.Numerator = 1;
526 Header.PresentationTime.Denominator = 1;
538 if (!
This->hStopEvent)
542 if (!
This->hStopEvent)
619 DPRINT(
"Failed to stop pin\n");
630 DWORD dwAudioBytes2 )
692 DWORD FormatSize, MixBufferSize;
693 ULONG DeviceId = 0, PinId;
760 DPRINT(
"PinId %u DeviceId %u\n", PinId, DeviceId);
779 DPRINT(
"failed to compute a compatible format\n");
791 MixBufferSize *=
This->MixFormat.nChannels;
792 MixBufferSize *= (
This->MixFormat.wBitsPerSample/8);
805 This->MixBufferSize = MixBufferSize;
806 DPRINT1(
"MixBufferSize %u BufferSize %u\n", MixBufferSize,
This->BufferSize);
#define InterlockedIncrement
#define InterlockedExchange
#define InterlockedDecrement
HRESULT NewDirectSoundCaptureBuffer(LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer, LPFILTERINFO Filter, LPCDSCBUFFERDESC lpcDSBufferDesc)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCaps(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDSCBCAPS lpDSCBCaps)
ULONG WINAPI IDirectSoundCaptureBufferImpl_Release(LPDIRECTSOUNDCAPTUREBUFFER8 iface)
ULONG WINAPI IDirectSoundCaptureBufferImpl_AddRef(LPDIRECTSOUNDCAPTUREBUFFER8 iface)
const GUID KSPROPSETID_Connection
const GUID KSINTERFACESETID_Standard
const GUID KSDATAFORMAT_TYPE_AUDIO
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Initialize(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc)
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Stop(LPDIRECTSOUNDCAPTUREBUFFER8 iface)
DWORD WINAPI MixerThreadRoutine(LPVOID lpParameter)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock(LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetStatus(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDWORD lpdwStatus)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCurrentPosition(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDWORD lpdwCapturePosition, LPDWORD lpdwReadPosition)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2)
const GUID KSEVENTSETID_LoopedStreaming
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(LPDIRECTSOUNDCAPTUREBUFFER8 iface, IN REFIID riid, LPVOID *ppobj)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetObjectInPath(LPDIRECTSOUNDCAPTUREBUFFER8 iface, REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject)
static IDirectSoundCaptureBuffer8Vtbl vt_DirectSoundCaptureBuffer8
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFXStatus(LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwFXCount, LPDWORD pdwFXStatus)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten)
const GUID KSMEDIUMSETID_Standard
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwFlags)
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
ULONG GetPinIdFromFilter(LPFILTERINFO Filter, BOOL bCapture, ULONG Offset)
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
VOID PerformChannelConversion(PUCHAR Buffer, ULONG BufferLength, PULONG BytesRead, ULONG OldChannels, ULONG NewChannels, ULONG BitsPerSample, PUCHAR Result, ULONG ResultLength, PULONG BytesWritten)
DWORD OpenPin(HANDLE hFilter, ULONG PinId, LPWAVEFORMATEX WaveFormatEx, PHANDLE hPin, BOOL bLoop)
BOOL CreateCompatiblePin(IN HANDLE hFilter, IN DWORD PinId, IN BOOL bLoop, IN LPWAVEFORMATEX WaveFormatEx, OUT LPWAVEFORMATEX WaveFormatOut, OUT PHANDLE hPin)
VOID DoNotifyPositionEvents(LPDIRECTSOUNDNOTIFY iface, DWORD OldPosition, DWORD NewPosition)
HRESULT NewDirectSoundNotify(LPDIRECTSOUNDNOTIFY *Notify, BOOL bLoop, BOOL bMix, HANDLE hPin, DWORD BufferSize)
#define HeapFree(x, y, z)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
#define DSERR_ALREADYINITIALIZED
struct IDirectSoundCapture * LPDIRECTSOUNDCAPTURE
struct IDirectSoundCaptureBuffer8 * LPDIRECTSOUNDCAPTUREBUFFER8
#define DSERR_UNSUPPORTED
#define IDirectSoundNotify_AddRef(p)
#define DSERR_OUTOFMEMORY
#define DSBLOCK_ENTIREBUFFER
#define DSCBSTART_LOOPING
#define DSCBSTATUS_LOOPING
#define DSCBSTATUS_CAPTURING
#define DSERR_INVALIDPARAM
struct IDirectSoundNotify * LPDIRECTSOUNDNOTIFY
#define KSPROPERTY_TYPE_SET
#define KSPROPERTY_TYPE_GET
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define InterlockedCompareExchange
@ KSPROPERTY_CONNECTION_STATE
#define IOCTL_KS_PROPERTY
#define IOCTL_KS_WRITE_STREAM
_In_ DWORD _In_ DWORD dwOffset
_Check_return_ HRESULT WINAPI StringFromIID(_In_ REFIID rclsid, _Outptr_ LPOLESTR *lplpsz)
#define IsEqualIID(riid1, riid2)
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
LPDIRECTSOUNDNOTIFY Notify
volatile LONG CurrentMixPosition
volatile LONG StopMixerThread
IDirectSoundCaptureBuffer8Vtbl * lpVtbl
LPWAVEFORMATEX lpwfxFormat
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define RtlMoveMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ PWDF_MEMORY_DESCRIPTOR _Out_opt_ PULONG BytesTransferred
DWORD WINAPI GetLastError(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO