Version 0.9.2

Added: New troubleshooting options have been added to the Configurator that can be tried in case of problems.
Improved: E-APO is now normally always installed as LFX/GFX, also in Windows 8.1 and later, to avoid problems with some applications bypassing SFX/MFX APOs (e.g. Skype).
Fixed: If the input channel count was higher than the output channel count and there was no child APO, Equalizer APO could crash during initialization.
Fixed: If a file in the config path was only renamed (not modified), the configuration was not reloaded.
This commit is contained in:
jthedering committed 2015-04-14 18:44:29 +00:00
1 parent 3d234120f6
commit d81193521b
18 files changed
+708 -298

No files matched your search

+301 -153
View File
@@ -30,16 +30,33 @@ using namespace std;
#define commonKeyPath L"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\MMDevices\\Audio"
#define renderKeyPath commonKeyPath L"\\Render"
#define captureKeyPath commonKeyPath L"\\Capture"
#define childApoPath APP_REGPATH L"\\Child APOs"
static const wchar_t* preMixChildGuidValueName = L"PreMixChild";
static const wchar_t* postMixChildGuidValueName = L"PostMixChild";
static const wchar_t* versionValueName = L"Version";
static const wchar_t* connectionValueName = L"{a45c254e-df1c-4efd-8020-67d146a850e0},2";
static const wchar_t* deviceValueName = L"{b3f8fa53-0004-438e-9003-51a46e139bfc},6";
static const wchar_t* lfxGuidValueName = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},1";
static const wchar_t* gfxGuidValueName = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},2";
static const wchar_t* lfxGuidValueName2 = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},5";
static const wchar_t* gfxGuidValueName2 = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},6";
static const wchar_t* sfxGuidValueName = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},5";
static const wchar_t* mfxGuidValueName = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},6";
static const wchar_t* efxGuidValueName = L"{d04e05a6-594b-4fb6-a80d-01af5eed7d1d},7";
static const unsigned allGuidValueNameCount = 5;
static const wchar_t* allGuidValueNames[] = {lfxGuidValueName, gfxGuidValueName, sfxGuidValueName, mfxGuidValueName, efxGuidValueName};
static enum GuidValueIndices
{
LFX_INDEX = 0,
GFX_INDEX = 1,
SFX_INDEX = 2,
MFX_INDEX = 3,
EFX_INDEX = 4
};
static const wchar_t* fxTitleValueName = L"{b725f130-47ef-101a-a5f1-02608c9eebac},10";
static const wchar_t* sfxProcessingModesValueName = L"{d3993a3f-99c2-4402-b5ec-a92a0367664b},5";
static const wchar_t* mfxProcessingModesValueName = L"{d3993a3f-99c2-4402-b5ec-a92a0367664b},6";
static const wchar_t* efxProcessingModesValueName = L"{d3993a3f-99c2-4402-b5ec-a92a0367664b},7";
static const wchar_t* defaultProcessingModeValue = L"{C18E2F7E-933D-4965-B7D1-1EEF228D2AF3}";
static const wchar_t* installVersion = L"2";
vector<DeviceAPOInfo> DeviceAPOInfo::loadAllInfos(bool input)
{
@@ -51,7 +68,10 @@ vector<DeviceAPOInfo> DeviceAPOInfo::loadAllInfos(bool input)
DeviceAPOInfo info;
if(info.load(deviceGuidString))
{
info.selectedInstallState = info.currentInstallState;
result.push_back(info);
}
}
return result;
@@ -81,89 +101,126 @@ bool DeviceAPOInfo::load(const wstring& deviceGuid)
deviceName = RegistryHelper::readValue(keyPath + L"\\Properties", deviceValueName);
isInstalled = false;
isLFX = false;
isAPO2 = false;
installAsAPO2 = false;
currentInstallState.installMode = INSTALL_LFX_GFX;
version = L"0";
preMixChildGuid = L"";
postMixChildGuid = L"";
currentInstallState.installPreMix = true;
currentInstallState.installPostMix = !isInput;
currentInstallState.useOriginalAPOPreMix = true;
currentInstallState.useOriginalAPOPostMix = !isInput;
if(!RegistryHelper::keyExists(keyPath + L"\\FxProperties"))
{
originalLfxGuid = APOGUID_NOKEY;
originalGfxGuid = APOGUID_NOKEY;
for(int i=0; i < allGuidValueNameCount; i++)
originalApoGuids[i] = APOGUID_NOKEY;
}
else
{
originalLfxGuid = APOGUID_NOVALUE;
originalGfxGuid = APOGUID_NOVALUE;
installAsAPO2 = RegistryHelper::isWindowsVersionAtLeast(6, 3) // Windows 8.1
&& (RegistryHelper::valueExists(keyPath + L"\\FxProperties", lfxGuidValueName2)
|| RegistryHelper::valueExists(keyPath + L"\\FxProperties", gfxGuidValueName2));
wstring lfxValueName;
wstring gfxValueName;
if(installAsAPO2)
for(int i=0; i < allGuidValueNameCount; i++)
{
lfxValueName = lfxGuidValueName2;
gfxValueName = gfxGuidValueName2;
}
else
{
lfxValueName = lfxGuidValueName;
gfxValueName = gfxGuidValueName;
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", allGuidValueNames[i]))
originalApoGuids[i] = RegistryHelper::readValue(keyPath + L"\\FxProperties", allGuidValueNames[i]);
else
originalApoGuids[i] = APOGUID_NOVALUE;
}
bool found = false;
if(isInput)
found = tryAPOGuid(keyPath, lfxValueName, EQUALIZERAPO_LFX_GUID, true, installAsAPO2);
else
found = tryAPOGuid(keyPath, lfxValueName, EQUALIZERAPO_LFX_GUID, true, installAsAPO2) && tryAPOGuid(keyPath, gfxValueName, EQUALIZERAPO_GFX_GUID, false, installAsAPO2);
isDual = found;
if(!found)
found = tryAPOGuid(keyPath, lfxGuidValueName, EQUALIZERAPO_GFX_GUID, true, false);
if(!found)
found = tryAPOGuid(keyPath, gfxGuidValueName, EQUALIZERAPO_GFX_GUID, false, false);
if(!found)
found = tryAPOGuid(keyPath, lfxGuidValueName2, EQUALIZERAPO_GFX_GUID, true, true);
if(!found)
found = tryAPOGuid(keyPath, gfxGuidValueName2, EQUALIZERAPO_GFX_GUID, false, true);
isInstalled = found;
if(found)
bool foundAt[allGuidValueNameCount];
for(int i=0; i < allGuidValueNameCount; i++)
{
if(RegistryHelper::keyExists(APP_REGPATH L"\\Child APOs\\" + deviceGuid))
foundAt[i] = false;
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", allGuidValueNames[i]))
{
if(isAPO2)
wstring apoGuidString = RegistryHelper::readValue(keyPath + L"\\FxProperties", allGuidValueNames[i]);
GUID apoGuid;
if(SUCCEEDED(CLSIDFromString(apoGuidString.c_str(), &apoGuid)))
{
originalLfxGuid = RegistryHelper::readValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, lfxGuidValueName2);
originalGfxGuid = RegistryHelper::readValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, gfxGuidValueName2);
}
else
{
originalLfxGuid = RegistryHelper::readValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, lfxGuidValueName);
originalGfxGuid = RegistryHelper::readValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, gfxGuidValueName);
}
}
else if(RegistryHelper::valueExists(APP_REGPATH L"\\Child APOs", deviceGuid))
{
if(isLFX)
{
originalLfxGuid = RegistryHelper::readValue(APP_REGPATH L"\\Child APOs", deviceGuid);
originalGfxGuid = L"";
}
else
{
originalLfxGuid = L"";
originalGfxGuid = RegistryHelper::readValue(APP_REGPATH L"\\Child APOs", deviceGuid);
if(apoGuid == EQUALIZERAPO_PRE_MIX_GUID || apoGuid == EQUALIZERAPO_POST_MIX_GUID)
{
foundAt[i] = true;
found = true;
}
}
}
}
else
if(found)
{
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", lfxValueName))
originalLfxGuid = RegistryHelper::readValue(keyPath + L"\\FxProperties", lfxValueName);
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", gfxValueName))
originalGfxGuid = RegistryHelper::readValue(keyPath + L"\\FxProperties", gfxValueName);
isInstalled = true;
if(RegistryHelper::keyExists(childApoPath L"\\" + deviceGuid))
{
if(RegistryHelper::valueExists(childApoPath L"\\" + deviceGuid, versionValueName))
{
version = RegistryHelper::readValue(childApoPath L"\\" + deviceGuid, versionValueName);
if(version != installVersion)
throw RegistryException(L"Unsupported version of APO installation detected! Please uninstall newer Equalizer APO before using this version of Configurator.");
}
else
{
version = L"1";
}
for(int i=0; i < allGuidValueNameCount; i++)
{
if(RegistryHelper::valueExists(childApoPath L"\\" + deviceGuid, allGuidValueNames[i]))
originalApoGuids[i] = RegistryHelper::readValue(childApoPath L"\\" + deviceGuid, allGuidValueNames[i]);
}
if(version == installVersion)
{
if(RegistryHelper::valueExists(childApoPath L"\\" + deviceGuid, preMixChildGuidValueName))
preMixChildGuid = RegistryHelper::readValue(childApoPath L"\\" + deviceGuid, preMixChildGuidValueName);
if(RegistryHelper::valueExists(childApoPath L"\\" + deviceGuid, postMixChildGuidValueName))
postMixChildGuid = RegistryHelper::readValue(childApoPath L"\\" + deviceGuid, postMixChildGuidValueName);
currentInstallState.installPreMix = foundAt[LFX_INDEX] || foundAt[SFX_INDEX];
currentInstallState.installPostMix = foundAt[GFX_INDEX] || foundAt[MFX_INDEX] || foundAt[EFX_INDEX];
if(preMixChildGuid == L"")
currentInstallState.useOriginalAPOPreMix = false;
if(postMixChildGuid == L"")
currentInstallState.useOriginalAPOPostMix = false;
if(foundAt[LFX_INDEX] || foundAt[GFX_INDEX])
currentInstallState.installMode = INSTALL_LFX_GFX;
else if(foundAt[EFX_INDEX])
currentInstallState.installMode = INSTALL_SFX_EFX;
else if(foundAt[SFX_INDEX] || foundAt[MFX_INDEX])
currentInstallState.installMode = INSTALL_SFX_MFX;
}
else
{
if(RegistryHelper::valueExists(childApoPath L"\\" + deviceGuid, lfxGuidValueName))
{
preMixChildGuid = originalApoGuids[0];
postMixChildGuid = originalApoGuids[1];
}
else
{
preMixChildGuid = originalApoGuids[2];
postMixChildGuid = originalApoGuids[3];
}
}
}
else if(RegistryHelper::valueExists(childApoPath, deviceGuid))
{
for(int i=0; i < allGuidValueNameCount; i++)
{
if(foundAt[i])
{
originalApoGuids[i] = RegistryHelper::readValue(childApoPath, deviceGuid);
if(i == LFX_INDEX || i == SFX_INDEX)
preMixChildGuid = originalApoGuids[i];
else
postMixChildGuid = originalApoGuids[i];
break;
}
}
}
}
}
@@ -172,45 +229,96 @@ bool DeviceAPOInfo::load(const wstring& deviceGuid)
bool DeviceAPOInfo::canBeUpgraded()
{
return isInstalled && !isDual;
return isInstalled && version != installVersion;
}
bool DeviceAPOInfo::hasChanges()
{
return isInstalled && selectedInstallState != currentInstallState;
}
bool DeviceAPOInfo::isExperimental()
{
return !isInstalled && originalGfxGuid == APOGUID_NOKEY;
return !isInstalled && originalApoGuids[0] == APOGUID_NOKEY;
}
wstring DeviceAPOInfo::getOriginalAPOPreMix()
{
wstring guid;
switch(selectedInstallState.installMode)
{
case INSTALL_LFX_GFX:
guid = originalApoGuids[LFX_INDEX];
if(RegistryHelper::isWindowsVersionAtLeast(6, 3)) // Windows 8.1
{
if(originalApoGuids[LFX_INDEX] == APOGUID_NOVALUE && originalApoGuids[GFX_INDEX] == APOGUID_NOVALUE)
guid = originalApoGuids[SFX_INDEX];
}
break;
case INSTALL_SFX_MFX:
guid = originalApoGuids[SFX_INDEX];
if(originalApoGuids[SFX_INDEX] == APOGUID_NOVALUE && originalApoGuids[MFX_INDEX] == APOGUID_NOVALUE)
guid = originalApoGuids[LFX_INDEX];
break;
case INSTALL_SFX_EFX:
guid = originalApoGuids[SFX_INDEX];
if(originalApoGuids[SFX_INDEX] == APOGUID_NOVALUE && originalApoGuids[EFX_INDEX] == APOGUID_NOVALUE)
guid = originalApoGuids[LFX_INDEX];
break;
}
if(guid == APOGUID_NOKEY || guid == APOGUID_NOVALUE)
guid = L"";
return guid;
}
wstring DeviceAPOInfo::getOriginalAPOPostMix()
{
wstring guid;
switch(selectedInstallState.installMode)
{
case INSTALL_LFX_GFX:
guid = originalApoGuids[GFX_INDEX];
if(RegistryHelper::isWindowsVersionAtLeast(6, 3)) // Windows 8.1
{
if(originalApoGuids[LFX_INDEX] == APOGUID_NOVALUE && originalApoGuids[GFX_INDEX] == APOGUID_NOVALUE)
guid = originalApoGuids[MFX_INDEX];
}
break;
case INSTALL_SFX_MFX:
guid = originalApoGuids[MFX_INDEX];
if(originalApoGuids[SFX_INDEX] == APOGUID_NOVALUE && originalApoGuids[MFX_INDEX] == APOGUID_NOVALUE)
guid = originalApoGuids[GFX_INDEX];
break;
case INSTALL_SFX_EFX:
guid = originalApoGuids[EFX_INDEX];
if(originalApoGuids[SFX_INDEX] == APOGUID_NOVALUE && originalApoGuids[EFX_INDEX] == APOGUID_NOVALUE)
guid = originalApoGuids[GFX_INDEX];
break;
}
if(guid == APOGUID_NOKEY || guid == APOGUID_NOVALUE)
guid = L"";
return guid;
}
void DeviceAPOInfo::install()
{
RegistryHelper::createKey(APP_REGPATH L"\\Child APOs");
RegistryHelper::createKey(APP_REGPATH L"\\Child APOs\\" + deviceGuid);
if(!selectedInstallState.installPreMix && !selectedInstallState.installPostMix)
return;
wstring lfxValueName;
wstring gfxValueName;
if(installAsAPO2)
{
lfxValueName = lfxGuidValueName2;
gfxValueName = gfxGuidValueName2;
}
else
{
lfxValueName = lfxGuidValueName;
gfxValueName = gfxGuidValueName;
}
RegistryHelper::writeValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, lfxValueName, originalLfxGuid);
if(isInput)
RegistryHelper::writeValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, gfxValueName, L"");
else
RegistryHelper::writeValue(APP_REGPATH L"\\Child APOs\\" + deviceGuid, gfxValueName, originalGfxGuid);
RegistryHelper::createKey(childApoPath);
RegistryHelper::createKey(childApoPath L"\\" + deviceGuid);
wstring keyPath;
if(isInput)
keyPath = captureKeyPath L"\\" + deviceGuid;
else
if(!isInput)
keyPath = renderKeyPath L"\\" + deviceGuid;
else
keyPath = captureKeyPath L"\\" + deviceGuid;
if(originalGfxGuid == APOGUID_NOKEY)
if(!RegistryHelper::keyExists(keyPath + L"\\FxProperties"))
{
try
{
@@ -226,25 +334,97 @@ void DeviceAPOInfo::install()
}
RegistryHelper::writeValue(keyPath + L"\\FxProperties", fxTitleValueName, L"Equalizer APO");
RegistryHelper::writeMultiValue(keyPath + L"\\FxProperties", sfxProcessingModesValueName, defaultProcessingModeValue);
RegistryHelper::writeMultiValue(keyPath + L"\\FxProperties", mfxProcessingModesValueName, defaultProcessingModeValue);
for(int i=0; i < allGuidValueNameCount; i++)
{
RegistryHelper::writeValue(childApoPath L"\\" + deviceGuid, allGuidValueNames[i], APOGUID_NOKEY);
}
}
else
{
vector<wstring> valuenames;
if(originalLfxGuid != APOGUID_NOVALUE)
valuenames.push_back(lfxValueName);
if(!isInput && originalGfxGuid != APOGUID_NOVALUE)
valuenames.push_back(gfxValueName);
for(int i=0; i < allGuidValueNameCount; i++)
{
wstring apoGuidString = APOGUID_NOVALUE;
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", allGuidValueNames[i]))
{
apoGuidString = RegistryHelper::readValue(keyPath + L"\\FxProperties", allGuidValueNames[i]);
valuenames.push_back(allGuidValueNames[i]);
}
RegistryHelper::writeValue(childApoPath L"\\" + deviceGuid, allGuidValueNames[i], apoGuidString);
}
if(!valuenames.empty())
RegistryHelper::saveToFile(keyPath + L"\\FxProperties", valuenames,
L"backup_" + StringHelper::replaceIllegalCharacters(deviceName) + L"_" + StringHelper::replaceIllegalCharacters(connectionName) + L".reg");
}
RegistryHelper::writeValue(keyPath + L"\\FxProperties", lfxValueName, RegistryHelper::getGuidString(EQUALIZERAPO_LFX_GUID));
if(!isInput)
RegistryHelper::writeValue(keyPath + L"\\FxProperties", gfxValueName, RegistryHelper::getGuidString(EQUALIZERAPO_GFX_GUID));
wstring preMixValue;
wstring postMixValue;
if(selectedInstallState.useOriginalAPOPreMix)
preMixValue = getOriginalAPOPreMix();
if(selectedInstallState.useOriginalAPOPostMix)
postMixValue = getOriginalAPOPostMix();
RegistryHelper::writeValue(childApoPath L"\\" + deviceGuid, preMixChildGuidValueName, preMixValue);
RegistryHelper::writeValue(childApoPath L"\\" + deviceGuid, postMixChildGuidValueName, postMixValue);
RegistryHelper::writeValue(childApoPath L"\\" + deviceGuid, versionValueName, installVersion);
if(selectedInstallState.installMode == INSTALL_LFX_GFX)
{
if(selectedInstallState.installPreMix)
RegistryHelper::writeValue(keyPath + L"\\FxProperties", lfxGuidValueName, RegistryHelper::getGuidString(EQUALIZERAPO_PRE_MIX_GUID));
if(selectedInstallState.installPostMix && !isInput)
RegistryHelper::writeValue(keyPath + L"\\FxProperties", gfxGuidValueName, RegistryHelper::getGuidString(EQUALIZERAPO_POST_MIX_GUID));
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", sfxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", sfxGuidValueName);
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", mfxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", mfxGuidValueName);
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", efxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", efxGuidValueName);
}
else if(selectedInstallState.installMode == INSTALL_SFX_MFX)
{
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", lfxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", lfxGuidValueName);
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", gfxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", gfxGuidValueName);
if(selectedInstallState.installPreMix)
{
RegistryHelper::writeValue(keyPath + L"\\FxProperties", sfxGuidValueName, RegistryHelper::getGuidString(EQUALIZERAPO_PRE_MIX_GUID));
if(!RegistryHelper::valueExists(keyPath + L"\\FxProperties", sfxProcessingModesValueName))
RegistryHelper::writeMultiValue(keyPath + L"\\FxProperties", sfxProcessingModesValueName, defaultProcessingModeValue);
}
if(selectedInstallState.installPostMix && !isInput)
{
RegistryHelper::writeValue(keyPath + L"\\FxProperties", mfxGuidValueName, RegistryHelper::getGuidString(EQUALIZERAPO_POST_MIX_GUID));
if(!RegistryHelper::valueExists(keyPath + L"\\FxProperties", mfxProcessingModesValueName))
RegistryHelper::writeMultiValue(keyPath + L"\\FxProperties", mfxProcessingModesValueName, defaultProcessingModeValue);
}
// don't change efx
}
else if(selectedInstallState.installMode == INSTALL_SFX_EFX)
{
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", lfxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", lfxGuidValueName);
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", gfxGuidValueName))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", gfxGuidValueName);
if(selectedInstallState.installPreMix)
{
RegistryHelper::writeValue(keyPath + L"\\FxProperties", sfxGuidValueName, RegistryHelper::getGuidString(EQUALIZERAPO_PRE_MIX_GUID));
if(!RegistryHelper::valueExists(keyPath + L"\\FxProperties", sfxProcessingModesValueName))
RegistryHelper::writeMultiValue(keyPath + L"\\FxProperties", sfxProcessingModesValueName, defaultProcessingModeValue);
}
// don't change mfx
if(selectedInstallState.installPostMix && !isInput)
{
RegistryHelper::writeValue(keyPath + L"\\FxProperties", efxGuidValueName, RegistryHelper::getGuidString(EQUALIZERAPO_POST_MIX_GUID));
if(!RegistryHelper::valueExists(keyPath + L"\\FxProperties", efxProcessingModesValueName))
RegistryHelper::writeMultiValue(keyPath + L"\\FxProperties", efxProcessingModesValueName, defaultProcessingModeValue);
}
}
}
void DeviceAPOInfo::uninstall()
@@ -255,64 +435,32 @@ void DeviceAPOInfo::uninstall()
else
keyPath = captureKeyPath L"\\" + deviceGuid;
if(originalLfxGuid == APOGUID_NOKEY || originalGfxGuid == APOGUID_NOKEY)
if(originalApoGuids[0] == APOGUID_NOKEY)
{
RegistryHelper::deleteKey(keyPath + L"\\FxProperties");
}
else
{
wstring lfxValueName;
wstring gfxValueName;
if(isAPO2)
for(int i=0; i < allGuidValueNameCount; i++)
{
lfxValueName = lfxGuidValueName2;
gfxValueName = gfxGuidValueName2;
}
else
{
lfxValueName = lfxGuidValueName;
gfxValueName = gfxGuidValueName;
}
if(originalLfxGuid == APOGUID_NOVALUE)
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", lfxValueName);
else if(originalLfxGuid != L"")
RegistryHelper::writeValue(keyPath + L"\\FxProperties", lfxValueName, originalLfxGuid);
if(originalGfxGuid == APOGUID_NOVALUE)
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", gfxValueName);
else if(originalGfxGuid != L"")
RegistryHelper::writeValue(keyPath + L"\\FxProperties", gfxValueName, originalGfxGuid);
}
if(RegistryHelper::valueExists(APP_REGPATH L"\\Child APOs", deviceGuid))
RegistryHelper::deleteValue(APP_REGPATH L"\\Child APOs", deviceGuid);
if(RegistryHelper::keyExists(APP_REGPATH L"\\Child APOs\\" + deviceGuid))
RegistryHelper::deleteKey(APP_REGPATH L"\\Child APOs\\" + deviceGuid);
if(RegistryHelper::keyEmpty(APP_REGPATH L"\\Child APOs"))
RegistryHelper::deleteKey(APP_REGPATH L"\\Child APOs");
}
bool DeviceAPOInfo::tryAPOGuid(const wstring& keyPath, const wstring& valueName, GUID guid, bool lfx, bool apo2)
{
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", valueName))
{
wstring apoGuidString = RegistryHelper::readValue(keyPath + L"\\FxProperties", valueName);
GUID apoGuid;
if(SUCCEEDED(CLSIDFromString(apoGuidString.c_str(), &apoGuid)))
{
if(apoGuid == guid)
if(originalApoGuids[i] == APOGUID_NOVALUE)
{
isLFX = lfx;
isAPO2 = apo2;
return true;
if(RegistryHelper::valueExists(keyPath + L"\\FxProperties", allGuidValueNames[i]))
RegistryHelper::deleteValue(keyPath + L"\\FxProperties", allGuidValueNames[i]);
}
else if(originalApoGuids[i] != L"")
{
RegistryHelper::writeValue(keyPath + L"\\FxProperties", allGuidValueNames[i], originalApoGuids[i]);
}
}
}
return false;
}
if(RegistryHelper::valueExists(childApoPath, deviceGuid))
RegistryHelper::deleteValue(childApoPath, deviceGuid);
if(RegistryHelper::keyExists(childApoPath L"\\" + deviceGuid))
RegistryHelper::deleteKey(childApoPath L"\\" + deviceGuid);
if(RegistryHelper::keyEmpty(childApoPath))
RegistryHelper::deleteKey(childApoPath);
}