summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorHiroshi Inoue2009-08-27 15:03:34 +0000
committerHiroshi Inoue2009-08-27 15:03:34 +0000
commit64501e33ea195500748fb967939cd4e76da8d8f3 (patch)
treeb8bc0e934a78cf5f5cf261eb888de50058f47fe9 /setup.c
parent14d6724ebc69844078ab60249b86ad35552551f1 (diff)
Changes for 8.4.0101.
1.Fix a column uodatability problem reported by Tom Goodman. 2.Display SSL mode list properly on setup dialog. 3.Don't truncate the result of msgtowstr()/wstrtomsg(). 4.Implement ConfigDriver() function.
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c80
1 files changed, 79 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 1e08b0d..618b5be 100644
--- a/setup.c
+++ b/setup.c
@@ -7,7 +7,7 @@
*
* Classes: n/a
*
- * API functions: ConfigDSN
+ * API functions: ConfigDSN, ConfigDriver
*
* Comments: See "notice.txt" for copyright and license information.
*-------
@@ -123,6 +123,44 @@ ConfigDSN(HWND hwnd,
return fSuccess;
}
+/*--------
+ * ConfigDriver
+ *
+ * Description: ODBC Setup entry point
+ * This entry point is called by the ODBC Installer
+ * (see file header for more details)
+ * Arguments : hwnd ----------- Parent window handle
+ * fRequest ------- Request type (i.e., add, config, or remove)
+ * lpszDriver ----- Driver name
+ * lpszArgs ------- A null-terminated string containing
+ arguments for a driver specific fRequest
+ * lpszMsg -------- A null-terimated string containing
+ an output message from the driver setup
+ * cnMsgMax ------- Length of lpszMSg
+ * pcbMsgOut ------ Total number of bytes available to
+ return in lpszMsg
+ * Returns : TRUE success, FALSE otherwise
+ *--------
+ */
+static BOOL SetDriverAttributes(LPCSTR lpszDriver);
+BOOL CALLBACK
+ConfigDriver(HWND hwnd,
+ WORD fRequest,
+ LPCSTR lpszDriver,
+ LPCSTR lpszArgs,
+ LPSTR lpszMsg,
+ WORD cbMsgMax,
+ WORD *pcbMsgOut)
+{
+ BOOL fSuccess = TRUE; /* Success/fail flag */
+
+ /* Add the driver */
+ if (ODBC_INSTALL_DRIVER == fRequest)
+ fSuccess = SetDriverAttributes(lpszDriver);
+
+ return fSuccess;
+}
+
/*-------
* CenterDialog
@@ -512,6 +550,46 @@ SetDSNAttributes(HWND hwndParent, LPSETUPDLG lpsetupdlg, DWORD *errcode)
return TRUE;
}
+/*--------
+ * SetDriverAttributes
+ *
+ * Description: Write driver information attributes to ODBCINST.INI
+ * Input : lpszDriver - The driver name
+ * Output : TRUE if successful, FALSE otherwise
+ *--------
+ */
+static BOOL
+SetDriverAttributes(LPCSTR lpszDriver)
+{
+ BOOL ret = FALSE;
+
+ /* Validate arguments */
+ if (!lpszDriver || !lpszDriver[0])
+ return FALSE;
+
+ if (!SQLWritePrivateProfileString(lpszDriver, "APILevel", "1", ODBCINST_INI))
+ goto cleanup;
+ if (!SQLWritePrivateProfileString(lpszDriver, "ConnectFunctions", "YYN", ODBCINST_INI))
+ goto cleanup;
+ if (!SQLWritePrivateProfileString(lpszDriver, "DriverODBCVer",
+#ifdef UNICODE_SUPPORT
+ "03.51",
+#else
+ "03.00",
+#endif
+ ODBCINST_INI))
+ goto cleanup;
+ if (!SQLWritePrivateProfileString(lpszDriver, "FileUsage", "0", ODBCINST_INI))
+ goto cleanup;
+ if (!SQLWritePrivateProfileString(lpszDriver, "SQLLevel", "1", ODBCINST_INI))
+ goto cleanup;
+
+ ret = TRUE;
+cleanup:
+
+ return ret;
+}
+
#ifdef WIN32