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 static LPWSTR
SQLInstall_strdup_multi(LPCSTR str
)
45 for (p
= str
; *p
; p
+= lstrlenA(p
) + 1)
48 len
= MultiByteToWideChar(CP_ACP
, 0, str
, p
- str
, NULL
, 0 );
49 ret
= HeapAlloc(GetProcessHeap(), 0, (len
+1)*sizeof(WCHAR
));
50 MultiByteToWideChar(CP_ACP
, 0, str
, p
- str
, ret
, len
);
56 static LPWSTR
SQLInstall_strdup(LPCSTR str
)
64 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0 );
65 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
66 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
71 BOOL WINAPI
SQLConfigDataSourceW(HWND hwndParent
, WORD fRequest
,
72 LPCWSTR lpszDriver
, LPCWSTR lpszAttributes
)
75 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
79 BOOL WINAPI
SQLConfigDataSource(HWND hwndParent
, WORD fRequest
,
80 LPCSTR lpszDriver
, LPCSTR lpszAttributes
)
83 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
87 BOOL WINAPI
SQLConfigDriverW(HWND hwndParent
, WORD fRequest
, LPCWSTR lpszDriver
,
88 LPCWSTR lpszArgs
, LPWSTR lpszMsg
, WORD cbMsgMax
, WORD
*pcbMsgOut
)
91 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
95 BOOL WINAPI
SQLConfigDriver(HWND hwndParent
, WORD fRequest
, LPCSTR lpszDriver
,
96 LPCSTR lpszArgs
, LPSTR lpszMsg
, WORD cbMsgMax
, WORD
*pcbMsgOut
)
99 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
103 BOOL WINAPI
SQLCreateDataSourceW(HWND hwnd
, LPWSTR lpszDS
)
106 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
110 BOOL WINAPI
SQLCreateDataSource(HWND hwnd
, LPSTR lpszDS
)
113 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
117 BOOL WINAPI
SQLGetAvailableDriversW(LPCWSTR lpszInfFile
, LPWSTR lpszBuf
,
118 WORD cbBufMax
, WORD
*pcbBufOut
)
121 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
125 BOOL WINAPI
SQLGetAvailableDrivers(LPCSTR lpszInfFile
, LPSTR lpszBuf
,
126 WORD cbBufMax
, WORD
*pcbBufOut
)
129 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
133 BOOL WINAPI
SQLGetConfigMode(UWORD
*pwConfigMode
)
136 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
140 BOOL WINAPI
SQLGetInstalledDriversW(LPWSTR lpszBuf
, WORD cbBufMax
,
144 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
148 BOOL WINAPI
SQLGetInstalledDrivers(LPSTR lpszBuf
, WORD cbBufMax
,
152 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
156 int WINAPI
SQLGetPrivateProfileStringW(LPCWSTR lpszSection
, LPCWSTR lpszEntry
,
157 LPCWSTR lpszDefault
, LPCWSTR RetBuffer
, INT cbRetBuffer
,
158 LPCWSTR lpszFilename
)
161 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
165 int WINAPI
SQLGetPrivateProfileString(LPCSTR lpszSection
, LPCSTR lpszEntry
,
166 LPCSTR lpszDefault
, LPCSTR RetBuffer
, INT cbRetBuffer
,
170 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
174 BOOL WINAPI
SQLGetTranslatorW(HWND hwndParent
, LPWSTR lpszName
, WORD cbNameMax
,
175 WORD
*pcbNameOut
, LPWSTR lpszPath
, WORD cbPathMax
,
176 WORD
*pcbPathOut
, DWORD
*pvOption
)
179 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
183 BOOL WINAPI
SQLGetTranslator(HWND hwndParent
, LPSTR lpszName
, WORD cbNameMax
,
184 WORD
*pcbNameOut
, LPSTR lpszPath
, WORD cbPathMax
,
185 WORD
*pcbPathOut
, DWORD
*pvOption
)
188 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
192 BOOL WINAPI
SQLInstallDriverW(LPCWSTR lpszInfFile
, LPCWSTR lpszDriver
,
193 LPWSTR lpszPath
, WORD cbPathMax
, WORD
* pcbPathOut
)
195 FIXME("%s %s %p %d %p\n", debugstr_w(lpszInfFile
),
196 debugstr_w(lpszDriver
), lpszPath
, cbPathMax
, pcbPathOut
);
197 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
201 BOOL WINAPI
SQLInstallDriver(LPCSTR lpszInfFile
, LPCSTR lpszDriver
,
202 LPSTR lpszPath
, WORD cbPathMax
, WORD
* pcbPathOut
)
204 FIXME("%s %s %p %d %p\n", debugstr_a(lpszInfFile
),
205 debugstr_a(lpszDriver
), lpszPath
, cbPathMax
, pcbPathOut
);
206 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
210 BOOL WINAPI
SQLInstallDriverExW(LPCWSTR lpszDriver
, LPCWSTR lpszPathIn
,
211 LPWSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
212 WORD fRequest
, LPDWORD lpdwUsageCount
)
216 FIXME("%s %s %p %d %p %d %p\n", debugstr_w(lpszDriver
), debugstr_w(lpszPathIn
),
217 lpszPathOut
, cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
219 for (p
= lpszDriver
; *p
; p
+= lstrlenW(p
) + 1)
220 FIXME("%s\n", debugstr_w(p
));
222 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
226 BOOL WINAPI
SQLInstallDriverEx(LPCSTR lpszDriver
, LPCSTR lpszPathIn
,
227 LPSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
228 WORD fRequest
, LPDWORD lpdwUsageCount
)
230 LPWSTR driver
, pathin
;
231 WCHAR pathout
[MAX_PATH
];
235 TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszDriver
), debugstr_a(lpszPathIn
),
236 lpszPathOut
, cbPathOutMax
, pcbPathOut
, fRequest
, lpdwUsageCount
);
238 driver
= SQLInstall_strdup_multi(lpszDriver
);
239 pathin
= SQLInstall_strdup(lpszPathIn
);
241 r
= SQLInstallDriverExW( driver
, pathin
, pathout
, MAX_PATH
,
242 &cbOut
, fRequest
, lpdwUsageCount
);
245 *pcbPathOut
= WideCharToMultiByte(CP_ACP
, 0, pathout
, -1,
246 lpszPathOut
, cbPathOutMax
, NULL
, NULL
);
252 BOOL WINAPI
SQLInstallDriverManagerW(LPWSTR lpszPath
, WORD cbPathMax
,
256 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
260 BOOL WINAPI
SQLInstallDriverManager(LPSTR lpszPath
, WORD cbPathMax
,
264 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
268 BOOL WINAPI
SQLInstallODBCW(HWND hwndParent
, LPCWSTR lpszInfFile
,
269 LPCWSTR lpszSrcPath
, LPCWSTR lpszDrivers
)
272 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
276 BOOL WINAPI
SQLInstallODBC(HWND hwndParent
, LPCSTR lpszInfFile
,
277 LPCSTR lpszSrcPath
, LPCSTR lpszDrivers
)
280 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
284 RETCODE WINAPI
SQLInstallerErrorW(WORD iError
, DWORD
*pfErrorCode
,
285 LPWSTR lpszErrorMsg
, WORD cbErrorMsgMax
, WORD
*pcbErrorMsg
)
288 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
292 RETCODE WINAPI
SQLInstallerError(WORD iError
, DWORD
*pfErrorCode
,
293 LPSTR lpszErrorMsg
, WORD cbErrorMsgMax
, WORD
*pcbErrorMsg
)
296 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
300 BOOL WINAPI
SQLInstallTranslatorExW(LPCWSTR lpszTranslator
, LPCWSTR lpszPathIn
,
301 LPWSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
302 WORD fRequest
, LPDWORD lpdwUsageCount
)
305 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
309 BOOL WINAPI
SQLInstallTranslatorEx(LPCSTR lpszTranslator
, LPCSTR lpszPathIn
,
310 LPSTR lpszPathOut
, WORD cbPathOutMax
, WORD
*pcbPathOut
,
311 WORD fRequest
, LPDWORD lpdwUsageCount
)
314 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
318 BOOL WINAPI
SQLInstallTranslator(LPCSTR lpszInfFile
, LPCSTR lpszTranslator
,
319 LPCSTR lpszPathIn
, LPSTR lpszPathOut
, WORD cbPathOutMax
,
320 WORD
*pcbPathOut
, WORD fRequest
, LPDWORD lpdwUsageCount
)
323 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
327 BOOL WINAPI
SQLInstallTranslatorW(LPCWSTR lpszInfFile
, LPCWSTR lpszTranslator
,
328 LPCWSTR lpszPathIn
, LPWSTR lpszPathOut
, WORD cbPathOutMax
,
329 WORD
*pcbPathOut
, WORD fRequest
, LPDWORD lpdwUsageCount
)
332 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
336 BOOL WINAPI
SQLManageDataSources(HWND hwnd
)
339 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
343 RETCODE WINAPI
SQLPostInstallerErrorW(DWORD fErrorCode
, LPWSTR szErrorMsg
)
346 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
350 RETCODE WINAPI
SQLPostInstallerError(DWORD fErrorCode
, LPSTR szErrorMsg
)
353 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
357 BOOL WINAPI
SQLReadFileDSNW(LPCWSTR lpszFileName
, LPCWSTR lpszAppName
,
358 LPCWSTR lpszKeyName
, LPWSTR lpszString
, WORD cbString
,
362 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
366 BOOL WINAPI
SQLReadFileDSN(LPCSTR lpszFileName
, LPCSTR lpszAppName
,
367 LPCSTR lpszKeyName
, LPSTR lpszString
, WORD cbString
,
371 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
375 BOOL WINAPI
SQLRemoveDefaultDataSource(void)
378 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
382 BOOL WINAPI
SQLRemoveDriverW(LPCWSTR lpszDriver
, BOOL fRemoveDSN
,
383 LPDWORD lpdwUsageCount
)
386 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
390 BOOL WINAPI
SQLRemoveDriver(LPCSTR lpszDriver
, BOOL fRemoveDSN
,
391 LPDWORD lpdwUsageCount
)
394 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
398 BOOL WINAPI
SQLRemoveDriverManager(LPDWORD pdwUsageCount
)
401 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
405 BOOL WINAPI
SQLRemoveDSNFromIniW(LPCWSTR lpszDSN
)
408 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
412 BOOL WINAPI
SQLRemoveDSNFromIni(LPCSTR lpszDSN
)
415 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
419 BOOL WINAPI
SQLRemoveTranslatorW(LPCWSTR lpszTranslator
, LPDWORD lpdwUsageCount
)
422 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
426 BOOL WINAPI
SQLRemoveTranslator(LPCSTR lpszTranslator
, LPDWORD lpdwUsageCount
)
429 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
433 BOOL WINAPI
SQLSetConfigMode(UWORD wConfigMode
)
436 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
440 BOOL WINAPI
SQLValidDSNW(LPCWSTR lpszDSN
)
443 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
447 BOOL WINAPI
SQLValidDSN(LPCSTR lpszDSN
)
450 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
454 BOOL WINAPI
SQLWriteDSNToIniW(LPCWSTR lpszDSN
, LPCWSTR lpszDriver
)
457 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
461 BOOL WINAPI
SQLWriteDSNToIni(LPCSTR lpszDSN
, LPCSTR lpszDriver
)
464 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
468 BOOL WINAPI
SQLWriteFileDSNW(LPCWSTR lpszFileName
, LPCWSTR lpszAppName
,
469 LPCWSTR lpszKeyName
, LPCWSTR lpszString
)
472 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
476 BOOL WINAPI
SQLWriteFileDSN(LPCSTR lpszFileName
, LPCSTR lpszAppName
,
477 LPCSTR lpszKeyName
, LPCSTR lpszString
)
480 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
484 BOOL WINAPI
SQLWritePrivateProfileStringW(LPCWSTR lpszSection
, LPCWSTR lpszEntry
,
485 LPCWSTR lpszString
, LPCWSTR lpszFilename
)
488 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
492 BOOL WINAPI
SQLWritePrivateProfileString(LPCSTR lpszSection
, LPCSTR lpszEntry
,
493 LPCSTR lpszString
, LPCSTR lpszFilename
)
496 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);