https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad6f1ac72b4c5d863bfc83...
commit ad6f1ac72b4c5d863bfc83975174f24e130292ad Author: Serge Gautherie 32623169+SergeGautherie@users.noreply.github.com AuthorDate: Fri Nov 29 14:13:13 2019 +0100 Commit: Hermès BÉLUSCA - MAÏTO hermes.belusca-maito@reactos.org CommitDate: Fri Nov 29 14:13:13 2019 +0100
[DEVMGR] CClassNode::SetupNode(): Properly use Type (#2100) --- dll/win32/devmgr/devmgmt/ClassNode.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dll/win32/devmgr/devmgmt/ClassNode.cpp b/dll/win32/devmgr/devmgmt/ClassNode.cpp index bba78cf13e6..17cb7edaae0 100644 --- a/dll/win32/devmgr/devmgmt/ClassNode.cpp +++ b/dll/win32/devmgr/devmgmt/ClassNode.cpp @@ -42,8 +42,6 @@ CClassNode::SetupNode() 0); if (hKey != INVALID_HANDLE_VALUE) { - Type = REG_SZ; - // Lookup the class description (win7+) Size = sizeof(m_DisplayName); Success = RegQueryValueExW(hKey, @@ -54,8 +52,12 @@ CClassNode::SetupNode() &Size); if (Success == ERROR_SUCCESS) { + if (Type != REG_SZ) + { + Success = ERROR_INVALID_DATA; + } // Check if the string starts with an @ - if (m_DisplayName[0] == L'@') + else if (m_DisplayName[0] == L'@') { // The description is located in a module resource Success = ConvertResourceDescriptorToString(m_DisplayName, sizeof(m_DisplayName)); @@ -71,6 +73,10 @@ CClassNode::SetupNode() &Type, (LPBYTE)m_DisplayName, &Size); + if (Success == ERROR_SUCCESS && Type != REG_SZ) + { + Success = ERROR_INVALID_DATA; + } }
// Close the registry key