ReactOS  0.4.15-dev-1187-g119f102
auxil.c File Reference
#include "mmdrv.h"
#include <debug.h>
#include "wave.h"
Include dependency graph for auxil.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

APIENTRY DWORD auxMessage (UINT dwId, UINT uMessage, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
 
DWORD AuxGetAudio (DWORD dwID, PBYTE pVolume, DWORD sizeVolume)
 
DWORD AuxSetAudio (DWORD dwID, PBYTE pVolume, DWORD sizeVolume)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 15 of file auxil.c.

Function Documentation

◆ AuxGetAudio()

DWORD AuxGetAudio ( DWORD  dwID,
PBYTE  pVolume,
DWORD  sizeVolume 
)

Definition at line 69 of file auxil.c.

70 {
74 
76  if (Result != MMSYSERR_NOERROR)
77  return Result;
78 
79 
82 
83 
85 
86  return Result;
87  }
#define CloseHandle
Definition: compat.h:487
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
Definition: hubbusif.h:121
#define IOCTL_AUX_GET_VOLUME
Definition: mmdef.h:82
UINT MMRESULT
Definition: mmsystem.h:962
MMRESULT OpenDevice(DeviceInfo **private_data, MIDIOPENDESC *open_desc, DWORD flags)
Definition: beepmidi.c:264
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
_In_ LPCGUID _In_ SIZE_T _In_ SIZE_T _Out_opt_ PSIZE_T BytesReturned
Definition: potypes.h:549
DWORD TranslateStatus(void)
Definition: utils.c:30
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GENERIC_READ
Definition: compat.h:135
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

Referenced by auxMessage().

◆ auxMessage()

APIENTRY DWORD auxMessage ( UINT  dwId,
UINT  uMessage,
DWORD  dwUser,
DWORD  dwParam1,
DWORD  dwParam2 
)

Definition at line 20 of file auxil.c.

26 {
29 
30  DPRINT("auxMessage\n");
31 
32 
33  // the following cases are documented by DDK
34  switch (uMessage)
35  {
36  case AUXDM_GETDEVCAPS:
37  DPRINT("AUXDM_GETDEVCAPS");
38  return GetDeviceCapabilities(dwId, AuxDevice, (LPBYTE)dwParam1, (DWORD)dwParam2);
39 
40  case AUXDM_GETNUMDEVS:
41  DPRINT("AUXDM_GETNUMDEVS");
42  return GetDeviceCount(AuxDevice);
43 
44  case AUXDM_GETVOLUME:
45  DPRINT("AUXDM_GETVOLUME");
46  Result = AuxGetAudio(dwId, (PBYTE) &Volume, sizeof(Volume));
47 
48  if (Result == MMSYSERR_NOERROR)
49  {
50  *(LPDWORD)dwParam1 = (DWORD)MAKELONG(HIWORD(Volume.Left), HIWORD(Volume.Right));
51  }
52  return Result;
53 
54 
55  case AUXDM_SETVOLUME:
56  DPRINT("AUXDM_SETVOLUME");
57 
58  Volume.Right = HIWORD(dwParam1) << 16;
59  Volume.Left = LOWORD(dwParam1) << 16;
60 
61  return AuxSetAudio(dwId, (PBYTE)&Volume, sizeof(Volume));
62 
63  }
64 
65  return MMSYSERR_NOERROR;
66 }
#define AUXDM_SETVOLUME
Definition: mmddk.h:185
UINT MMRESULT
Definition: mmsystem.h:962
DWORD AuxSetAudio(DWORD dwID, PBYTE pVolume, DWORD sizeVolume)
Definition: auxil.c:89
#define AUXDM_GETNUMDEVS
Definition: mmddk.h:182
unsigned char * LPBYTE
Definition: typedefs.h:53
#define MAKELONG(a, b)
Definition: typedefs.h:249
_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
void DPRINT(...)
Definition: polytest.cpp:61
DWORD AuxGetAudio(DWORD dwID, PBYTE pVolume, DWORD sizeVolume)
Definition: auxil.c:69
#define AUXDM_GETVOLUME
Definition: mmddk.h:184
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LPDWORD
Definition: nt_native.h:46
#define AUXDM_GETDEVCAPS
Definition: mmddk.h:183
DWORD GetDeviceCount(DeviceType device_type)
Definition: common.c:58
#define HIWORD(l)
Definition: typedefs.h:247
MMRESULT GetDeviceCapabilities(MIDIOUTCAPS *caps)
Definition: beepmidi.c:210
BYTE * PBYTE
Definition: pedump.c:66
#define LOWORD(l)
Definition: pedump.c:82

Referenced by MMDRV_Install().

◆ AuxSetAudio()

DWORD AuxSetAudio ( DWORD  dwID,
PBYTE  pVolume,
DWORD  sizeVolume 
)

Definition at line 89 of file auxil.c.

90 {
94 
96  if (Result != MMSYSERR_NOERROR)
97  return Result;
98 
99  Result = DeviceIoControl(DeviceHandle, IOCTL_AUX_SET_VOLUME, (LPVOID)pVolume, sizeVolume, NULL, 0,
101 
102 
104 
105  return Result;
106  }
#define CloseHandle
Definition: compat.h:487
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
Definition: hubbusif.h:121
UINT MMRESULT
Definition: mmsystem.h:962
#define IOCTL_AUX_SET_VOLUME
Definition: mmdef.h:81
MMRESULT OpenDevice(DeviceInfo **private_data, MIDIOPENDESC *open_desc, DWORD flags)
Definition: beepmidi.c:264
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
_In_ LPCGUID _In_ SIZE_T _In_ SIZE_T _Out_opt_ PSIZE_T BytesReturned
Definition: potypes.h:549
DWORD TranslateStatus(void)
Definition: utils.c:30
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GENERIC_READ
Definition: compat.h:135
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

Referenced by auxMessage().