Modified: trunk/reactos/lib/mmdrv/auxil.c
Modified: trunk/reactos/lib/mmdrv/midi.c
Modified: trunk/reactos/lib/mmdrv/mmddk.h
Modified: trunk/reactos/lib/mmdrv/mmdef.h
Modified: trunk/reactos/lib/mmdrv/utils.c
Modified: trunk/reactos/lib/mmdrv/wave.c
Modified: trunk/reactos/lib/mmdrv/wave.h
--- trunk/reactos/lib/mmdrv/auxil.c 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/auxil.c 2005-11-20 17:52:53 UTC (rev 19381)
@@ -9,13 +9,14 @@
* UPDATE HISTORY:
* Mar 16, 2004: Created skeleton implementation
*/
-
#include "mmdrv.h"
+#include "wave.h"
+
#define NDEBUG
#include <debug.h>
-APIENTRY DWORD auxMessage(UINT uDevice,
+APIENTRY DWORD auxMessage(UINT dwId,
UINT uMessage,
DWORD dwUser,
DWORD dwParam1,
@@ -28,14 +29,21 @@
switch (uMessage)
{
case AUXDM_GETDEVCAPS:
- return 0;
+ DPRINT("AUXDM_GETDEVCAPS");
+ return GetDeviceCapabilities(dwId, AuxDevice, (LPBYTE)dwParam1, (DWORD)dwParam2);
+
case AUXDM_GETNUMDEVS:
- return 0;
+ DPRINT("AUXDM_GETNUMDEVS");
+ return GetDeviceCount(AuxDevice);
+
case AUXDM_GETVOLUME:
return 0;
+
case AUXDM_SETVOLUME:
return 0;
}
return MMSYSERR_NOERROR;
}
+
+
--- trunk/reactos/lib/mmdrv/midi.c 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/midi.c 2005-11-20 17:52:53 UTC (rev 19381)
@@ -10,6 +10,7 @@
*/
#include "mmdrv.h"
+#include "wave.h"
#define NDEBUG
#include <debug.h>
@@ -233,7 +234,7 @@
case MODM_GETDEVCAPS:
DPRINT("MODM_GETDEVCAPS");
- return MMSYSERR_NOTSUPPORTED;
+ return GetDeviceCapabilities(ID, MidiOutDevice, (LPBYTE)Param1, (DWORD)Param2);
case MODM_OPEN :
return OpenMidiDevice(MidiOutDevice, ID, User, Param1, Param2);
--- trunk/reactos/lib/mmdrv/mmddk.h 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/mmddk.h 2005-11-20 17:52:53 UTC (rev 19381)
@@ -29,6 +29,8 @@
#include <mmsystem.h>
#include <winbase.h>
+
+
#define MAX_MIDIINDRV (16)
/* For now I'm making 16 the maximum number of midi devices one can
* have. This should be more than enough for everybody. But as a purist,
--- trunk/reactos/lib/mmdrv/mmdef.h 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/mmdef.h 2005-11-20 17:52:53 UTC (rev 19381)
@@ -52,6 +52,7 @@
#define IOCTL_SOUND_BASE FILE_DEVICE_SOUND
#define IOCTL_WAVE_BASE 0x0000
#define IOCTL_MIDI_BASE 0x0080
+#define IOCTL_AUX_BASE 0x0100
// Wave device driver IOCTLs
@@ -84,4 +85,10 @@
#define IOCTL_MIDI_CACHE_PATCHES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_MIDI_CACHE_DRUM_PATCHES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
+// AUX device driver IOCTLs
+#define IOCTL_AUX_GET_CAPABILITIES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AUX_SET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_AUX_GET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
+#define IOCTL_SOUND_GET_CHANGED_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
+
#endif
--- trunk/reactos/lib/mmdrv/utils.c 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/utils.c 2005-11-20 17:52:53 UTC (rev 19381)
@@ -82,8 +82,12 @@
case MidiInDevice :
wsprintf(DeviceName, L"\\\\.%ls%d", MIDI_IN_DEVICE_NAME_U + strlen("\\Device"), ID);
break;
+ case AuxDevice :
+ wsprintf(DeviceName, L"\\\\.%ls%d", AUX_DEVICE_NAME_U + strlen("\\Device"), ID);
+ break;
default : // Aux
- wsprintf(DeviceName, L"\\\\.%ls%d", AUX_DEVICE_NAME_U + strlen("\\Device"), ID);
+ DPRINT("No Auido Device Found");
+ return MMSYSERR_BADDEVICEID; /* Maybe we should change error code */
};
DPRINT("Attempting to open %S\n", DeviceName);
--- trunk/reactos/lib/mmdrv/wave.c 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/wave.c 2005-11-20 17:52:53 UTC (rev 19381)
@@ -23,13 +23,9 @@
* ============================
*/
-static MMRESULT GetDeviceCapabilities(DWORD ID, UINT DeviceType,
+MMRESULT GetDeviceCapabilities(DWORD ID, UINT DeviceType,
LPBYTE pCaps, DWORD Size)
{
- // FIXME: Implement :)
-// return sndGetData(DeviceType, id, dwSize, lpCaps,
-// IOCTL_WAVE_GET_CAPABILITIES);
-
HANDLE DeviceHandle = NULL;
MMRESULT Result = MMSYSERR_NOERROR;
DWORD BytesReturned = 0;
@@ -46,12 +42,32 @@
// Setting the overlapped parameter (last) to null means we
// wait until the operation completes.
//
+
- Result = DeviceIoControl(DeviceHandle, IOCTL_WAVE_GET_CAPABILITIES,
+ if (DeviceType == WaveOutDevice)
+ {
+ Result = DeviceIoControl(DeviceHandle, IOCTL_WAVE_GET_CAPABILITIES,
NULL, 0, (LPVOID)pCaps, Size,
&BytesReturned, NULL) ? MMSYSERR_NOERROR : TranslateStatus();
+ }
+ else if (DeviceType == MidiOutDevice)
+ {
+ Result = DeviceIoControl(DeviceHandle, IOCTL_MIDI_GET_CAPABILITIES,
+ NULL, 0, (LPVOID)pCaps, Size,
+ &BytesReturned, NULL) ? MMSYSERR_NOERROR : TranslateStatus();
+ }
+ else if (DeviceType == AuxDevice)
+ {
+ Result = DeviceIoControl(DeviceHandle, IOCTL_AUX_GET_CAPABILITIES,
+ NULL, 0, (LPVOID)pCaps, Size,
+ &BytesReturned, NULL) ? MMSYSERR_NOERROR : TranslateStatus();
+ }
+
+
+
+
// Close the handle and return the result code
// CloseHandle(DeviceHandle);
--- trunk/reactos/lib/mmdrv/wave.h 2005-11-20 17:51:09 UTC (rev 19380)
+++ trunk/reactos/lib/mmdrv/wave.h 2005-11-20 17:52:53 UTC (rev 19381)
@@ -78,3 +78,6 @@
HANDLE ThreadHandle; // Handle for thread termination ONLY
MMRESULT AuxReturnCode; // Return code from Aux task
}WAVEALLOC, *PWAVEALLOC;
+
+MMRESULT GetDeviceCapabilities(DWORD ID, UINT DeviceType,
+ LPBYTE pCaps, DWORD Size);