midimap: Introduce XP form and prefer it.

Since XP form doesn't support channel mappings, old form is
remained for compatiblity.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51505
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2021-07-24 21:45:24 +09:00 committed by Alexandre Julliard
parent 1e02ef4027
commit dbf3b3b6bf
1 changed files with 37 additions and 21 deletions

View File

@ -36,7 +36,15 @@
/*
* Here's how Windows stores the midiOut mapping information.
*
* Full form (in HKU) is:
* Windows XP form (in HKU) is:
*
* [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap]
* "szPname"="TiMidity port 0"
* (incomplete)
*
* szPname: name of midiOut device to use.
*
* If szPname isn't defined, we use Windows 2000 form (also in HKU):
*
* [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap] 988836060
* "AutoScheme"=dword:00000000
@ -216,6 +224,13 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
DWORD type, size, out;
WCHAR buffer[256];
size = sizeof(buffer);
if (!RegQueryValueExW(hKey, L"szPname", 0, &type, (void*)buffer, &size))
{
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
}
else
{
ret = 2;
size = sizeof(out);
if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
@ -244,6 +259,7 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
}
}
}
}
RegCloseKey(hKey);
if (ret && TRACE_ON(midi))