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

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2017-03-22 12:32:27 +01:00 committed by Alexandre Julliard
parent 7f1044f212
commit 49b644d7a2
1 changed files with 10 additions and 7 deletions

View File

@ -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);