ReactOS  0.4.13-dev-544-gede3fdd
audio_test.c File Reference
#include <windows.h>
#include <stdio.h>
#include <math.h>
#include <setupapi.h>
#include <ndk/umtypes.h>
#include <ks.h>
#include <ksmedia.h>
#include "interface.h"
Include dependency graph for audio_test.c:

Go to the source code of this file.

Macros

#define _UNICODE
 
#define UNICODE
 
#define WIN32_NO_STATUS
 
#define _KSDDK_
 
#define _2pi   6.283185307179586476925286766559
 

Functions

VOID TestKs ()
 
int __cdecl main (int argc, char *argv[])
 

Variables

GUID CategoryGuid = {STATIC_KSCATEGORY_AUDIO}
 
const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}
 
const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSPROPSETID_Sysaudio = {0xCBE3FAA0L, 0xCC75, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}
 
const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}
 
const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
 
const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
 
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}
 

Macro Definition Documentation

◆ _2pi

#define _2pi   6.283185307179586476925286766559

Definition at line 15 of file audio_test.c.

◆ _KSDDK_

#define _KSDDK_

Definition at line 4 of file audio_test.c.

◆ _UNICODE

#define _UNICODE

Definition at line 1 of file audio_test.c.

◆ UNICODE

Definition at line 2 of file audio_test.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 3 of file audio_test.c.

Function Documentation

◆ main()

int __cdecl main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 243 of file audio_test.c.

