ReactOS 0.4.15-dev-5672-gf73ac17
misc.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Configuration of network devices
4 * FILE: dll/directx/dsound_new/misc.c
5 * PURPOSE: Misc support routines
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9
10#include "precomp.h"
11
12const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}};
13const GUID KSPROPSETID_Topology = {0x720D4AC0L, 0x7533, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
14const GUID KSPROPSETID_Audio = {0x45FFAAA0L, 0x6E1B, 0x11D0, {0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}};
15
16
17VOID
22 ULONG OldChannels,
23 ULONG NewChannels,
24 ULONG BitsPerSample,
28{
29 DWORD NewIndex, OldIndex;
30 DWORD NewLength, Skip;
31
32 if (NewChannels > OldChannels)
33 {
35 ASSERT(0);
36 }
37
38 /* setup index */
39 NewIndex = 0;
40 OldIndex = 0;
41
42 /* calculate offsets */
43 NewLength = NewChannels * (BitsPerSample/8);
44 Skip = OldChannels * (BitsPerSample/8);
45
46 do
47 {
48 if (NewIndex + NewLength>= ResultLength)
49 {
50 NewIndex = ResultLength;
51 break;
52 }
53
54 if (OldIndex + Skip >= BufferLength)
55 {
56 OldIndex = BufferLength;
57 break;
58 }
59
60 /* copy first channel */
61 RtlMoveMemory(&Result[NewIndex], &Buffer[OldIndex], NewLength);
62
63 /* skip other channels */
64 OldIndex += Skip;
65
66 /* increment offset */
67 NewIndex += NewLength;
68
69 }while(TRUE);
70
71 *BytesRead = OldIndex;
72 *BytesWritten = NewIndex;
73}
74
75
76BOOL
78 IN HANDLE hPin,
79 IN LPWAVEFORMATEX WaveFormatEx)
80{
81 DWORD dwResult;
84
85 /* setup connection request */
89
90 /* setup data format */
91 DataFormat.WaveFormatEx.wFormatTag = WaveFormatEx->wFormatTag;
92 DataFormat.WaveFormatEx.nSamplesPerSec = WaveFormatEx->nSamplesPerSec;
93 DataFormat.WaveFormatEx.nBlockAlign = WaveFormatEx->nBlockAlign;
94 DataFormat.WaveFormatEx.cbSize = 0;
95 DataFormat.DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX);
96 DataFormat.DataFormat.Flags = 0;
97 DataFormat.DataFormat.Reserved = 0;
98 DataFormat.DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
99 DataFormat.DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
100 DataFormat.DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
101 DataFormat.DataFormat.SampleSize = 4;
102 DataFormat.WaveFormatEx.nChannels = WaveFormatEx->nChannels;
103 DataFormat.WaveFormatEx.nAvgBytesPerSec = WaveFormatEx->nAvgBytesPerSec;
104 DataFormat.WaveFormatEx.wBitsPerSample = WaveFormatEx->wBitsPerSample;
105
107
108 if (dwResult == ERROR_SUCCESS)
109 return TRUE;
110 else
111 return FALSE;
112}
113
114
115BOOL
117 HANDLE hFilter,
118 DWORD PinId,
119 DWORD SampleFrequency,
120 LPWAVEFORMATEX WaveFormatEx,
121 DWORD MinimumBitsPerSample,
122 DWORD MaximumBitsPerSample,
123 DWORD MaximumChannels,
124 LPWAVEFORMATEX WaveFormatOut)
125{
126 DWORD nChannels, nBitsPerSample;
127 KSDATAFORMAT_WAVEFORMATEX WaveFormat;
131 DWORD dwResult;
132
133 /* allocate request */
135 if (!Pin)
136 {
137 /* no memory */
138 return FALSE;
139 }
140
141 Item = (PKSMULTIPLE_ITEM)(Pin + 1);
143
144 /* setup request */
145 Pin->PinId = PinId;
146 Pin->Property.Flags = KSPROPERTY_TYPE_GET;
147 Pin->Property.Set = KSPROPSETID_Pin;
149 Item->Count = 1;
150 Item->Size = sizeof(KSDATAFORMAT_WAVEFORMATEX);
151
152
153 DataFormat->WaveFormatEx.wFormatTag = WaveFormatEx->wFormatTag;
154 DataFormat->WaveFormatEx.nSamplesPerSec = SampleFrequency;
155 DataFormat->WaveFormatEx.nBlockAlign = WaveFormatEx->nBlockAlign;
156 DataFormat->WaveFormatEx.cbSize = 0;
157 DataFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX);
158 DataFormat->DataFormat.Flags = 0;
159 DataFormat->DataFormat.Reserved = 0;
160 DataFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
161 DataFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
162 DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
163 DataFormat->DataFormat.SampleSize = 4;
164
165 for(nChannels = 1; nChannels <= 2; nChannels++)
166 {
167 for(nBitsPerSample = MinimumBitsPerSample; nBitsPerSample <= MaximumBitsPerSample; nBitsPerSample += 8)
168 {
169 DataFormat->WaveFormatEx.nChannels = nChannels;
170 DataFormat->WaveFormatEx.nAvgBytesPerSec = (nBitsPerSample / 8) * nChannels * SampleFrequency;
171 DataFormat->WaveFormatEx.wBitsPerSample = nBitsPerSample;
172
173 DPRINT("CurrentFormat: InFormat nChannels %u wBitsPerSample %u nSamplesPerSec %u\n",
174 nChannels, nBitsPerSample, SampleFrequency);
175
177 (LPVOID)&WaveFormat, sizeof(KSDATAFORMAT_WAVEFORMATEX), NULL);
178
179 DPRINT("dwResult %x\n", dwResult);
180
181
182 if (dwResult == ERROR_SUCCESS)
183 {
184 /* found a compatible audio range */
185 WaveFormatOut->cbSize = 0;
186 WaveFormatOut->nBlockAlign = WaveFormatEx->nBlockAlign;
187 WaveFormatOut->wFormatTag = WaveFormatEx->wFormatTag;
188 WaveFormatOut->nAvgBytesPerSec = (nBitsPerSample / 8) * nChannels * SampleFrequency;
189 WaveFormatOut->wBitsPerSample = nBitsPerSample;
190 WaveFormatOut->nSamplesPerSec = SampleFrequency;
191 WaveFormatOut->nChannels = nChannels;
192
193 /* free buffer */
195
196 DPRINT("InFormat nChannels %u wBitsPerSample %u nSamplesPerSec %u\nOutFormat nChannels %u nBitsPerSample %u nSamplesPerSec %u\n",
197 WaveFormatEx->nChannels, WaveFormatEx->wBitsPerSample, WaveFormatEx->nSamplesPerSec,
198 WaveFormatOut->nChannels, WaveFormatOut->wBitsPerSample, WaveFormatOut->nSamplesPerSec);
199
200 return TRUE;
201 }
202 }
203 }
204
205 /* free buffer */
207 ASSERT(0);
208 return FALSE;
209}
210
211DWORD
213 HANDLE hFilter,
214 ULONG PinId,
215 LPWAVEFORMATEX WaveFormatEx,
216 PHANDLE hPin,
217 BOOL bLoop)
218{
220 PKSPIN_CONNECT PinConnect;
222
223 /* calculate request size */
224 Size = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX);
225
227 if (!PinConnect)
228 {
229 /* not enough memory */
230 return DSERR_OUTOFMEMORY;
231 }
232 /* build pin request */
234
235 if (bLoop)
237 else
239
240 PinConnect->Interface.Flags = 0;
241 PinConnect->Medium.Set = KSMEDIUMSETID_Standard;
242 PinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE;
243 PinConnect->Medium.Flags = 0;
244 PinConnect->PinToHandle = NULL;
245 PinConnect->PinId = PinId;
247 PinConnect->Priority.PrioritySubClass = 1;
248
249 DataFormat = (PKSDATAFORMAT_WAVEFORMATEX) (PinConnect + 1);
250
251 /* initialize data format */
252 DataFormat->WaveFormatEx.wFormatTag = WaveFormatEx->wFormatTag;
253 DataFormat->WaveFormatEx.nChannels = WaveFormatEx->nChannels;
254 DataFormat->WaveFormatEx.nSamplesPerSec = WaveFormatEx->nSamplesPerSec;
255 DataFormat->WaveFormatEx.nBlockAlign = WaveFormatEx->nBlockAlign;
256 DataFormat->WaveFormatEx.nAvgBytesPerSec = WaveFormatEx->nAvgBytesPerSec;
257 DataFormat->WaveFormatEx.wBitsPerSample = WaveFormatEx->wBitsPerSample;
258 DataFormat->WaveFormatEx.cbSize = 0;
259 DataFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX);
260 DataFormat->DataFormat.Flags = 0;
261 DataFormat->DataFormat.Reserved = 0;
262 DataFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
263
264 DataFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
265 DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
266 DataFormat->DataFormat.SampleSize = 4;
267
268 Result = KsCreatePin(hFilter, PinConnect, GENERIC_READ | GENERIC_WRITE, hPin);
269
270 HeapFree(GetProcessHeap(), 0, PinConnect);
271
272 return Result;
273}
274
275
276DWORD
279 IN PHANDLE OutHandle)
280{
282
283 /* open the filter */
285
286 /* check for success */
288 {
289 DPRINT("Failed to open Filter %ws\n", lpFileName);
290 return GetLastError();
291 }
292
293 *OutHandle = Handle;
294 return ERROR_SUCCESS;
295}
296
297DWORD
301 IN LPVOID InBuffer,
306{
307 OVERLAPPED Overlapped;
308 BOOLEAN IoResult;
309 DWORD Transferred = 0;
310
311 /* Overlapped I/O is done here - this is used for waiting for completion */
312 ZeroMemory(&Overlapped, sizeof(OVERLAPPED));
313 Overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
314
315 if (!Overlapped.hEvent)
316 return GetLastError();
317
318 /* Talk to the device */
319 IoResult = DeviceIoControl(Handle,
321 InBuffer,
323 OutBuffer,
326 &Overlapped);
327
328 /* If failure occurs, make sure it's not just due to the overlapped I/O */
329 if (!IoResult)
330 {
332 {
333 CloseHandle(Overlapped.hEvent);
334 return GetLastError();
335 }
336 }
337
338 /* Wait for the I/O to complete */
339 IoResult = GetOverlappedResult(Handle,
340 &Overlapped,
341 &Transferred,
342 TRUE);
343
344 /* Don't need this any more */
345 CloseHandle(Overlapped.hEvent);
346
347 if (!IoResult)
348 return GetLastError();
349
350 if ( BytesTransferred )
351 *BytesTransferred = Transferred;
352
353 return ERROR_SUCCESS;
354}
355
356DWORD
358 IN HANDLE hFilter,
359 OUT PULONG NumPins)
360{
362
363 *NumPins = 0;
364
365 /* setup the pin request */
367 Pin.Set = KSPROPSETID_Pin;
369
370 /* query the device */
371 return SyncOverlappedDeviceIoControl(hFilter, IOCTL_KS_PROPERTY, (LPVOID)&Pin, sizeof(KSPROPERTY), (PVOID)NumPins, sizeof(ULONG), NULL);
372}
373
374DWORD
376 IN HANDLE hFilter,
378 OUT PKSMULTIPLE_ITEM *OutMultipleItem)
379{
381 PKSMULTIPLE_ITEM MultipleItem;
383
384 /* setup query request */
385 Property.Id = PropertyId;
388
389 /* query the size */
391
392 if (Status != ERROR_MORE_DATA)
393 {
394 /* failed */
395 DPRINT("Failed to query PropertyId %lu ErrorCode %lx\n", PropertyId, Status);
396 return Status;
397 }
398
399 MultipleItem = HeapAlloc(GetProcessHeap(), 0, BytesReturned);
400 if (!MultipleItem)
401 {
402 /* not enough memory */
403 DPRINT("Failed to allocate %u Bytes\n", BytesReturned);
404 return ERROR_OUTOFMEMORY;
405 }
406
407 /* retrieve data ranges */
409
410
411 if (Status != ERROR_SUCCESS)
412 {
413 /* failed to get data ranges */
414 DPRINT("SyncOverlappedDeviceIoControl failed with %lx\n", Status);
415
416 HeapFree(GetProcessHeap(), 0, MultipleItem);
417 return Status;
418 }
419
420 /* save result */
421 *OutMultipleItem = MultipleItem;
422 return Status;
423
424}
425
426DWORD
428 IN HANDLE hFilter,
429 IN ULONG PinId,
430 OUT PKSPIN_COMMUNICATION Communication)
431{
433
437 Property.PinId = PinId;
438 Property.Reserved = 0;
439
440 return SyncOverlappedDeviceIoControl(hFilter, IOCTL_KS_PROPERTY, (LPVOID)&Property, sizeof(KSP_PIN), (LPVOID)Communication, sizeof(KSPIN_COMMUNICATION), NULL);
441}
442
443DWORD
445 IN HANDLE hFilter,
446 IN ULONG PinId,
448{
450
454 Property.PinId = PinId;
455 Property.Reserved = 0;
456
458}
459
460DWORD
462 IN HANDLE hFilter,
463 IN ULONG PinId,
464 IN OUT PKSMULTIPLE_ITEM * OutMultipleItem)
465{
469 PKSMULTIPLE_ITEM MultipleItem;
470
471 /* prepare request */
472 Property.Reserved = 0;
473 Property.PinId = PinId;
477
478 /* retrieve size of data ranges buffer */
480
481#if 0
482 if (Status != ERROR_MORE_DATA)
483 {
484 DPRINT("SyncOverlappedDeviceIoControl failed with %lx\n", Status);
485 return Status;
486 }
487#endif
488
490 MultipleItem = HeapAlloc(GetProcessHeap(), 0, BytesReturned);
491 if (!MultipleItem)
492 {
493 /* not enough memory */
494 DPRINT("Failed to allocate %u Bytes\n", BytesReturned);
495 return ERROR_OUTOFMEMORY;
496 }
497
498 /* retrieve data ranges */
500
501
502 if (Status != ERROR_SUCCESS)
503 {
504 /* failed to get data ranges */
505 DPRINT("SyncOverlappedDeviceIoControl failed with %lx\n", Status);
506
507 HeapFree(GetProcessHeap(), 0, MultipleItem);
508 return Status;
509 }
510
511 /* save result */
512 *OutMultipleItem = MultipleItem;
513 return Status;
514}
515
516BOOL
518 IN HANDLE hFilter,
519 IN DWORD PinId,
520 IN BOOL bLoop,
521 IN LPWAVEFORMATEX WaveFormatEx,
522 OUT LPWAVEFORMATEX WaveFormatOut,
523 OUT PHANDLE hPin)
524{
526 PKSDATARANGE_AUDIO AudioRange;
527 DWORD dwResult;
528 DWORD dwIndex, nChannels;
529
530 dwResult = GetFilterPinDataRanges(hFilter, PinId, &Item);
531
532 if (dwResult != ERROR_SUCCESS)
533 {
534 /* failed to get data ranges */
535 return FALSE;
536 }
537
538 CopyMemory(WaveFormatOut, WaveFormatEx, sizeof(WAVEFORMATEX));
539
540 /* iterate through all dataranges */
541 AudioRange = (PKSDATARANGE_AUDIO)(Item + 1);
542 for(dwIndex = 0; dwIndex < Item->Count; dwIndex++)
543 {
544 if (AudioRange->DataRange.FormatSize != sizeof(KSDATARANGE_AUDIO))
545 {
547 AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize);
548 continue;
549 }
550
551 if (WaveFormatOut->nSamplesPerSec < AudioRange->MinimumSampleFrequency)
552 WaveFormatOut->nSamplesPerSec = AudioRange->MinimumSampleFrequency;
553 else if (WaveFormatOut->nSamplesPerSec > AudioRange->MaximumSampleFrequency)
554 WaveFormatOut->nSamplesPerSec = AudioRange->MaximumSampleFrequency;
555
556 if (WaveFormatOut->wBitsPerSample < AudioRange->MinimumBitsPerSample)
557 WaveFormatOut->wBitsPerSample = AudioRange->MinimumBitsPerSample;
558 else if (WaveFormatOut->wBitsPerSample > AudioRange->MaximumBitsPerSample)
559 WaveFormatOut->wBitsPerSample = AudioRange->MaximumBitsPerSample;
560
561 DPRINT("MinimumBitsPerSample %u MaximumBitsPerSample %u MinimumSampleFrequency %u MaximumSampleFrequency %u\n",
562 AudioRange->MinimumBitsPerSample, AudioRange->MaximumBitsPerSample, AudioRange->MinimumSampleFrequency, AudioRange->MaximumSampleFrequency);
563
564 for(nChannels = 1; nChannels <= AudioRange->MaximumChannels; nChannels++)
565 {
566 WaveFormatOut->nChannels = nChannels;
567
568 dwResult = OpenPin(hFilter, PinId, WaveFormatOut, hPin, TRUE);
569 if (dwResult == ERROR_SUCCESS)
570 {
571 DPRINT("InFormat nChannels %u wBitsPerSample %u nSamplesPerSec %u\nOutFormat nChannels %u nBitsPerSample %u nSamplesPerSec %u\n",
572 WaveFormatEx->nChannels, WaveFormatEx->wBitsPerSample, WaveFormatEx->nSamplesPerSec,
573 WaveFormatOut->nChannels, WaveFormatOut->wBitsPerSample, WaveFormatOut->nSamplesPerSec);
574
575
576 /* free buffer */
578 return TRUE;
579 }
580 }
581 AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize);
582 }
583
584 /* free buffer */
586 return FALSE;
587}
588
static USHORT USHORT * NewLength
unsigned char BOOLEAN
#define UNIMPLEMENTED
Definition: debug.h:115
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: cdrom.h:932
Definition: bufpool.h:45
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_IO_PENDING
Definition: dderror.h:15
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
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
DataFlow
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
const GUID KSPROPSETID_Audio
Definition: misc.c:14
const GUID KSPROPSETID_Pin
Definition: misc.c:12
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
DWORD GetFilterPinDataRanges(IN HANDLE hFilter, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: misc.c:461
VOID PerformChannelConversion(PUCHAR Buffer, ULONG BufferLength, PULONG BytesRead, ULONG OldChannels, ULONG NewChannels, ULONG BitsPerSample, PUCHAR Result, ULONG ResultLength, PULONG BytesWritten)
Definition: misc.c:18
DWORD OpenPin(HANDLE hFilter, ULONG PinId, LPWAVEFORMATEX WaveFormatEx, PHANDLE hPin, BOOL bLoop)
Definition: misc.c:212
DWORD OpenFilter(IN LPCWSTR lpFileName, IN PHANDLE OutHandle)
Definition: misc.c:277
BOOL CreateCompatiblePin(IN HANDLE hFilter, IN DWORD PinId, IN BOOL bLoop, IN LPWAVEFORMATEX WaveFormatEx, OUT LPWAVEFORMATEX WaveFormatOut, OUT PHANDLE hPin)
Definition: misc.c:517
DWORD GetFilterPinCount(IN HANDLE hFilter, OUT PULONG NumPins)
Definition: misc.c:357
DWORD GetFilterNodeProperty(IN HANDLE hFilter, IN ULONG PropertyId, OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: misc.c:375
const GUID KSPROPSETID_Topology
Definition: misc.c:13
DWORD GetFilterPinDataFlow(IN HANDLE hFilter, IN ULONG PinId, OUT PKSPIN_DATAFLOW DataFlow)
Definition: misc.c:444
BOOL DoDataIntersection(HANDLE hFilter, DWORD PinId, DWORD SampleFrequency, LPWAVEFORMATEX WaveFormatEx, DWORD MinimumBitsPerSample, DWORD MaximumBitsPerSample, DWORD MaximumChannels, LPWAVEFORMATEX WaveFormatOut)
Definition: misc.c:116
BOOL SetPinFormat(IN HANDLE hPin, IN LPWAVEFORMATEX WaveFormatEx)
Definition: misc.c:77
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define GENERIC_READ
Definition: compat.h:135
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define DSERR_OUTOFMEMORY
Definition: dsound.h:125
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
BOOL WINAPI GetOverlappedResult(IN HANDLE hFile, IN LPOVERLAPPED lpOverlapped, OUT LPDWORD lpNumberOfBytesTransferred, IN BOOL bWait)
Definition: iocompl.c:221
#define KSPRIORITY_NORMAL
Definition: ks.h:1386
#define KSMEDIUM_TYPE_ANYINSTANCE
Definition: ks.h:301
@ KSPROPERTY_CONNECTION_DATAFORMAT
Definition: ks.h:351
#define KSMEDIUMSETID_Standard
Definition: ks.h:306
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
@ KSPROPERTY_PIN_COMMUNICATION
Definition: ks.h:632
@ KSPROPERTY_PIN_DATAINTERSECTION
Definition: ks.h:629
@ KSPROPERTY_PIN_DATARANGES
Definition: ks.h:628
@ KSPROPERTY_PIN_CTYPES
Definition: ks.h:626
@ KSPROPERTY_PIN_DATAFLOW
Definition: ks.h:627
KSPIN_DATAFLOW
Definition: ks.h:1248
enum KSPIN_DATAFLOW * PKSPIN_DATAFLOW
#define KSPROPSETID_Connection
Definition: ks.h:346
KSPIN_COMMUNICATION
Definition: ks.h:1253
@ KSINTERFACE_STANDARD_STREAMING
Definition: ks.h:283
@ KSINTERFACE_STANDARD_LOOPED_STREAMING
Definition: ks.h:284
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM
#define KSINTERFACESETID_Standard
Definition: ks.h:280
enum KSPIN_COMMUNICATION * PKSPIN_COMMUNICATION
struct KSDATAFORMAT_WAVEFORMATEX * PKSDATAFORMAT_WAVEFORMATEX
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
struct KSDATARANGE_AUDIO * PKSDATARANGE_AUDIO
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:983
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:1031
KSDDKAPI DWORD NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
Definition: ksuser.c:192
#define ASSERT(a)
Definition: mode.c:44
#define FILE_FLAG_OVERLAPPED
Definition: disk.h:46
#define GENERIC_WRITE
Definition: nt_native.h:90
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
int nChannels
Definition: pcmconverter.c:95
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4071
#define DPRINT
Definition: sndvol32.h:71
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
ULONG MaximumChannels
Definition: ksmedia.h:680
ULONG MinimumBitsPerSample
Definition: ksmedia.h:681
ULONG MaximumBitsPerSample
Definition: ksmedia.h:682
ULONG MaximumSampleFrequency
Definition: ksmedia.h:684
KSDATARANGE DataRange
Definition: ksmedia.h:679
ULONG MinimumSampleFrequency
Definition: ksmedia.h:683
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
GUID Set
Definition: dmksctrl.h:76
ULONG PinId
Definition: ks.h:2603
KSPIN_MEDIUM Medium
Definition: ks.h:2602
KSPRIORITY Priority
Definition: ks.h:2605
KSPIN_INTERFACE Interface
Definition: ks.h:2601
HANDLE PinToHandle
Definition: ks.h:2604
ULONG PriorityClass
Definition: ks.h:1391
ULONG PrioritySubClass
Definition: ks.h:1392
Definition: ks.h:642
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125
ULONG Flags
Definition: ntfs.h:536
HANDLE hEvent
Definition: winbase.h:820
WORD nBlockAlign
Definition: mmreg.h:82
WORD cbSize
Definition: mmreg.h:84
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nChannels
Definition: mmreg.h:79
WORD wFormatTag
Definition: mmreg.h:78
WORD wBitsPerSample
Definition: mmreg.h:83
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t * LPDWORD
Definition: typedefs.h:59
#define IN
Definition: typedefs.h:39
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_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_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052
_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
_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
#define ZeroMemory
Definition: winbase.h:1670
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
_In_ LPCSTR lpFileName
Definition: winbase.h:3058
#define CreateEvent
Definition: winbase.h:3619
#define CopyMemory
Definition: winbase.h:1668
_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
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185