https://git.reactos.org/?p=reactos.git;a=commitdiff;h=677edc637c76abd45d6d9…
commit 677edc637c76abd45d6d9b1afcb266ce1cfe4dfc
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sun Jan 20 19:55:45 2019 +0300
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Jan 20 17:55:45 2019 +0100
[WINMM] Load Wave/MIDI mapper drivers only after actual device drivers (#1241)
CORE-15620
---
dll/win32/winmm/registry.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dll/win32/winmm/registry.c b/dll/win32/winmm/registry.c
index 57f6605b32..563c63f84b 100644
--- a/dll/win32/winmm/registry.c
+++ b/dll/win32/winmm/registry.c
@@ -32,6 +32,9 @@ BOOL LoadRegistryMMEDrivers(char* key)
DWORD value_data_length = 256;
char value_data[256];
+ char wavemapper[256] = { 0 };
+ char midimapper[256] = { 0 };
+
DWORD value_type;
if ( RegOpenKeyA(HKEY_LOCAL_MACHINE, key, &drivers_key) != ERROR_SUCCESS )
@@ -60,14 +63,16 @@ BOOL LoadRegistryMMEDrivers(char* key)
if ( ! stricmp("wavemapper", value_name) )
{
TRACE("Found a Wave-mapper: %s\n", value_data);
- valid_driver = TRUE;
+ /* Delay loading Wave mapper driver */
+ strcpy(wavemapper, value_data);
is_mapper = TRUE;
driver_count ++;
}
else if ( ! stricmp("midimapper", value_name) )
{
TRACE("Found a MIDI-mapper: %s\n", value_data);
- valid_driver = TRUE;
+ /* Delay loading MIDI mapper driver */
+ strcpy(midimapper, value_data);
is_mapper = TRUE;
driver_count ++;
}
@@ -125,6 +130,23 @@ BOOL LoadRegistryMMEDrivers(char* key)
driver_index ++;
}
+ /* Finally load mapper drivers, since they expect device drivers already loaded */
+ if (*wavemapper)
+ {
+ if (!MMDRV_Install("wavemapper", wavemapper, TRUE))
+ {
+ TRACE("FAILED when initializing %s\n", wavemapper);
+ }
+ }
+
+ if (*midimapper)
+ {
+ if (!MMDRV_Install("midimapper", midimapper, TRUE))
+ {
+ TRACE("FAILED when initializing %s\n", midimapper);
+ }
+ }
+
TRACE("Found a total of %d drivers\n", driver_count);
return driver_count;