244 {
245  ULONG Length;
246  PSHORT SoundBuffer;
247  ULONG i = 0;
248  BOOL Status;
249  OVERLAPPED Overlapped;
251  HANDLE hWdmAud;
253 
254  TestKs();
255  return 0;
256 
257  hWdmAud = CreateFileW(L"\\\\.\\wdmaud",
259  0,
260  NULL,
263  NULL);
264  if (!hWdmAud)
265  {
266  printf("Failed to open wdmaud with %lx\n", GetLastError());
267  return -1;
268  }
269 
270  printf("WDMAUD: opened\n");
271 
272  /* clear device info */
274 
275  ZeroMemory(&Overlapped, sizeof(OVERLAPPED));
276  Overlapped.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
277 
278  DeviceInfo.DeviceType = WAVE_OUT_DEVICE_TYPE;
279 
280 
282 
283  if (!Status)
284  {
285  if (WaitForSingleObject(&Overlapped.hEvent, 5000) != WAIT_OBJECT_0)
286  {
287  printf("Failed to get num of wave out devices with %lx\n", GetLastError());
288  CloseHandle(hWdmAud);
289  return -1;
290  }
291  }
292 
293  printf("WDMAUD: Num Devices %lu\n", DeviceInfo.DeviceCount);
294 
295  if (!DeviceInfo.DeviceCount)
296  {
297  CloseHandle(hWdmAud);
298  return 0;
299  }
300 
302 
303  if (!Status)
304  {
305  if (WaitForSingleObject(&Overlapped.hEvent, 5000) != WAIT_OBJECT_0)
306  {
307  printf("Failed to get iocaps %lx\n", GetLastError());
308  }
309  }
310  printf("WDMAUD: Capabilities NumChannels %x dwFormats %lx\n", DeviceInfo.u.WaveOutCaps.wChannels, DeviceInfo.u.WaveOutCaps.dwFormats);
311 
312  DeviceInfo.u.WaveFormatEx.cbSize = sizeof(WAVEFORMATEX);
313  DeviceInfo.u.WaveFormatEx.wFormatTag = WAVE_FORMAT_PCM;
314  DeviceInfo.u.WaveFormatEx.nChannels = 2;
315  DeviceInfo.u.WaveFormatEx.nSamplesPerSec = 48000;
316  DeviceInfo.u.WaveFormatEx.nBlockAlign = 4;
317  DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = 48000 * 4;
318  DeviceInfo.u.WaveFormatEx.wBitsPerSample = 16;
319 
320 
321 
323  if (!Status)
324  {
325  if (WaitForSingleObject(&Overlapped.hEvent, 5000) != WAIT_OBJECT_0)
326  {
327  printf("Failed to open device with %lx\n", GetLastError());
328  CloseHandle(hWdmAud);
329  return -1;
330  }
331  }
332 
333  printf("WDMAUD: opened device\n");
334 
335  //
336  // Allocate a buffer for 1 second
337  //
338  Length = 48000 * 4;
340 
341  //
342  // Fill the buffer with a 500 Hz sine tone
343  //
344  while (i < Length / 2)
345  {
346  //
347  // Generate the wave for each channel:
348  // Amplitude * sin( Sample * Frequency * 2PI / SamplesPerSecond )
349  //
350  SoundBuffer[i] = 0x7FFF * sin(0.5 * (i - 1) * 500 * _2pi / 48000);
351  i++;
352  SoundBuffer[i] = 0x7FFF * sin((0.5 * i - 2) * 500 * _2pi / 48000);
353  i++;
354  }
355 
356  DeviceInfo.u.State = KSSTATE_RUN;
358  if (!Status)
359  {
360  if (WaitForSingleObject(&Overlapped.hEvent, 5000) != WAIT_OBJECT_0)
361  {
362  printf("Failed to set device into run state %lx\n", GetLastError());
363  CloseHandle(hWdmAud);
364  return -1;
365  }
366  }
367 
368  //
369  // Play our 1-second buffer
370  //
371  DeviceInfo.Header.Data = (PUCHAR)SoundBuffer;
372  DeviceInfo.Header.DataUsed = DeviceInfo.Header.FrameExtent = Length;
374  if (!Status)
375  {
376  if (WaitForSingleObject(&Overlapped.hEvent, 5000) != WAIT_OBJECT_0)
377  {
378  printf("Failed to play buffer %lx\n", GetLastError());
379  CloseHandle(hWdmAud);
380  return -1;
381  }
382  }
383 
384  printf("WDMAUD: Played buffer\n");
385 
386  DeviceInfo.u.State = KSSTATE_STOP;
388  if (!Status)
389  {
390  if (WaitForSingleObject(&Overlapped.hEvent, 5000) != WAIT_OBJECT_0)
391  {
392  printf("Failed to set device into stop state %lx\n", GetLastError());
393  CloseHandle(hWdmAud);
394  return -1;
395  }
396  }
397  printf("WDMAUD: STOPPED\n");
398  CloseHandle(&Overlapped.hEvent);
399  CloseHandle(hWdmAud);
400  printf("WDMAUD: COMPLETE\n");
401  return 0;
402 }
#define IOCTL_SETDEVICE_STATE
Definition: interface.h:134
#define CloseHandle
Definition: compat.h:398
#define IOCTL_GETCAPABILITIES
Definition: interface.h:204
signed short * PSHORT
Definition: retypes.h:6
unsigned char * PUCHAR
Definition: retypes.h:3
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
struct tWAVEFORMATEX WAVEFORMATEX
Definition: austream.idl:23
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define WAVE_FORMAT_PCM
Definition: constants.h:425
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_WRITE
Definition: nt_native.h:90
HANDLE hEvent
Definition: winbase.h:792
smooth NULL
Definition: ftsmooth.c:416
WCHAR Data[ANYSIZE_ARRAY]
#define IOCTL_OPEN_WDMAUD
Definition: interface.h:82
#define OPEN_EXISTING
Definition: compat.h:426
#define WAIT_OBJECT_0
Definition: winbase.h:387
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IOCTL_GETNUMDEVS_TYPE
Definition: interface.h:117
#define IOCTL_WRITEDATA
Definition: interface.h:221
struct _DeviceInfo DeviceInfo
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _2pi
Definition: audio_test.c:15
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
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)
Definition: deviceio.c:136
VOID TestKs()
Definition: audio_test.c:30
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CreateFileW
Definition: compat.h:400
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
#define FILE_FLAG_OVERLAPPED
Definition: disk.h:46
#define printf
Definition: config.h:203

◆ TestKs()

VOID TestKs ( )

Definition at line 30 of file audio_test.c.

