advapi32: Use variable of correct type to store LSTATUS result.

Sebastian Lackner sebastian at fds-team.de
Tue Sep 13 02:02:07 CDT 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

Michael Müller has been working on Clang patches to catch errors like mixing HRESULT with other types.
He's planning to share the patches soon, but I decided to fix some the easy ones in the meantime. ;)

.../dlls/advapi32/registry.c:1032:16: warning: Assigning 'LSTATUS' (aka 'int') to 'HRESULT' (aka 'int') [wine-hresult-check]
        status = RegQueryValueExA(hkey, val_list[i].ve_valuename, NULL, NULL, NULL, &val_list[i].ve_valuelen);
               ^
.../dlls/advapi32/registry.c:1033:19: warning: Comparing 'HRESULT' (aka 'int') against 'int' [wine-hresult-check]
        if(status != ERROR_SUCCESS)
                  ^
.../dlls/advapi32/registry.c:1040:20: warning: Assigning 'LSTATUS' (aka 'int') to 'HRESULT' (aka 'int') [wine-hresult-check]
            status = RegQueryValueExA(hkey, val_list[i].ve_valuename, NULL, &val_list[i].ve_type,
                   ^
.../dlls/advapi32/registry.c:1042:23: warning: Comparing 'HRESULT' (aka 'int') against 'int' [wine-hresult-check]
            if(status != ERROR_SUCCESS)
                      ^
.../dlls/advapi32/registry.c:1077:16: warning: Assigning 'LSTATUS' (aka 'int') to 'HRESULT' (aka 'int') [wine-hresult-check]
        status = RegQueryValueExW(hkey, val_list[i].ve_valuename, NULL, NULL, NULL, &val_list[i].ve_valuelen);
               ^
.../dlls/advapi32/registry.c:1078:19: warning: Comparing 'HRESULT' (aka 'int') against 'int' [wine-hresult-check]
        if(status != ERROR_SUCCESS)
                  ^
.../dlls/advapi32/registry.c:1085:20: warning: Assigning 'LSTATUS' (aka 'int') to 'HRESULT' (aka 'int') [wine-hresult-check]
            status = RegQueryValueExW(hkey, val_list[i].ve_valuename, NULL, &val_list[i].ve_type,
                   ^
.../dlls/advapi32/registry.c:1087:23: warning: Comparing 'HRESULT' (aka 'int') against 'int' [wine-hresult-check]
            if(status != ERROR_SUCCESS)
                      ^

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

diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 4b3d852..11be690 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -1019,7 +1019,7 @@ LSTATUS WINAPI RegQueryMultipleValuesA( HKEY hkey, PVALENTA val_list, DWORD num_
 {
     unsigned int i;
     DWORD maxBytes = *ldwTotsize;
-    HRESULT status;
+    LSTATUS status;
     LPSTR bufptr = lpValueBuf;
     *ldwTotsize = 0;
 
@@ -1065,7 +1065,7 @@ LSTATUS WINAPI RegQueryMultipleValuesW( HKEY hkey, PVALENTW val_list, DWORD num_
 {
     unsigned int i;
     DWORD maxBytes = *ldwTotsize;
-    HRESULT status;
+    LSTATUS status;
     LPSTR bufptr = (LPSTR)lpValueBuf;
     *ldwTotsize = 0;
 
-- 
2.9.0



More information about the wine-patches mailing list