[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:
Serge Gautherie
2019-11-20 22:13:48 +01:00
committed by Victor Perevertkin
parent c3da027012
commit 9c82d16b14
4 changed files with 8 additions and 7 deletions

View File

@@ -131,7 +131,7 @@ CDeviceNode::SetupNode()
&m_ClassImage);
// Get the description for the device
ulLength = DISPLAY_NAME_LEN * sizeof(WCHAR);
ulLength = sizeof(m_DisplayName);
cr = CM_Get_DevNode_Registry_PropertyW(m_DevInst,
CM_DRP_FRIENDLYNAME,
NULL,
@@ -140,7 +140,7 @@ CDeviceNode::SetupNode()
0);
if (cr != CR_SUCCESS)
{
ulLength = DISPLAY_NAME_LEN * sizeof(WCHAR);
ulLength = sizeof(m_DisplayName);
cr = CM_Get_DevNode_Registry_PropertyW(m_DevInst,
CM_DRP_DEVICEDESC,
NULL,