31 {
37  PKSPIN_CONNECT PinConnect;
40  KSSTATE State;
41  DWORD Length;
42  HANDLE FilterHandle;
43  HANDLE PinHandle;
44  PSHORT SoundBuffer;
45  UINT i = 0;
46  BOOL Result;
48 
49  //
50  // Get a handle to KS Audio Interfaces
51  //
53  NULL,
54  NULL,
55  DIGCF_DEVICEINTERFACE); //DIGCF_PRESENT
56 
57  printf("DeviceHandle %p\n", DeviceHandle);
58 
59  //
60  // Enumerate the first interface
61  //
62  InterfaceData.cbSize = sizeof(InterfaceData);
63  InterfaceData.Reserved = 0;
65  NULL,
66  &CategoryGuid,
67  1,
68  &InterfaceData);
69 
70  printf("SetupDiEnumDeviceInterfaces %u Error %ld\n", Result, GetLastError());
71 
72  //
73  // Get the interface details (namely the device path)
74  //
77  0,
78  Length);
79  DetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
80  DeviceData.cbSize = sizeof(DeviceData);
81  DeviceData.Reserved = 0;
84  DetailData,
85  Length,
86  NULL,
87  &DeviceData);
88 
89  wprintf(L"SetupDiGetDeviceInterfaceDetail %u Path DetailData %s\n", Result, (LPWSTR)&DetailData->DevicePath[0]);
90 
91  //
92  // Open a handle to the device
93  //
94  FilterHandle = CreateFile(DetailData->DevicePath,
96  0,
97  NULL,
100  NULL);
101 
102  printf("Handle %p\n", FilterHandle);
103 
104  //
105  // Close the interface handle and clean up
106  //
108 
109  //
110  // Allocate a KS Pin Connection Request Structure
111  //
112  Length = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX);
113  printf("Length %ld KSPIN %u DATAFORMAT %u\n", Length, sizeof(KSPIN_CONNECT), sizeof(KSDATAFORMAT_WAVEFORMATEX));
114  PinConnect = (PKSPIN_CONNECT)HeapAlloc(GetProcessHeap(), 0, Length);
115  DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)(PinConnect + 1);
116 
117  //
118  // Setup the KS Pin Data
119  //
122  PinConnect->Interface.Flags = 0;
123  PinConnect->Medium.Set = KSMEDIUMSETID_Standard;
124  PinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE;
125  PinConnect->Medium.Flags = 0;
126  PinConnect->PinId = 0;
127  PinConnect->PinToHandle = NULL;
129  PinConnect->Priority.PrioritySubClass = 1;
130 
131  //
132  // Setup the KS Data Format Information
133  //
134  DataFormat->WaveFormatEx.wFormatTag = WAVE_FORMAT_PCM;
135  DataFormat->WaveFormatEx.nChannels = 2;
136  DataFormat->WaveFormatEx.nSamplesPerSec = 48000;
137  DataFormat->WaveFormatEx.nBlockAlign = 4;
138  DataFormat->WaveFormatEx.nAvgBytesPerSec = 48000 * 4;
139  DataFormat->WaveFormatEx.wBitsPerSample = 16;
140  DataFormat->WaveFormatEx.cbSize = 0;
141  DataFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) +
142  sizeof(WAVEFORMATEX);
143  DataFormat->DataFormat.Flags = KSDATAFORMAT_ATTRIBUTES;
144  DataFormat->DataFormat.Reserved = 0;
145  DataFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
146  DataFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
147  DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
148  DataFormat->DataFormat.SampleSize = 4;
149 
150  //
151  // Create the pin
152  //
153  Status = KsCreatePin(FilterHandle, PinConnect, GENERIC_WRITE, &PinHandle);
154 
155  printf("PinHandle %p Status %lx\n", PinHandle, Status);
156 
157  //
158  // Allocate a buffer for 1 second
159  //
160  Length = 48000 * 4;
161  SoundBuffer = (PSHORT)HeapAlloc(GetProcessHeap(), 0, Length);
162 
163  //
164  // Fill the buffer with a 500 Hz sine tone
165  //
166  while (i < Length / 2)
167  {
168  //
169  // Generate the wave for each channel:
170  // Amplitude * sin( Sample * Frequency * 2PI / SamplesPerSecond )
171  //
172  SoundBuffer[i] = 0x7FFF * sin(0.5 * (i - 1) * 500 * _2pi / 48000);
173  i++;
174  SoundBuffer[i] = 0x7FFF * sin((0.5 * i - 2) * 500 * _2pi / 48000);
175  i++;
176  }
177 
178  //
179  // Create and fill out the KS Stream Packet
180  //
183  sizeof(KSSTREAM_HEADER));
184  Packet->Data = SoundBuffer;
185  Packet->FrameExtent = Length;
186  Packet->DataUsed = Length;
187  Packet->Size = sizeof(KSSTREAM_HEADER);
188  Packet->PresentationTime.Numerator = 1;
189  Packet->PresentationTime.Denominator = 1;
190 
191  //
192  // Setup a KS Property to change the state
193  //
197  Property->Flags = KSPROPERTY_TYPE_SET;
198 
199  //
200  // Change the state to run
201  //
202  State = KSSTATE_RUN;
203  DeviceIoControl(PinHandle,
205  Property,
206  sizeof(KSPROPERTY),
207  &State,
208  sizeof(State),
209  &Length,
210  NULL);
211 
212  //
213  // Play our 1-second buffer
214  //
215  DeviceIoControl(PinHandle,
217  NULL,
218  0,
219  Packet,
220  Packet->Size,
221  &Length,
222  NULL);
223 
224  //
225  // Change the state to stop
226  //
228  DeviceIoControl(PinHandle,
230  Property,
231  sizeof(KSPROPERTY),
232  &State,
233  sizeof(State),
234  &Length,
235  NULL);
236 
237  CloseHandle(PinHandle);
238  CloseHandle(FilterHandle);
239 }
struct KSIDENTIFIER KSPROPERTY
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:157
KSPIN_INTERFACE Interface
Definition: ks.h:2630
#define CloseHandle
Definition: compat.h:398
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
Definition: hubbusif.h:121
KSPIN_MEDIUM Medium
Definition: ks.h:2631
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
KSDDKAPI DWORD NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
Definition: ksuser.c:192
#define KSPRIORITY_NORMAL
Definition: ks.h:1416
SP_DEVICE_INTERFACE_DETAIL_DATA_A * PSP_DEVICE_INTERFACE_DETAIL_DATA
Definition: setupapi.h:1144
signed short * PSHORT
Definition: retypes.h:6
LONG NTSTATUS
Definition: precomp.h:26
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
const GUID KSDATAFORMAT_SUBTYPE_PCM
Definition: audio_test.c:26
ULONG PriorityClass
Definition: ks.h:1421
#define wprintf(...)
Definition: whoami.c:18
struct KSSTREAM_HEADER * PKSSTREAM_HEADER
GUID Set
Definition: dmksctrl.h:76
const GUID KSMEDIUMSETID_Standard
Definition: audio_test.c:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define WAVE_FORMAT_PCM
Definition: constants.h:425
ULONG PinId
Definition: ks.h:2632
const GUID KSINTERFACESETID_Standard
Definition: audio_test.c:23
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE PinToHandle
Definition: ks.h:2633
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
_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
#define SetupDiGetDeviceInterfaceDetail
Definition: setupapi.h:2596
#define OPEN_EXISTING
Definition: compat.h:426
const GUID KSDATAFORMAT_TYPE_AUDIO
Definition: audio_test.c:25
ULONG PrioritySubClass
Definition: ks.h:1422
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
ULONG Id
Definition: dmksctrl.h:77
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2898
#define MAX_PATH
Definition: compat.h:26
GUID CategoryGuid
Definition: audio_test.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _2pi
Definition: audio_test.c:15
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct KSPIN_CONNECT * PKSPIN_CONNECT
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
ULONG Flags
Definition: dmksctrl.h:78
static const WCHAR L[]
Definition: oid.c:1250
#define KSDATAFORMAT_ATTRIBUTES
Definition: ks.h:55
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: audio_test.c:27
CHAR DevicePath[ANYSIZE_ARRAY]
Definition: setupapi.h:846
#define SetupDiGetClassDevs
Definition: setupapi.h:2588
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
struct KSDATAFORMAT_WAVEFORMATEX * PKSDATAFORMAT_WAVEFORMATEX
enum State_ State
Definition: pofuncs.h:54
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)
Definition: deviceio.c:136
KSSTATE
Definition: ks.h:1244
#define KSMEDIUM_TYPE_ANYINSTANCE
Definition: ks.h:331
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:904
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
Definition: devinst.c:2785
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_DEVICE_INTERFACE_DETAIL_DATA
Definition: setupapi.h:1144
#define DIGCF_DEVICEINTERFACE
Definition: setupapi.h:174
IN PVOID IN PVOID InterfaceData
Definition: pci.h:359
KSPRIORITY Priority
Definition: ks.h:2634
struct KSIDENTIFIER * PKSPROPERTY
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define printf
Definition: config.h:203
const GUID KSPROPSETID_Connection
Definition: audio_test.c:20

