ReactOS 0.4.16-dev-197-g92996da
primary.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/primary.c
5 * PURPOSE: Primary IDirectSoundBuffer8 implementation
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9
10
11#include "precomp.h"
12
13typedef struct
14{
15 const IDirectSoundBuffer8Vtbl *lpVtbl;
17
29
35 LPVOID* ppobj)
36{
37 LPOLESTR pStr;
39
41 IsEqualIID(riid, &IID_IDirectSoundBuffer) ||
42 IsEqualIID(riid, &IID_IDirectSoundBuffer8))
43 {
44 *ppobj = (LPVOID)&This->lpVtbl;
46 return S_OK;
47 }
48
49 if (SUCCEEDED(StringFromIID(riid, &pStr)))
50 {
51 DPRINT("No Interface for class %s\n", pStr);
52 CoTaskMemFree(pStr);
53 }
54 return E_NOINTERFACE;
55}
56
61{
62 ULONG ref;
64
66
67 return ref;
68
69}
70
75{
76 ULONG ref;
78
79 ref = InterlockedDecrement(&(This->ref));
80
81 if (!ref)
82 {
83 if (This->hPin)
84 {
85 /* close pin handle */
86 CloseHandle(This->hPin);
87 }
88 /* free primary buffer */
90 }
91
92 return ref;
93}
94
99 LPDSBCAPS pDSBufferCaps)
100{
102
103 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetCaps\n");
104
105 if (!pDSBufferCaps)
106 {
107 /* invalid parameter */
108 return DSERR_INVALIDPARAM;
109 }
110
111 if (pDSBufferCaps->dwSize < sizeof(DSBCAPS))
112 {
113 /* invalid buffer size */
114 return DSERR_INVALIDPARAM;
115 }
116
117 /* get buffer details */
118 pDSBufferCaps->dwUnlockTransferRate = 0;
119 pDSBufferCaps->dwPlayCpuOverhead = 0;
120 pDSBufferCaps->dwSize = 0; //FIXME
121 pDSBufferCaps->dwFlags = This->dwFlags;
122
123 return DS_OK;
124}
125
127WINAPI
130 LPDWORD pdwCurrentPlayCursor,
131 LPDWORD pdwCurrentWriteCursor)
132{
134
135 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetCurrentPosition\n");
136
137 if (This->dwLevel < DSSCL_PRIORITY)
138 {
139 /* needs priority level */
141 }
142
143 if (!pdwCurrentPlayCursor && !pdwCurrentWriteCursor)
144 {
145 /* all parameters are null */
146 return DSERR_INVALIDPARAM;
147 }
148
150 return DSERR_INVALIDPARAM;
151}
152
154WINAPI
157 LPWAVEFORMATEX pwfxFormat,
158 DWORD dwSizeAllocated,
159 LPDWORD pdwSizeWritten)
160{
161 DWORD FormatSize;
163
164 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetFormat\n");
165
166 FormatSize = sizeof(WAVEFORMATEX) + This->Format.cbSize;
167
168 if (!pwfxFormat && !pdwSizeWritten)
169 {
170 /* invalid parameter */
171 return DSERR_INVALIDPARAM;
172 }
173
174 if (!pwfxFormat)
175 {
176 /* return required format size */
177 *pdwSizeWritten = FormatSize;
178 return DS_OK;
179 }
180 else
181 {
182 if (dwSizeAllocated >= FormatSize)
183 {
184 /* copy format */
185 CopyMemory(pwfxFormat, &This->Format, FormatSize);
186
187 if (pdwSizeWritten)
188 *pdwSizeWritten = FormatSize;
189
190 return DS_OK;
191 }
192 /* buffer too small */
193 if (pdwSizeWritten)
194 *pdwSizeWritten = 0;
195
196 return DSERR_INVALIDPARAM;
197 }
198}
199
201WINAPI
204 LPLONG plVolume)
205{
207
208 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetVolume\n");
209
210 if (!plVolume)
211 {
212 /* invalid parameter */
213 return DSERR_INVALIDPARAM;
214 }
215
216 /* get volume */
217 *plVolume = This->Volume;
218
219 return DS_OK;
220}
221
223WINAPI
226 LPLONG plPan)
227{
229
230 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetPan\n");
231
232 if (!plPan)
233 {
234 /* invalid parameter */
235 return DSERR_INVALIDPARAM;
236 }
237
238 /* get frequency */
239 *plPan = This->VolumePan;
240
241 return DS_OK;
242}
243
245WINAPI
248 LPDWORD pdwFrequency)
249{
251
252 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetFrequency\n");
253
254 if (!pdwFrequency)
255 {
256 /* invalid parameter */
257 return DSERR_INVALIDPARAM;
258 }
259
260 /* get frequency */
261 *pdwFrequency = This->dwFrequency;
262
263 return DS_OK;
264}
265
267WINAPI
270 LPDWORD pdwStatus)
271{
273
274 DPRINT("PrimaryDirectSoundBuffer8Impl_fnGetStatus\n");
275
276 if (!pdwStatus)
277 {
278 /* invalid parameter */
279 return DSERR_INVALIDPARAM;
280 }
281
282 *pdwStatus = 0;
283 if (This->State == KSSTATE_RUN || This->State == KSSTATE_ACQUIRE)
284 {
285 /* buffer is playing */
286 *pdwStatus |= DSBSTATUS_PLAYING | DSBSTATUS_LOOPING;
287 }
288
289 return DS_OK;
290}
291
293WINAPI
296 LPDIRECTSOUND pDirectSound,
297 LPCDSBUFFERDESC pcDSBufferDesc)
298{
299 /* RTFM */
301}
302
304WINAPI
308 DWORD dwBytes,
309 LPVOID *ppvAudioPtr1,
310 LPDWORD pdwAudioBytes1,
311 LPVOID *ppvAudioPtr2,
312 LPDWORD pdwAudioBytes2,
314{
316 return DSERR_INVALIDPARAM;
317}
318
320WINAPI
323 DWORD dwReserved1,
324 DWORD dwPriority,
326{
328
329 DPRINT("PrimaryDirectSoundBuffer8Impl_fnPlay dwFlags %x\n", dwFlags);
330
331 if (dwReserved1 != 0 || !(dwFlags & DSBPLAY_LOOPING))
332 {
333 /* invalid parameter */
334 return DSERR_INVALIDPARAM;
335 }
336
338
339 if (This->State == KSSTATE_STOP)
340 {
342 ASSERT(This->State == KSSTATE_ACQUIRE);
343 }
344
345 if (This->State == KSSTATE_ACQUIRE)
346 {
348 ASSERT(This->State == KSSTATE_PAUSE);
349 }
350
351 if (This->State == KSSTATE_PAUSE)
352 {
354 ASSERT(This->State == KSSTATE_RUN);
355 }
356
358
359 return DS_OK;
360}
361
363WINAPI
366 DWORD dwNewPosition)
367{
368 /* The position of a primary buffer can't be set */
369 return DSERR_INVALIDCALL;
370}
371
373WINAPI
376 LPCWAVEFORMATEX pcfxFormat)
377{
379
380 if (This->dwLevel == DSSCL_NORMAL)
381 {
382 /* can't change format with this level */
384 }
385
386 ASSERT(pcfxFormat->cbSize == 0);
387
388
389 DPRINT("This %p Format: Tag %x nChannels %u nSamplesPerSec %u nAvgBytesPerSec %u nBlockAlign %u wBitsPerSample %u cbSize %u\n", This,
390 pcfxFormat->wFormatTag, pcfxFormat->nChannels, pcfxFormat->nSamplesPerSec, pcfxFormat->nAvgBytesPerSec, pcfxFormat->nBlockAlign, pcfxFormat->wBitsPerSample, pcfxFormat->cbSize);
391
392 CopyMemory(&This->Format, pcfxFormat, sizeof(WAVEFORMATEX));
393
394 return DS_OK;
395}
396
398WINAPI
401 LONG lVolume)
402{
404
405 if (lVolume < DSBVOLUME_MIN || lVolume > DSBVOLUME_MAX)
406 {
407 /* invalid parameter */
408 return DSERR_INVALIDPARAM;
409 }
410
411 /* TODO: call volume node */
412
413 /* Store volume */
414 This->Volume = lVolume;
415
416 return DS_OK;
417}
418
420WINAPI
423 LONG lPan)
424{
426
427 if (lPan < DSBPAN_LEFT || lPan > DSBPAN_RIGHT)
428 {
429 /* invalid parameter */
430 return DSERR_INVALIDPARAM;
431 }
432
433 /* TODO: call volume node */
434
435 /* Store volume pan */
436 This->VolumePan = lPan;
437
438 return DS_OK;
439}
440
442WINAPI
445 DWORD dwFrequency)
446{
448
449 if (This->dwLevel < DSSCL_PRIORITY)
450 {
451 /* needs priority level */
453 }
454
455 /* invalid request */
457}
458
460WINAPI
463{
465
466 DPRINT("PrimaryDirectSoundBuffer8Impl_fnStop\n");
467
469
470 if (This->State == KSSTATE_RUN)
471 {
473 ASSERT(This->State == KSSTATE_PAUSE);
474 }
475
476 if (This->State == KSSTATE_PAUSE)
477 {
479 ASSERT(This->State == KSSTATE_ACQUIRE);
480 }
481
482 if (This->State == KSSTATE_ACQUIRE)
483 {
485 ASSERT(This->State == KSSTATE_STOP);
486 }
487
489
490 return DS_OK;
491}
492
493
495WINAPI
498 LPVOID pvAudioPtr1,
499 DWORD dwAudioBytes1,
500 LPVOID pvAudioPtr2,
501 DWORD dwAudioBytes2)
502{
504 return DSERR_INVALIDPARAM;
505}
506
507
509WINAPI
512{
514 return DSERR_INVALIDPARAM;
515}
516
517
519WINAPI
522 DWORD dwEffectsCount,
523 LPDSEFFECTDESC pDSFXDesc,
524 LPDWORD pdwResultCodes)
525{
527 return DSERR_INVALIDPARAM;
528}
529
531WINAPI
535 DWORD dwEffectsCount,
536 LPDWORD pdwResultCodes)
537{
539 return DSERR_INVALIDPARAM;
540}
541
543WINAPI
546 REFGUID rguidObject,
547 DWORD dwIndex,
548 REFGUID rguidInterface,
549 LPVOID *ppObject)
550{
552 return DSERR_INVALIDPARAM;
553}
554
555static IDirectSoundBuffer8Vtbl vt_DirectSoundBuffer8 =
556{
557 /* IUnknown methods */
561 /* IDirectSoundBuffer methods */
580 /* IDirectSoundBuffer8 methods */
584};
585
586DWORD
591{
594 OVERLAPPED Overlapped;
595
597
598 ZeroMemory(&Overlapped, sizeof(OVERLAPPED));
599 Overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
600
601
602 ASSERT(This->hPin);
604
605 Header.FrameExtent = BufferSize;
606 Header.DataUsed = BufferSize;
607 Header.Data = Buffer;
608 Header.Size = sizeof(KSSTREAM_HEADER);
609 Header.PresentationTime.Numerator = 1;
610 Header.PresentationTime.Denominator = 1;
611
613
614 if (Result != ERROR_SUCCESS)
615 return 0;
616
617 return BytesTransferred;
618}
619
620VOID
624{
628
629 if (This->State == State)
630 return;
631
635
637 if (Result == ERROR_SUCCESS)
638 {
639 This->State = State;
640 }
641}
642
646 LPDWORD pdwCurrentPlayCursor,
647 LPDWORD pdwCurrentWriteCursor)
648{
653
654 //DPRINT("PrimaryDirectSoundBuffer_GetPosition\n");
655
656 if (!This->hPin)
657 {
658 if (pdwCurrentPlayCursor)
659 *pdwCurrentPlayCursor = 0;
660
661 if (pdwCurrentWriteCursor)
662 *pdwCurrentWriteCursor = 0;
663
664 DPRINT("No Audio Pin\n");
665 return DS_OK;
666 }
667
668 /* setup audio position property request */
672
673
675
676 if (Result != ERROR_SUCCESS)
677 {
678 DPRINT("GetPosition failed with %x\n", Result);
679 return DSERR_UNSUPPORTED;
680 }
681
682 //DPRINT("Play %I64u Write %I64u \n", Position.PlayOffset, Position.WriteOffset);
683
684 if (pdwCurrentPlayCursor)
685 *pdwCurrentPlayCursor = (DWORD)Position.PlayOffset;
686
687 if (pdwCurrentWriteCursor)
688 *pdwCurrentWriteCursor = (DWORD)Position.WriteOffset;
689
690 return DS_OK;
691}
692
696 LPWAVEFORMATEX pcfxFormat,
697 BOOL bLooped)
698{
699 ULONG PinId, DeviceId = 0, Result;
701
702 if (This->hPin)
703 {
704 // FIXME
705 // check if multiple buffers are active
706 // in that case need mixing
707
708 if (SetPinFormat(This->hPin, pcfxFormat))
709 return DS_OK;
710 else
711 return DSERR_GENERIC;
712 }
713
714 do
715 {
716 /* try all available recording pins on that filter */
717 PinId = GetPinIdFromFilter(This->Filter, FALSE, DeviceId);
718 DPRINT("PinId %u DeviceId %u\n", PinId, DeviceId);
719
720 if (PinId == ULONG_MAX)
721 break;
722
723 Result = OpenPin(This->Filter->hFilter, PinId, (LPWAVEFORMATEX)pcfxFormat, &This->hPin, bLooped);
724 DPRINT("PinId %u Result %u\n", PinId, Result);
725 if (Result == ERROR_SUCCESS)
726 {
727 This->dwFrequency = pcfxFormat->nSamplesPerSec;
728 break;
729 }
730
731 This->hPin = NULL;
732 DeviceId++;
733 }while(TRUE);
734
735 if (!This->hPin)
736 {
737 DPRINT("PrimaryDirectSoundBuffer8Impl_fnSetFormat failed\n");
738 return DSERR_INVALIDPARAM;
739 }
740
741 DPRINT("PrimaryDirectSoundBuffer8Impl_fnSetFormat success\n");
742 return DS_OK;
743}
744
745VOID
748{
750
752
753
754}
755
756VOID
759{
761
763
764}
765
766
771 DWORD dwLevel,
773{
775
776 if (!This)
777 {
778 /* not enough memory */
779 return DSERR_OUTOFMEMORY;
780 }
781
782 This->ref = 1;
783 This->lpVtbl = &vt_DirectSoundBuffer8;
784 This->Filter = Filter;
785 This->dwLevel = dwLevel;
786 This->dwFlags = dwFlags;
787 This->dwFrequency = 0;
788 This->Volume = DSBVOLUME_MAX;
789 This->VolumePan = DSBPAN_CENTER;
790 This->hPin = NULL;
791
792 /* FIXME: determine default format for audio device */
793 This->Format.cbSize = sizeof(WAVEFORMATEX);
794 This->Format.nChannels = 2;
795 This->Format.nSamplesPerSec = 44100;
796 This->Format.wBitsPerSample = 16;
797 This->Format.wFormatTag = WAVE_FORMAT_PCM;
798 This->Format.nBlockAlign = (This->Format.nChannels * This->Format.wBitsPerSample) / 8;
799 This->Format.nAvgBytesPerSec = (This->Format.nChannels * This->Format.nSamplesPerSec * This->Format.wBitsPerSample) / 8;
800
802
804 return DS_OK;
805}
806
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WAVE_FORMAT_PCM
Definition: constants.h:425
const GUID IID_IUnknown
#define UNIMPLEMENTED
Definition: debug.h:118
Definition: bufpool.h:45
Definition: Header.h:9
#define BufferSize
Definition: mmc.h:75
#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
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
ULONG GetPinIdFromFilter(LPFILTERINFO Filter, BOOL bCapture, ULONG Offset)
Definition: devicelist.c:13
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 OpenPin(HANDLE hFilter, ULONG PinId, LPWAVEFORMATEX WaveFormatEx, PHANDLE hPin, BOOL bLoop)
Definition: misc.c:212
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 HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define DSERR_ALREADYINITIALIZED
Definition: dsound.h:129
#define DSERR_CONTROLUNAVAIL
Definition: dsound.h:120
#define DSERR_UNSUPPORTED
Definition: dsound.h:127
#define DSBPAN_CENTER
Definition: dsound.h:227
#define DSERR_OUTOFMEMORY
Definition: dsound.h:125
#define DSBSTATUS_LOOPING
Definition: dsound.h:198
#define DSBVOLUME_MAX
Definition: dsound.h:229
#define DSSCL_NORMAL
Definition: dsound.h:247
#define DSERR_INVALIDCALL
Definition: dsound.h:122
#define DSSCL_PRIORITY
Definition: dsound.h:248
struct IDirectSound * LPDIRECTSOUND
Definition: dsound.h:70
#define DSBSTATUS_PLAYING
Definition: dsound.h:196
#define DS_OK
Definition: dsound.h:116
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
struct IDirectSoundBuffer8 * LPDIRECTSOUNDBUFFER8
Definition: dsound.h:79
#define DSBPLAY_LOOPING
Definition: dsound.h:189
#define DSERR_PRIOLEVELNEEDED
Definition: dsound.h:124
#define DSERR_GENERIC
Definition: dsound.h:123
#define DSBPAN_RIGHT
Definition: dsound.h:228
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnRestore(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:510
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetCurrentPosition(LPDIRECTSOUNDBUFFER8 iface, LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor)
Definition: primary.c:128
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnPlay(LPDIRECTSOUNDBUFFER8 iface, DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags)
Definition: primary.c:321
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetPan(LPDIRECTSOUNDBUFFER8 iface, LPLONG plPan)
Definition: primary.c:224
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetCaps(LPDIRECTSOUNDBUFFER8 iface, LPDSBCAPS pDSBufferCaps)
Definition: primary.c:97
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetVolume(LPDIRECTSOUNDBUFFER8 iface, LPLONG plVolume)
Definition: primary.c:202
ULONG WINAPI PrimaryDirectSoundBuffer8Impl_fnAddRef(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:59
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnSetCurrentPosition(LPDIRECTSOUNDBUFFER8 iface, DWORD dwNewPosition)
Definition: primary.c:364
VOID PrimaryDirectSoundBuffer_ReleaseLock(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:757
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnQueryInterface(LPDIRECTSOUNDBUFFER8 iface, IN REFIID riid, LPVOID *ppobj)
Definition: primary.c:32
VOID PrimaryDirectSoundBuffer_AcquireLock(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:746
DWORD PrimaryDirectSoundBuffer_Write(LPDIRECTSOUNDBUFFER8 iface, LPVOID Buffer, DWORD BufferSize)
Definition: primary.c:587
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnLock(LPDIRECTSOUNDBUFFER8 iface, DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags)
Definition: primary.c:305
HRESULT NewPrimarySoundBuffer(LPDIRECTSOUNDBUFFER8 *OutBuffer, LPFILTERINFO Filter, DWORD dwLevel, DWORD dwFlags)
Definition: primary.c:768
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnSetFX(LPDIRECTSOUNDBUFFER8 iface, DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes)
Definition: primary.c:520
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetFormat(LPDIRECTSOUNDBUFFER8 iface, LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten)
Definition: primary.c:155
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnSetFrequency(LPDIRECTSOUNDBUFFER8 iface, DWORD dwFrequency)
Definition: primary.c:443
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnStop(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:461
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnUnlock(LPDIRECTSOUNDBUFFER8 iface, LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2)
Definition: primary.c:496
static IDirectSoundBuffer8Vtbl vt_DirectSoundBuffer8
Definition: primary.c:555
ULONG WINAPI PrimaryDirectSoundBuffer8Impl_fnRelease(LPDIRECTSOUNDBUFFER8 iface)
Definition: primary.c:73
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnSetFormat(LPDIRECTSOUNDBUFFER8 iface, LPCWAVEFORMATEX pcfxFormat)
Definition: primary.c:374
VOID PrimaryDirectSoundBuffer_SetState(LPDIRECTSOUNDBUFFER8 iface, KSSTATE State)
Definition: primary.c:621
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnSetPan(LPDIRECTSOUNDBUFFER8 iface, LONG lPan)
Definition: primary.c:421
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnSetVolume(LPDIRECTSOUNDBUFFER8 iface, LONG lVolume)
Definition: primary.c:399
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetObjectInPath(LPDIRECTSOUNDBUFFER8 iface, REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject)
Definition: primary.c:544
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnAcquireResources(LPDIRECTSOUNDBUFFER8 iface, DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes)
Definition: primary.c:532
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetFrequency(LPDIRECTSOUNDBUFFER8 iface, LPDWORD pdwFrequency)
Definition: primary.c:246
HRESULT PrimaryDirectSoundBuffer_GetPosition(LPDIRECTSOUNDBUFFER8 iface, LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor)
Definition: primary.c:644
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnGetStatus(LPDIRECTSOUNDBUFFER8 iface, LPDWORD pdwStatus)
Definition: primary.c:268
HRESULT PrimaryDirectSoundBuffer_SetFormat(LPDIRECTSOUNDBUFFER8 iface, LPWAVEFORMATEX pcfxFormat, BOOL bLooped)
Definition: primary.c:694
struct CDirectSoundBuffer * LPCDirectSoundBuffer
HRESULT WINAPI PrimaryDirectSoundBuffer8Impl_fnInitialize(LPDIRECTSOUNDBUFFER8 iface, LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc)
Definition: primary.c:294
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define ULONG_MAX
Definition: limits.h:44
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ KSPROPERTY_CONNECTION_STATE
Definition: ks.h:349
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
KSSTATE
Definition: ks.h:1214
@ KSSTATE_ACQUIRE
Definition: ks.h:1216
@ KSSTATE_PAUSE
Definition: ks.h:1217
@ KSSTATE_RUN
Definition: ks.h:1218
@ KSSTATE_STOP
Definition: ks.h:1215
#define KSPROPSETID_Connection
Definition: ks.h:346
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:139
@ KSPROPERTY_AUDIO_POSITION
Definition: ksmedia.h:1058
#define KSPROPSETID_Audio
Definition: ksmedia.h:1051
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
static LPOLESTR
Definition: stg_prop.c:27
#define DWORD
Definition: nt_native.h:44
#define LPVOID
Definition: nt_native.h:45
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2033
_Check_return_ HRESULT WINAPI StringFromIID(_In_ REFIID rclsid, _Outptr_ LPOLESTR *lplpsz)
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4071
#define DPRINT
Definition: sndvol32.h:73
const IDirectSoundBuffer8Vtbl * lpVtbl
Definition: primary.c:15
LPFILTERINFO Filter
Definition: primary.c:18
CRITICAL_SECTION Lock
Definition: primary.c:26
KSSTATE State
Definition: primary.c:27
DWORD dwFrequency
Definition: primary.c:21
WAVEFORMATEX Format
Definition: primary.c:24
DWORD dwUnlockTransferRate
Definition: dsound.h:242
DWORD dwPlayCpuOverhead
Definition: dsound.h:243
DWORD dwFlags
Definition: dsound.h:240
DWORD dwSize
Definition: dsound.h:239
Definition: scsiwmi.h:51
HANDLE hEvent
Definition: winbase.h:844
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
Definition: send.c:48
static COORD Position
Definition: mouse.c:34
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
int32_t * LPLONG
Definition: typedefs.h:58
uint32_t * LPDWORD
Definition: typedefs.h:59
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_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
#define ZeroMemory
Definition: winbase.h:1736
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define CreateEvent
Definition: winbase.h:3772
#define CopyMemory
Definition: winbase.h:1734
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
_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