mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Fix windows wrappers
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cfad41f28a
commit
cd702af3a1
@@ -57,22 +57,22 @@ int64_t RegistryReader::getSetting(const char *settingName, int64_t defaultValue
|
||||
DWORD success = ERROR_SUCCESS;
|
||||
bool readSettingFromEnv = true;
|
||||
|
||||
success = RegOpenKeyExA(hkeyType,
|
||||
registryReadRootKey.c_str(),
|
||||
0,
|
||||
KEY_READ,
|
||||
&Key);
|
||||
success = SysCalls::regOpenKeyExA(hkeyType,
|
||||
registryReadRootKey.c_str(),
|
||||
0,
|
||||
KEY_READ,
|
||||
&Key);
|
||||
|
||||
if (ERROR_SUCCESS == success) {
|
||||
DWORD size = sizeof(int64_t);
|
||||
int64_t regData;
|
||||
|
||||
success = RegQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
NULL,
|
||||
reinterpret_cast<LPBYTE>(®Data),
|
||||
&size);
|
||||
success = SysCalls::regQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
NULL,
|
||||
reinterpret_cast<LPBYTE>(®Data),
|
||||
&size);
|
||||
if (ERROR_SUCCESS == success) {
|
||||
value = regData;
|
||||
readSettingFromEnv = false;
|
||||
@@ -95,30 +95,30 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
|
||||
std::string keyValue = value;
|
||||
bool readSettingFromEnv = true;
|
||||
|
||||
success = RegOpenKeyExA(hkeyType,
|
||||
registryReadRootKey.c_str(),
|
||||
0,
|
||||
KEY_READ,
|
||||
&Key);
|
||||
success = SysCalls::regOpenKeyExA(hkeyType,
|
||||
registryReadRootKey.c_str(),
|
||||
0,
|
||||
KEY_READ,
|
||||
&Key);
|
||||
if (ERROR_SUCCESS == success) {
|
||||
DWORD regType = REG_NONE;
|
||||
DWORD regSize = 0;
|
||||
|
||||
success = RegQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
®Type,
|
||||
NULL,
|
||||
®Size);
|
||||
success = SysCalls::regQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
®Type,
|
||||
NULL,
|
||||
®Size);
|
||||
if (ERROR_SUCCESS == success) {
|
||||
if (regType == REG_SZ || regType == REG_MULTI_SZ) {
|
||||
auto regData = std::make_unique<char[]>(regSize);
|
||||
success = RegQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
®Type,
|
||||
reinterpret_cast<LPBYTE>(regData.get()),
|
||||
®Size);
|
||||
success = SysCalls::regQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
®Type,
|
||||
reinterpret_cast<LPBYTE>(regData.get()),
|
||||
®Size);
|
||||
if (success == ERROR_SUCCESS) {
|
||||
keyValue.assign(regData.get());
|
||||
readSettingFromEnv = false;
|
||||
@@ -126,12 +126,12 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
|
||||
} else if (regType == REG_BINARY) {
|
||||
size_t charCount = regSize / sizeof(wchar_t);
|
||||
auto regData = std::make_unique<wchar_t[]>(charCount);
|
||||
success = RegQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
®Type,
|
||||
reinterpret_cast<LPBYTE>(regData.get()),
|
||||
®Size);
|
||||
success = SysCalls::regQueryValueExA(Key,
|
||||
settingName,
|
||||
NULL,
|
||||
®Type,
|
||||
reinterpret_cast<LPBYTE>(regData.get()),
|
||||
®Size);
|
||||
|
||||
if (ERROR_SUCCESS == success) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user