We need to look at the Setup key for the driver, as it can be different compare to the actually driver.
For example, mysql uses the same Setup file to configure both the Ascii/Unicode vession but has a different file for the actual ODBC functions.
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
We need to look at the Setup key for the driver, as it can be different compare to the actually driver.
For example, mysql uses the same Setup file to configure both the Ascii/Unicode vession but has a different file for the actual ODBC functions. --- dlls/odbccp32/odbccp32.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index 95bfb90781e..d8d57e6bd40 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -223,7 +223,6 @@ static BOOL SQLInstall_narrow(int mode, LPSTR buffer, LPCWSTR str, WORD str_leng
static HMODULE load_config_driver(const WCHAR *driver) { - static WCHAR reg_driver[] = {'d','r','i','v','e','r',0}; long ret; HMODULE hmod; WCHAR *filename = NULL; @@ -236,7 +235,7 @@ static HMODULE load_config_driver(const WCHAR *driver)
if ((ret = RegOpenKeyW(hkey, driver, &hkeydriver)) == ERROR_SUCCESS) { - ret = RegGetValueW(hkeydriver, NULL, reg_driver, RRF_RT_REG_SZ, &type, NULL, &size); + ret = RegGetValueW(hkeydriver, NULL, L"Setup", RRF_RT_REG_SZ, &type, NULL, &size); if(ret != ERROR_SUCCESS || type != REG_SZ) { RegCloseKey(hkeydriver); @@ -255,7 +254,7 @@ static HMODULE load_config_driver(const WCHAR *driver)
return NULL; } - ret = RegGetValueW(hkeydriver, NULL, reg_driver, RRF_RT_REG_SZ, &type, filename, &size); + ret = RegGetValueW(hkeydriver, NULL, L"Setup", RRF_RT_REG_SZ, &type, filename, &size);
RegCloseKey(hkeydriver); }
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/odbccp32/odbccp32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index d8d57e6bd40..46468765b86 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -372,7 +372,7 @@ BOOL WINAPI SQLConfigDataSourceW(HWND hwnd, WORD request, LPCWSTR driver, LPCWST WORD mapped_request;
TRACE("%p, %d, %s, %s\n", hwnd, request, debugstr_w(driver), debugstr_w(attributes)); - if (TRACE_ON(odbc)) + if (TRACE_ON(odbc) && attributes) { const WCHAR *p; for (p = attributes; *p; p += lstrlenW(p) + 1) @@ -417,7 +417,7 @@ BOOL WINAPI SQLConfigDataSource(HWND hwnd, WORD request, LPCSTR driver, LPCSTR a
TRACE("%p, %d, %s, %s\n", hwnd, request, debugstr_a(driver), debugstr_a(attributes));
- if (TRACE_ON(odbc)) + if (TRACE_ON(odbc) && attributes) { const char *p; for (p = attributes; *p; p += lstrlenA(p) + 1)