ReactOS  0.4.14-dev-50-g13bb5e2
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 #define YDEBUG
19 #include <debug.h>
20 #include <ks.h>
21 #include <ksmedia.h>
22 #include <limits.h>
23 #include <stdio.h>
24 
25 #include "resource.h"
26 
27 
28 /* factory method */
30 
31 /* factory table */
32 typedef struct
33 {
37 
38 
39 typedef struct tagFILTERINFO
40 {
48 
51 
52 #define INIT_GUID(guid, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
53  guid.Data1 = l; guid.Data2 = w1; guid.Data3 = w2; \
54  guid.Data4[0] = b1; guid.Data4[1] = b2; guid.Data4[2] = b3; \
55  guid.Data4[3] = b4; guid.Data4[4] = b5; guid.Data4[5] = b6; \
56  guid.Data4[6] = b7; guid.Data4[7] = b8;
57 
58 typedef enum
59 {
63 }PIN_TYPE;
64 
65 /* globals */
67 extern LPFILTERINFO RootInfo;
68 
69 /* classfactory.c */
70 
74  PLONG pcRefDll,
75  REFIID riidInst);
76 
77 
78 /* devicelist.c */
79 
80 HRESULT
82  LPFILTERINFO *OutRootInfo);
83 
84 BOOL
86  LPCGUID pGuidSrc,
88 
89 BOOL
91  IN ULONG DeviceID,
93  BOOL bPlayback);
94 
95 ULONG
98  BOOL bCapture,
99  ULONG Offset);
100 
101 /* directsound.c */
102 
103 HRESULT
104 CALLBACK
106  IUnknown* pUnkOuter,
107  REFIID riid,
108  LPVOID* ppvObject);
109 
110 
111 /* misc.c */
112 
113 VOID
115  PUCHAR Buffer,
118  ULONG OldChannels,
119  ULONG NewChannels,
120  ULONG BitsPerSample,
121  PUCHAR Result,
124 
125 BOOL
127  IN HANDLE hPin,
128  IN LPWAVEFORMATEX WaveFormatEx);
129 
130 BOOL
132  IN HANDLE hFilter,
133  IN DWORD PinId,
134  IN BOOL bLoop,
135  IN LPWAVEFORMATEX WaveFormatEx,
136  OUT LPWAVEFORMATEX WaveFormatOut,
137  OUT PHANDLE hPin);
138 
139 
140 DWORD
142  IN HANDLE Handle,
144  IN LPVOID InBuffer,
146  OUT LPVOID OutBuffer,
148  OUT LPDWORD BytesTransferred OPTIONAL);
149 
150 DWORD
152  LPDIRECTSOUNDBUFFER8 iface,
153  LPVOID Buffer,
154  DWORD BufferSize);
155 
156 
157 DWORD
158 OpenPin(
159  HANDLE hFilter,
160  ULONG PinId,
161  LPWAVEFORMATEX WaveFormatEx,
162  PHANDLE hPin,
163  BOOL bLoop);
164 
165 DWORD
166 OpenFilter(
168  IN PHANDLE OutHandle);
169 
170 DWORD
172  IN HANDLE hFilter,
173  OUT PULONG NumPins);
174 
175 DWORD
177  IN HANDLE hFilter,
178  IN ULONG PinId,
179  OUT PKSPIN_COMMUNICATION Communication);
180 
181 DWORD
183  IN HANDLE hFilter,
184  IN ULONG PinId,
186 
187 /* primary.c */
188 
189 HRESULT
191  LPDIRECTSOUNDBUFFER8 iface,
192  LPDWORD pdwCurrentPlayCursor,
193  LPDWORD pdwCurrentWriteCursor);
194 
195 VOID
197  LPDIRECTSOUNDBUFFER8 iface,
198  KSSTATE State);
199 
200 HRESULT
202  LPDIRECTSOUNDBUFFER8 *OutBuffer,
204  DWORD dwLevel,
205  DWORD dwFlags);
206 
207 HRESULT
209  LPDIRECTSOUNDBUFFER8 iface,
210  LPWAVEFORMATEX pcfxFormat,
211  BOOL bLooped);
212 
213 VOID
215  LPDIRECTSOUNDBUFFER8 iface);
216 
217 VOID
219  LPDIRECTSOUNDBUFFER8 iface);
220 
221 /* secondary.c */
222 
223 HRESULT
225  LPDIRECTSOUNDBUFFER8 *OutBuffer,
227  DWORD dwLevel,
228  LPCDSBUFFERDESC lpcDSBufferDesc,
229  LPDIRECTSOUNDBUFFER8 PrimaryBuffer);
230 
231 /* property.c */
232 HRESULT
233 CALLBACK
235  IUnknown* pUnkOuter,
236  REFIID riid,
237  LPVOID* ppvObject);
238 
239 /* capture.c */
240 
241 HRESULT
242 CALLBACK
244  IUnknown* pUnkOuter,
245  REFIID riid,
246  LPVOID* ppvObject);
247 
248 
249 /* capturebuffer.c */
250 HRESULT
252  LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer,
254  LPCDSCBUFFERDESC lpcDSBufferDesc);
255 
256 /* notify.c */
257 VOID
259  LPDIRECTSOUNDNOTIFY iface,
260  DWORD OldPosition,
261  DWORD NewPosition);
262 
263 HRESULT
266  BOOL bLoop,
267  BOOL bMix,
268  HANDLE hPin,
269  DWORD BufferSize);
270 
271 #endif
struct IDirectSoundBuffer8 * LPDIRECTSOUNDBUFFER8
Definition: dsound.h:79
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
HRESULT EnumAudioDeviceInterfaces(LPFILTERINFO *OutRootInfo)
Definition: devicelist.c:384
DWORD GetFilterPinDataFlow(IN HANDLE hFilter, IN ULONG PinId, OUT PKSPIN_DATAFLOW DataFlow)
Definition: misc.c:444
#define IN
Definition: typedefs.h:38
VOID DoNotifyPositionEvents(LPDIRECTSOUNDNOTIFY iface, DWORD OldPosition, DWORD NewPosition)
Definition: notify.c:190
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
#define REFIID
Definition: guiddef.h:118
HRESULT CALLBACK NewDirectSound(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: directsound.c:449
BOOL CreateCompatiblePin(IN HANDLE hFilter, IN DWORD PinId, IN BOOL bLoop, IN LPWAVEFORMATEX WaveFormatEx, OUT LPWAVEFORMATEX WaveFormatOut, OUT PHANDLE hPin)
Definition: misc.c:517
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
struct tagFILTERINFO * lpNext
Definition: precomp.h:49
DWORD GetFilterPinCommunication(IN HANDLE hFilter, IN ULONG PinId, OUT PKSPIN_COMMUNICATION Communication)
Definition: misc.c:427
REFIID riid
Definition: precomp.h:44
IClassFactory * IClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: classfactory.c:125
DWORD GetFilterPinCount(IN HANDLE hFilter, OUT PULONG NumPins)
Definition: misc.c:357
unsigned char * PUCHAR
Definition: retypes.h:3
_In_ USHORT DeviceID
Definition: iotypes.h:860
#define CALLBACK
Definition: compat.h:27
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG OutBufferSize
Definition: classpnp.h:429
HRESULT NewSecondarySoundBuffer(LPDIRECTSOUNDBUFFER8 *OutBuffer, LPFILTERINFO Filter, DWORD dwLevel, LPCDSBUFFERDESC lpcDSBufferDesc, LPDIRECTSOUNDBUFFER8 PrimaryBuffer)
Definition: secondary.c:611
LPFILTERINFO RootInfo
Definition: dsound.c:13
HRESULT NewPrimarySoundBuffer(LPDIRECTSOUNDBUFFER8 *OutBuffer, LPFILTERINFO Filter, DWORD dwLevel, DWORD dwFlags)
Definition: primary.c:768
HRESULT(CALLBACK * LPFNCREATEINSTANCE)(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: precomp.h:22
HRESULT CALLBACK NewDirectSoundCapture(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: capture.c:284
WCHAR DevicePath[MAX_PATH]
Definition: precomp.h:42
REFIID riid
Definition: precomp.h:34
PULONG Pin
Definition: precomp.h:45
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT PrimaryDirectSoundBuffer_SetFormat(LPDIRECTSOUNDBUFFER8 iface, LPWAVEFORMATEX pcfxFormat, BOOL bLooped)
Definition: primary.c:694
_In_ ULONG BufferLength
Definition: usbdlib.h:225
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
_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:426
HANDLE hFilter
Definition: precomp.h:43
DWORD OpenPin(HANDLE hFilter, ULONG PinId, LPWAVEFORMATEX WaveFormatEx, PHANDLE hPin, BOOL bLoop)
Definition: misc.c:212
enum KSPIN_COMMUNICATION * PKSPIN_COMMUNICATION
Definition: bufpool.h:45
struct tagFILTERINFO FILTERINFO
VOID PrimaryDirectSoundBuffer_SetState(LPDIRECTSOUNDBUFFER8 iface, KSSTATE State)
Definition: primary.c:621
ULONG GetPinIdFromFilter(LPFILTERINFO Filter, BOOL bCapture, ULONG Offset)
Definition: devicelist.c:13
_In_ HANDLE Handle
Definition: extypes.h:390
HRESULT NewDirectSoundNotify(LPDIRECTSOUNDNOTIFY *Notify, BOOL bLoop, BOOL bMix, HANDLE hPin, DWORD BufferSize)
Definition: notify.c:232
GUID DeviceGuid[2]
Definition: precomp.h:46
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG InBufferSize
Definition: classpnp.h:429
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
struct tagFILTERINFO * LPFILTERINFO
#define MAX_PATH
Definition: compat.h:26
DWORD OpenFilter(IN LPCWSTR lpFileName, IN PHANDLE OutHandle)
Definition: misc.c:277
#define BufferSize
Definition: classpnp.h:419
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID PrimaryDirectSoundBuffer_AcquireLock(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:746
BOOL SetPinFormat(IN HANDLE hPin, IN LPWAVEFORMATEX WaveFormatEx)
Definition: misc.c:77
PIN_TYPE
Definition: precomp.h:58
BOOL FindDeviceByGuid(LPCGUID pGuidSrc, LPFILTERINFO *Filter)
Definition: devicelist.c:470
HRESULT NewDirectSoundCaptureBuffer(LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer, LPFILTERINFO Filter, LPCDSCBUFFERDESC lpcDSBufferDesc)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
SP_DEVINFO_DATA DeviceData
Definition: precomp.h:41
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
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
REFIID LPVOID * ppvObject
Definition: precomp.h:44
struct IDirectSoundNotify * LPDIRECTSOUNDNOTIFY
Definition: dsound.h:82
KSSTATE
Definition: ks.h:1214
ULONG PinCount
Definition: precomp.h:44
VOID PrimaryDirectSoundBuffer_ReleaseLock(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:757
HRESULT CALLBACK NewKsPropertySet(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: property.c:244
unsigned int * PULONG
Definition: retypes.h:1
BOOL FindDeviceByMappedId(IN ULONG DeviceID, LPFILTERINFO *Filter, BOOL bPlayback)
Definition: devicelist.c:442
HRESULT PrimaryDirectSoundBuffer_GetPosition(LPDIRECTSOUNDBUFFER8 iface, LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor)
Definition: primary.c:644
ULONG MappedId[2]
Definition: precomp.h:47
DWORD PrimaryDirectSoundBuffer_Write(LPDIRECTSOUNDBUFFER8 iface, LPVOID Buffer, DWORD BufferSize)
Definition: primary.c:587
#define OUT
Definition: typedefs.h:39
uint32_t * LPDWORD
Definition: typedefs.h:57
unsigned int ULONG
Definition: retypes.h:1
struct IDirectSoundCaptureBuffer8 * LPDIRECTSOUNDCAPTUREBUFFER8
Definition: dsound.h:100
typedef HRESULT(CALLBACK *LPFNCREATEINSTANCE)(IUnknown *pUnkOuter
DataFlow
signed int * PLONG
Definition: retypes.h:5
enum KSPIN_DATAFLOW * PKSPIN_DATAFLOW
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesRead
Definition: fltkernel.h:1255
HINSTANCE dsound_hInstance
Definition: dsound.c:12
_In_ LPCSTR lpFileName
Definition: winbase.h:3011
VOID PerformChannelConversion(PUCHAR Buffer, ULONG BufferLength, PULONG BytesRead, ULONG OldChannels, ULONG NewChannels, ULONG BitsPerSample, PUCHAR Result, ULONG ResultLength, PULONG BytesWritten)
Definition: misc.c:18
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68