2 * Implementation of the ODBC driver installer
4 * Copyright 2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Hans Leidekker
6 * Copyright 2007 Bill Medland
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(odbc
);
38 /* Registry key names */
39 static const WCHAR drivers_key
[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','I','N','S','T','.','I','N','I','\\','O','D','B','C',' ','D','r','i','v','e','r','s',0};
41 /* This config mode is known to be process-wide.
42 * MSDN documentation suggests that the value is hidden somewhere in the registry but I haven't found it yet.
43 * Although both the registry and the ODBC.ini files appear to be maintained together they are not maintained automatically through the registry's IniFileMapping.
45 static UWORD config_mode
= ODBC_BOTH_DSN
;
47 /* MSDN documentation suggests that the error subsystem handles errors 1 to 8
48 * only and experimentation (Windows 2000) shows that the errors are process-
49 * wide so go for the simple solution; static arrays.
51 static int num_errors
;
52 static int error_code
[8];
53 static const WCHAR
*error_msg
[8];
54 static const WCHAR odbc_error_general_err
[] = {'G','e','n','e','r','a','l',' ','e','r','r','o','r',0};
55 static const WCHAR odbc_error_invalid_buff_len
[] = {'I','n','v','a','l','i','d',' ','b','u','f','f','e','r',' ','l','e','n','g','t','h',0};
56 static const WCHAR odbc_error_component_not_found
[] = {'C','o','m','p','o','n','e','n','t',' ','n','o','t',' ','f','o','u','n','d',0};
57 static const WCHAR odbc_error_out_of_mem
[] = {'O','u','t',' ','o','f',' ','m','e','m','o','r','y',0};
58 static const WCHAR odbc_error_invalid_param_sequence
[] = {'I','n','v','a','l','i','d',' ','p','a','r','a','m','e','t','e','r',' ','s','e','q','u','e','n','c','e',0};
60 /* Push an error onto the error stack, taking care of ranges etc. */
61 static void push_error(int code
, LPCWSTR msg
)
63 if (num_errors
< sizeof error_code
/sizeof error_code
[0])
65 error_code
[num_errors
] = code
;
66 error_msg
[num_errors
] = msg
;
71 /* Clear the error stack */
72 static void clear_errors(void)
77 BOOL WINAPI
ODBCCPlApplet( LONG i
, LONG j
, LONG
* p1
, LONG
* p2
)
80 FIXME( "( %d %d %p %p) : stub!\n", i
, j
, p1
, p2
);
84 static LPWSTR
SQLInstall_strdup_multi(LPCSTR str
)
93 for (p
= str
; *p
; p
+= lstrlenA(p
) + 1)
96 len
= MultiByteToWideChar(CP_ACP
, 0, str
, p
- str
, NULL
, 0 );
97 ret
= HeapAlloc(GetProcessHeap(), 0, (len
+1)*sizeof(WCHAR
));
98 MultiByteToWideChar(CP_ACP
, 0, str
, p
- str
, ret
, len
);
104 static LPWSTR
SQLInstall_strdup(LPCSTR str
)
112 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0 );
113 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
114 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
119 /* Convert the wide string or zero-length-terminated list of wide strings to a
120 * narrow string or zero-length-terminated list of narrow strings.
121 * Do not try to emulate windows undocumented excesses (e.g. adding a third \0
124 * mode Indicates the sort of string.
125 * 1 denotes that the buffers contain strings terminated by a single nul
127 * 2 denotes that the buffers contain zero-length-terminated lists
128 * (frequently erroneously referred to as double-null-terminated)
129 * buffer The narrow-character buffer into which to place the result. This
130 * must be a non-null pointer to the first element of a buffer whose
131 * length is passed in buffer_length.
132 * str The wide-character buffer containing the string or list of strings to
133 * be converted. str_length defines how many wide characters in the
134 * buffer are to be converted, including all desired terminating nul
136 * str_length Effective length of str
137 * buffer_length Length of buffer
138 * returned_length A pointer to a variable that will receive the number of
139 * narrow characters placed into the buffer. This pointer
142 static BOOL
SQLInstall_narrow(int mode
, LPSTR buffer
, LPCWSTR str
, WORD str_length
, WORD buffer_length
, WORD
*returned_length
)
144 LPSTR pbuf
; /* allows us to allocate a temporary buffer only if needed */
145 int len
; /* Length of the converted list */
146 BOOL success
= FALSE
;
147 assert(mode
== 1 || mode
== 2);
148 assert(buffer_length
);
149 len
= WideCharToMultiByte(CP_ACP
, 0, str
, str_length
, 0, 0, NULL
, NULL
);
152 if (len
> buffer_length
)
154 pbuf
= HeapAlloc(GetProcessHeap(), 0, len
);
160 len
= WideCharToMultiByte(CP_ACP
, 0, str
, str_length
, pbuf
, len
, NULL
, NULL
);
165 if (buffer_length
> (mode
- 1))
167 memcpy (buffer
, pbuf
, buffer_length
-mode
);
168 *(buffer
+buffer_length
-mode
) = '\0';
170 *(buffer
+buffer_length
-1) = '\0';
174 *returned_length
= pbuf
== buffer
? len
: buffer_length
;
180 ERR("transferring wide to narrow\n");
184 HeapFree(GetProcessHeap(), 0, pbuf
);
189 ERR("measuring wide to narrow\n");
194 BOOL WINAPI
SQLConfigDataSourceW(HWND hwndParent
, WORD fRequest
,
195 LPCWSTR lpszDriver
, LPCWSTR lpszAttributes
)
200 FIXME("%p %d %s %s\n", hwndParent
, fRequest
, debugstr_w(lpszDriver
),
201 debugstr_w(lpszAttributes
));
203 for (p
= lpszAttributes
; *p
; p
+= lstrlenW(p
) + 1)
204 FIXME("%s\n", debugstr_w(p
));
209 BOOL WINAPI
SQLConfigDataSource(HWND hwndParent
, WORD fRequest
,
210 LPCSTR lpszDriver
, LPCSTR lpszAttributes
)
212 FIXME("%p %d %s %s\n", hwndParent
, fRequest
, debugstr_a(lpszDriver
),
213 debugstr_a(lpszAttributes
));
218 BOOL WINAPI
SQLConfigDriverW(HWND hwndParent
, WORD fRequest
, LPCWSTR lpszDriver
,
219 LPCWSTR lpszArgs
, LPWSTR lpszMsg
, WORD cbMsgMax
, WORD
*pcbMsgOut
)
222 FIXME("(%p %d %s %s %p %d %p)\n", hwndParent
, fRequest
, debugstr_w(lpszDriver
),
223 debugstr_w(lpszArgs
), lpszMsg
, cbMsgMax
, pcbMsgOut
);
227 BOOL WINAPI
SQLConfigDriver(HWND hwndParent
, WORD fRequest
, LPCSTR lpszDriver
,
228 LPCSTR lpszArgs
, LPSTR lpszMsg
, WORD cbMsgMax
, WORD
*pcbMsgOut
)
231 FIXME("(%p %d %s %s %p %d %p)\n", hwndParent
, fRequest
, debugstr_a(lpszDriver
),
232 debugstr_a(lpszArgs
), lpszMsg
, cbMsgMax
, pcbMsgOut
);
236 BOOL WINAPI
SQLCreateDataSourceW(HWND hwnd
, LPCWSTR lpszDS
)
240 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
244 BOOL WINAPI
SQLCreateDataSource(HWND hwnd
, LPCSTR lpszDS
)
248 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
252 BOOL WINAPI
SQLGetAvailableDriversW(LPCWSTR lpszInfFile
, LPWSTR lpszBuf
,
253 WORD cbBufMax
, WORD
*pcbBufOut
)
257 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
261 BOOL WINAPI
SQLGetAvailableDrivers(LPCSTR lpszInfFile
, LPSTR lpszBuf
,
262 WORD cbBufMax
, WORD
*pcbBufOut
)
266 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
270 BOOL WINAPI
SQLGetConfigMode(UWORD
*pwConfigMode
)
274 *pwConfigMode
= config_mode
;
278 /* This is implemented sensibly rather than according to exact conformance to Microsoft's buggy implementations
279 * e.g. The Microsoft one occasionally actually adds a third nul character (possibly beyond the buffer).
280 * e.g. If the key has no drivers then version 3.525.1117.0 does not modify the buffer at all, not even a nul character.
282 BOOL WINAPI
SQLGetInstalledDriversW(LPWSTR lpszBuf
, WORD cbBufMax
,
285 HKEY hDrivers
; /* Registry handle to the Drivers key */
286 LONG reg_ret
; /* Return code from registry functions */
287 BOOL success
= FALSE
; /* The value we will return */
290 if (!lpszBuf
|| cbBufMax
== 0)
292 push_error(ODBC_ERROR_INVALID_BUFF_LEN
, odbc_error_invalid_buff_len
);
294 else if ((reg_ret
= RegOpenKeyExW (HKEY_LOCAL_MACHINE
/* The drivers does not depend on the config mode */,
295 drivers_key
, 0, KEY_READ
/* Maybe overkill */,
296 &hDrivers
)) == ERROR_SUCCESS
)
304 size_name
= cbBufMax
;
305 if ((reg_ret
= RegEnumValueW(hDrivers
, index
, lpszBuf
, &size_name
, NULL
, NULL
, NULL
, NULL
)) == ERROR_SUCCESS
)
308 assert (size_name
< cbBufMax
&& *(lpszBuf
+ size_name
) == 0);
310 cbBufMax
-= size_name
;
315 if (reg_ret
!= ERROR_NO_MORE_ITEMS
)
318 push_error(ODBC_ERROR_GENERAL_ERR
, odbc_error_general_err
);
324 if ((reg_ret
= RegCloseKey (hDrivers
)) != ERROR_SUCCESS
)
325 TRACE ("Error %d closing ODBC Drivers key\n", reg_ret
);
329 /* MSDN states that it returns failure with COMPONENT_NOT_FOUND in this case.
330 * Version 3.525.1117.0 (Windows 2000) does not; it actually returns success.
331 * I doubt if it will actually be an issue.
333 push_error(ODBC_ERROR_COMPONENT_NOT_FOUND
, odbc_error_component_not_found
);
338 BOOL WINAPI
SQLGetInstalledDrivers(LPSTR lpszBuf
, WORD cbBufMax
,
342 int size_wbuf
= cbBufMax
;
345 wbuf
= HeapAlloc(GetProcessHeap(), 0, size_wbuf
*sizeof(WCHAR
));
348 ret
= SQLGetInstalledDriversW(wbuf
, size_wbuf
, &size_used
);
351 if (!(ret
= SQLInstall_narrow(2, lpszBuf
, wbuf
, size_used
, cbBufMax
, pcbBufOut
)))
353 push_error(ODBC_ERROR_GENERAL_ERR
, odbc_error_general_err
);
356 HeapFree(GetProcessHeap(), 0, wbuf
);
357 /* ignore failure; we have achieved the aim */
361 push_error(ODBC_ERROR_OUT_OF_MEM
, odbc_error_out_of_mem
);
367 int WINAPI
SQLGetPrivateProfileStringW(LPCWSTR lpszSection
, LPCWSTR lpszEntry
,
368 LPCWSTR lpszDefault
, LPCWSTR RetBuffer
, int cbRetBuffer
,
369 LPCWSTR lpszFilename
)
373 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
377 int WINAPI
SQLGetPrivateProfileString(LPCSTR lpszSection
, LPCSTR lpszEntry
,
378 LPCSTR lpszDefault
, LPCSTR RetBuffer
, int cbRetBuffer
,
383 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
387 BOOL WINAPI
SQLGetTranslatorW(HWND hwndParent
, LPWSTR lpszName
, WORD cbNameMax
,
388 WORD
*pcbNameOut
, LPWSTR lpszPath
, WORD cbPathMax
,
389 WORD
*pcbPathOut
, DWORD
*pvOption
)
393 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
397 BOOL WINAPI
SQLGetTranslator(HWND hwndParent
, LPSTR lpszName
, WORD cbNameMax
,
398 WORD
*pcbNameOut
, LPSTR lpszPath
, WORD cbPathMax
,
399 WORD
*pcbPathOut
, DWORD
*pvOption
)
403 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
407 BOOL WINAPI
SQLInstallDriverW(LPCWSTR lpszInfFile
, LPCWSTR lpszDriver
,
408 LPWSTR lpszPath
, WORD cbPathMax
, WORD
* pcbPathOut
)
413 TRACE("%s %s %p %d %p\n", debugstr_w(lpszInfFile
),
414 debugstr_w(lpszDriver
), lpszPath
, cbPathMax
, pcbPathOut
);
419 return SQLInstallDriverExW(lpszDriver
, NULL
, lpszPath
, cbPathMax
,
420 pcbPathOut
, ODBC_INSTALL_COMPLETE
, &usage
);
423 BOOL WINAPI
SQLInstallDriver(LPCSTR lpszInfFile
, LPCSTR lpszDriver
,
424 LPSTR lpszPath
, WORD cbPathMax
, WORD
* pcbPathOut
)
429 TRACE("%s %s %p %d %p\n", debugstr_a(lpszInfFile
),
430 debugstr_a(lpszDriver
), lpszPath
, cbPathMax
, pcbPathOut
);
435 return SQLInstallDriverEx(lpszDriver
, NULL
, lpszPath
, cbPathMax
,
436 pcbPathOut
, ODBC_INSTALL_COMPLETE
, &usage
);
439 BOOL WINAPI
SQLInstallDriverExW(LPCWSTR lpszDriver
, LPCWSTR lpszPathIn
,
440 LPWSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
441 WORD fRequest
, LPDWORD lpdwUsageCount
)
445 WCHAR path
[MAX_PATH
];
448 TRACE("%s %s %p %d %p %d %p\n", debugstr_w(lpszDriver
),
449 debugstr_w(lpszPathIn
), lpszPathOut
, cbPathOutMax
, pcbPathOut
,
450 fRequest
, lpdwUsageCount
);
452 for (p
= lpszDriver
; *p
; p
+= lstrlenW(p
) + 1)
453 TRACE("%s\n", debugstr_w(p
));
455 len
= GetSystemDirectoryW(path
, MAX_PATH
);
460 len
= GetSystemDirectoryW(path
, MAX_PATH
);
462 if (lpszPathOut
&& cbPathOutMax
> len
)
464 lstrcpyW(lpszPathOut
, path
);
470 BOOL WINAPI
SQLInstallDriverEx(LPCSTR lpszDriver
, LPCSTR lpszPathIn
,
471 LPSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
472 WORD fRequest
, LPDWORD lpdwUsageCount
)
475 LPWSTR driver
, pathin
;
476 WCHAR pathout
[MAX_PATH
];
481 TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszDriver
),
482 debugstr_a(lpszPathIn
), lpszPathOut
, cbPathOutMax
, pcbPathOut
,
483 fRequest
, lpdwUsageCount
);
485 for (p
= lpszDriver
; *p
; p
+= lstrlenA(p
) + 1)
486 TRACE("%s\n", debugstr_a(p
));
488 driver
= SQLInstall_strdup_multi(lpszDriver
);
489 pathin
= SQLInstall_strdup(lpszPathIn
);
491 ret
= SQLInstallDriverExW(driver
, pathin
, pathout
, MAX_PATH
, &cbOut
,
492 fRequest
, lpdwUsageCount
);
495 int len
= WideCharToMultiByte(CP_ACP
, 0, pathout
, -1, lpszPathOut
,
500 *pcbPathOut
= len
- 1;
502 if (!lpszPathOut
|| cbPathOutMax
< len
)
507 len
= WideCharToMultiByte(CP_ACP
, 0, pathout
, -1, lpszPathOut
,
508 cbPathOutMax
, NULL
, NULL
);
513 HeapFree(GetProcessHeap(), 0, driver
);
514 HeapFree(GetProcessHeap(), 0, pathin
);
518 BOOL WINAPI
SQLInstallDriverManagerW(LPWSTR lpszPath
, WORD cbPathMax
,
522 WCHAR path
[MAX_PATH
];
524 TRACE("(%p %d %p)\n", lpszPath
, cbPathMax
, pcbPathOut
);
526 if (cbPathMax
< MAX_PATH
)
531 len
= GetSystemDirectoryW(path
, MAX_PATH
);
536 if (lpszPath
&& cbPathMax
> len
)
538 lstrcpyW(lpszPath
, path
);
544 BOOL WINAPI
SQLInstallDriverManager(LPSTR lpszPath
, WORD cbPathMax
,
549 WCHAR path
[MAX_PATH
];
551 TRACE("(%p %d %p)\n", lpszPath
, cbPathMax
, pcbPathOut
);
553 if (cbPathMax
< MAX_PATH
)
558 ret
= SQLInstallDriverManagerW(path
, MAX_PATH
, &cbOut
);
561 len
= WideCharToMultiByte(CP_ACP
, 0, path
, -1, lpszPath
, 0,
566 *pcbPathOut
= len
- 1;
568 if (!lpszPath
|| cbPathMax
< len
)
571 len
= WideCharToMultiByte(CP_ACP
, 0, path
, -1, lpszPath
,
572 cbPathMax
, NULL
, NULL
);
578 BOOL WINAPI
SQLInstallODBCW(HWND hwndParent
, LPCWSTR lpszInfFile
,
579 LPCWSTR lpszSrcPath
, LPCWSTR lpszDrivers
)
583 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
587 BOOL WINAPI
SQLInstallODBC(HWND hwndParent
, LPCSTR lpszInfFile
,
588 LPCSTR lpszSrcPath
, LPCSTR lpszDrivers
)
592 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
596 SQLRETURN WINAPI
SQLInstallerErrorW(WORD iError
, DWORD
*pfErrorCode
,
597 LPWSTR lpszErrorMsg
, WORD cbErrorMsgMax
, WORD
*pcbErrorMsg
)
599 TRACE("%d %p %p %d %p\n", iError
, pfErrorCode
, lpszErrorMsg
,
600 cbErrorMsgMax
, pcbErrorMsg
);
606 else if (iError
<= num_errors
)
608 BOOL truncated
= FALSE
;
613 *pfErrorCode
= error_code
[iError
];
614 msg
= error_msg
[iError
];
615 len
= msg
? lstrlenW(msg
) : 0;
619 if (cbErrorMsgMax
< len
)
624 if (lpszErrorMsg
&& len
)
628 memcpy (lpszErrorMsg
, msg
, len
* sizeof(WCHAR
));
638 /* Yes. If you pass a null pointer and a large length it is not an error! */
642 return truncated
? SQL_SUCCESS_WITH_INFO
: SQL_SUCCESS
;
645 /* At least on Windows 2000 , the buffers are not altered in this case. However that is a little too dangerous a test for just now */
649 if (lpszErrorMsg
&& cbErrorMsgMax
> 0)
650 *lpszErrorMsg
= '\0';
655 SQLRETURN WINAPI
SQLInstallerError(WORD iError
, DWORD
*pfErrorCode
,
656 LPSTR lpszErrorMsg
, WORD cbErrorMsgMax
, WORD
*pcbErrorMsg
)
661 TRACE("%d %p %p %d %p\n", iError
, pfErrorCode
, lpszErrorMsg
,
662 cbErrorMsgMax
, pcbErrorMsg
);
665 if (lpszErrorMsg
&& cbErrorMsgMax
)
667 wbuf
= HeapAlloc(GetProcessHeap(), 0, cbErrorMsgMax
*sizeof(WCHAR
));
671 ret
= SQLInstallerErrorW(iError
, pfErrorCode
, wbuf
, cbErrorMsgMax
, &cbwbuf
);
675 SQLInstall_narrow(1, lpszErrorMsg
, wbuf
, cbwbuf
+1, cbErrorMsgMax
, &cbBuf
);
676 HeapFree(GetProcessHeap(), 0, wbuf
);
678 *pcbErrorMsg
= cbBuf
-1;
683 BOOL WINAPI
SQLInstallTranslatorExW(LPCWSTR lpszTranslator
, LPCWSTR lpszPathIn
,
684 LPWSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
685 WORD fRequest
, LPDWORD lpdwUsageCount
)
689 WCHAR path
[MAX_PATH
];
692 TRACE("%s %s %p %d %p %d %p\n", debugstr_w(lpszTranslator
),
693 debugstr_w(lpszPathIn
), lpszPathOut
, cbPathOutMax
, pcbPathOut
,
694 fRequest
, lpdwUsageCount
);
696 for (p
= lpszTranslator
; *p
; p
+= lstrlenW(p
) + 1)
697 TRACE("%s\n", debugstr_w(p
));
699 len
= GetSystemDirectoryW(path
, MAX_PATH
);
704 if (lpszPathOut
&& cbPathOutMax
> len
)
706 lstrcpyW(lpszPathOut
, path
);
712 BOOL WINAPI
SQLInstallTranslatorEx(LPCSTR lpszTranslator
, LPCSTR lpszPathIn
,
713 LPSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
714 WORD fRequest
, LPDWORD lpdwUsageCount
)
717 LPWSTR translator
, pathin
;
718 WCHAR pathout
[MAX_PATH
];
723 TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszTranslator
),
724 debugstr_a(lpszPathIn
), lpszPathOut
, cbPathOutMax
, pcbPathOut
,
725 fRequest
, lpdwUsageCount
);
727 for (p
= lpszTranslator
; *p
; p
+= lstrlenA(p
) + 1)
728 TRACE("%s\n", debugstr_a(p
));
730 translator
= SQLInstall_strdup_multi(lpszTranslator
);
731 pathin
= SQLInstall_strdup(lpszPathIn
);
733 ret
= SQLInstallTranslatorExW(translator
, pathin
, pathout
, MAX_PATH
,
734 &cbOut
, fRequest
, lpdwUsageCount
);
737 int len
= WideCharToMultiByte(CP_ACP
, 0, pathout
, -1, lpszPathOut
,
742 *pcbPathOut
= len
- 1;
744 if (!lpszPathOut
|| cbPathOutMax
< len
)
749 len
= WideCharToMultiByte(CP_ACP
, 0, pathout
, -1, lpszPathOut
,
750 cbPathOutMax
, NULL
, NULL
);
755 HeapFree(GetProcessHeap(), 0, translator
);
756 HeapFree(GetProcessHeap(), 0, pathin
);
760 BOOL WINAPI
SQLInstallTranslator(LPCSTR lpszInfFile
, LPCSTR lpszTranslator
,
761 LPCSTR lpszPathIn
, LPSTR lpszPathOut
, WORD cbPathOutMax
,
762 WORD
*pcbPathOut
, WORD fRequest
, LPDWORD lpdwUsageCount
)
765 TRACE("%s %s %s %p %d %p %d %p\n", debugstr_a(lpszInfFile
),
766 debugstr_a(lpszTranslator
), debugstr_a(lpszPathIn
), lpszPathOut
,
767 cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
772 return SQLInstallTranslatorEx(lpszTranslator
, lpszPathIn
, lpszPathOut
,
773 cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
776 BOOL WINAPI
SQLInstallTranslatorW(LPCWSTR lpszInfFile
, LPCWSTR lpszTranslator
,
777 LPCWSTR lpszPathIn
, LPWSTR lpszPathOut
, WORD cbPathOutMax
,
778 WORD
*pcbPathOut
, WORD fRequest
, LPDWORD lpdwUsageCount
)
781 TRACE("%s %s %s %p %d %p %d %p\n", debugstr_w(lpszInfFile
),
782 debugstr_w(lpszTranslator
), debugstr_w(lpszPathIn
), lpszPathOut
,
783 cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
788 return SQLInstallTranslatorExW(lpszTranslator
, lpszPathIn
, lpszPathOut
,
789 cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
792 BOOL WINAPI
SQLManageDataSources(HWND hwnd
)
796 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
800 SQLRETURN WINAPI
SQLPostInstallerErrorW(DWORD fErrorCode
, LPCWSTR szErrorMsg
)
803 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
807 SQLRETURN WINAPI
SQLPostInstallerError(DWORD fErrorCode
, LPCSTR szErrorMsg
)
810 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
814 BOOL WINAPI
SQLReadFileDSNW(LPCWSTR lpszFileName
, LPCWSTR lpszAppName
,
815 LPCWSTR lpszKeyName
, LPWSTR lpszString
, WORD cbString
,
820 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
824 BOOL WINAPI
SQLReadFileDSN(LPCSTR lpszFileName
, LPCSTR lpszAppName
,
825 LPCSTR lpszKeyName
, LPSTR lpszString
, WORD cbString
,
830 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
834 BOOL WINAPI
SQLRemoveDefaultDataSource(void)
838 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
842 BOOL WINAPI
SQLRemoveDriverW(LPCWSTR lpszDriver
, BOOL fRemoveDSN
,
843 LPDWORD lpdwUsageCount
)
847 if (lpdwUsageCount
) *lpdwUsageCount
= 1;
851 BOOL WINAPI
SQLRemoveDriver(LPCSTR lpszDriver
, BOOL fRemoveDSN
,
852 LPDWORD lpdwUsageCount
)
856 if (lpdwUsageCount
) *lpdwUsageCount
= 1;
860 BOOL WINAPI
SQLRemoveDriverManager(LPDWORD pdwUsageCount
)
864 if (pdwUsageCount
) *pdwUsageCount
= 1;
868 BOOL WINAPI
SQLRemoveDSNFromIniW(LPCWSTR lpszDSN
)
872 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
876 BOOL WINAPI
SQLRemoveDSNFromIni(LPCSTR lpszDSN
)
880 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
884 BOOL WINAPI
SQLRemoveTranslatorW(LPCWSTR lpszTranslator
, LPDWORD lpdwUsageCount
)
888 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
892 BOOL WINAPI
SQLRemoveTranslator(LPCSTR lpszTranslator
, LPDWORD lpdwUsageCount
)
896 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
900 BOOL WINAPI
SQLSetConfigMode(UWORD wConfigMode
)
903 if (wConfigMode
> ODBC_SYSTEM_DSN
)
905 push_error(ODBC_ERROR_INVALID_PARAM_SEQUENCE
, odbc_error_invalid_param_sequence
);
910 config_mode
= wConfigMode
;
915 BOOL WINAPI
SQLValidDSNW(LPCWSTR lpszDSN
)
919 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
923 BOOL WINAPI
SQLValidDSN(LPCSTR lpszDSN
)
927 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
931 BOOL WINAPI
SQLWriteDSNToIniW(LPCWSTR lpszDSN
, LPCWSTR lpszDriver
)
935 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
939 BOOL WINAPI
SQLWriteDSNToIni(LPCSTR lpszDSN
, LPCSTR lpszDriver
)
943 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
947 BOOL WINAPI
SQLWriteFileDSNW(LPCWSTR lpszFileName
, LPCWSTR lpszAppName
,
948 LPCWSTR lpszKeyName
, LPCWSTR lpszString
)
952 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
956 BOOL WINAPI
SQLWriteFileDSN(LPCSTR lpszFileName
, LPCSTR lpszAppName
,
957 LPCSTR lpszKeyName
, LPCSTR lpszString
)
961 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
965 BOOL WINAPI
SQLWritePrivateProfileStringW(LPCWSTR lpszSection
, LPCWSTR lpszEntry
,
966 LPCWSTR lpszString
, LPCWSTR lpszFilename
)
970 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
974 BOOL WINAPI
SQLWritePrivateProfileString(LPCSTR lpszSection
, LPCSTR lpszEntry
,
975 LPCSTR lpszString
, LPCSTR lpszFilename
)
979 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);