From b5732b1c2ee7ca631bdabc0e45483a2ccaefcd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Wed, 21 Jan 2015 23:16:41 +0100 Subject: [PATCH] odbc32: Add winediag message when no drivers could be found. --- dlls/odbc32/proxyodbc.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 89cf1546c27..66b3a650de2 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -49,6 +49,7 @@ static BOOL ODBC_LoadDriverManager(void); static BOOL ODBC_LoadDMFunctions(void); WINE_DEFAULT_DEBUG_CHANNEL(odbc); +WINE_DECLARE_DEBUG_CHANNEL(winediag); static SQLRETURN (*pSQLAllocConnect)(SQLHENV,SQLHDBC*); static SQLRETURN (*pSQLAllocEnv)(SQLHENV*); @@ -1914,11 +1915,19 @@ SQLRETURN WINAPI SQLDrivers( SQLSMALLINT cbDriverAttrMax, SQLSMALLINT *pcbDriverAttr) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("direction=%d\n", fDirection); if (!pSQLDrivers) return SQL_ERROR; - return pSQLDrivers(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, - szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + ret = pSQLDrivers(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, + szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + + if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) + ERR_(winediag)("No ODBC drivers could be found. " + "Check the settings for your libodbc provider.\n"); + + return ret; } @@ -2647,11 +2656,19 @@ SQLRETURN WINAPI SQLDriversW( SQLSMALLINT cbDriverAttrMax, SQLSMALLINT *pcbDriverAttr) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("direction=%d\n", fDirection); if (!pSQLDriversW) return SQL_ERROR; - return pSQLDriversW(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, - szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + ret = pSQLDriversW(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, + szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + + if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) + ERR_(winediag)("No ODBC drivers could be found. " + "Check the settings for your libodbc provider.\n"); + + return ret; } /*************************************************************************