Fix dumping of cl_cache

- change creatOsReader and constructor of RegistryReader
- move body of constructors of RegistryReader from .h to .cpp

Change-Id: I57cbf51a57cb1cb7f9cd2473af766a79cf2035d2
This commit is contained in:
Katarzyna Cencelewska
2018-11-30 11:51:49 +01:00
committed by sys_ocldev
parent fe228ea5f7
commit a99939b08f
4 changed files with 16 additions and 17 deletions

View File

@@ -17,7 +17,15 @@ SettingsReader *SettingsReader::createOsReader(bool userScope) {
return new RegistryReader(userScope);
}
SettingsReader *SettingsReader::createOsReader(const std::string &regKey) {
return new RegistryReader(regKey);
return new RegistryReader("Software\\Intel\\IGFX\\OCL\\" + regKey);
}
RegistryReader::RegistryReader(bool userScope) {
igdrclHkeyType = userScope ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
setUpProcessName();
}
RegistryReader::RegistryReader(const std::string &regKey) : registryReadRootKey(regKey) {
setUpProcessName();
}
void RegistryReader::setUpProcessName() {
char buff[MAX_PATH];
@@ -75,7 +83,6 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
0,
KEY_READ,
&Key);
if (ERROR_SUCCESS == success) {
DWORD regType = REG_NONE;
DWORD regSize = 0;
@@ -86,7 +93,6 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
&regType,
NULL,
&regSize);
if (success == ERROR_SUCCESS && regType == REG_SZ) {
char *regData = new char[regSize];
success = RegQueryValueExA(Key,

View File

@@ -19,14 +19,8 @@ class RegistryReader : public SettingsReader {
int32_t getSetting(const char *settingName, int32_t defaultValue) override;
bool getSetting(const char *settingName, bool defaultValue) override;
std::string getSetting(const char *settingName, const std::string &value) override;
RegistryReader(bool userScope) {
igdrclHkeyType = userScope ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
setUpProcessName();
}
RegistryReader(std::string regKey) {
registryReadRootKey.append(std::string(1, PATH_SEPARATOR)).append(regKey);
setUpProcessName();
}
RegistryReader(bool userScope);
RegistryReader(const std::string &regKey);
const char *appSpecificLocation(const std::string &name) override;
protected: