feature: debug flag to disable DriverStore path enforcement

Resolves: NEO-8320

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-08-30 16:57:22 +00:00
committed by Compute-Runtime-Automation
parent db95855092
commit 9e89704624
5 changed files with 46 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ const HKEY validHkey = reinterpret_cast<HKEY>(0);
bool getNumThreadsCalled = false;
bool mmapAllowExtendedPointers = false;
bool pathExistsMock = false;
const char *driverStorePath = nullptr;
bool pathExists(const std::string &path) {
return pathExistsMock;
@@ -127,6 +128,16 @@ LSTATUS regQueryValueExA(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDW
*reinterpret_cast<uint64_t *>(lpData) = regQueryValueExpectedData;
}
}
} else if (driverStorePath && (strcmp(lpValueName, "DriverStorePathForComputeRuntime") == 0)) {
if (lpData) {
strcpy(reinterpret_cast<char *>(lpData), driverStorePath);
}
if (lpcbData) {
*lpcbData = static_cast<DWORD>(strlen(driverStorePath) + 1u);
if (lpType) {
*lpType = REG_SZ;
}
}
}
}