ReactOS 0.4.15-dev-7928-g68a8619
precomp.h
Go to the documentation of this file.
1#ifndef PRECOMP_H
2#define PRECOMP_H
3
4#define COBJMACROS
5#define NONAMELESSUNION
6#define NONAMELESSSTRUCT
7
8#include <windows.h>
9#include <setupapi.h>
10#include <mmddk.h>
11#include <objbase.h>
12#include <olectl.h>
13#include <unknwn.h>
14#include <dsound.h>
15#include <dsconf.h>
16#include <vfwmsgs.h>
17#include <setupapi.h>
18#include <ks.h>
19#include <ksmedia.h>
20#include <limits.h>
21#include <stdio.h>
22
23#include "resource.h"
24
25// #define NDEBUG
26#include <debug.h>
27
28/* factory method */
30
31/* factory table */
32typedef struct
33{
37
38typedef struct tagFILTERINFO
39{
47
50
51#define INIT_GUID(guid, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
52 guid.Data1 = l; guid.Data2 = w1; guid.Data3 = w2; \
53 guid.Data4[0] = b1; guid.Data4[1] = b2; guid.Data4[2] = b3; \
54 guid.Data4[3] = b4; guid.Data4[4] = b5; guid.Data4[5] = b6; \
55 guid.Data4[6] = b7; guid.Data4[7] = b8;
56
57typedef enum
58{
63
64/* globals */
67
68/* classfactory.c */
69
73 PLONG pcRefDll,
74 REFIID riidInst);
75
76/* devicelist.c */
77
80 LPFILTERINFO *OutRootInfo);
81
82BOOL
84 LPCGUID pGuidSrc,
86
87BOOL
91 BOOL bPlayback);
92
96 BOOL bCapture,
98
99/* directsound.c */
100
104 IUnknown* pUnkOuter,
105 REFIID riid,
107
108/* misc.c */
109
110VOID
115 ULONG OldChannels,
116 ULONG NewChannels,
117 ULONG BitsPerSample,
121
122BOOL
124 IN HANDLE hPin,
125 IN LPWAVEFORMATEX WaveFormatEx);
126
127BOOL
130 IN DWORD PinId,
131 IN BOOL bLoop,
132 IN LPWAVEFORMATEX WaveFormatEx,
133 OUT LPWAVEFORMATEX WaveFormatOut,
134 OUT PHANDLE hPin);
135
136DWORD
140 IN LPVOID InBuffer,
145
146DWORD
151
152DWORD
153OpenPin(
155 ULONG PinId,
156 LPWAVEFORMATEX WaveFormatEx,
157 PHANDLE hPin,
158 BOOL bLoop);
159
160DWORD
163 IN PHANDLE OutHandle);
164
165DWORD
168 OUT PULONG NumPins);
169
170DWORD
173 IN ULONG PinId,
174 OUT PKSPIN_COMMUNICATION Communication);
175
176DWORD
179 IN ULONG PinId,
181
182/* primary.c */
183
187 LPDWORD pdwCurrentPlayCursor,
188 LPDWORD pdwCurrentWriteCursor);
189
190VOID
193 KSSTATE State);
194
199 DWORD dwLevel,
200 DWORD dwFlags);
201
205 LPWAVEFORMATEX pcfxFormat,
206 BOOL bLooped);
207
208VOID
211
212VOID
215
216/* secondary.c */
217
222 DWORD dwLevel,
223 LPCDSBUFFERDESC lpcDSBufferDesc,
224 LPDIRECTSOUNDBUFFER8 PrimaryBuffer);
225
226/* property.c */
227
231 IUnknown* pUnkOuter,
232 REFIID riid,
234
235/* capture.c */
236
240 IUnknown* pUnkOuter,
241 REFIID riid,
243
244/* capturebuffer.c */
245
250 LPCDSCBUFFERDESC lpcDSBufferDesc);
251
252/* notify.c */
253
254VOID
257 DWORD OldPosition,
258 DWORD NewPosition);
259
263 BOOL bLoop,
264 BOOL bMix,
265 HANDLE hPin,
267
268#endif
Definition: bufpool.h:45
DataFlow
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
HRESULT(CALLBACK * LPFNCREATEINSTANCE)(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: precomp.h:22
HRESULT NewDirectSoundCaptureBuffer(LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer, LPFILTERINFO Filter, LPCDSCBUFFERDESC lpcDSBufferDesc)
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
Definition: misc.c:298
DWORD GetFilterPinCommunication(IN HANDLE hFilter, IN ULONG PinId, OUT PKSPIN_COMMUNICATION Communication)
Definition: misc.c:427
HRESULT EnumAudioDeviceInterfaces(LPFILTERINFO *OutRootInfo)
Definition: devicelist.c:384
HRESULT NewSecondarySoundBuffer(LPDIRECTSOUNDBUFFER8 *OutBuffer, LPFILTERINFO Filter, DWORD dwLevel, LPCDSBUFFERDESC lpcDSBufferDesc, LPDIRECTSOUNDBUFFER8 PrimaryBuffer)
Definition: secondary.c:611
VOID PrimaryDirectSoundBuffer_ReleaseLock(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:757
VOID PerformChannelConversion(PUCHAR Buffer, ULONG BufferLength, PULONG BytesRead, ULONG OldChannels, ULONG NewChannels, ULONG BitsPerSample, PUCHAR Result, ULONG ResultLength, PULONG BytesWritten)
Definition: misc.c:18
LPFILTERINFO RootInfo
Definition: dsound.c:13
DWORD OpenPin(HANDLE hFilter, ULONG PinId, LPWAVEFORMATEX WaveFormatEx, PHANDLE hPin, BOOL bLoop)
Definition: misc.c:212
VOID PrimaryDirectSoundBuffer_AcquireLock(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:746
DWORD OpenFilter(IN LPCWSTR lpFileName, IN PHANDLE OutHandle)
Definition: misc.c:277
DWORD PrimaryDirectSoundBuffer_Write(LPDIRECTSOUNDBUFFER8 iface, LPVOID Buffer, DWORD BufferSize)
Definition: primary.c:587
PIN_TYPE
Definition: precomp.h:58
@ PIN_TYPE_PLAYBACK
Definition: precomp.h:60
@ PIN_TYPE_RECORDING
Definition: precomp.h:61
@ PIN_TYPE_NONE
Definition: precomp.h:59
BOOL CreateCompatiblePin(IN HANDLE hFilter, IN DWORD PinId, IN BOOL bLoop, IN LPWAVEFORMATEX WaveFormatEx, OUT LPWAVEFORMATEX WaveFormatOut, OUT PHANDLE hPin)
Definition: misc.c:517
HRESULT CALLBACK NewKsPropertySet(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: property.c:244
HRESULT NewPrimarySoundBuffer(LPDIRECTSOUNDBUFFER8 *OutBuffer, LPFILTERINFO Filter, DWORD dwLevel, DWORD dwFlags)
Definition: primary.c:768
HRESULT CALLBACK NewDirectSoundCapture(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: capture.c:284
VOID DoNotifyPositionEvents(LPDIRECTSOUNDNOTIFY iface, DWORD OldPosition, DWORD NewPosition)
Definition: notify.c:190
BOOL FindDeviceByMappedId(IN ULONG DeviceID, LPFILTERINFO *Filter, BOOL bPlayback)
Definition: devicelist.c:442
DWORD GetFilterPinCount(IN HANDLE hFilter, OUT PULONG NumPins)
Definition: misc.c:357
IClassFactory * IClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: classfactory.c:125
struct tagFILTERINFO * LPFILTERINFO
VOID PrimaryDirectSoundBuffer_SetState(LPDIRECTSOUNDBUFFER8 iface, KSSTATE State)
Definition: primary.c:621
struct tagFILTERINFO FILTERINFO
BOOL FindDeviceByGuid(LPCGUID pGuidSrc, LPFILTERINFO *Filter)
Definition: devicelist.c:470
DWORD GetFilterPinDataFlow(IN HANDLE hFilter, IN ULONG PinId, OUT PKSPIN_DATAFLOW DataFlow)
Definition: misc.c:444
HRESULT NewDirectSoundNotify(LPDIRECTSOUNDNOTIFY *Notify, BOOL bLoop, BOOL bMix, HANDLE hPin, DWORD BufferSize)
Definition: notify.c:232
HRESULT CALLBACK NewDirectSound(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: directsound.c:449
HRESULT PrimaryDirectSoundBuffer_GetPosition(LPDIRECTSOUNDBUFFER8 iface, LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor)
Definition: primary.c:644
HRESULT PrimaryDirectSoundBuffer_SetFormat(LPDIRECTSOUNDBUFFER8 iface, LPWAVEFORMATEX pcfxFormat, BOOL bLooped)
Definition: primary.c:694
HINSTANCE dsound_hInstance
Definition: dsound.c:12
ULONG GetPinIdFromFilter(LPFILTERINFO Filter, BOOL bCapture, ULONG Offset)
Definition: devicelist.c:13
BOOL SetPinFormat(IN HANDLE hPin, IN LPWAVEFORMATEX WaveFormatEx)
Definition: misc.c:77
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
struct IDirectSoundCaptureBuffer8 * LPDIRECTSOUNDCAPTUREBUFFER8
Definition: dsound.h:100
struct IDirectSoundNotify * LPDIRECTSOUNDNOTIFY
Definition: dsound.h:82
struct IDirectSoundBuffer8 * LPDIRECTSOUNDBUFFER8
Definition: dsound.h:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
ULONG Handle
Definition: gdb_input.c:15
REFIID riid
Definition: atlbase.h:39
KSSTATE
Definition: ks.h:1214
enum KSPIN_DATAFLOW * PKSPIN_DATAFLOW
enum KSPIN_COMMUNICATION * PKSPIN_COMMUNICATION
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define REFIID
Definition: guiddef.h:118
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4071
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
REFIID riid
Definition: precomp.h:34
struct tagFILTERINFO * lpNext
Definition: precomp.h:48
ULONG PinCount
Definition: precomp.h:43
WCHAR DevicePath[MAX_PATH]
Definition: precomp.h:41
SP_DEVINFO_DATA DeviceData
Definition: precomp.h:40
PULONG Pin
Definition: precomp.h:44
GUID DeviceGuid[2]
Definition: precomp.h:45
HANDLE hFilter
Definition: precomp.h:42
ULONG MappedId[2]
Definition: precomp.h:46
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t * LPDWORD
Definition: typedefs.h:59
#define IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_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
Definition: wdfiotarget.h:960
_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
Definition: wdfiotarget.h:870
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
Definition: wdfpdo.h:278
_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
Definition: wdfusb.h:1342
_In_ ULONG OutBufferSize
Definition: wdfwmi.h:87
_In_ ULONG InBufferSize
Definition: wdfwmi.h:106
_In_ LPCSTR lpFileName
Definition: winbase.h:3071
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define HRESULT
Definition: msvc.h:7
_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
Definition: wsk.h:409
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185