From 57f92860239cb87ce4b1d723ce6f9661d881fa97 Mon Sep 17 00:00:00 2001 From: Randy Date: Tue, 2 May 2023 05:05:50 -0700 Subject: [PATCH] [RegistryPreview]Fix empty DWORD and QWORD values (#25751) Adds special handling for DWORD and QWORD Value types with empty values. --- .../RegistryPreviewUI/MainWindow.Utilities.cs | 15 +++++++++++++++ .../Strings/en-US/Resources.resw | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs index 82228f2834..8206826473 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs +++ b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs @@ -430,6 +430,21 @@ namespace RegistryPreview registryValue.Value = value; + break; + case "REG_DWORD": + if (value.Length <= 0) + { + registryValue.Type = "ERROR"; + } + + break; + case "REG_QWORD": + if (value.Length <= 0) + { + value = resourceLoader.GetString("InvalidQword"); + } + + registryValue.Value = value; break; default: registryValue.Value = value; diff --git a/src/modules/registrypreview/RegistryPreviewUI/Strings/en-US/Resources.resw b/src/modules/registrypreview/RegistryPreviewUI/Strings/en-US/Resources.resw index 9270f17093..03fc8da221 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/Strings/en-US/Resources.resw +++ b/src/modules/registrypreview/RegistryPreviewUI/Strings/en-US/Resources.resw @@ -138,6 +138,9 @@ Registry files (*.reg) + + (Invalid QWORD (64-bit) value) + doesn't appear to be a valid registry file!