From: Andrew Greenwood Date: Sun, 15 Feb 2009 13:31:52 +0000 (+0000) Subject: Split custom ReactOS-only non-standard extensions from NTDDSND.H X-Git-Tag: backups/danny-web@40415~24^2~473 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=805ca6f02acded74c08bbdef3d8fb16ffcd1093d Split custom ReactOS-only non-standard extensions from NTDDSND.H Updated relevant code to include the new headers SNDTYPES.H and SNDNAMES.H Corrected CTL_CODE macros and included SNDTYPES.H in WDMAUD interface header A lot of this is just refactoring, hence the large number of files! svn path=/trunk/; revision=39606 --- diff --git a/reactos/dll/win32/sndblst/sndblst.c b/reactos/dll/win32/sndblst/sndblst.c new file mode 100644 index 00000000000..9eefcd2e1c3 --- /dev/null +++ b/reactos/dll/win32/sndblst/sndblst.c @@ -0,0 +1,226 @@ +/* + * PROJECT: ReactOS Sound System + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/sndblst/sndblst.c + * + * PURPOSE: Sound Blaster MME User-Mode Driver + * + * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org) + * + * NOTES: Currently very experimental and being used as a guinea-pig for + * changes to the MME-Buddy libraries. + * TODO: Adhere to maximum device name length! +*/ + +#include +#include +#include +#include +#include +#include +//#include + +PWSTR SBWaveOutDeviceName = L"ROS Sound Blaster Out"; +PWSTR SBWaveInDeviceName = L"ROS Sound Blaster In"; +/* TODO: Mixer etc */ + +MMRESULT +GetSoundBlasterDeviceCapabilities( + IN PSOUND_DEVICE SoundDevice, + OUT PVOID Capabilities, + IN DWORD CapabilitiesSize) +{ + MMRESULT Result; + MMDEVICE_TYPE DeviceType; + + SND_ASSERT( SoundDevice ); + SND_ASSERT( Capabilities ); + + SND_TRACE(L"Sndblst - GetSoundBlasterDeviceCapabilities\n"); + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + /* Use the default method of obtaining device capabilities */ + Result = GetNt4SoundDeviceCapabilities(SoundDevice, + Capabilities, + CapabilitiesSize); + + if ( ! MMSUCCESS(Result) ) + return Result; + + /* Inject the appropriate device name */ + switch ( DeviceType ) + { + case WAVE_OUT_DEVICE_TYPE : + { + LPWAVEOUTCAPS WaveOutCaps = (LPWAVEOUTCAPS) Capabilities; + CopyWideString(WaveOutCaps->szPname, SBWaveOutDeviceName); + break; + } + case WAVE_IN_DEVICE_TYPE : + { + LPWAVEINCAPS WaveInCaps = (LPWAVEINCAPS) Capabilities; + CopyWideString(WaveInCaps->szPname, SBWaveInDeviceName); + break; + } + } + + return MMSYSERR_NOERROR; +} + +BOOLEAN FoundDevice( + UCHAR DeviceType, + PWSTR DevicePath) +{ + MMRESULT Result; + PSOUND_DEVICE SoundDevice = NULL; + MMFUNCTION_TABLE FuncTable; + PWSTR PathCopy; + + SND_TRACE(L"(Callback) Found device: %wS\n", DevicePath); + + PathCopy = AllocateWideString(wcslen(DevicePath)); + + if ( ! PathCopy ) + return FALSE; + + CopyWideString(PathCopy, DevicePath); + + Result = ListSoundDevice(DeviceType, (PVOID) PathCopy, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + return FALSE; + + /* Set up our function table */ + FuncTable.GetCapabilities = GetSoundBlasterDeviceCapabilities; + FuncTable.QueryWaveFormatSupport = QueryNt4WaveDeviceFormatSupport; + FuncTable.SetWaveFormat = SetNt4WaveDeviceFormat; + FuncTable.Open = OpenNt4SoundDevice; + FuncTable.Close = CloseNt4SoundDevice; + FuncTable.PrepareWaveHeader = NULL; + FuncTable.UnprepareWaveHeader = NULL; + FuncTable.SubmitWaveHeader = NULL; + + SetSoundDeviceFunctionTable(SoundDevice, &FuncTable); + + return TRUE; +} + +APIENTRY LONG +DriverProc( + DWORD DriverId, + HANDLE DriverHandle, + UINT Message, + LONG Parameter1, + LONG Parameter2) +{ + MMRESULT Result; + + switch ( Message ) + { + case DRV_LOAD : + { + SND_TRACE(L"DRV_LOAD\n"); + + Result = InitEntrypointMutexes(); + + if ( ! MMSUCCESS(Result) ) + return 0L; + + Result = EnumerateNt4ServiceSoundDevices(L"sndblst", + 0, + FoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + CleanupEntrypointMutexes(); + + UnlistAllSoundDevices(); + + return 0L; + } + +/* + PSOUND_DEVICE snd; + GetSoundDevice(WAVE_OUT_DEVICE_TYPE, 0, &snd); + GetSoundDevice(AUX_DEVICE_TYPE, 0, &snd); + GetSoundDevice(AUX_DEVICE_TYPE, 1, &snd); + GetSoundDevice(AUX_DEVICE_TYPE, 2, &snd); +*/ + + SND_TRACE(L"Initialisation complete\n"); + + return 1L; + } + + case DRV_FREE : + { + SND_TRACE(L"DRV_FREE\n"); + + /* TODO: Clean up the path names! */ + UnlistAllSoundDevices(); + + CleanupEntrypointMutexes(); + + SND_TRACE(L"Unfreed memory blocks: %d\n", + GetMemoryAllocationCount()); + + return 1L; + } + + case DRV_ENABLE : + case DRV_DISABLE : + { + SND_TRACE(L"DRV_ENABLE / DRV_DISABLE\n"); + return 1L; + } + + case DRV_OPEN : + case DRV_CLOSE : + { + SND_TRACE(L"DRV_OPEN / DRV_CLOSE\n"); + return 1L; + } + + case DRV_QUERYCONFIGURE : + { + SND_TRACE(L"DRV_QUERYCONFIGURE"); + return 0L; + } + case DRV_CONFIGURE : + return DRVCNF_OK; + + default : + SND_TRACE(L"Unhandled message %d\n", Message); + return DefDriverProc(DriverId, + DriverHandle, + Message, + Parameter1, + Parameter2); + } +} + +BOOL WINAPI DllMain( + HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + switch ( fdwReason ) + { + case DLL_PROCESS_ATTACH : + SND_TRACE(L"DLL_PROCESS_ATTACH\n"); + break; + case DLL_PROCESS_DETACH : + SND_TRACE(L"DLL_PROCESS_DETACH\n"); + break; + case DLL_THREAD_ATTACH : + SND_TRACE(L"DLL_THREAD_ATTACH\n"); + break; + case DLL_THREAD_DETACH : + SND_TRACE(L"DLL_THREAD_DETACH\n"); + break; + } + + return TRUE; +} diff --git a/reactos/dll/win32/sndblst/sndblst.def b/reactos/dll/win32/sndblst/sndblst.def new file mode 100644 index 00000000000..f1da764ca5f --- /dev/null +++ b/reactos/dll/win32/sndblst/sndblst.def @@ -0,0 +1,15 @@ +; $Id: sndblst.def 34299 2008-07-05 02:43:17Z silverblade $ +; +; sndblst.def +; +; ReactOS Operating System +; +LIBRARY sndblst.dll +EXPORTS +DriverProc@20 +widMessage@20 +wodMessage@20 +midMessage@20 +modMessage@20 +mxdMessage@20 +auxMessage@20 diff --git a/reactos/dll/win32/sndblst/sndblst.rbuild b/reactos/dll/win32/sndblst/sndblst.rbuild new file mode 100644 index 00000000000..dc3193187e1 --- /dev/null +++ b/reactos/dll/win32/sndblst/sndblst.rbuild @@ -0,0 +1,16 @@ + + + + include/reactos/libs/sound + . + + mment4 + mmebuddy + ntdll + kernel32 + user32 + winmm + advapi32 + sndblst.c + diff --git a/reactos/dll/win32/win32.rbuild b/reactos/dll/win32/win32.rbuild index f61949f4441..c4c78234e2f 100644 --- a/reactos/dll/win32/win32.rbuild +++ b/reactos/dll/win32/win32.rbuild @@ -394,6 +394,9 @@ + + + diff --git a/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h b/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h index 0bfbfc7340b..bc43be771c9 100644 --- a/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h +++ b/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h @@ -6,7 +6,8 @@ /// /// History: 12/02/2008 Created - +// These are now in sndtypes.h +/* typedef enum { DEVICE_TYPE_NONE = 0, @@ -18,10 +19,13 @@ typedef enum DEVICE_TYPE_AUX_OUT }AUDIO_DEVICE_TYPE; +*/ + +#include typedef struct { - AUDIO_DEVICE_TYPE DeviceType; + SOUND_DEVICE_TYPE DeviceType; ULONG DeviceIndex; HANDLE hDevice; @@ -55,7 +59,11 @@ typedef struct /// Return Code: STATUS_SUCCESS indicates success, otherwise appropiate error code /// Prequsites: none -#define IOCTL_OPEN_WDMAUD CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 0, METHOD_BUFFERED); +#define IOCTL_OPEN_WDMAUD \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 0, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_CLOSE_WDMAUD @@ -68,7 +76,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: openend device -#define IOCTL_CLOSE_WDMAUD CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 1, METHOD_BUFFERED); +#define IOCTL_CLOSE_WDMAUD \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 1, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); \ /// IOCTL_GETNUMDEVS_TYPE @@ -82,8 +94,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: none -#define IOCTL_GETNUMDEVS_TYPE CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 2, METHOD_BUFFERED); - +#define IOCTL_GETNUMDEVS_TYPE \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 2, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_SETDEVICE_STATE @@ -96,7 +111,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: opened device -#define IOCTL_SETDEVICE_STATE CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 3, METHOD_BUFFERED); +#define IOCTL_SETDEVICE_STATE \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 3, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_GETDEVID @@ -110,9 +129,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: opened device - -#define IOCTL_GETDEVID CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 4, METHOD_BUFFERED); - +#define IOCTL_GETDEVID \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 4, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_GETVOLUME @@ -126,8 +147,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: opened device - -#define IOCTL_GETVOLUME CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 5, METHOD_BUFFERED); +#define IOCTL_GETVOLUME \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 5, \ + METHOD_BUFFEERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_SETVOLUME @@ -140,8 +164,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: opened device - -#define IOCTL_SETVOLUME CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 6, METHOD_BUFFERED); +#define IOCTL_SETVOLUME \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 6, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_GETCAPABILTIES @@ -154,8 +181,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: none - -#define IOCTL_GETCAPABILTIES CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 7, METHOD_BUFFERED); +#define IOCTL_GETCAPABILITIES \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 7, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); /// IOCTL_WRITEDATA @@ -168,11 +198,11 @@ typedef struct /// ReturnCode: STATUS_SUCCESS indicates success /// Prequsites: opened device - -#define IOCTL_WRITEDATA CTL_CODE(FILE_DEVICE_SOUND, FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 8, METHOD_BUFFERED); - - - +#define IOCTL_WRITEDATA \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 8, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); #endif diff --git a/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild b/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild index dd3b89db132..93ab5bba026 100644 --- a/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild +++ b/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild @@ -2,6 +2,7 @@ . + include/reactos/libs/sound ntoskrnl ks entry.c diff --git a/reactos/include/ddk/ntddsnd.h b/reactos/include/ddk/ntddsnd.h index 888ac5596e5..d4c8887a1fb 100644 --- a/reactos/include/ddk/ntddsnd.h +++ b/reactos/include/ddk/ntddsnd.h @@ -9,6 +9,7 @@ 24 May 2008 - Created 2 July 2008 - Added device names as seen from user-mode 5 July 2008 - Added macros for checking device type + 14 Feb 2009 - Added base control codes for nonstandard extensions This file contains definitions and structures for Windows NT4 style multimedia drivers. The NT4 DDK has these split across multiple header @@ -23,108 +24,11 @@ type IDs). */ -#ifndef NTDDWAVE -#define NTDDWAVE +#ifndef NTDDSND_H +#define NTDDSND_H #define SOUND_MAX_DEVICES 100 - - -/* - Device types - - Not part of the original DDK header, but based on the values stored in - registry by sndblst -*/ - -#define WAVE_IN_DEVICE_TYPE 1 -#define WAVE_OUT_DEVICE_TYPE 2 -#define MIDI_IN_DEVICE_TYPE 3 -#define MIDI_OUT_DEVICE_TYPE 4 -#define AUX_DEVICE_TYPE 5 -#define MIXER_DEVICE_TYPE 6 - -#define MIN_SOUND_DEVICE_TYPE WAVE_IN_DEVICE_TYPE -#define MAX_SOUND_DEVICE_TYPE MIXER_DEVICE_TYPE -#define SOUND_DEVICE_TYPES 6 - -#define IS_VALID_SOUND_DEVICE_TYPE(x) \ - ( ( x >= MIN_SOUND_DEVICE_TYPE ) && ( x <= MAX_SOUND_DEVICE_TYPE ) ) - -#define IS_WAVE_DEVICE_TYPE(x) \ - ( ( x == WAVE_IN_DEVICE_TYPE ) || ( x == WAVE_OUT_DEVICE_TYPE ) ) - -#define IS_MIDI_DEVICE_TYPE(x) \ - ( ( x == MIDI_IN_DEVICE_TYPE ) || ( x == MIDI_OUT_DEVICE_TYPE ) ) - -#define IS_AUX_DEVICE_TYPE(x) \ - ( x == AUX_DEVICE_TYPE ) - -#define IS_MIXER_DEVICE_TYPE(x) \ - ( x == MIXER_DEVICE_TYPE ) - - -/* - Base device names - - Each device name should be given a numerical suffix identifying that - unique device, eg: - - \Device\WaveOut0 - First wave output device - \Device\WaveOut1 - Second wave output device -*/ - -#define SOUND_MAX_DEVICE_NAME 80 - -#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn" -#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn" -#define DD_WAVE_IN_DOS_DEVICE_NAME "\\DosDevices\\WaveIn" -#define DD_WAVE_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveIn" -#define DD_WAVE_IN_WIN32_DEVICE_NAME "\\\\.\\WaveIn" -#define DD_WAVE_IN_WIN32_DEVICE_NAME_U L"\\\\.\\WaveIn" - -#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut" -#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut" -#define DD_WAVE_OUT_DOS_DEVICE_NAME "\\DosDevices\\WaveOut" -#define DD_WAVE_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveOut" -#define DD_WAVE_OUT_WIN32_DEVICE_NAME "\\\\.\\WaveOut" -#define DD_WAVE_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\WaveOut" - -#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn" -#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn" -#define DD_MIDI_IN_DOS_DEVICE_NAME "\\DosDevices\\MidiIn" -#define DD_MIDI_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiIn" -#define DD_MIDI_IN_WIN32_DEVICE_NAME "\\\\.\\MidiIn" -#define DD_MIDI_IN_WIN32_DEVICE_NAME_U L"\\\\.\\MidiIn" - -#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut" -#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut" -#define DD_MIDI_OUT_DOS_DEVICE_NAME "\\DosDevices\\MidiOut" -#define DD_MIDI_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiOut" -#define DD_MIDI_OUT_WIN32_DEVICE_NAME "\\\\.\\MidiOut" -#define DD_MIDI_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\MidiOut" - -#define DD_MIX_DEVICE_NAME "\\Device\\MMMix" -#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix" -#define DD_MIX_DOS_DEVICE_NAME "\\DosDevices\\MMMix" -#define DD_MIX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMMix" -#define DD_MIX_WIN32_DEVICE_NAME "\\\\.\\MMMix" -#define DD_MIX_WIN32_DEVICE_NAME_U L"\\\\.\\MMMix" - -#define DD_AUX_DEVICE_NAME "\\Device\\MMAux" -#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux" -#define DD_AUX_DOS_DEVICE_NAME "\\DosDevices\\MMAux" -#define DD_AUX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMAux" -#define DD_AUX_WIN32_DEVICE_NAME "\\\\.\\MMAux" -#define DD_AUX_WIN32_DEVICE_NAME_U L"\\\\.\\MMAux" - -/* - Registry keys -*/ - -#define REG_SERVICES_KEY_NAME_U L"System\\CurrentControlSet\\Services" -#define REG_PARAMETERS_KEY_NAME_U L"Parameters" -#define REG_DEVICE_KEY_NAME_U L"Device" -#define REG_DEVICES_KEY_NAME_U L"Devices" +#define SOUND_MAX_DEVICE_NAME 80 /* diff --git a/reactos/include/reactos/libs/sound/sndnames.h b/reactos/include/reactos/libs/sound/sndnames.h new file mode 100644 index 00000000000..fe4dcea8489 --- /dev/null +++ b/reactos/include/reactos/libs/sound/sndnames.h @@ -0,0 +1,80 @@ +/* + ReactOS Sound System + NT4 audio device and registry key names + + Author: + Andrew Greenwood (silverblade@reactos.org) + + History: + 14 Feb 2009 - Split from ntddsnd.h + + These were enhancements to the original NT4 DDK audio device header + files. +*/ + +#ifndef SNDNAMES_H +#define SNDNAMES_H + +/* + Base device names (NT4) + + Each device name should be given a numerical suffix identifying that + unique device, eg: + + \Device\WaveOut0 - First wave output device + \Device\WaveOut1 - Second wave output device +*/ + +#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn" +#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn" +#define DD_WAVE_IN_DOS_DEVICE_NAME "\\DosDevices\\WaveIn" +#define DD_WAVE_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveIn" +#define DD_WAVE_IN_WIN32_DEVICE_NAME "\\\\.\\WaveIn" +#define DD_WAVE_IN_WIN32_DEVICE_NAME_U L"\\\\.\\WaveIn" + +#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut" +#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut" +#define DD_WAVE_OUT_DOS_DEVICE_NAME "\\DosDevices\\WaveOut" +#define DD_WAVE_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveOut" +#define DD_WAVE_OUT_WIN32_DEVICE_NAME "\\\\.\\WaveOut" +#define DD_WAVE_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\WaveOut" + +#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn" +#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn" +#define DD_MIDI_IN_DOS_DEVICE_NAME "\\DosDevices\\MidiIn" +#define DD_MIDI_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiIn" +#define DD_MIDI_IN_WIN32_DEVICE_NAME "\\\\.\\MidiIn" +#define DD_MIDI_IN_WIN32_DEVICE_NAME_U L"\\\\.\\MidiIn" + +#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut" +#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut" +#define DD_MIDI_OUT_DOS_DEVICE_NAME "\\DosDevices\\MidiOut" +#define DD_MIDI_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiOut" +#define DD_MIDI_OUT_WIN32_DEVICE_NAME "\\\\.\\MidiOut" +#define DD_MIDI_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\MidiOut" + +#define DD_MIX_DEVICE_NAME "\\Device\\MMMix" +#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix" +#define DD_MIX_DOS_DEVICE_NAME "\\DosDevices\\MMMix" +#define DD_MIX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMMix" +#define DD_MIX_WIN32_DEVICE_NAME "\\\\.\\MMMix" +#define DD_MIX_WIN32_DEVICE_NAME_U L"\\\\.\\MMMix" + +#define DD_AUX_DEVICE_NAME "\\Device\\MMAux" +#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux" +#define DD_AUX_DOS_DEVICE_NAME "\\DosDevices\\MMAux" +#define DD_AUX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMAux" +#define DD_AUX_WIN32_DEVICE_NAME "\\\\.\\MMAux" +#define DD_AUX_WIN32_DEVICE_NAME_U L"\\\\.\\MMAux" + + +/* + Registry keys (NT4) +*/ + +#define REG_SERVICES_KEY_NAME_U L"System\\CurrentControlSet\\Services" +#define REG_PARAMETERS_KEY_NAME_U L"Parameters" +#define REG_DEVICE_KEY_NAME_U L"Device" +#define REG_DEVICES_KEY_NAME_U L"Devices" + +#endif diff --git a/reactos/include/reactos/libs/sound/sndtypes.h b/reactos/include/reactos/libs/sound/sndtypes.h new file mode 100644 index 00000000000..2f2017b24e0 --- /dev/null +++ b/reactos/include/reactos/libs/sound/sndtypes.h @@ -0,0 +1,59 @@ +/* + ReactOS Sound System + Device type IDs and macros + + Author: + Andrew Greenwood (silverblade@reactos.org) + + History: + 14 Feb 2009 - Split from ntddsnd.h + + These are enhancements to the original NT4 DDK audio device header + files. +*/ + +#ifndef SNDTYPES_H +#define SNDTYPES_H + +/* + Device types + + Based on the values stored into the registry by the NT4 sndblst + driver. +*/ + +typedef enum +{ + // The sound device types + WAVE_IN_DEVICE_TYPE = 1, + WAVE_OUT_DEVICE_TYPE = 2, + MIDI_IN_DEVICE_TYPE = 3, + MIDI_OUT_DEVICE_TYPE = 4, + AUX_DEVICE_TYPE = 5, + MIXER_DEVICE_TYPE = 6, + + // Range of valid device type IDs + MIN_SOUND_DEVICE_TYPE = 1, + MAX_SOUND_DEVICE_TYPE = 6, + + // Number of sound device types + SOUND_DEVICE_TYPES = 6 +} SOUND_DEVICE_TYPE; + +#define IS_VALID_SOUND_DEVICE_TYPE(x) \ + ( ( x >= MIN_SOUND_DEVICE_TYPE ) && ( x <= MAX_SOUND_DEVICE_TYPE ) ) + +#define IS_WAVE_DEVICE_TYPE(x) \ + ( ( x == WAVE_IN_DEVICE_TYPE ) || ( x == WAVE_OUT_DEVICE_TYPE ) ) + +#define IS_MIDI_DEVICE_TYPE(x) \ + ( ( x == MIDI_IN_DEVICE_TYPE ) || ( x == MIDI_OUT_DEVICE_TYPE ) ) + +#define IS_AUX_DEVICE_TYPE(x) \ + ( x == AUX_DEVICE_TYPE ) + +#define IS_MIXER_DEVICE_TYPE(x) \ + ( x == MIXER_DEVICE_TYPE ) + + +#endif diff --git a/reactos/lib/drivers/directory.rbuild b/reactos/lib/drivers/directory.rbuild index de283ec2cf0..3f84d4447ea 100644 --- a/reactos/lib/drivers/directory.rbuild +++ b/reactos/lib/drivers/directory.rbuild @@ -13,4 +13,7 @@ + + + diff --git a/reactos/lib/drivers/sound/legacy/devname.c b/reactos/lib/drivers/sound/legacy/devname.c index c21814eb663..d8ec89941dc 100644 --- a/reactos/lib/drivers/sound/legacy/devname.c +++ b/reactos/lib/drivers/sound/legacy/devname.c @@ -11,6 +11,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c b/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c index 917b1104e49..96b4ca2a410 100644 --- a/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c +++ b/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mmebuddy/capabilities.c b/reactos/lib/drivers/sound/mmebuddy/capabilities.c index 1bca7cdb05e..fa69d2e87a2 100644 --- a/reactos/lib/drivers/sound/mmebuddy/capabilities.c +++ b/reactos/lib/drivers/sound/mmebuddy/capabilities.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* diff --git a/reactos/lib/drivers/sound/mmebuddy/devicelist.c b/reactos/lib/drivers/sound/mmebuddy/devicelist.c index f16b3ea5025..e4e4791012e 100644 --- a/reactos/lib/drivers/sound/mmebuddy/devicelist.c +++ b/reactos/lib/drivers/sound/mmebuddy/devicelist.c @@ -12,6 +12,7 @@ #include #include #include +#include #include ULONG SoundDeviceCounts[SOUND_DEVICE_TYPES]; diff --git a/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c b/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c index 79be4068ae5..9afe6100d62 100644 --- a/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c +++ b/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c b/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c index 30990e449e7..78db820b6ba 100644 --- a/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c +++ b/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c b/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c index e9911c17f14..c9702814081 100644 --- a/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c +++ b/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mmebuddy/mmewrap.c b/reactos/lib/drivers/sound/mmebuddy/mmewrap.c index 0c299e33971..1a1870399e5 100644 --- a/reactos/lib/drivers/sound/mmebuddy/mmewrap.c +++ b/reactos/lib/drivers/sound/mmebuddy/mmewrap.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* diff --git a/reactos/lib/drivers/sound/mmebuddy/reentrancy.c b/reactos/lib/drivers/sound/mmebuddy/reentrancy.c index 8a93c74530b..16ed1a1f9bb 100644 --- a/reactos/lib/drivers/sound/mmebuddy/reentrancy.c +++ b/reactos/lib/drivers/sound/mmebuddy/reentrancy.c @@ -12,6 +12,7 @@ #include #include #include +#include #include HANDLE EntrypointMutexes[SOUND_DEVICE_TYPES]; diff --git a/reactos/lib/drivers/sound/mmebuddy/wave/format.c b/reactos/lib/drivers/sound/mmebuddy/wave/format.c index d4f64b51973..1b59c9ea86a 100644 --- a/reactos/lib/drivers/sound/mmebuddy/wave/format.c +++ b/reactos/lib/drivers/sound/mmebuddy/wave/format.c @@ -12,6 +12,7 @@ #include #include #include +#include #include MMRESULT diff --git a/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c b/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c index 9fdbbda78ec..a3815b8cb9e 100644 --- a/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c +++ b/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c b/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c index 27dcbb9f9cd..60df66ae83e 100644 --- a/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c +++ b/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/reactos/lib/drivers/sound/mment4/control.c b/reactos/lib/drivers/sound/mment4/control.c index 27c7ed45bfc..94c2b08c894 100644 --- a/reactos/lib/drivers/sound/mment4/control.c +++ b/reactos/lib/drivers/sound/mment4/control.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/reactos/lib/drivers/sound/mment4/detect.c b/reactos/lib/drivers/sound/mment4/detect.c index 35e7af031ee..d76b9d76eb8 100644 --- a/reactos/lib/drivers/sound/mment4/detect.c +++ b/reactos/lib/drivers/sound/mment4/detect.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include diff --git a/reactos/lib/drivers/sound/mment4/registry.c b/reactos/lib/drivers/sound/mment4/registry.c index 3cffee1fd5c..482998b8452 100644 --- a/reactos/lib/drivers/sound/mment4/registry.c +++ b/reactos/lib/drivers/sound/mment4/registry.c @@ -13,6 +13,9 @@ #include #include +#include +#include + #include #include