2 * Implementation of the ODBC driver installer
4 * Copyright 2005 Mike McCormack for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #define NONAMELESSUNION
30 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(odbc
);
36 BOOL WINAPI
ODBCCPlApplet( LONG i
, LONG j
, LONG
* p1
, LONG
* p2
)
38 FIXME( "( %ld %ld %p %p) : stub!\n", i
, j
, p1
, p2
);
42 static LPWSTR
SQLInstall_strdup_multi(LPCSTR str
)
51 for (p
= str
; *p
; p
+= lstrlenA(p
) + 1)
54 len
= MultiByteToWideChar(CP_ACP
, 0, str
, p
- str
, NULL
, 0 );
55 ret
= HeapAlloc(GetProcessHeap(), 0, (len
+1)*sizeof(WCHAR
));
56 MultiByteToWideChar(CP_ACP
, 0, str
, p
- str
, ret
, len
);
62 static LPWSTR
SQLInstall_strdup(LPCSTR str
)
70 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0 );
71 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
72 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
77 BOOL WINAPI
SQLConfigDataSourceW(HWND hwndParent
, WORD fRequest
,
78 LPCWSTR lpszDriver
, LPCWSTR lpszAttributes
)
81 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
85 BOOL WINAPI
SQLConfigDataSource(HWND hwndParent
, WORD fRequest
,
86 LPCSTR lpszDriver
, LPCSTR lpszAttributes
)
89 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
93 BOOL WINAPI
SQLConfigDriverW(HWND hwndParent
, WORD fRequest
, LPCWSTR lpszDriver
,
94 LPCWSTR lpszArgs
, LPWSTR lpszMsg
, WORD cbMsgMax
, WORD
*pcbMsgOut
)
97 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
101 BOOL WINAPI
SQLConfigDriver(HWND hwndParent
, WORD fRequest
, LPCSTR lpszDriver
,
102 LPCSTR lpszArgs
, LPSTR lpszMsg
, WORD cbMsgMax
, WORD
*pcbMsgOut
)
105 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
109 BOOL WINAPI
SQLCreateDataSourceW(HWND hwnd
, LPCWSTR lpszDS
)
112 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
116 BOOL WINAPI
SQLCreateDataSource(HWND hwnd
, LPCSTR lpszDS
)
119 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
123 BOOL WINAPI
SQLGetAvailableDriversW(LPCWSTR lpszInfFile
, LPWSTR lpszBuf
,
124 WORD cbBufMax
, WORD
*pcbBufOut
)
127 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
131 BOOL WINAPI
SQLGetAvailableDrivers(LPCSTR lpszInfFile
, LPSTR lpszBuf
,
132 WORD cbBufMax
, WORD
*pcbBufOut
)
135 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
139 BOOL WINAPI
SQLGetConfigMode(UWORD
*pwConfigMode
)
142 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
146 BOOL WINAPI
SQLGetInstalledDriversW(LPWSTR lpszBuf
, WORD cbBufMax
,
150 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
154 BOOL WINAPI
SQLGetInstalledDrivers(LPSTR lpszBuf
, WORD cbBufMax
,
158 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
162 int WINAPI
SQLGetPrivateProfileStringW(LPCWSTR lpszSection
, LPCWSTR lpszEntry
,
163 LPCWSTR lpszDefault
, LPCWSTR RetBuffer
, int cbRetBuffer
,
164 LPCWSTR lpszFilename
)
167 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
171 int WINAPI
SQLGetPrivateProfileString(LPCSTR lpszSection
, LPCSTR lpszEntry
,
172 LPCSTR lpszDefault
, LPCSTR RetBuffer
, int cbRetBuffer
,
176 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
180 BOOL WINAPI
SQLGetTranslatorW(HWND hwndParent
, LPWSTR lpszName
, WORD cbNameMax
,
181 WORD
*pcbNameOut
, LPWSTR lpszPath
, WORD cbPathMax
,
182 WORD
*pcbPathOut
, DWORD
*pvOption
)
185 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
189 BOOL WINAPI
SQLGetTranslator(HWND hwndParent
, LPSTR lpszName
, WORD cbNameMax
,
190 WORD
*pcbNameOut
, LPSTR lpszPath
, WORD cbPathMax
,
191 WORD
*pcbPathOut
, DWORD
*pvOption
)
194 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
198 BOOL WINAPI
SQLInstallDriverW(LPCWSTR lpszInfFile
, LPCWSTR lpszDriver
,
199 LPWSTR lpszPath
, WORD cbPathMax
, WORD
* pcbPathOut
)
201 FIXME("%s %s %p %d %p\n", debugstr_w(lpszInfFile
),
202 debugstr_w(lpszDriver
), lpszPath
, cbPathMax
, pcbPathOut
);
203 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
207 BOOL WINAPI
SQLInstallDriver(LPCSTR lpszInfFile
, LPCSTR lpszDriver
,
208 LPSTR lpszPath
, WORD cbPathMax
, WORD
* pcbPathOut
)
210 FIXME("%s %s %p %d %p\n", debugstr_a(lpszInfFile
),
211 debugstr_a(lpszDriver
), lpszPath
, cbPathMax
, pcbPathOut
);
212 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
216 BOOL WINAPI
SQLInstallDriverExW(LPCWSTR lpszDriver
, LPCWSTR lpszPathIn
,
217 LPWSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
218 WORD fRequest
, LPDWORD lpdwUsageCount
)
222 FIXME("%s %s %p %d %p %d %p\n", debugstr_w(lpszDriver
), debugstr_w(lpszPathIn
),
223 lpszPathOut
, cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
225 for (p
= lpszDriver
; *p
; p
+= lstrlenW(p
) + 1)
226 FIXME("%s\n", debugstr_w(p
));
228 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
232 BOOL WINAPI
SQLInstallDriverEx(LPCSTR lpszDriver
, LPCSTR lpszPathIn
,
233 LPSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
234 WORD fRequest
, LPDWORD lpdwUsageCount
)
236 LPWSTR driver
, pathin
;
237 WCHAR pathout
[MAX_PATH
];
241 TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszDriver
), debugstr_a(lpszPathIn
),
242 lpszPathOut
, cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
244 driver
= SQLInstall_strdup_multi(lpszDriver
);
245 pathin
= SQLInstall_strdup(lpszPathIn
);
247 r
= SQLInstallDriverExW( driver
, pathin
, pathout
, MAX_PATH
,
248 &cbOut
, fRequest
, lpdwUsageCount
);
251 *pcbPathOut
= WideCharToMultiByte(CP_ACP
, 0, pathout
, -1,
252 lpszPathOut
, cbPathOutMax
, NULL
, NULL
);
258 BOOL WINAPI
SQLInstallDriverManagerW(LPWSTR lpszPath
, WORD cbPathMax
,
262 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
266 BOOL WINAPI
SQLInstallDriverManager(LPSTR lpszPath
, WORD cbPathMax
,
270 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
274 BOOL WINAPI
SQLInstallODBCW(HWND hwndParent
, LPCWSTR lpszInfFile
,
275 LPCWSTR lpszSrcPath
, LPCWSTR lpszDrivers
)
278 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
282 BOOL WINAPI
SQLInstallODBC(HWND hwndParent
, LPCSTR lpszInfFile
,
283 LPCSTR lpszSrcPath
, LPCSTR lpszDrivers
)
286 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
290 SQLRETURN WINAPI
SQLInstallerErrorW(WORD iError
, DWORD
*pfErrorCode
,
291 LPWSTR lpszErrorMsg
, WORD cbErrorMsgMax
, WORD
*pcbErrorMsg
)
294 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
298 SQLRETURN WINAPI
SQLInstallerError(WORD iError
, DWORD
*pfErrorCode
,
299 LPSTR lpszErrorMsg
, WORD cbErrorMsgMax
, WORD
*pcbErrorMsg
)
302 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
306 BOOL WINAPI
SQLInstallTranslatorExW(LPCWSTR lpszTranslator
, LPCWSTR lpszPathIn
,
307 LPWSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
308 WORD fRequest
, LPDWORD lpdwUsageCount
)
311 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
315 BOOL WINAPI
SQLInstallTranslatorEx(LPCSTR lpszTranslator
, LPCSTR lpszPathIn
,
316 LPSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
317 WORD fRequest
, LPDWORD lpdwUsageCount
)
320 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
324 BOOL WINAPI
SQLInstallTranslator(LPCSTR lpszInfFile
, LPCSTR lpszTranslator
,
325 LPCSTR lpszPathIn
, LPSTR lpszPathOut
, WORD cbPathOutMax
,
326 WORD
*pcbPathOut
, WORD fRequest
, LPDWORD lpdwUsageCount
)
329 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
333 BOOL WINAPI
SQLInstallTranslatorW(LPCWSTR lpszInfFile
, LPCWSTR lpszTranslator
,
334 LPCWSTR lpszPathIn
, LPWSTR lpszPathOut
, WORD cbPathOutMax
,
335 WORD
*pcbPathOut
, WORD fRequest
, LPDWORD lpdwUsageCount
)
338 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
342 BOOL WINAPI
SQLManageDataSources(HWND hwnd
)
345 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
349 SQLRETURN WINAPI
SQLPostInstallerErrorW(DWORD fErrorCode
, LPCWSTR szErrorMsg
)
352 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
356 SQLRETURN WINAPI
SQLPostInstallerError(DWORD fErrorCode
, LPCSTR szErrorMsg
)
359 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
363 BOOL WINAPI
SQLReadFileDSNW(LPCWSTR lpszFileName
, LPCWSTR lpszAppName
,
364 LPCWSTR lpszKeyName
, LPWSTR lpszString
, WORD cbString
,
368 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
372 BOOL WINAPI
SQLReadFileDSN(LPCSTR lpszFileName
, LPCSTR lpszAppName
,
373 LPCSTR lpszKeyName
, LPSTR lpszString
, WORD cbString
,
377 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
381 BOOL WINAPI
SQLRemoveDefaultDataSource(void)
384 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
388 BOOL WINAPI
SQLRemoveDriverW(LPCWSTR lpszDriver
, BOOL fRemoveDSN
,
389 LPDWORD lpdwUsageCount
)
392 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
396 BOOL WINAPI
SQLRemoveDriver(LPCSTR lpszDriver
, BOOL fRemoveDSN
,
397 LPDWORD lpdwUsageCount
)
400 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
404 BOOL WINAPI
SQLRemoveDriverManager(LPDWORD pdwUsageCount
)
407 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
411 BOOL WINAPI
SQLRemoveDSNFromIniW(LPCWSTR lpszDSN
)
414 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
418 BOOL WINAPI
SQLRemoveDSNFromIni(LPCSTR lpszDSN
)
421 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
425 BOOL WINAPI
SQLRemoveTranslatorW(LPCWSTR lpszTranslator
, LPDWORD lpdwUsageCount
)
428 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
432 BOOL WINAPI
SQLRemoveTranslator(LPCSTR lpszTranslator
, LPDWORD lpdwUsageCount
)
435 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
439 BOOL WINAPI
SQLSetConfigMode(UWORD wConfigMode
)
442 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
446 BOOL WINAPI
SQLValidDSNW(LPCWSTR lpszDSN
)
449 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
453 BOOL WINAPI
SQLValidDSN(LPCSTR lpszDSN
)
456 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
460 BOOL WINAPI
SQLWriteDSNToIniW(LPCWSTR lpszDSN
, LPCWSTR lpszDriver
)
463 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
467 BOOL WINAPI
SQLWriteDSNToIni(LPCSTR lpszDSN
, LPCSTR lpszDriver
)
470 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
474 BOOL WINAPI
SQLWriteFileDSNW(LPCWSTR lpszFileName
, LPCWSTR lpszAppName
,
475 LPCWSTR lpszKeyName
, LPCWSTR lpszString
)
478 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
482 BOOL WINAPI
SQLWriteFileDSN(LPCSTR lpszFileName
, LPCSTR lpszAppName
,
483 LPCSTR lpszKeyName
, LPCSTR lpszString
)
486 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
490 BOOL WINAPI
SQLWritePrivateProfileStringW(LPCWSTR lpszSection
, LPCWSTR lpszEntry
,
491 LPCWSTR lpszString
, LPCWSTR lpszFilename
)
494 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
498 BOOL WINAPI
SQLWritePrivateProfileString(LPCSTR lpszSection
, LPCSTR lpszEntry
,
499 LPCSTR lpszString
, LPCSTR lpszFilename
)
502 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);