Commit dbf3b3b6 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

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=51505Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1e02ef40
......@@ -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
......@@ -214,33 +222,41 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
else
{
DWORD type, size, out;
WCHAR buffer[256];
WCHAR buffer[256];
ret = 2;
size = sizeof(out);
if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
size = sizeof(buffer);
if (!RegQueryValueExW(hKey, L"szPname", 0, &type, (void*)buffer, &size))
{
size = sizeof(buffer);
if (!RegQueryValueExW(hKey, L"CurrentScheme", 0, &type, (void*)buffer, &size))
{
if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer)))
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
}
else
{
ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n");
}
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
}
if (ret == 2)
else
{
size = sizeof(buffer);
if (!RegQueryValueExW(hKey, L"CurrentInstrument", 0, &type, (void*)buffer, &size) && *buffer)
ret = 2;
size = sizeof(out);
if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
{
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
size = sizeof(buffer);
if (!RegQueryValueExW(hKey, L"CurrentScheme", 0, &type, (void*)buffer, &size))
{
if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer)))
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
}
else
{
ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n");
}
}
else
if (ret == 2)
{
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
size = sizeof(buffer);
if (!RegQueryValueExW(hKey, L"CurrentInstrument", 0, &type, (void*)buffer, &size) && *buffer)
{
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
}
else
{
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment