bool CRulesManager::FindRule(const USB_DK_HIDE_RULE &Rule, TFunctor Functor) { for (const auto &SubKey : m_RegAccess) { try { USB_DK_HIDE_RULE ExistingRule; ReadRule(SubKey, ExistingRule); if (Rule == ExistingRule) { Functor(SubKey); return true; } } catch (const UsbDkRuleManagerException &e) { auto ErrorText = tstring(TEXT("Error while processing rule ")) + SubKey + TEXT(": ") + string2tstring(e.what()); OutputDebugString(ErrorText.c_str()); } } return false; }
void printExceptionString(const char *errorStr) { auto tString = string2tstring(string(errorStr)); OutputDebugString(tString.c_str()); tcout << tString; }