ReactOS 0.4.15-dev-7918-g2a2556c
odbcinst.h File Reference
#include <sql.h>
Include dependency graph for odbcinst.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ODBCVER   0x0351
 
#define INSTAPI   __stdcall
 
#define ODBC_ADD_DSN   1
 
#define ODBC_CONFIG_DSN   2
 
#define ODBC_REMOVE_DSN   3
 
#define ODBC_ADD_SYS_DSN   4
 
#define ODBC_CONFIG_SYS_DSN   5
 
#define ODBC_REMOVE_SYS_DSN   6
 
#define ODBC_INSTALL_INQUIRY   1
 
#define ODBC_INSTALL_COMPLETE   2
 
#define ODBC_INSTALL_DRIVER   1
 
#define ODBC_REMOVE_DRIVER   2
 
#define ODBC_CONFIG_DRIVER   3
 
#define ODBC_CONFIG_DRIVER_MAX   100
 
#define ODBC_REMOVE_DEFAULT_DSN   7
 
#define ODBC_BOTH_DSN   0
 
#define ODBC_USER_DSN   1
 
#define ODBC_SYSTEM_DSN   2
 
#define ODBC_ERROR_GENERAL_ERR   1
 
#define ODBC_ERROR_INVALID_BUFF_LEN   2
 
#define ODBC_ERROR_INVALID_HWND   3
 
#define ODBC_ERROR_INVALID_STR   4
 
#define ODBC_ERROR_INVALID_REQUEST_TYPE   5
 
#define ODBC_ERROR_COMPONENT_NOT_FOUND   6
 
#define ODBC_ERROR_INVALID_NAME   7
 
#define ODBC_ERROR_INVALID_KEYWORD_VALUE   8
 
#define ODBC_ERROR_INVALID_DSN   9
 
#define ODBC_ERROR_INVALID_INF   10
 
#define ODBC_ERROR_REQUEST_FAILED   11
 
#define ODBC_ERROR_INVALID_PATH   12
 
#define ODBC_ERROR_LOAD_LIB_FAILED   13
 
#define ODBC_ERROR_INVALID_PARAM_SEQUENCE   14
 
#define ODBC_ERROR_INVALID_LOG_FILE   15
 
#define ODBC_ERROR_USER_CANCELED   16
 
#define ODBC_ERROR_USAGE_UPDATE_FAILED   17
 
#define ODBC_ERROR_CREATE_DSN_FAILED   18
 
#define ODBC_ERROR_WRITING_SYSINFO_FAILED   19
 
#define ODBC_ERROR_REMOVE_DSN_FAILED   20
 
#define ODBC_ERROR_OUT_OF_MEM   21
 
#define ODBC_ERROR_OUTPUT_STRING_TRUNCATED   22
 

Functions

BOOL INSTAPI ConfigDSN (HWND, WORD, LPCSTR, LPCSTR)
 
BOOL INSTAPI ConfigDSNW (HWND, WORD, LPCWSTR, LPCWSTR)
 
BOOL INSTAPI ConfigTranslator (HWND, DWORD *)
 
BOOL INSTAPI SQLConfigDataSource (HWND, WORD, LPCSTR, LPCSTR)
 
BOOL INSTAPI SQLConfigDataSourceW (HWND, WORD, LPCWSTR, LPCWSTR)
 
BOOL INSTAPI SQLCreateDataSource (HWND, LPCSTR)
 
BOOL INSTAPI SQLCreateDataSourceW (HWND, LPCWSTR)
 
BOOL INSTAPI SQLGetAvailableDrivers (LPCSTR, LPSTR, WORD, WORD *)
 
BOOL INSTAPI SQLGetAvailableDriversW (LPCWSTR, LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLGetInstalledDrivers (LPSTR, WORD, WORD *)
 
BOOL INSTAPI SQLGetInstalledDriversW (LPWSTR, WORD, WORD *)
 
int INSTAPI SQLGetPrivateProfileString (LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR)
 
int INSTAPI SQLGetPrivateProfileStringW (LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, int, LPCWSTR)
 
BOOL INSTAPI SQLGetTranslator (HWND, LPSTR, WORD, WORD *, LPSTR, WORD, WORD *, DWORD *)
 
BOOL INSTAPI SQLGetTranslatorW (HWND, LPWSTR, WORD, WORD *, LPWSTR, WORD, WORD *, DWORD *)
 
BOOL INSTAPI SQLInstallDriver (LPCSTR, LPCSTR, LPSTR, WORD, WORD *)
 
BOOL INSTAPI SQLInstallDriverManager (LPSTR, WORD, WORD *)
 
BOOL INSTAPI SQLInstallDriverManagerW (LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLInstallDriverW (LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLInstallODBC (HWND, LPCSTR, LPCSTR, LPCSTR)
 
BOOL INSTAPI SQLInstallODBCW (HWND, LPCWSTR, LPCWSTR, LPCWSTR)
 
BOOL INSTAPI SQLManageDataSources (HWND)
 
BOOL INSTAPI SQLRemoveDefaultDataSource (void)
 
BOOL INSTAPI SQLRemoveDSNFromIni (LPCSTR)
 
BOOL INSTAPI SQLRemoveDSNFromIniW (LPCWSTR)
 
BOOL INSTAPI SQLValidDSN (LPCSTR)
 
BOOL INSTAPI SQLValidDSNW (LPCWSTR)
 
BOOL INSTAPI SQLWriteDSNToIni (LPCSTR, LPCSTR)
 
BOOL INSTAPI SQLWriteDSNToIniW (LPCWSTR, LPCWSTR)
 
BOOL INSTAPI SQLWritePrivateProfileString (LPCSTR, LPCSTR, LPCSTR, LPCSTR)
 
BOOL INSTAPI SQLWritePrivateProfileStringW (LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR)
 
BOOL INSTAPI ConfigDriver (HWND, WORD, LPCSTR, LPCSTR, LPSTR, WORD, WORD *)
 
BOOL INSTAPI ConfigDriverW (HWND, WORD, LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLConfigDriver (HWND, WORD, LPCSTR, LPCSTR, LPSTR, WORD, WORD *)
 
BOOL INSTAPI SQLConfigDriverW (HWND, WORD, LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLInstallTranslator (LPCSTR, LPCSTR, LPCSTR, LPSTR, WORD, WORD *, WORD, LPDWORD)
 
BOOL INSTAPI SQLInstallTranslatorW (LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *, WORD, LPDWORD)
 
BOOL INSTAPI SQLRemoveDriver (LPCSTR, BOOL, LPDWORD)
 
BOOL INSTAPI SQLRemoveDriverManager (LPDWORD)
 
BOOL INSTAPI SQLRemoveDriverW (LPCWSTR, BOOL, LPDWORD)
 
BOOL INSTAPI SQLRemoveTranslator (LPCSTR, LPDWORD)
 
BOOL INSTAPI SQLRemoveTranslatorW (LPCWSTR, LPDWORD)
 
BOOL INSTAPI SQLGetConfigMode (UWORD *)
 
BOOL INSTAPI SQLInstallDriverEx (LPCSTR, LPCSTR, LPSTR, WORD, WORD *, WORD, LPDWORD)
 
BOOL INSTAPI SQLInstallDriverExW (LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *, WORD, LPDWORD)
 
SQLRETURN INSTAPI SQLInstallerError (WORD, DWORD *, LPSTR, WORD, WORD *)
 
SQLRETURN INSTAPI SQLInstallerErrorW (WORD, DWORD *, LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLInstallTranslatorEx (LPCSTR, LPCSTR, LPSTR, WORD, WORD *, WORD, LPDWORD)
 
BOOL INSTAPI SQLInstallTranslatorExW (LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *, WORD, LPDWORD)
 
SQLRETURN INSTAPI SQLPostInstallerError (DWORD, LPCSTR)
 
SQLRETURN INSTAPI SQLPostInstallerErrorW (DWORD, LPCWSTR)
 
BOOL INSTAPI SQLReadFileDSN (LPCSTR, LPCSTR, LPCSTR, LPSTR, WORD, WORD *)
 
BOOL INSTAPI SQLReadFileDSNW (LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, WORD, WORD *)
 
BOOL INSTAPI SQLSetConfigMode (UWORD)
 
BOOL INSTAPI SQLWriteFileDSN (LPCSTR, LPCSTR, LPCSTR, LPCSTR)
 
BOOL INSTAPI SQLWriteFileDSNW (LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR)
 

Macro Definition Documentation

◆ INSTAPI

#define INSTAPI   __stdcall

Definition at line 11 of file odbcinst.h.

◆ ODBC_ADD_DSN

#define ODBC_ADD_DSN   1

Definition at line 12 of file odbcinst.h.

◆ ODBC_ADD_SYS_DSN

#define ODBC_ADD_SYS_DSN   4

Definition at line 16 of file odbcinst.h.

◆ ODBC_BOTH_DSN

#define ODBC_BOTH_DSN   0

Definition at line 28 of file odbcinst.h.

◆ ODBC_CONFIG_DRIVER

#define ODBC_CONFIG_DRIVER   3

Definition at line 23 of file odbcinst.h.

◆ ODBC_CONFIG_DRIVER_MAX

#define ODBC_CONFIG_DRIVER_MAX   100

Definition at line 24 of file odbcinst.h.

◆ ODBC_CONFIG_DSN

#define ODBC_CONFIG_DSN   2

Definition at line 13 of file odbcinst.h.

◆ ODBC_CONFIG_SYS_DSN

#define ODBC_CONFIG_SYS_DSN   5

Definition at line 17 of file odbcinst.h.

◆ ODBC_ERROR_COMPONENT_NOT_FOUND

#define ODBC_ERROR_COMPONENT_NOT_FOUND   6

Definition at line 36 of file odbcinst.h.

◆ ODBC_ERROR_CREATE_DSN_FAILED

#define ODBC_ERROR_CREATE_DSN_FAILED   18

Definition at line 48 of file odbcinst.h.

◆ ODBC_ERROR_GENERAL_ERR

#define ODBC_ERROR_GENERAL_ERR   1

Definition at line 31 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_BUFF_LEN

#define ODBC_ERROR_INVALID_BUFF_LEN   2

Definition at line 32 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_DSN

#define ODBC_ERROR_INVALID_DSN   9

Definition at line 39 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_HWND

#define ODBC_ERROR_INVALID_HWND   3

Definition at line 33 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_INF

#define ODBC_ERROR_INVALID_INF   10

Definition at line 40 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_KEYWORD_VALUE

#define ODBC_ERROR_INVALID_KEYWORD_VALUE   8

Definition at line 38 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_LOG_FILE

#define ODBC_ERROR_INVALID_LOG_FILE   15

Definition at line 45 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_NAME

#define ODBC_ERROR_INVALID_NAME   7

Definition at line 37 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_PARAM_SEQUENCE

#define ODBC_ERROR_INVALID_PARAM_SEQUENCE   14

Definition at line 44 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_PATH

#define ODBC_ERROR_INVALID_PATH   12

Definition at line 42 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_REQUEST_TYPE

#define ODBC_ERROR_INVALID_REQUEST_TYPE   5

Definition at line 35 of file odbcinst.h.

◆ ODBC_ERROR_INVALID_STR

#define ODBC_ERROR_INVALID_STR   4

Definition at line 34 of file odbcinst.h.

◆ ODBC_ERROR_LOAD_LIB_FAILED

#define ODBC_ERROR_LOAD_LIB_FAILED   13

Definition at line 43 of file odbcinst.h.

◆ ODBC_ERROR_OUT_OF_MEM

#define ODBC_ERROR_OUT_OF_MEM   21

Definition at line 51 of file odbcinst.h.

◆ ODBC_ERROR_OUTPUT_STRING_TRUNCATED

#define ODBC_ERROR_OUTPUT_STRING_TRUNCATED   22

Definition at line 52 of file odbcinst.h.

◆ ODBC_ERROR_REMOVE_DSN_FAILED

#define ODBC_ERROR_REMOVE_DSN_FAILED   20

Definition at line 50 of file odbcinst.h.

◆ ODBC_ERROR_REQUEST_FAILED

#define ODBC_ERROR_REQUEST_FAILED   11

Definition at line 41 of file odbcinst.h.

◆ ODBC_ERROR_USAGE_UPDATE_FAILED

#define ODBC_ERROR_USAGE_UPDATE_FAILED   17

Definition at line 47 of file odbcinst.h.

◆ ODBC_ERROR_USER_CANCELED

#define ODBC_ERROR_USER_CANCELED   16

Definition at line 46 of file odbcinst.h.

◆ ODBC_ERROR_WRITING_SYSINFO_FAILED

#define ODBC_ERROR_WRITING_SYSINFO_FAILED   19

Definition at line 49 of file odbcinst.h.

◆ ODBC_INSTALL_COMPLETE

#define ODBC_INSTALL_COMPLETE   2

Definition at line 20 of file odbcinst.h.

◆ ODBC_INSTALL_DRIVER

#define ODBC_INSTALL_DRIVER   1

Definition at line 21 of file odbcinst.h.

◆ ODBC_INSTALL_INQUIRY

#define ODBC_INSTALL_INQUIRY   1

Definition at line 19 of file odbcinst.h.

◆ ODBC_REMOVE_DEFAULT_DSN

#define ODBC_REMOVE_DEFAULT_DSN   7

Definition at line 27 of file odbcinst.h.

◆ ODBC_REMOVE_DRIVER

#define ODBC_REMOVE_DRIVER   2

Definition at line 22 of file odbcinst.h.

◆ ODBC_REMOVE_DSN

#define ODBC_REMOVE_DSN   3

Definition at line 14 of file odbcinst.h.

◆ ODBC_REMOVE_SYS_DSN

#define ODBC_REMOVE_SYS_DSN   6

Definition at line 18 of file odbcinst.h.

◆ ODBC_SYSTEM_DSN

#define ODBC_SYSTEM_DSN   2

Definition at line 30 of file odbcinst.h.

◆ ODBC_USER_DSN

#define ODBC_USER_DSN   1

Definition at line 29 of file odbcinst.h.

◆ ODBCVER

#define ODBCVER   0x0351

Definition at line 9 of file odbcinst.h.

Function Documentation

◆ ConfigDriver()

BOOL INSTAPI ConfigDriver ( HWND  ,
WORD  ,
LPCSTR  ,
LPCSTR  ,
LPSTR  ,
WORD  ,
WORD  
)

◆ ConfigDriverW()

BOOL INSTAPI ConfigDriverW ( HWND  ,
WORD  ,
LPCWSTR  ,
LPCWSTR  ,
LPWSTR  ,
WORD  ,
WORD  
)

◆ ConfigDSN()

BOOL INSTAPI ConfigDSN ( HWND  ,
WORD  ,
LPCSTR  ,
LPCSTR   
)

◆ ConfigDSNW()

BOOL INSTAPI ConfigDSNW ( HWND  ,
WORD  ,
LPCWSTR  ,
LPCWSTR   
)

◆ ConfigTranslator()

BOOL INSTAPI ConfigTranslator ( HWND  ,
DWORD  
)

◆ SQLConfigDataSource()

BOOL INSTAPI SQLConfigDataSource ( HWND  hwndParent,
WORD  fRequest,
LPCSTR  lpszDriver,
LPCSTR  lpszAttributes 
)

Definition at line 240 of file odbccp32.c.

242{
243 FIXME("%p %d %s %s\n", hwndParent, fRequest, debugstr_a(lpszDriver),
244 debugstr_a(lpszAttributes));
245 clear_errors();
246 return TRUE;
247}
#define FIXME(fmt,...)
Definition: debug.h:111
static HWND hwndParent
Definition: cryptui.c:300
#define TRUE
Definition: types.h:120
#define debugstr_a
Definition: kernel32.h:31
static void clear_errors(void)
Definition: odbccp32.c:86

Referenced by test_SQLConfigDataSource().

◆ SQLConfigDataSourceW()

BOOL INSTAPI SQLConfigDataSourceW ( HWND  hwndParent,
WORD  fRequest,
LPCWSTR  lpszDriver,
LPCWSTR  lpszAttributes 
)

Definition at line 225 of file odbccp32.c.

227{
228 LPCWSTR p;
229
230 clear_errors();
231 FIXME("%p %d %s %s\n", hwndParent, fRequest, debugstr_w(lpszDriver),
232 debugstr_w(lpszAttributes));
233
234 for (p = lpszAttributes; *p; p += lstrlenW(p) + 1)
235 FIXME("%s\n", debugstr_w(p));
236
237 return TRUE;
238}
#define lstrlenW
Definition: compat.h:750
GLfloat GLfloat p
Definition: glext.h:8902
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by ITERATE_InstallODBCDataSource(), and ITERATE_RemoveODBCDataSource().

◆ SQLConfigDriver()

BOOL INSTAPI SQLConfigDriver ( HWND  hwnd,
WORD  request,
LPCSTR  driver,
LPCSTR  args,
LPSTR  msg,
WORD  msgmax,
WORD msgout 
)

Definition at line 397 of file odbccp32.c.

399{
400 BOOL (WINAPI *pConfigDriverA)(HWND hwnd, WORD request, const char *driver, const char *args, const char *msg, WORD msgmax, WORD *msgout);
402 WCHAR *driverW;
403 BOOL funcret = FALSE;
404
405 clear_errors();
406 TRACE("(%p %d %s %s %p %d %p)\n", hwnd, request, debugstr_a(driver),
407 debugstr_a(args), msg, msgmax, msgout);
408
410 if(!driverW)
411 {
413 return FALSE;
414 }
416 {
417 BOOL ret = FALSE;
418 WCHAR *argsW = heap_strdupAtoW(args);
419 if(argsW)
420 {
422 HeapFree(GetProcessHeap(), 0, argsW);
423 }
424 else
425 {
427 }
428
430
431 return ret;
432 }
433
436 if(!hmod)
437 return FALSE;
438
439 pConfigDriverA = (void*)GetProcAddress(hmod, "ConfigDriver");
440 if(pConfigDriverA)
441 funcret = pConfigDriverA(hwnd, request, driver, args, msg, msgmax, msgout);
442
443 if(!funcret)
445
447
448 return funcret;
449}
#define msg(x)
Definition: auth_time.c:54
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:143
struct @1669::@1670 driver
#define BOOL
Definition: nt_native.h:43
#define ODBC_ERROR_REQUEST_FAILED
Definition: odbcinst.h:41
#define ODBC_CONFIG_DRIVER
Definition: odbcinst.h:23
#define ODBC_ERROR_OUT_OF_MEM
Definition: odbcinst.h:51
static const WCHAR driverW[]
#define args
Definition: format.c:66
#define TRACE(s)
Definition: solgame.cpp:4
Definition: match.c:390
Definition: tftpd.h:86
int ret
static WCHAR * heap_strdupAtoW(const char *str)
Definition: odbccp32.c:91
static const WCHAR odbc_error_request_failed[]
Definition: odbccp32.c:71
static void push_error(int code, LPCWSTR msg)
Definition: odbccp32.c:75
static BOOL write_config_value(const WCHAR *driver, const WCHAR *args)
Definition: odbccp32.c:307
static HMODULE load_config_driver(const WCHAR *driver)
Definition: odbccp32.c:249
static const WCHAR odbc_error_out_of_mem[]
Definition: odbccp32.c:66
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_SQLInstallDriverEx().

◆ SQLConfigDriverW()

BOOL INSTAPI SQLConfigDriverW ( HWND  hwnd,
WORD  request,
LPCWSTR  driver,
LPCWSTR  args,
LPWSTR  msg,
WORD  msgmax,
WORD msgout 
)

Definition at line 365 of file odbccp32.c.

367{
368 BOOL (WINAPI *pConfigDriverW)(HWND hwnd, WORD request, const WCHAR *driver, const WCHAR *args, const WCHAR *msg, WORD msgmax, WORD *msgout);
370 BOOL funcret = FALSE;
371
372 clear_errors();
373 TRACE("(%p %d %s %s %p %d %p)\n", hwnd, request, debugstr_w(driver),
374 debugstr_w(args), msg, msgmax, msgout);
375
377 {
379 }
380
382 if(!hmod)
383 return FALSE;
384
385 pConfigDriverW = (void*)GetProcAddress(hmod, "ConfigDriverW");
386 if(pConfigDriverW)
387 funcret = pConfigDriverW(hwnd, request, driver, args, msg, msgmax, msgout);
388
389 if(!funcret)
391
393
394 return funcret;
395}

◆ SQLCreateDataSource()

BOOL INSTAPI SQLCreateDataSource ( HWND  hwnd,
LPCSTR  lpszDS 
)

Definition at line 459 of file odbccp32.c.

460{
461 clear_errors();
462 FIXME("%p %s\n", hwnd, debugstr_a(lpszDS));
464 return FALSE;
465}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752

◆ SQLCreateDataSourceW()

BOOL INSTAPI SQLCreateDataSourceW ( HWND  hwnd,
LPCWSTR  lpszDS 
)

Definition at line 451 of file odbccp32.c.

452{
453 clear_errors();
454 FIXME("%p %s\n", hwnd, debugstr_w(lpszDS));
456 return FALSE;
457}

◆ SQLGetAvailableDrivers()

BOOL INSTAPI SQLGetAvailableDrivers ( LPCSTR  lpszInfFile,
LPSTR  lpszBuf,
WORD  cbBufMax,
WORD pcbBufOut 
)

Definition at line 476 of file odbccp32.c.

478{
479 clear_errors();
480 FIXME("%s %p %d %p\n", debugstr_a(lpszInfFile), lpszBuf, cbBufMax, pcbBufOut);
482 return FALSE;
483}

◆ SQLGetAvailableDriversW()

BOOL INSTAPI SQLGetAvailableDriversW ( LPCWSTR  lpszInfFile,
LPWSTR  lpszBuf,
WORD  cbBufMax,
WORD pcbBufOut 
)

Definition at line 467 of file odbccp32.c.

469{
470 clear_errors();
471 FIXME("%s %p %d %p\n", debugstr_w(lpszInfFile), lpszBuf, cbBufMax, pcbBufOut);
473 return FALSE;
474}

◆ SQLGetConfigMode()

BOOL INSTAPI SQLGetConfigMode ( UWORD pwConfigMode)

Definition at line 485 of file odbccp32.c.

486{
487 clear_errors();
488 TRACE("%p\n", pwConfigMode);
489 if (pwConfigMode)
490 *pwConfigMode = config_mode;
491 return TRUE;
492}
static UWORD config_mode
Definition: odbccp32.c:54

Referenced by test_SQLConfigMode().

◆ SQLGetInstalledDrivers()

BOOL INSTAPI SQLGetInstalledDrivers ( LPSTR  ,
WORD  ,
WORD  
)

◆ SQLGetInstalledDriversW()

BOOL INSTAPI SQLGetInstalledDriversW ( LPWSTR  ,
WORD  ,
WORD  
)

◆ SQLGetPrivateProfileString()

int INSTAPI SQLGetPrivateProfileString ( LPCSTR  section,
LPCSTR  entry,
LPCSTR  defvalue,
LPSTR  buff,
int  buff_len,
LPCSTR  filename 
)

Definition at line 687 of file odbccp32.c.

689{
690 WCHAR *sectionW, *filenameW;
691 BOOL usedefault = TRUE;
692 HKEY sectionkey;
693 LONG ret = 0;
694
695 TRACE("%s %s %s %p %d %s\n", debugstr_a(section), debugstr_a(entry),
696 debugstr_a(defvalue), buff, buff_len, debugstr_a(filename));
697
698 clear_errors();
699
700 if (buff_len <= 0)
701 return 0;
702
703 if (buff)
704 buff[0] = 0;
705
706 if (!section || !defvalue || !buff)
707 return 0;
708
709 sectionW = heap_strdupAtoW(section);
711
712 sectionkey = get_privateprofile_sectionkey(sectionW, filenameW);
713
714 heap_free(sectionW);
716
717 if (sectionkey)
718 {
719 DWORD type, size;
720
721 if (entry)
722 {
723 size = buff_len * sizeof(*buff);
724 if (RegGetValueA(sectionkey, NULL, entry, RRF_RT_REG_SZ, &type, buff, &size) == ERROR_SUCCESS)
725 {
726 usedefault = FALSE;
727 ret = (size / sizeof(*buff)) - 1;
728 }
729 }
730 else
731 {
732 char name[MAX_PATH] = {0};
733 DWORD index = 0;
735
736 usedefault = FALSE;
737
738 memset(buff, 0, buff_len);
739
740 namelen = sizeof(name);
741 while (RegEnumValueA(sectionkey, index, name, &namelen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
742 {
743 if ((ret + namelen+1) > buff_len)
744 break;
745
747
748 ret += namelen+1;
749 namelen = sizeof(name);
750 index++;
751 }
752 }
753
754 RegCloseKey(sectionkey);
755 }
756 else
757 usedefault = entry != NULL;
758
759 if (usedefault)
760 {
761 lstrcpynA(buff, defvalue, buff_len);
762 ret = strlen(buff);
763 }
764
765 return ret;
766}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegEnumValueA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpdwReserved, _Out_opt_ LPDWORD lpdwType, _Out_opt_ LPBYTE lpData, _Inout_opt_ LPDWORD lpcbData)
Definition: reg.c:2668
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:2037
#define lstrcpynA
Definition: compat.h:751
#define MAX_PATH
Definition: compat.h:34
#define RRF_RT_REG_SZ
Definition: driver.c:575
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLint namelen
Definition: glext.h:7232
GLuint index
Definition: glext.h:6031
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static const WCHAR filenameW[]
Definition: amstream.c:41
long LONG
Definition: pedump.c:60
#define memset(x, y, z)
Definition: compat.h:39
Definition: name.c:39
Definition: parser.c:56
static HKEY get_privateprofile_sectionkey(LPCWSTR section, LPCWSTR filename)
Definition: odbccp32.c:596

Referenced by test_SQLGetPrivateProfileString().

◆ SQLGetPrivateProfileStringW()

int INSTAPI SQLGetPrivateProfileStringW ( LPCWSTR  section,
LPCWSTR  entry,
LPCWSTR  defvalue,
LPWSTR  buff,
int  buff_len,
LPCWSTR  filename 
)

Definition at line 615 of file odbccp32.c.

617{
618 BOOL usedefault = TRUE;
619 HKEY sectionkey;
620 LONG ret = 0;
621
622 TRACE("%s %s %s %p %d %s\n", debugstr_w(section), debugstr_w(entry),
623 debugstr_w(defvalue), buff, buff_len, debugstr_w(filename));
624
625 clear_errors();
626
627 if (buff_len <= 0 || !section)
628 return 0;
629
630 if(buff)
631 buff[0] = 0;
632
633 if (!defvalue || !buff)
634 return 0;
635
637 if (sectionkey)
638 {
639 DWORD type, size;
640
641 if (entry)
642 {
643 size = buff_len * sizeof(*buff);
644 if (RegGetValueW(sectionkey, NULL, entry, RRF_RT_REG_SZ, &type, buff, &size) == ERROR_SUCCESS)
645 {
646 usedefault = FALSE;
647 ret = (size / sizeof(*buff)) - 1;
648 }
649 }
650 else
651 {
653 DWORD index = 0;
655
656 usedefault = FALSE;
657
658 memset(buff, 0, buff_len);
659
660 namelen = sizeof(name);
661 while (RegEnumValueW(sectionkey, index, name, &namelen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
662 {
663 if ((ret + namelen+1) > buff_len)
664 break;
665
667 ret += namelen+1;
668 namelen = sizeof(name);
669 index++;
670 }
671 }
672
673 RegCloseKey(sectionkey);
674 }
675 else
676 usedefault = entry != NULL;
677
678 if (usedefault)
679 {
680 lstrcpynW(buff, defvalue, buff_len);
681 ret = lstrlenW(buff);
682 }
683
684 return ret;
685}
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
#define lstrcpyW
Definition: compat.h:749
#define lstrcpynW
Definition: compat.h:738

Referenced by test_SQLGetPrivateProfileStringW().

◆ SQLGetTranslator()

BOOL INSTAPI SQLGetTranslator ( HWND  hwndParent,
LPSTR  lpszName,
WORD  cbNameMax,
WORD pcbNameOut,
LPSTR  lpszPath,
WORD  cbPathMax,
WORD pcbPathOut,
DWORD pvOption 
)

Definition at line 779 of file odbccp32.c.

782{
783 clear_errors();
784 FIXME("%p %s %d %p %p %d %p %p\n", hwndParent, debugstr_a(lpszName), cbNameMax,
785 pcbNameOut, lpszPath, cbPathMax, pcbPathOut, pvOption);
787 return FALSE;
788}

◆ SQLGetTranslatorW()

BOOL INSTAPI SQLGetTranslatorW ( HWND  hwndParent,
LPWSTR  lpszName,
WORD  cbNameMax,
WORD pcbNameOut,
LPWSTR  lpszPath,
WORD  cbPathMax,
WORD pcbPathOut,
DWORD pvOption 
)

Definition at line 768 of file odbccp32.c.

771{
772 clear_errors();
773 FIXME("%p %s %d %p %p %d %p %p\n", hwndParent, debugstr_w(lpszName), cbNameMax,
774 pcbNameOut, lpszPath, cbPathMax, pcbPathOut, pvOption);
776 return FALSE;
777}

◆ SQLInstallDriver()

BOOL INSTAPI SQLInstallDriver ( LPCSTR  lpszInfFile,
LPCSTR  lpszDriver,
LPSTR  lpszPath,
WORD  cbPathMax,
WORD pcbPathOut 
)

Definition at line 806 of file odbccp32.c.

808{
809 DWORD usage;
810
811 clear_errors();
812 TRACE("%s %s %p %d %p\n", debugstr_a(lpszInfFile),
813 debugstr_a(lpszDriver), lpszPath, cbPathMax, pcbPathOut);
814
815 if (lpszInfFile)
816 return FALSE;
817
818 return SQLInstallDriverEx(lpszDriver, NULL, lpszPath, cbPathMax,
819 pcbPathOut, ODBC_INSTALL_COMPLETE, &usage);
820}
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define ODBC_INSTALL_COMPLETE
Definition: odbcinst.h:20
BOOL WINAPI SQLInstallDriverEx(LPCSTR lpszDriver, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount)
Definition: odbccp32.c:955

◆ SQLInstallDriverEx()

BOOL INSTAPI SQLInstallDriverEx ( LPCSTR  lpszDriver,
LPCSTR  lpszPathIn,
LPSTR  lpszPathOut,
WORD  cbPathOutMax,
WORD pcbPathOut,
WORD  fRequest,
LPDWORD  lpdwUsageCount 
)

Definition at line 955 of file odbccp32.c.

958{
959 LPWSTR driver, pathin;
960 WCHAR pathout[MAX_PATH];
961 BOOL ret;
962 WORD cbOut = 0;
963
964 clear_errors();
965 TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszDriver),
966 debugstr_a(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut,
967 fRequest, lpdwUsageCount);
968
969 driver = SQLInstall_strdup_multi(lpszDriver);
970 pathin = SQLInstall_strdup(lpszPathIn);
971
972 ret = SQLInstallDriverExW(driver, pathin, pathout, MAX_PATH, &cbOut,
973 fRequest, lpdwUsageCount);
974 if (ret)
975 {
976 int len = WideCharToMultiByte(CP_ACP, 0, pathout, -1, lpszPathOut,
977 0, NULL, NULL);
978 if (len)
979 {
980 if (pcbPathOut)
981 *pcbPathOut = len - 1;
982
983 if (!lpszPathOut || cbPathOutMax < len)
984 {
985 ret = FALSE;
986 goto out;
987 }
988 len = WideCharToMultiByte(CP_ACP, 0, pathout, -1, lpszPathOut,
989 cbPathOutMax, NULL, NULL);
990 }
991 }
992
993out:
995 HeapFree(GetProcessHeap(), 0, pathin);
996 return ret;
997}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
GLenum GLsizei len
Definition: glext.h:6722
static FILE * out
Definition: regtests2xml.c:44
BOOL WINAPI SQLInstallDriverExW(LPCWSTR lpszDriver, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount)
Definition: odbccp32.c:928
static LPWSTR SQLInstall_strdup(LPCSTR str)
Definition: odbccp32.c:135
static LPWSTR SQLInstall_strdup_multi(LPCSTR str)
Definition: odbccp32.c:115
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by SQLInstallDriver(), test_SQLGetInstalledDrivers(), and test_SQLInstallDriverEx().

◆ SQLInstallDriverExW()

BOOL INSTAPI SQLInstallDriverExW ( LPCWSTR  lpszDriver,
LPCWSTR  lpszPathIn,
LPWSTR  lpszPathOut,
WORD  cbPathOutMax,
WORD pcbPathOut,
WORD  fRequest,
LPDWORD  lpdwUsageCount 
)

Definition at line 928 of file odbccp32.c.

931{
932 UINT len;
934
935 clear_errors();
936 TRACE("%s %s %p %d %p %d %p\n", debugstr_w(lpszDriver),
937 debugstr_w(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut,
938 fRequest, lpdwUsageCount);
939
940 write_registry_values(odbcdrivers, lpszDriver, lpszPathIn, path, lpdwUsageCount);
941
942 len = lstrlenW(path);
943
944 if (pcbPathOut)
945 *pcbPathOut = len;
946
947 if (lpszPathOut && cbPathOutMax > len)
948 {
949 lstrcpyW(lpszPathOut, path);
950 return TRUE;
951 }
952 return FALSE;
953}
unsigned int UINT
Definition: ndis.h:50
static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, const WCHAR *path_in, WCHAR *path, DWORD *usage_count)
Definition: odbccp32.c:822
static const WCHAR odbcdrivers[]
Definition: odbccp32.c:47

Referenced by ITERATE_InstallODBCDriver(), SQLInstallDriverEx(), and SQLInstallDriverW().

◆ SQLInstallDriverManager()

BOOL INSTAPI SQLInstallDriverManager ( LPSTR  lpszPath,
WORD  cbPathMax,
WORD pcbPathOut 
)

Definition at line 1025 of file odbccp32.c.

1027{
1028 BOOL ret;
1029 WORD len, cbOut = 0;
1031
1032 TRACE("(%p %d %p)\n", lpszPath, cbPathMax, pcbPathOut);
1033
1034 if (cbPathMax < MAX_PATH)
1035 return FALSE;
1036
1037 clear_errors();
1038
1040 if (ret)
1041 {
1042 len = WideCharToMultiByte(CP_ACP, 0, path, -1, lpszPath, 0,
1043 NULL, NULL);
1044 if (len)
1045 {
1046 if (pcbPathOut)
1047 *pcbPathOut = len - 1;
1048
1049 if (!lpszPath || cbPathMax < len)
1050 return FALSE;
1051
1052 len = WideCharToMultiByte(CP_ACP, 0, path, -1, lpszPath,
1053 cbPathMax, NULL, NULL);
1054 }
1055 }
1056 return ret;
1057}
BOOL WINAPI SQLInstallDriverManagerW(LPWSTR lpszPath, WORD cbPathMax, WORD *pcbPathOut)
Definition: odbccp32.c:999

Referenced by test_SQLInstallDriverManager().

◆ SQLInstallDriverManagerW()

BOOL INSTAPI SQLInstallDriverManagerW ( LPWSTR  lpszPath,
WORD  cbPathMax,
WORD pcbPathOut 
)

Definition at line 999 of file odbccp32.c.

1001{
1002 UINT len;
1004
1005 TRACE("(%p %d %p)\n", lpszPath, cbPathMax, pcbPathOut);
1006
1007 if (cbPathMax < MAX_PATH)
1008 return FALSE;
1009
1010 clear_errors();
1011
1013
1014 if (pcbPathOut)
1015 *pcbPathOut = len;
1016
1017 if (lpszPath && cbPathMax > len)
1018 {
1019 lstrcpyW(lpszPath, path);
1020 return TRUE;
1021 }
1022 return FALSE;
1023}
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313

Referenced by SQLInstallDriverManager().

◆ SQLInstallDriverW()

BOOL INSTAPI SQLInstallDriverW ( LPCWSTR  lpszInfFile,
LPCWSTR  lpszDriver,
LPWSTR  lpszPath,
WORD  cbPathMax,
WORD pcbPathOut 
)

Definition at line 790 of file odbccp32.c.

792{
793 DWORD usage;
794
795 clear_errors();
796 TRACE("%s %s %p %d %p\n", debugstr_w(lpszInfFile),
797 debugstr_w(lpszDriver), lpszPath, cbPathMax, pcbPathOut);
798
799 if (lpszInfFile)
800 return FALSE;
801
802 return SQLInstallDriverExW(lpszDriver, NULL, lpszPath, cbPathMax,
803 pcbPathOut, ODBC_INSTALL_COMPLETE, &usage);
804}

◆ SQLInstallerError()

SQLRETURN INSTAPI SQLInstallerError ( WORD  iError,
DWORD pfErrorCode,
LPSTR  lpszErrorMsg,
WORD  cbErrorMsgMax,
WORD pcbErrorMsg 
)

Definition at line 1138 of file odbccp32.c.

1140{
1141 SQLRETURN ret;
1142 LPWSTR wbuf;
1143 WORD cbwbuf;
1144 TRACE("%d %p %p %d %p\n", iError, pfErrorCode, lpszErrorMsg,
1145 cbErrorMsgMax, pcbErrorMsg);
1146
1147 wbuf = 0;
1148 if (lpszErrorMsg && cbErrorMsgMax)
1149 {
1150 wbuf = HeapAlloc(GetProcessHeap(), 0, cbErrorMsgMax*sizeof(WCHAR));
1151 if (!wbuf)
1152 return SQL_ERROR;
1153 }
1154 ret = SQLInstallerErrorW(iError, pfErrorCode, wbuf, cbErrorMsgMax, &cbwbuf);
1155 if (wbuf)
1156 {
1157 WORD cbBuf = 0;
1158 SQLInstall_narrow(1, lpszErrorMsg, wbuf, cbwbuf+1, cbErrorMsgMax, &cbBuf);
1159 HeapFree(GetProcessHeap(), 0, wbuf);
1160 if (pcbErrorMsg)
1161 *pcbErrorMsg = cbBuf-1;
1162 }
1163 return ret;
1164}
#define HeapAlloc
Definition: compat.h:733
#define SQL_ERROR
Definition: sql.h:68
SQLSMALLINT SQLRETURN
Definition: sqltypes.h:38
static BOOL SQLInstall_narrow(int mode, LPSTR buffer, LPCWSTR str, WORD str_length, WORD buffer_length, WORD *returned_length)
Definition: odbccp32.c:173
SQLRETURN WINAPI SQLInstallerErrorW(WORD iError, DWORD *pfErrorCode, LPWSTR lpszErrorMsg, WORD cbErrorMsgMax, WORD *pcbErrorMsg)
Definition: odbccp32.c:1079

Referenced by check_error_(), test_SQLConfigDataSource(), and test_SQLInstallerError().

◆ SQLInstallerErrorW()

SQLRETURN INSTAPI SQLInstallerErrorW ( WORD  iError,
DWORD pfErrorCode,
LPWSTR  lpszErrorMsg,
WORD  cbErrorMsgMax,
WORD pcbErrorMsg 
)

Definition at line 1079 of file odbccp32.c.

1081{
1082 TRACE("%d %p %p %d %p\n", iError, pfErrorCode, lpszErrorMsg,
1083 cbErrorMsgMax, pcbErrorMsg);
1084
1085 if (iError == 0)
1086 {
1087 return SQL_ERROR;
1088 }
1089 else if (iError <= num_errors)
1090 {
1091 BOOL truncated = FALSE;
1092 WORD len;
1093 LPCWSTR msg;
1094 iError--;
1095 if (pfErrorCode)
1096 *pfErrorCode = error_code[iError];
1097 msg = error_msg[iError];
1098 len = msg ? lstrlenW(msg) : 0;
1099 if (pcbErrorMsg)
1100 *pcbErrorMsg = len;
1101 len++;
1102 if (cbErrorMsgMax < len)
1103 {
1104 len = cbErrorMsgMax;
1105 truncated = TRUE;
1106 }
1107 if (lpszErrorMsg && len)
1108 {
1109 if (msg)
1110 {
1111 memcpy (lpszErrorMsg, msg, len * sizeof(WCHAR));
1112 }
1113 else
1114 {
1115 assert(len==1);
1116 *lpszErrorMsg = 0;
1117 }
1118 }
1119 else
1120 {
1121 /* Yes. If you pass a null pointer and a large length it is not an error! */
1122 truncated = TRUE;
1123 }
1124
1125 return truncated ? SQL_SUCCESS_WITH_INFO : SQL_SUCCESS;
1126 }
1127
1128 /* 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 */
1129 if (pcbErrorMsg)
1130 *pcbErrorMsg = 0;
1131
1132 if (lpszErrorMsg && cbErrorMsgMax > 0)
1133 *lpszErrorMsg = '\0';
1134
1135 return SQL_NO_DATA;
1136}
#define assert(x)
Definition: debug.h:53
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define SQL_SUCCESS
Definition: sql.h:163
#define SQL_SUCCESS_WITH_INFO
Definition: sql.h:164
#define SQL_NO_DATA
Definition: sql.h:315
static int error_code[8]
Definition: odbccp32.c:61
static const WCHAR * error_msg[8]
Definition: odbccp32.c:62
static int num_errors
Definition: odbccp32.c:60

Referenced by SQLInstallerError(), test_SQLConfigMode(), test_SQLGetInstalledDrivers(), test_SQLInstallDriverEx(), test_SQLInstallDriverManager(), test_SQLInstallTranslatorEx(), and test_SQLWritePrivateProfileString().

◆ SQLInstallODBC()

BOOL INSTAPI SQLInstallODBC ( HWND  hwndParent,
LPCSTR  lpszInfFile,
LPCSTR  lpszSrcPath,
LPCSTR  lpszDrivers 
)

Definition at line 1069 of file odbccp32.c.

1071{
1072 clear_errors();
1073 FIXME("%p %s %s %s\n", hwndParent, debugstr_a(lpszInfFile),
1074 debugstr_a(lpszSrcPath), debugstr_a(lpszDrivers));
1076 return FALSE;
1077}

◆ SQLInstallODBCW()

BOOL INSTAPI SQLInstallODBCW ( HWND  hwndParent,
LPCWSTR  lpszInfFile,
LPCWSTR  lpszSrcPath,
LPCWSTR  lpszDrivers 
)

Definition at line 1059 of file odbccp32.c.

1061{
1062 clear_errors();
1063 FIXME("%p %s %s %s\n", hwndParent, debugstr_w(lpszInfFile),
1064 debugstr_w(lpszSrcPath), debugstr_w(lpszDrivers));
1066 return FALSE;
1067}

◆ SQLInstallTranslator()

BOOL INSTAPI SQLInstallTranslator ( LPCSTR  lpszInfFile,
LPCSTR  lpszTranslator,
LPCSTR  lpszPathIn,
LPSTR  lpszPathOut,
WORD  cbPathOutMax,
WORD pcbPathOut,
WORD  fRequest,
LPDWORD  lpdwUsageCount 
)

Definition at line 1241 of file odbccp32.c.

1244{
1245 clear_errors();
1246 TRACE("%s %s %s %p %d %p %d %p\n", debugstr_a(lpszInfFile),
1247 debugstr_a(lpszTranslator), debugstr_a(lpszPathIn), lpszPathOut,
1248 cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount);
1249
1250 if (lpszInfFile)
1251 return FALSE;
1252
1253 return SQLInstallTranslatorEx(lpszTranslator, lpszPathIn, lpszPathOut,
1254 cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount);
1255}
BOOL WINAPI SQLInstallTranslatorEx(LPCSTR lpszTranslator, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount)
Definition: odbccp32.c:1193

◆ SQLInstallTranslatorEx()

BOOL INSTAPI SQLInstallTranslatorEx ( LPCSTR  lpszTranslator,
LPCSTR  lpszPathIn,
LPSTR  lpszPathOut,
WORD  cbPathOutMax,
WORD pcbPathOut,
WORD  fRequest,
LPDWORD  lpdwUsageCount 
)

Definition at line 1193 of file odbccp32.c.

1196{
1197 LPCSTR p;
1198 LPWSTR translator, pathin;
1199 WCHAR pathout[MAX_PATH];
1200 BOOL ret;
1201 WORD cbOut = 0;
1202
1203 clear_errors();
1204 TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszTranslator),
1205 debugstr_a(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut,
1206 fRequest, lpdwUsageCount);
1207
1208 for (p = lpszTranslator; *p; p += lstrlenA(p) + 1)
1209 TRACE("%s\n", debugstr_a(p));
1210
1211 translator = SQLInstall_strdup_multi(lpszTranslator);
1212 pathin = SQLInstall_strdup(lpszPathIn);
1213
1214 ret = SQLInstallTranslatorExW(translator, pathin, pathout, MAX_PATH,
1215 &cbOut, fRequest, lpdwUsageCount);
1216 if (ret)
1217 {
1218 int len = WideCharToMultiByte(CP_ACP, 0, pathout, -1, lpszPathOut,
1219 0, NULL, NULL);
1220 if (len)
1221 {
1222 if (pcbPathOut)
1223 *pcbPathOut = len - 1;
1224
1225 if (!lpszPathOut || cbPathOutMax < len)
1226 {
1227 ret = FALSE;
1228 goto out;
1229 }
1230 len = WideCharToMultiByte(CP_ACP, 0, pathout, -1, lpszPathOut,
1231 cbPathOutMax, NULL, NULL);
1232 }
1233 }
1234
1235out:
1236 HeapFree(GetProcessHeap(), 0, translator);
1237 HeapFree(GetProcessHeap(), 0, pathin);
1238 return ret;
1239}
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
BOOL WINAPI SQLInstallTranslatorExW(LPCWSTR lpszTranslator, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount)
Definition: odbccp32.c:1166
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by SQLInstallTranslator(), and test_SQLInstallTranslatorEx().

◆ SQLInstallTranslatorExW()

BOOL INSTAPI SQLInstallTranslatorExW ( LPCWSTR  lpszTranslator,
LPCWSTR  lpszPathIn,
LPWSTR  lpszPathOut,
WORD  cbPathOutMax,
WORD pcbPathOut,
WORD  fRequest,
LPDWORD  lpdwUsageCount 
)

Definition at line 1166 of file odbccp32.c.

1169{
1170 UINT len;
1172
1173 clear_errors();
1174 TRACE("%s %s %p %d %p %d %p\n", debugstr_w(lpszTranslator),
1175 debugstr_w(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut,
1176 fRequest, lpdwUsageCount);
1177
1178 write_registry_values(odbctranslators, lpszTranslator, lpszPathIn, path, lpdwUsageCount);
1179
1180 len = lstrlenW(path);
1181
1182 if (pcbPathOut)
1183 *pcbPathOut = len;
1184
1185 if (lpszPathOut && cbPathOutMax > len)
1186 {
1187 lstrcpyW(lpszPathOut, path);
1188 return TRUE;
1189 }
1190 return FALSE;
1191}
static const WCHAR odbctranslators[]
Definition: odbccp32.c:48

Referenced by ITERATE_InstallODBCTranslator(), SQLInstallTranslatorEx(), and SQLInstallTranslatorW().

◆ SQLInstallTranslatorW()

BOOL INSTAPI SQLInstallTranslatorW ( LPCWSTR  lpszInfFile,
LPCWSTR  lpszTranslator,
LPCWSTR  lpszPathIn,
LPWSTR  lpszPathOut,
WORD  cbPathOutMax,
WORD pcbPathOut,
WORD  fRequest,
LPDWORD  lpdwUsageCount 
)

Definition at line 1257 of file odbccp32.c.

1260{
1261 clear_errors();
1262 TRACE("%s %s %s %p %d %p %d %p\n", debugstr_w(lpszInfFile),
1263 debugstr_w(lpszTranslator), debugstr_w(lpszPathIn), lpszPathOut,
1264 cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount);
1265
1266 if (lpszInfFile)
1267 return FALSE;
1268
1269 return SQLInstallTranslatorExW(lpszTranslator, lpszPathIn, lpszPathOut,
1270 cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount);
1271}

◆ SQLManageDataSources()

BOOL INSTAPI SQLManageDataSources ( HWND  hwnd)

Definition at line 1273 of file odbccp32.c.

1274{
1275 clear_errors();
1276 FIXME("%p\n", hwnd);
1278 return FALSE;
1279}

◆ SQLPostInstallerError()

SQLRETURN INSTAPI SQLPostInstallerError ( DWORD  fErrorCode,
LPCSTR  szErrorMsg 
)

Definition at line 1288 of file odbccp32.c.

1289{
1290 FIXME("%u %s\n", fErrorCode, debugstr_a(szErrorMsg));
1292 return FALSE;
1293}

◆ SQLPostInstallerErrorW()

SQLRETURN INSTAPI SQLPostInstallerErrorW ( DWORD  fErrorCode,
LPCWSTR  szErrorMsg 
)

Definition at line 1281 of file odbccp32.c.

1282{
1283 FIXME("%u %s\n", fErrorCode, debugstr_w(szErrorMsg));
1285 return FALSE;
1286}

◆ SQLReadFileDSN()

BOOL INSTAPI SQLReadFileDSN ( LPCSTR  lpszFileName,
LPCSTR  lpszAppName,
LPCSTR  lpszKeyName,
LPSTR  lpszString,
WORD  cbString,
WORD pcbString 
)

Definition at line 1306 of file odbccp32.c.

1309{
1310 clear_errors();
1311 FIXME("%s %s %s %s %d %p\n", debugstr_a(lpszFileName), debugstr_a(lpszAppName),
1312 debugstr_a(lpszKeyName), debugstr_a(lpszString), cbString, pcbString);
1314 return FALSE;
1315}

◆ SQLReadFileDSNW()

BOOL INSTAPI SQLReadFileDSNW ( LPCWSTR  lpszFileName,
LPCWSTR  lpszAppName,
LPCWSTR  lpszKeyName,
LPWSTR  lpszString,
WORD  cbString,
WORD pcbString 
)

Definition at line 1295 of file odbccp32.c.

1298{
1299 clear_errors();
1300 FIXME("%s %s %s %s %d %p\n", debugstr_w(lpszFileName), debugstr_w(lpszAppName),
1301 debugstr_w(lpszKeyName), debugstr_w(lpszString), cbString, pcbString);
1303 return FALSE;
1304}

◆ SQLRemoveDefaultDataSource()

BOOL INSTAPI SQLRemoveDefaultDataSource ( void  )

Definition at line 1317 of file odbccp32.c.

1318{
1319 clear_errors();
1320 FIXME("\n");
1322 return FALSE;
1323}

◆ SQLRemoveDriver()

BOOL INSTAPI SQLRemoveDriver ( LPCSTR  lpszDriver,
BOOL  fRemoveDSN,
LPDWORD  lpdwUsageCount 
)

Definition at line 1380 of file odbccp32.c.

1382{
1383 WCHAR *driver;
1384 BOOL ret;
1385
1386 clear_errors();
1387 TRACE("%s %d %p\n", debugstr_a(lpszDriver), fRemoveDSN, lpdwUsageCount);
1388
1389 driver = SQLInstall_strdup(lpszDriver);
1390
1391 ret = SQLRemoveDriverW(driver, fRemoveDSN, lpdwUsageCount);
1392
1394 return ret;
1395}
BOOL WINAPI SQLRemoveDriverW(LPCWSTR drivername, BOOL remove_dsn, LPDWORD usage_count)
Definition: odbccp32.c:1325

Referenced by test_SQLGetInstalledDrivers(), and test_SQLInstallDriverEx().

◆ SQLRemoveDriverManager()

BOOL INSTAPI SQLRemoveDriverManager ( LPDWORD  pdwUsageCount)

Definition at line 1397 of file odbccp32.c.

1398{
1399 clear_errors();
1400 FIXME("%p\n", pdwUsageCount);
1401 if (pdwUsageCount) *pdwUsageCount = 1;
1402 return TRUE;
1403}

◆ SQLRemoveDriverW()

BOOL INSTAPI SQLRemoveDriverW ( LPCWSTR  drivername,
BOOL  remove_dsn,
LPDWORD  usage_count 
)

Definition at line 1325 of file odbccp32.c.

1326{
1327 HKEY hkey;
1328 DWORD usagecount = 1;
1329
1330 clear_errors();
1331 TRACE("%s %d %p\n", debugstr_w(drivername), remove_dsn, usage_count);
1332
1334 {
1335 HKEY hkeydriver;
1336
1337 if (RegOpenKeyW(hkey, drivername, &hkeydriver) == ERROR_SUCCESS)
1338 {
1339 DWORD size, type;
1340 DWORD count;
1341
1342 size = sizeof(usagecount);
1343 RegGetValueA(hkeydriver, NULL, "UsageCount", RRF_RT_DWORD, &type, &usagecount, &size);
1344 TRACE("Usage count %d\n", usagecount);
1345 count = usagecount - 1;
1346 if (count)
1347 {
1348 if (RegSetValueExA(hkeydriver, "UsageCount", 0, REG_DWORD, (BYTE*)&count, sizeof(count)) != ERROR_SUCCESS)
1349 ERR("Failed to write registry UsageCount key\n");
1350 }
1351
1352 RegCloseKey(hkeydriver);
1353 }
1354
1355 if (usagecount)
1356 usagecount--;
1357
1358 if (!usagecount)
1359 {
1360 if (RegDeleteKeyW(hkey, drivername) != ERROR_SUCCESS)
1361 ERR("Failed to delete registry key: %s\n", debugstr_w(drivername));
1362
1363 if (RegOpenKeyW(hkey, odbcdrivers, &hkeydriver) == ERROR_SUCCESS)
1364 {
1365 if(RegDeleteValueW(hkeydriver, drivername) != ERROR_SUCCESS)
1366 ERR("Failed to delete registry value: %s\n", debugstr_w(drivername));
1367 RegCloseKey(hkeydriver);
1368 }
1369 }
1370
1371 RegCloseKey(hkey);
1372 }
1373
1374 if (usage_count)
1375 *usage_count = usagecount;
1376
1377 return TRUE;
1378}
#define ERR(fmt,...)
Definition: debug.h:110
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
#define RRF_RT_DWORD
Definition: driver.c:581
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define REG_DWORD
Definition: sdbapi.c:596
static const WCHAR odbcini[]
Definition: odbccp32.c:46
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
unsigned char BYTE
Definition: xxhash.c:193

Referenced by ITERATE_RemoveODBCDriver(), and SQLRemoveDriver().

◆ SQLRemoveDSNFromIni()

BOOL INSTAPI SQLRemoveDSNFromIni ( LPCSTR  lpszDSN)

Definition at line 1413 of file odbccp32.c.

1414{
1415 clear_errors();
1416 FIXME("%s\n", debugstr_a(lpszDSN));
1418 return FALSE;
1419}

◆ SQLRemoveDSNFromIniW()

BOOL INSTAPI SQLRemoveDSNFromIniW ( LPCWSTR  lpszDSN)

Definition at line 1405 of file odbccp32.c.

1406{
1407 clear_errors();
1408 FIXME("%s\n", debugstr_w(lpszDSN));
1410 return FALSE;
1411}

◆ SQLRemoveTranslator()

BOOL INSTAPI SQLRemoveTranslator ( LPCSTR  lpszTranslator,
LPDWORD  lpdwUsageCount 
)

Definition at line 1486 of file odbccp32.c.

1487{
1488 WCHAR *translator;
1489 BOOL ret;
1490
1491 clear_errors();
1492 TRACE("%s %p\n", debugstr_a(lpszTranslator), lpdwUsageCount);
1493
1494 translator = SQLInstall_strdup(lpszTranslator);
1495 ret = SQLRemoveTranslatorW(translator, lpdwUsageCount);
1496
1497 HeapFree(GetProcessHeap(), 0, translator);
1498 return ret;
1499}
BOOL WINAPI SQLRemoveTranslatorW(const WCHAR *translator, DWORD *usage_count)
Definition: odbccp32.c:1421

Referenced by test_SQLInstallTranslatorEx().

◆ SQLRemoveTranslatorW()

BOOL INSTAPI SQLRemoveTranslatorW ( LPCWSTR  ,
LPDWORD   
)

◆ SQLSetConfigMode()

BOOL INSTAPI SQLSetConfigMode ( UWORD  wConfigMode)

Definition at line 1501 of file odbccp32.c.

1502{
1503 clear_errors();
1504 TRACE("%u\n", wConfigMode);
1505
1506 if (wConfigMode > ODBC_SYSTEM_DSN)
1507 {
1509 return FALSE;
1510 }
1511 else
1512 {
1513 config_mode = wConfigMode;
1514 return TRUE;
1515 }
1516}
#define ODBC_SYSTEM_DSN
Definition: odbcinst.h:30
#define ODBC_ERROR_INVALID_PARAM_SEQUENCE
Definition: odbcinst.h:44
static const WCHAR odbc_error_invalid_param_sequence[]
Definition: odbccp32.c:67

Referenced by test_SQLConfigMode().

◆ SQLValidDSN()

BOOL INSTAPI SQLValidDSN ( LPCSTR  lpszDSN)

Definition at line 1532 of file odbccp32.c.

1533{
1534 static const char *invalid = "[]{}(),;?*=!@\\";
1535 clear_errors();
1536 TRACE("%s\n", debugstr_a(lpszDSN));
1537
1538 if(strlen(lpszDSN) > SQL_MAX_DSN_LENGTH || strpbrk(lpszDSN, invalid) != NULL)
1539 {
1540 return FALSE;
1541 }
1542
1543 return TRUE;
1544}
char * strpbrk(const char *String, const char *Delimiters)
Definition: utclib.c:302
static const WCHAR invalid[]
Definition: assoc.c:39
#define SQL_MAX_DSN_LENGTH
Definition: sqlext.h:320

Referenced by test_SQLValidDSN().

◆ SQLValidDSNW()

BOOL INSTAPI SQLValidDSNW ( LPCWSTR  lpszDSN)

Definition at line 1518 of file odbccp32.c.

1519{
1520 static const WCHAR invalid[] = {'[',']','{','}','(',')',',',';','?','*','=','!','@','\\',0};
1521 clear_errors();
1522 TRACE("%s\n", debugstr_w(lpszDSN));
1523
1524 if(lstrlenW(lpszDSN) > SQL_MAX_DSN_LENGTH || wcspbrk(lpszDSN, invalid) != NULL)
1525 {
1526 return FALSE;
1527 }
1528
1529 return TRUE;
1530}
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)

Referenced by test_SQLValidDSNW().

◆ SQLWriteDSNToIni()

BOOL INSTAPI SQLWriteDSNToIni ( LPCSTR  lpszDSN,
LPCSTR  lpszDriver 
)

Definition at line 1553 of file odbccp32.c.

1554{
1555 clear_errors();
1556 FIXME("%s %s\n", debugstr_a(lpszDSN), debugstr_a(lpszDriver));
1557 return TRUE;
1558}

◆ SQLWriteDSNToIniW()

BOOL INSTAPI SQLWriteDSNToIniW ( LPCWSTR  lpszDSN,
LPCWSTR  lpszDriver 
)

Definition at line 1546 of file odbccp32.c.

1547{
1548 clear_errors();
1549 FIXME("%s %s\n", debugstr_w(lpszDSN), debugstr_w(lpszDriver));
1550 return TRUE;
1551}

◆ SQLWriteFileDSN()

BOOL INSTAPI SQLWriteFileDSN ( LPCSTR  lpszFileName,
LPCSTR  lpszAppName,
LPCSTR  lpszKeyName,
LPCSTR  lpszString 
)

Definition at line 1570 of file odbccp32.c.

1572{
1573 clear_errors();
1574 FIXME("%s %s %s %s\n", debugstr_a(lpszFileName), debugstr_a(lpszAppName),
1575 debugstr_a(lpszKeyName), debugstr_a(lpszString));
1577 return FALSE;
1578}

◆ SQLWriteFileDSNW()

BOOL INSTAPI SQLWriteFileDSNW ( LPCWSTR  lpszFileName,
LPCWSTR  lpszAppName,
LPCWSTR  lpszKeyName,
LPCWSTR  lpszString 
)

Definition at line 1560 of file odbccp32.c.

1562{
1563 clear_errors();
1564 FIXME("%s %s %s %s\n", debugstr_w(lpszFileName), debugstr_w(lpszAppName),
1565 debugstr_w(lpszKeyName), debugstr_w(lpszString));
1567 return FALSE;
1568}

◆ SQLWritePrivateProfileString()

BOOL INSTAPI SQLWritePrivateProfileString ( LPCSTR  lpszSection,
LPCSTR  lpszEntry,
LPCSTR  lpszString,
LPCSTR  lpszFilename 
)

Definition at line 1623 of file odbccp32.c.

1625{
1626 BOOL ret;
1627 WCHAR *sect, *entry, *string, *file;
1628 clear_errors();
1629 TRACE("%s %s %s %s\n", lpszSection, lpszEntry, lpszString, lpszFilename);
1630
1631 sect = heap_strdupAtoW(lpszSection);
1632 entry = heap_strdupAtoW(lpszEntry);
1633 string = heap_strdupAtoW(lpszString);
1634 file = heap_strdupAtoW(lpszFilename);
1635
1636 ret = SQLWritePrivateProfileStringW(sect, entry, string, file);
1637
1638 heap_free(sect);
1640 heap_free(string);
1641 heap_free(file);
1642
1643 return ret;
1644}
char string[160]
Definition: util.h:11
Definition: fci.c:127
BOOL WINAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry, LPCWSTR lpszString, LPCWSTR lpszFilename)
Definition: odbccp32.c:1580

Referenced by test_SQLGetPrivateProfileString(), test_SQLGetPrivateProfileStringW(), and test_SQLWritePrivateProfileString().

◆ SQLWritePrivateProfileStringW()

BOOL INSTAPI SQLWritePrivateProfileStringW ( LPCWSTR  lpszSection,
LPCWSTR  lpszEntry,
LPCWSTR  lpszString,
LPCWSTR  lpszFilename 
)

Definition at line 1580 of file odbccp32.c.

1582{
1583 static const WCHAR empty[] = {0};
1584 LONG ret;
1585 HKEY hkey;
1586
1587 clear_errors();
1588 TRACE("%s %s %s %s\n", debugstr_w(lpszSection), debugstr_w(lpszEntry),
1589 debugstr_w(lpszString), debugstr_w(lpszFilename));
1590
1591 if(!lpszFilename || !*lpszFilename)
1592 {
1594 return FALSE;
1595 }
1596
1598 {
1599 HKEY hkeyfilename;
1600
1601 if ((ret = RegCreateKeyW(hkey, lpszFilename, &hkeyfilename)) == ERROR_SUCCESS)
1602 {
1603 HKEY hkey_section;
1604
1605 if ((ret = RegCreateKeyW(hkeyfilename, lpszSection, &hkey_section)) == ERROR_SUCCESS)
1606 {
1607 if(lpszString)
1608 ret = RegSetValueExW(hkey_section, lpszEntry, 0, REG_SZ, (BYTE*)lpszString, (lstrlenW(lpszString)+1)*sizeof(WCHAR));
1609 else
1610 ret = RegSetValueExW(hkey_section, lpszEntry, 0, REG_SZ, (BYTE*)empty, sizeof(empty));
1611 RegCloseKey(hkey_section);
1612 }
1613
1614 RegCloseKey(hkeyfilename);
1615 }
1616
1617 RegCloseKey(hkey);
1618 }
1619
1620 return ret == ERROR_SUCCESS;
1621}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
static const WCHAR empty[]
Definition: main.c:47
#define REG_SZ
Definition: layer.c:22
#define ODBC_ERROR_INVALID_STR
Definition: odbcinst.h:34
static const WCHAR odbc_error_invalid_param_string[]
Definition: odbccp32.c:68
static const WCHAR odbcW[]
Definition: odbccp32.c:45
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by SQLWritePrivateProfileString().