27static const WCHAR abcd_key[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'O',
'D',
'B',
'C',
'\\',
'a',
'b',
'c',
'd',
'.',
'I',
'N',
'I',
'\\',
'w',
'i',
'n',
'e',
'o',
'd',
'b',
'c',0};
28static const WCHAR abcdini_key[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'O',
'D',
'B',
'C',
'\\',
'a',
'b',
'c',
'd',
'.',
'I',
'N',
'I',0 };
38#define check_error(a) check_error_(__LINE__, a)
62 ok(bool_ret &&
config_mode ==
i,
"Failed to confirm SQLSetConfigMode.\n");
73 ok(sql_ret ==
SQL_ERROR,
"SQLInstallerError(0...) failed with %d instead of SQL_ERROR\n", sql_ret);
79 ok(sql_ret ==
SQL_NO_DATA,
"SQLInstallerError(>8...) failed with %d instead of SQL_NO_DATA\n", sql_ret);
84 ok(sql_ret ==
SQL_NO_DATA,
"Too many errors when forcing an error for testing\n");
88 ok(sql_ret ==
SQL_SUCCESS_WITH_INFO,
"SQLInstallerError(null addresses) failed with %d instead of SQL_SUCCESS_WITH_INFO\n", sql_ret);
102 ok(!bool_ret,
"SQLInstallDriverManager unexpectedly succeeded\n");
104 "Expected SQLInstallDriverManager to fail with ODBC_ERROR_INVALID_BUFF_LEN\n");
109 ok(!bool_ret,
"SQLInstallDriverManager unexpectedly succeeded\n");
111 "Expected SQLInstallDriverManager to fail with ODBC_ERROR_INVALID_BUFF_LEN\n");
116 ok(!bool_ret,
"SQLInstallDriverManager unexpectedly succeeded\n");
118 "Expected SQLInstallDriverManager to fail with ODBC_ERROR_INVALID_BUFF_LEN\n");
119 ok(path_out == 0xcafe,
"Expected path_out to not have changed\n");
126 win_skip(
"not enough privileges\n");
129 ok(bool_ret,
"SQLInstallDriverManager unexpectedly failed: %d\n",
132 ok(sql_ret ==
SQL_NO_DATA,
"Expected SQL_NO_DATA, got %d\n", sql_ret);
135 "Expected SQL_SUCCESS_WITH_INFO, got %d\n", sql_ret);
140 ok(bool_ret,
"SQLInstallDriverManager unexpectedly failed: %d\n",
143 ok(sql_ret ==
SQL_NO_DATA,
"Expected SQL_NO_DATA, got %d\n", sql_ret);
146 "Expected SQL_SUCCESS_WITH_INFO, got %d\n", sql_ret);
148 ok(path_out != 0xcafe,
"Expected path_out to show the correct amount of bytes\n");
153 static const WCHAR odbc_key[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'O',
'D',
'B',
'C',
'\\',
'O',
'D',
'B',
'C',
'.',
'I',
'N',
'I',
'\\',
'w',
'i',
'n',
'e',
'o',
'd',
'b',
'c',0};
159 ok(!
ret,
"SQLWritePrivateProfileString passed\n");
164 ok(!
ret,
"SQLWritePrivateProfileString passed\n");
169 ok(
ret,
"SQLWritePrivateProfileString failed\n");
175 ok(
ret,
"SQLWritePrivateProfileString failed\n");
189 ok(
ret,
"SQLWritePrivateProfileString failed\n");
218 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
223 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
228 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
232 ok(
ret ==
strlen(
"defaultX"),
"SQLGetPrivateProfileString returned %d\n",
ret);
236 ok(
ret ==
strlen(
"def"),
"SQLGetPrivateProfileString returned %d\n",
ret);
240 ok(
ret ==
strlen(
"default"),
"SQLGetPrivateProfileString returned %d\n",
ret);
244 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
248 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
252 ok(
ret,
"SQLWritePrivateProfileString failed\n");
258 ok(
ret ==
strlen(
"value0123456789"),
"SQLGetPrivateProfileString returned %d\n",
ret);
262 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
265 ok(
ret == 6,
"SQLGetPrivateProfileString returned %d\n",
ret);
269 ok(
ret == (
strlen(
"testing")+1),
"SQLGetPrivateProfileString returned %d\n",
ret);
273 ok(
ret,
"SQLWritePrivateProfileString failed\n");
277 ok(
ret == (
strlen(
"testing") +
strlen(
"value")+2),
"SQLGetPrivateProfileString returned %d\n",
ret);
285 ok(
ret == (
strlen(
"testing")+1),
"SQLGetPrivateProfileString returned %d\n",
ret);
295 ok(
ret == 0,
"SQLGetPrivateProfileString returned %d\n",
ret);
315 static WCHAR testing[] = {
't',
'e',
's',
't',
'i',
'n',
'g',0};
316 static WCHAR wineodbc[] = {
'w',
'i',
'n',
'e',
'o',
'd',
'b',
'c',0};
317 static WCHAR defaultval[] = {
'd',
'e',
'f',
'a',
'u',
'l',
't',0};
318 static WCHAR odbcini[] = {
'O',
'D',
'B',
'C',
'.',
'I',
'N',
'I',0};
319 static WCHAR abcdini[] = {
'a',
'b',
'c',
'd',
'.',
'I',
'N',
'I',0};
320 static WCHAR wine[] = {
'w',
'i',
'n',
'e',0};
321 static WCHAR value[] = {
'v',
'a',
'l',
'u',
'e',0};
323 static WCHAR defaultX[] = {
'd',
'e',
'f',
'a',
'u',
'l',
't',0};
324 static WCHAR def[] = {
'd',
'e',
'f',0};
325 static WCHAR value0[] = {
'v',
'a',
'l',
'u',
'e',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',0};
326 static WCHAR testingvalue[] = {
't',
'e',
's',
't',
'i',
'n',
'g',0,
'v',
'a',
'l',
'u',
'e',0};
333 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
338 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
343 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
347 ok(
ret ==
lstrlenW(defaultX),
"SQLGetPrivateProfileStringW returned %d\n",
ret);
355 ok(
ret ==
lstrlenW(defaultX),
"SQLGetPrivateProfileStringW returned %d\n",
ret);
359 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
363 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
367 ok(
ret,
"SQLWritePrivateProfileString failed\n");
373 ok(
ret ==
lstrlenW(value0),
"SQLGetPrivateProfileStringW returned %d\n",
ret);
377 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
380 ok(
ret == 6,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
384 ok(
ret ==
lstrlenW(testing)+1,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
388 ok(
ret,
"SQLWritePrivateProfileString failed\n");
401 ok(
ret ==
lstrlenW(testing)+1,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
409 ok(
ret == 0,
"SQLGetPrivateProfileStringW returned %d\n",
ret);
441 ok(!
ret,
"SQLConfigDriver returned %d\n",
ret);
447 ok(
ret,
"SQLInstallDriverEx failed\n");
451 win_skip(
"not enough privileges\n");
461 ok(!
ret,
"SQLConfigDriver failed '%s'\n",
error);
465 ok(
ret,
"SQLConfigDriver failed\n");
470 ok(
ret,
"SQLInstallDriverEx failed\n");
476 ok(!
ret,
"SQLConfigDriver successful\n");
481 ok(
ret,
"SQLConfigDriver failed\n");
495 strcpy(driverpath, syspath);
496 strcat(driverpath,
"\\sample.dll");
536 ok(
ret,
"SQLRemoveDriver failed\n");
537 ok(cnt == 0,
"SQLRemoveDriver failed %d\n", cnt);
541 ok(
ret,
"SQLRemoveDriver failed\n");
542 ok(cnt == 0,
"SQLRemoveDriver failed %d\n", cnt);
562 win_skip(
"not enough privileges\n");
586 strcpy(driverpath, syspath);
587 strcat(driverpath,
"\\sample.dll");
602 ok(
ret,
"SQLRemoveTranslator failed\n");
603 ok(cnt == 0,
"SQLRemoveTranslator failed %d\n", cnt);
607 ok(
ret,
"SQLRemoveTranslator failed\n");
608 ok(cnt == 0,
"SQLRemoveTranslator failed %d\n", cnt);
612 ok(!
ret,
"SQLRemoveTranslator succeeded\n");
613 ok(cnt == 100,
"SQLRemoveTranslator succeeded %d\n", cnt);
616 "SQLInstallTranslatorEx failed %d, %u\n", sql_ret,
error_code);
630 ok(
ret,
"SQLInstallDriverEx failed: %d\n",
ret);
634 skip(
"not enough privileges\n");
649 ok(written == 10,
"got written %d\n", written);
650 ok(!
buffer[9],
"buffer not doubly null-terminated\n");
654 ok(!
buffer[written-1] && !
buffer[written-2],
"buffer not doubly null-terminated\n");
662 ok(found,
"installed driver not found\n");
667 ok(written ==
len,
"expected written %d, got %d\n",
len, written);
668 ok(!
buffer[
len-1],
"buffer not doubly null-terminated\n");
673 ok(written ==
len+1,
"expected written %d, got %d\n",
len+1, written);
674 ok(!
buffer[
len],
"buffer not doubly null-terminated\n");
679 ok(written ==
len+2,
"expected written %d, got %d\n",
len+2, written);
680 ok(!
buffer[
len+1],
"buffer not doubly null-terminated\n");
687 static const char *
invalid =
"[]{}(),;?*=!@\\";
715 static const WCHAR invalid[] = {
'[',
']',
'{',
'}',
'(',
')',
',',
';',
'?',
'*',
'=',
'!',
'@',
'\\',0};
716 static const WCHAR value[] = {
'w',
'i',
'n',
'e',
'1',
'0',0};
717 static const WCHAR too_large[] = {
'W',
'i',
'n',
'e',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'3',
'4',
'5',
718 '6',
'7',
'8',
'9',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0', 0};
719 static const WCHAR with_space[] = {
'W',
'i',
'n',
'e',
' ',
'V',
'i',
'n',
'e',
'g',
'a',
'r', 0};
720 static const WCHAR max_dsn[] = {
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
721 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'1',
'2', 0};
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
static const WCHAR empty[]
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
GLuint GLuint GLsizei GLenum type
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_FILE_NOT_FOUND
static const WCHAR abcdini_key[]
static void test_SQLGetPrivateProfileStringW(void)
static void test_SQLValidDSN(void)
static void test_SQLInstallTranslatorEx(void)
static void test_SQLValidDSNW(void)
static void test_SQLGetPrivateProfileString(void)
static void test_SQLInstallDriverEx(void)
static void test_SQLWritePrivateProfileString(void)
static const WCHAR abcd_key[]
static void test_SQLGetInstalledDrivers(void)
static void test_SQLConfigDataSource(void)
static void check_error_(int line, DWORD expect)
static void test_SQLConfigMode(void)
static void test_SQLInstallDriverManager(void)
static void test_SQLInstallerError(void)
static const WCHAR invalid[]
#define ODBC_INSTALL_COMPLETE
#define ODBC_ERROR_WRITING_SYSINFO_FAILED
#define ODBC_CONFIG_DRIVER
#define ODBC_ERROR_INVALID_PARAM_SEQUENCE
#define ODBC_ERROR_INVALID_DSN
#define ODBC_ERROR_INVALID_STR
#define ODBC_ERROR_COMPONENT_NOT_FOUND
#define ODBC_ERROR_INVALID_BUFF_LEN
#define ODBC_ERROR_INVALID_KEYWORD_VALUE
#define SQL_SUCCESS_WITH_INFO
BOOL WINAPI SQLSetConfigMode(UWORD wConfigMode)
int WINAPI SQLGetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR defvalue, LPWSTR buff, int buff_len, LPCWSTR filename)
BOOL WINAPI SQLRemoveTranslator(LPCSTR lpszTranslator, LPDWORD lpdwUsageCount)
BOOL WINAPI SQLGetInstalledDrivers(char *buf, WORD size, WORD *sizeout)
SQLRETURN WINAPI SQLInstallerError(WORD iError, DWORD *pfErrorCode, LPSTR lpszErrorMsg, WORD cbErrorMsgMax, WORD *pcbErrorMsg)
BOOL WINAPI SQLValidDSNW(LPCWSTR lpszDSN)
BOOL WINAPI SQLInstallDriverManager(LPSTR lpszPath, WORD cbPathMax, WORD *pcbPathOut)
BOOL WINAPI SQLConfigDriver(HWND hwnd, WORD request, LPCSTR driver, LPCSTR args, LPSTR msg, WORD msgmax, WORD *msgout)
BOOL WINAPI SQLGetConfigMode(UWORD *pwConfigMode)
BOOL WINAPI SQLInstallDriverEx(LPCSTR lpszDriver, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount)
BOOL WINAPI SQLConfigDataSource(HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszAttributes)
int WINAPI SQLGetPrivateProfileString(LPCSTR section, LPCSTR entry, LPCSTR defvalue, LPSTR buff, int buff_len, LPCSTR filename)
static const WCHAR odbcini[]
BOOL WINAPI SQLValidDSN(LPCSTR lpszDSN)
BOOL WINAPI SQLWritePrivateProfileString(LPCSTR lpszSection, LPCSTR lpszEntry, LPCSTR lpszString, LPCSTR lpszFilename)
BOOL WINAPI SQLRemoveDriver(LPCSTR lpszDriver, BOOL fRemoveDSN, LPDWORD lpdwUsageCount)
BOOL WINAPI SQLInstallTranslatorEx(LPCSTR lpszTranslator, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount)
SQLRETURN WINAPI SQLInstallerErrorW(WORD iError, DWORD *pfErrorCode, LPWSTR lpszErrorMsg, WORD cbErrorMsgMax, WORD *pcbErrorMsg)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER