mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[DEVMGR] m_DisplayName: Some functions need bytes, not chars
Also: Always use explicit _countof() and sizeof(). Add a missing 'Size' re-init.
This commit is contained in:
committed by
Victor Perevertkin
parent
c3da027012
commit
9c82d16b14
@@ -42,10 +42,10 @@ CClassNode::SetupNode()
|
||||
0);
|
||||
if (hKey != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
Size = DISPLAY_NAME_LEN;
|
||||
Type = REG_SZ;
|
||||
|
||||
// Lookup the class description (win7+)
|
||||
Size = sizeof(m_DisplayName);
|
||||
Success = RegQueryValueExW(hKey,
|
||||
L"ClassDesc",
|
||||
NULL,
|
||||
@@ -58,12 +58,13 @@ CClassNode::SetupNode()
|
||||
if (m_DisplayName[0] == L'@')
|
||||
{
|
||||
// The description is located in a module resource
|
||||
Success = ConvertResourceDescriptorToString(m_DisplayName, DISPLAY_NAME_LEN);
|
||||
Success = ConvertResourceDescriptorToString(m_DisplayName, sizeof(m_DisplayName));
|
||||
}
|
||||
}
|
||||
else if (Success == ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
// WinXP stores the description in the default value
|
||||
Size = sizeof(m_DisplayName);
|
||||
Success = RegQueryValueExW(hKey,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -84,7 +85,7 @@ CClassNode::SetupNode()
|
||||
if (Success != ERROR_SUCCESS)
|
||||
{
|
||||
// Use the class name as the description
|
||||
RequiredSize = DISPLAY_NAME_LEN;
|
||||
RequiredSize = _countof(m_DisplayName);
|
||||
(VOID)SetupDiClassNameFromGuidW(&m_ClassGuid,
|
||||
m_DisplayName,
|
||||
RequiredSize,
|
||||
|
||||
Reference in New Issue
Block a user