Referenced by main().

Variable Documentation

◆ CategoryGuid

GUID CategoryGuid = {STATIC_KSCATEGORY_AUDIO}

Definition at line 17 of file audio_test.c.

Referenced by TestKs().

◆ KSDATAFORMAT_SPECIFIER_WAVEFORMATEX

const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}

Definition at line 27 of file audio_test.c.

Referenced by TestKs().

◆ KSDATAFORMAT_SUBTYPE_PCM

const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}

Definition at line 26 of file audio_test.c.

Referenced by TestKs().

◆ KSDATAFORMAT_TYPE_AUDIO

const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}

Definition at line 25 of file audio_test.c.

Referenced by TestKs().

◆ KSINTERFACESETID_Standard

const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 23 of file audio_test.c.

Referenced by TestKs().

◆ KSMEDIUMSETID_Standard

const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 24 of file audio_test.c.

Referenced by TestKs().

◆ KSPROPSETID_Connection

const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 20 of file audio_test.c.

Referenced by TestKs().

◆ KSPROPSETID_General

const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}

Definition at line 22 of file audio_test.c.

◆ KSPROPSETID_Pin

const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}

Definition at line 19 of file audio_test.c.

◆ KSPROPSETID_Sysaudio

const GUID KSPROPSETID_Sysaudio = {0xCBE3FAA0L, 0xCC75, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}

Definition at line 21 of file audio_test.c.