ReactOS 0.4.16-dev-300-g2aadf2e
midMessage.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/sound/mmebuddy/midi/midMessage.c
5 *
6 * PURPOSE: Provides the midMessage exported function, as required by
7 * the MME API, for MIDI input device support.
8 *
9 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
10*/
11
12#include "precomp.h"
13
14/*
15 Standard MME driver entry-point for messages relating to MIDI input.
16*/
20 UINT DeviceId,
22 DWORD_PTR PrivateHandle,
23 DWORD_PTR Parameter1,
24 DWORD_PTR Parameter2)
25{
27
29
30 SND_TRACE(L"midMessage - Message type %d\n", Message);
31
32 switch ( Message )
33 {
34 case MIDM_GETNUMDEVS :
35 {
37 break;
38 }
39
40 case MIDM_GETDEVCAPS :
41 {
43 DeviceId,
44 (PVOID) Parameter1,
45 Parameter2);
46 break;
47 }
48
50 {
51 Result = MmeGetDeviceInterfaceString(MIDI_IN_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR
52 break;
53 }
54
56 {
57 Result = MmeGetDeviceInterfaceString(MIDI_IN_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR
58 break;
59 }
60
61 case MIDM_OPEN :
62 {
64 DeviceId,
65 (LPWAVEOPENDESC) Parameter1,
66 Parameter2,
67 (DWORD_PTR*) PrivateHandle);
68 break;
69 }
70
71 case MIDM_CLOSE :
72 {
73 Result = MmeCloseDevice(PrivateHandle);
74 break;
75 }
76
77 case MIDM_START :
78 {
79 Result = MmeSetState(PrivateHandle, TRUE);
80 break;
81 }
82
83 case MIDM_STOP :
84 {
85 Result = MmeSetState(PrivateHandle, FALSE);
86 break;
87 }
88 }
89
90 SND_TRACE(L"midMessage returning MMRESULT %d\n", Result);
91
93
94 return Result;
95}
#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 MIDM_OPEN
Definition: mmddk.h:171
#define MIDM_START
Definition: mmddk.h:176
#define DRV_QUERYDEVICEINTERFACESIZE
Definition: mmddk.h:97
#define MIDM_STOP
Definition: mmddk.h:177
#define MIDM_CLOSE
Definition: mmddk.h:172
#define MIDM_GETDEVCAPS
Definition: mmddk.h:170
#define MIDM_GETNUMDEVS
Definition: mmddk.h:169
#define DRV_QUERYDEVICEINTERFACE
Definition: mmddk.h:96
static const WCHAR Message[]
Definition: register.c:74
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD APIENTRY midMessage(UINT DeviceId, UINT Message, DWORD_PTR PrivateHandle, DWORD_PTR Parameter1, DWORD_PTR Parameter2)
Definition: midMessage.c:19
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
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 MmeSetState(IN DWORD_PTR PrivateHandle, IN BOOL bStart)
Definition: mmewrap.c:19
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
@ MIDI_IN_DEVICE_TYPE
Definition: sndtypes.h:30
uint32_t DWORD_PTR
Definition: typedefs.h:65
_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