mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 21:12:10 +00:00
[DEVMGR] CClassNode::SetupNode(): Properly use Type (#2100)
This commit is contained in:
parent
6bf099a662
commit
ad6f1ac72b
1 changed files with 9 additions and 3 deletions
|
@ -42,8 +42,6 @@ CClassNode::SetupNode()
|
||||||
0);
|
0);
|
||||||
if (hKey != INVALID_HANDLE_VALUE)
|
if (hKey != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
Type = REG_SZ;
|
|
||||||
|
|
||||||
// Lookup the class description (win7+)
|
// Lookup the class description (win7+)
|
||||||
Size = sizeof(m_DisplayName);
|
Size = sizeof(m_DisplayName);
|
||||||
Success = RegQueryValueExW(hKey,
|
Success = RegQueryValueExW(hKey,
|
||||||
|
@ -54,8 +52,12 @@ CClassNode::SetupNode()
|
||||||
&Size);
|
&Size);
|
||||||
if (Success == ERROR_SUCCESS)
|
if (Success == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
if (Type != REG_SZ)
|
||||||
|
{
|
||||||
|
Success = ERROR_INVALID_DATA;
|
||||||
|
}
|
||||||
// Check if the string starts with an @
|
// 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
|
// The description is located in a module resource
|
||||||
Success = ConvertResourceDescriptorToString(m_DisplayName, sizeof(m_DisplayName));
|
Success = ConvertResourceDescriptorToString(m_DisplayName, sizeof(m_DisplayName));
|
||||||
|
@ -71,6 +73,10 @@ CClassNode::SetupNode()
|
||||||
&Type,
|
&Type,
|
||||||
(LPBYTE)m_DisplayName,
|
(LPBYTE)m_DisplayName,
|
||||||
&Size);
|
&Size);
|
||||||
|
if (Success == ERROR_SUCCESS && Type != REG_SZ)
|
||||||
|
{
|
||||||
|
Success = ERROR_INVALID_DATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the registry key
|
// Close the registry key
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue