OpenCoreDevProps: Fixed ignoring # in DeviceProperty Add and Block

This commit is contained in:
vit9696 2020-05-14 18:33:57 +03:00
parent 86b69367df
commit e1a2b99299
2 changed files with 23 additions and 4 deletions

View File

@ -28,6 +28,7 @@ OpenCore Changelog
- Fixed assertions on log exhaustion causing boot failures
- Fixed builtin text renderer failing to provide ConsoleControl
- Fixed compatibility with blit-only GOP (e.g. OVMF Bochs)
- Fixed ignoring `#` in DeviceProperty `Add` and `Block`
#### v0.5.8
- Fixed invalid CPU object reference in SSDT-PLUG

View File

@ -51,7 +51,11 @@ OcLoadDevPropsSupport (
}
for (DeviceIndex = 0; DeviceIndex < Config->DeviceProperties.Block.Count; ++DeviceIndex) {
AsciiDevicePath = OC_BLOB_GET (Config->DeviceProperties.Block.Keys[DeviceIndex]);
AsciiDevicePath = OC_BLOB_GET (Config->DeviceProperties.Block.Keys[DeviceIndex]);
if (AsciiDevicePath[0] == '#') {
DEBUG ((DEBUG_INFO, "OC: Device property skip blocking %a\n", AsciiDevicePath));
continue;
}
UnicodeDevicePath = AsciiStrCopyToUnicode (AsciiDevicePath, 0);
DevicePath = NULL;
@ -67,7 +71,12 @@ OcLoadDevPropsSupport (
}
for (PropertyIndex = 0; PropertyIndex < Config->DeviceProperties.Block.Values[DeviceIndex]->Count; ++PropertyIndex) {
AsciiProperty = OC_BLOB_GET (Config->DeviceProperties.Block.Values[DeviceIndex]->Values[PropertyIndex]);
AsciiProperty = OC_BLOB_GET (Config->DeviceProperties.Block.Values[DeviceIndex]->Values[PropertyIndex]);
if (AsciiProperty[0] == '#') {
DEBUG ((DEBUG_INFO, "OC: Device property skip blocking %a\n", AsciiProperty));
continue;
}
UnicodeProperty = AsciiStrCopyToUnicode (AsciiProperty, 0);
if (UnicodeProperty == NULL) {
@ -98,6 +107,11 @@ OcLoadDevPropsSupport (
for (DeviceIndex = 0; DeviceIndex < Config->DeviceProperties.Add.Count; ++DeviceIndex) {
PropertyMap = Config->DeviceProperties.Add.Values[DeviceIndex];
AsciiDevicePath = OC_BLOB_GET (Config->DeviceProperties.Add.Keys[DeviceIndex]);
if (AsciiDevicePath[0] == '#') {
DEBUG ((DEBUG_INFO, "OC: Device property skip adding %a\n", AsciiDevicePath));
continue;
}
UnicodeDevicePath = AsciiStrCopyToUnicode (AsciiDevicePath, 0);
DevicePath = NULL;
@ -112,9 +126,13 @@ OcLoadDevPropsSupport (
}
for (PropertyIndex = 0; PropertyIndex < PropertyMap->Count; ++PropertyIndex) {
AsciiProperty = OC_BLOB_GET (PropertyMap->Keys[PropertyIndex]);
UnicodeProperty = AsciiStrCopyToUnicode (AsciiProperty, 0);
AsciiProperty = OC_BLOB_GET (PropertyMap->Keys[PropertyIndex]);
if (AsciiProperty[0] == '#') {
DEBUG ((DEBUG_INFO, "OC: Device property skip adding %a\n", AsciiProperty));
continue;
}
UnicodeProperty = AsciiStrCopyToUnicode (AsciiProperty, 0);
if (UnicodeProperty == NULL) {
DEBUG ((DEBUG_WARN, "OC: Failed to convert %a property\n", AsciiProperty));
continue;