Nikolay Sivov : setupapi: Use sizeof() instead of numerical constants for buffer sizes.

Alexandre Julliard julliard at winehq.org
Wed Feb 8 15:52:11 CST 2017


Module: wine
Branch: master
Commit: 01080e6750abcad22ac30df0e4efe669b458f8ab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=01080e6750abcad22ac30df0e4efe669b458f8ab

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Feb  8 15:11:42 2017 +0300

setupapi: Use sizeof() instead of numerical constants for buffer sizes.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/devinst.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 63e578c..ffb5fad 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -903,7 +903,7 @@ BOOL WINAPI SetupDiClassGuidsFromNameExW(
 
     for (dwIndex = 0; ; dwIndex++)
     {
-	dwLength = 40;
+	dwLength = sizeof(szKeyName) / sizeof(WCHAR);
 	lError = RegEnumKeyExW(hClassesKey,
 			       dwIndex,
 			       szKeyName,
@@ -927,7 +927,7 @@ BOOL WINAPI SetupDiClassGuidsFromNameExW(
 		return FALSE;
 	    }
 
-	    dwLength = 256 * sizeof(WCHAR);
+	    dwLength = sizeof(szClassName);
 	    if (!RegQueryValueExW(hClassKey,
 				  Class,
 				  NULL,




More information about the wine-cvs mailing list