bool CheckContextMenuHandler(const UString &path, UInt32 wow) { // NSynchronization::CCriticalSectionLock lock(g_CS); CSysString s = TEXT("CLSID\\"); s += k_Clsid; s.AddAscii("\\InprocServer32"); { NRegistry::CKey key; if (key.Open(HKEY_CLASSES_ROOT, s, KEY_READ | wow) != ERROR_SUCCESS) return false; UString regPath; if (key.QueryValue(NULL, regPath) != ERROR_SUCCESS) return false; if (!path.IsEqualTo_NoCase(regPath)) return false; } return CheckHandlerCommon(Get_ContextMenuHandler_KeyName(k_KeyName_File), wow); /* && CheckHandlerCommon(Get_ContextMenuHandler_KeyName(k_KeyName_Directory), wow) // && CheckHandlerCommon(Get_ContextMenuHandler_KeyName(k_KeyName_Folder)) && CheckHandlerCommon(Get_DragDropHandler_KeyName(k_KeyName_Directory), wow) && CheckHandlerCommon(Get_DragDropHandler_KeyName(k_KeyName_Drive), wow); */ }
static bool ReadPathFromRegistry(HKEY baseKey, CSysString &path) { NRegistry::CKey key; if(key.Open(baseKey, kRegistryPath, KEY_READ) == ERROR_SUCCESS) if (key.QueryValue(kProgramPathValue, path) == ERROR_SUCCESS) { NName::NormalizeDirPathPrefix(path); return true; } return false; }
LONG CStartupInfo::OpenRegKey(HKEY parentKey, const CSysString &keyName, NRegistry::CKey &destKey) const { return destKey.Open(parentKey, GetFullKeyName(keyName)); }