Hans Leidekker : odbccp32/tests: RegGetValueA is not available on Windows XP.

Alexandre Julliard julliard at winehq.org
Wed Mar 22 15:52:34 CDT 2017


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Mar 22 12:32:27 2017 +0100

odbccp32/tests: RegGetValueA is not available on Windows XP.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/odbccp32/tests/misc.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/odbccp32/tests/misc.c b/dlls/odbccp32/tests/misc.c
index 905468c..4fdf584 100644
--- a/dlls/odbccp32/tests/misc.c
+++ b/dlls/odbccp32/tests/misc.c
@@ -420,7 +420,7 @@ void test_SQLInstallDriverEx(void)
     BOOL ret, sql_ret;
     DWORD cnt, error_code = 0;
     HKEY hkey;
-    DWORD reg_ret;
+    LONG res;
 
     GetSystemDirectoryA(syspath, MAX_PATH);
 
@@ -441,18 +441,21 @@ void test_SQLInstallDriverEx(void)
 
     if (ret)
     {
-        reg_ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\WINE ODBC Driver", 0, KEY_READ, &hkey);
-        ok(reg_ret == ERROR_SUCCESS, "RegOpenKeyExW failed\n");
-        if (reg_ret == ERROR_SUCCESS)
+        res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\WINE ODBC Driver", 0, KEY_READ, &hkey);
+        ok(res == ERROR_SUCCESS, "RegOpenKeyExW failed\n");
+        if (res == ERROR_SUCCESS)
         {
-            DWORD type, size = MAX_PATH;
+            DWORD type = 0xdeadbeef, size = MAX_PATH;
             char driverpath[MAX_PATH];
 
             strcpy(driverpath, syspath);
             strcat(driverpath, "\\sample.dll");
 
-            reg_ret = RegGetValueA(hkey, NULL, "Driver", RRF_RT_REG_SZ, &type, &path, &size);
-            ok(reg_ret == ERROR_SUCCESS, "RegGetValueA failed\n");
+            memset(path, 0, sizeof(path));
+            res = RegQueryValueExA(hkey, "Driver", NULL, &type, (BYTE *)path, &size);
+            ok(res == ERROR_SUCCESS, "got %d\n", res);
+            ok(type == REG_SZ, "got %u\n", type);
+            ok(size == strlen(driverpath) + 1, "got %u\n", size);
             ok(!strcmp(path, driverpath), "invalid path %s\n", path);
 
             RegCloseKey(hkey);




More information about the wine-cvs mailing list