ReactOS 0.4.15-dev-7659-ga55345b
wodMessage.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Sound System "MME Buddy" Library
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: lib/drivers/sound/mmebuddy/wave/wodMessage.c
5 *
6 * PURPOSE: Provides the wodMessage exported function, as required by
7 * the MME API, for wave output device support.
8 *
9 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
10*/
11
12#include "precomp.h"
13
14#if 0
16{
17 PWSTR WString = (PWSTR) String;
18 SND_TRACE(WString);
20}
21#endif
22
23/*
24 Standard MME driver entry-point for messages relating to wave audio
25 output.
26*/
30 UINT DeviceId,
32 DWORD_PTR PrivateHandle,
33 DWORD_PTR Parameter1,
34 DWORD_PTR Parameter2)
35{
37
39
40 SND_TRACE(L"wodMessage - Message type %d\n", Message);
41
42 switch ( Message )
43 {
44 case WODM_GETNUMDEVS :
45 {
47 break;
48 }
49
50 case WODM_GETDEVCAPS :
51 {
53 DeviceId,
54 (PVOID) Parameter1,
55 Parameter2);
56 break;
57 }
58
59 case WODM_OPEN :
60 {
62 DeviceId,
63 (LPWAVEOPENDESC) Parameter1,
64 Parameter2,
65 (DWORD_PTR*)PrivateHandle);
66 break;
67 }
68
69 case WODM_CLOSE :
70 {
71 Result = MmeCloseDevice(PrivateHandle);
72
73 break;
74 }
75
76 case WODM_PREPARE :
77 {
78 /* TODO: Do we need to pass 2nd parameter? */
79 Result = MmePrepareWaveHeader(PrivateHandle, Parameter1);
80 break;
81 }
82
83 case WODM_UNPREPARE :
84 {
85 Result = MmeUnprepareWaveHeader(PrivateHandle, Parameter1);
86 break;
87 }
88
89 case WODM_WRITE :
90 {
91 Result = MmeWriteWaveHeader(PrivateHandle, Parameter1);
92 break;
93 }
94
95 case WODM_RESET :
96 {
97 /* Stop playback, reset position to zero */
98 Result = MmeResetWavePlayback(PrivateHandle);
99 break;
100 }
101
102 case WODM_RESTART :
103 {
104 /* Continue playback when paused */
105 Result = MmeSetState(PrivateHandle, TRUE);
106 break;
107 }
108 case WODM_PAUSE :
109 {
110 /* pause playback */
111 Result = MmeSetState(PrivateHandle, FALSE);
112 break;
113 }
114
115 case WODM_GETPOS :
116 {
117 Result = MmeGetPosition(WAVE_OUT_DEVICE_TYPE, DeviceId, PrivateHandle, (MMTIME*)Parameter1, Parameter2);
118 break;
119 }
120
122 {
123 Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR
124 break;
125 }
126
128 {
129 Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR
130 break;
131 }
132 }
133
134 SND_TRACE(L"wodMessage returning MMRESULT %d\n", Result);
135
137
138 return Result;
139}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APIENTRY
Definition: api.h:79
#define WODM_PREPARE
Definition: mmddk.h:112
#define DRV_QUERYDEVICEINTERFACESIZE
Definition: mmddk.h:97
#define WODM_OPEN
Definition: mmddk.h:110
#define WODM_RESET
Definition: mmddk.h:117
#define WODM_WRITE
Definition: mmddk.h:114
#define WODM_RESTART
Definition: mmddk.h:116
#define WODM_GETNUMDEVS
Definition: mmddk.h:108
#define WODM_GETPOS
Definition: mmddk.h:118
#define WODM_GETDEVCAPS
Definition: mmddk.h:109
#define WODM_CLOSE
Definition: mmddk.h:111
#define DRV_QUERYDEVICEINTERFACE
Definition: mmddk.h:96
#define WODM_UNPREPARE
Definition: mmddk.h:113
#define WODM_PAUSE
Definition: mmddk.h:115
static const WCHAR Message[]
Definition: register.c:74
unsigned long DWORD
Definition: ntddk_ex.h:95
MMRESULT MmeOpenDevice(IN MMDEVICE_TYPE DeviceType, IN UINT DeviceId, IN LPWAVEOPENDESC OpenParameters, IN DWORD Flags, OUT DWORD_PTR *PrivateHandle)
Definition: mmewrap.c:132
MMRESULT MmeCloseDevice(IN DWORD_PTR PrivateHandle)
Definition: mmewrap.c:225
#define MmePrepareWaveHeader(private_handle, header)
Definition: mmebuddy.h:388
VOID AcquireEntrypointMutex(IN MMDEVICE_TYPE DeviceType)
Definition: reentrancy.c:75
ULONG GetSoundDeviceCount(IN MMDEVICE_TYPE DeviceType)
Definition: devicelist.c:67
MMRESULT MmeGetDeviceInterfaceString(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN LPWSTR Interface, IN DWORD InterfaceLength, OUT DWORD *InterfaceSize)
Definition: mmewrap.c:294
MMRESULT MmeGetPosition(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN DWORD_PTR PrivateHandle, IN MMTIME *Time, IN DWORD Size)
Definition: mmewrap.c:327
MMRESULT MmeSetState(IN DWORD_PTR PrivateHandle, IN BOOL bStart)
Definition: mmewrap.c:19
MMRESULT MmeResetWavePlayback(IN DWORD_PTR PrivateHandle)
Definition: mmewrap.c:280
#define MmeUnprepareWaveHeader(private_handle, header)
Definition: mmebuddy.h:391
#define MmeWriteWaveHeader(private_handle, header)
Definition: mmebuddy.h:394
VOID ReleaseEntrypointMutex(IN MMDEVICE_TYPE DeviceType)
Definition: reentrancy.c:92
MMRESULT MmeGetSoundDeviceCapabilities(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN PVOID Capabilities, IN DWORD CapabilitiesSize)
Definition: mmewrap.c:103
#define SND_TRACE(...)
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
@ WAVE_OUT_DEVICE_TYPE
Definition: sndtypes.h:29
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t DWORD_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
DWORD APIENTRY wodMessage(UINT DeviceId, UINT Message, DWORD_PTR PrivateHandle, DWORD_PTR Parameter1, DWORD_PTR Parameter2)
Definition: wodMessage.c:29
_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 * LPWSTR
Definition: xmlstorage.h:184