Merge pull request #852 from Notselwyn/patch-1
SEBWIN-789: remove historic hw VM check
This commit is contained in:
commit
bbb5ec2571
1 changed files with 0 additions and 41 deletions
|
@ -105,7 +105,6 @@ namespace SafeExamBrowser.SystemComponents
|
|||
{
|
||||
var isVirtualRegistry = false;
|
||||
|
||||
isVirtualRegistry |= HasHistoricVirtualMachineHardwareConfiguration();
|
||||
isVirtualRegistry |= HasLocalVirtualMachineDeviceCache();
|
||||
|
||||
return isVirtualRegistry;
|
||||
|
@ -134,46 +133,6 @@ namespace SafeExamBrowser.SystemComponents
|
|||
return isVirtualSystem;
|
||||
}
|
||||
|
||||
private bool HasHistoricVirtualMachineHardwareConfiguration()
|
||||
{
|
||||
var hasHistoricConfiguration = false;
|
||||
|
||||
if (registry.TryGetSubKeys(RegistryValue.MachineHive.HardwareConfig_Key, out var hardwareConfigSubkeys))
|
||||
{
|
||||
foreach (var configId in hardwareConfigSubkeys)
|
||||
{
|
||||
var hardwareConfigKey = $@"{RegistryValue.MachineHive.HardwareConfig_Key}\{configId}";
|
||||
var computerIdsKey = $@"{hardwareConfigKey}\ComputerIds";
|
||||
var success = true;
|
||||
|
||||
success &= registry.TryRead(hardwareConfigKey, "BIOSVendor", out var biosVendor);
|
||||
success &= registry.TryRead(hardwareConfigKey, "BIOSVersion", out var biosVersion);
|
||||
success &= registry.TryRead(hardwareConfigKey, "SystemManufacturer", out var systemManufacturer);
|
||||
success &= registry.TryRead(hardwareConfigKey, "SystemProductName", out var systemProductName);
|
||||
|
||||
if (success)
|
||||
{
|
||||
var biosInfo = $"{(string) biosVendor} {(string) biosVersion}";
|
||||
|
||||
hasHistoricConfiguration |= IsVirtualSystem(biosInfo, (string) systemManufacturer, (string) systemProductName);
|
||||
|
||||
if (registry.TryGetNames(computerIdsKey, out var computerIdNames))
|
||||
{
|
||||
foreach (var computerIdName in computerIdNames)
|
||||
{
|
||||
if (registry.TryRead(computerIdsKey, computerIdName, out var computerSummary))
|
||||
{
|
||||
hasHistoricConfiguration |= IsVirtualSystem((string) computerSummary, (string) systemManufacturer, (string) systemProductName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hasHistoricConfiguration;
|
||||
}
|
||||
|
||||
private bool HasLocalVirtualMachineDeviceCache()
|
||||
{
|
||||
var deviceName = System.Environment.GetEnvironmentVariable("COMPUTERNAME");
|
||||
|
|
Loading…
Reference in a new issue