diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 107502f2b57..bb59f44cc56 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -23,50 +23,50 @@ #include #include +#include #include #include #include -#include - #include "wine/test.h" static const char *msifile = "winetest-db.msi"; static const char *msifile2 = "winetst2-db.msi"; static const char *mstfile = "winetst-db.mst"; static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','-','d','b','.','m','s','i',0}; +static const WCHAR msifile2W[] = {'w','i','n','e','t','s','t','2','-','d','b','.','m','s','i',0}; static void test_msidatabase(void) { MSIHANDLE hdb = 0, hdb2 = 0; UINT res; - DeleteFile(msifile); + DeleteFileA(msifile); - res = MsiOpenDatabase( msifile, msifile2, &hdb ); + res = MsiOpenDatabaseA( msifile, msifile2, &hdb ); ok( res == ERROR_OPEN_FAILED, "expected failure\n"); - res = MsiOpenDatabase( msifile, (LPSTR) 0xff, &hdb ); + res = MsiOpenDatabaseA( msifile, (LPSTR)0xff, &hdb ); ok( res == ERROR_INVALID_PARAMETER, "expected failure\n"); res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); /* create an empty database */ - res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb ); + res = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb ); ok( res == ERROR_SUCCESS , "Failed to create database\n" ); res = MsiDatabaseCommit( hdb ); ok( res == ERROR_SUCCESS , "Failed to commit database\n" ); - ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n"); + ok( GetFileAttributesA( msifile ) != INVALID_FILE_ATTRIBUTES, "database should exist\n"); res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - res = MsiOpenDatabase( msifile, msifile2, &hdb2 ); + res = MsiOpenDatabaseA( msifile, msifile2, &hdb2 ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); - ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile2 ), "database should exist\n"); + ok( GetFileAttributesA( msifile2 ) != INVALID_FILE_ATTRIBUTES, "database should exist\n"); res = MsiDatabaseCommit( hdb2 ); ok( res == ERROR_SUCCESS , "Failed to commit database\n" ); @@ -74,15 +74,15 @@ static void test_msidatabase(void) res = MsiCloseHandle( hdb2 ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - res = MsiOpenDatabase( msifile, msifile2, &hdb2 ); + res = MsiOpenDatabaseA( msifile, msifile2, &hdb2 ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); res = MsiCloseHandle( hdb2 ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - ok( INVALID_FILE_ATTRIBUTES == GetFileAttributes( msifile2 ), "uncommitted database should not exist\n"); + ok( GetFileAttributesA( msifile2 ) == INVALID_FILE_ATTRIBUTES, "uncommitted database should not exist\n"); - res = MsiOpenDatabase( msifile, msifile2, &hdb2 ); + res = MsiOpenDatabaseA( msifile, msifile2, &hdb2 ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); res = MsiDatabaseCommit( hdb2 ); @@ -91,9 +91,9 @@ static void test_msidatabase(void) res = MsiCloseHandle( hdb2 ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile2 ), "committed database should exist\n"); + ok( GetFileAttributesA( msifile2 ) != INVALID_FILE_ATTRIBUTES, "committed database should exist\n"); - res = MsiOpenDatabase( msifile, MSIDBOPEN_READONLY, &hdb ); + res = MsiOpenDatabaseA( msifile, MSIDBOPEN_READONLY, &hdb ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); res = MsiDatabaseCommit( hdb ); @@ -102,45 +102,45 @@ static void test_msidatabase(void) res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - res = MsiOpenDatabase( msifile, MSIDBOPEN_DIRECT, &hdb ); + res = MsiOpenDatabaseA( msifile, MSIDBOPEN_DIRECT, &hdb ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - res = MsiOpenDatabase( msifile, MSIDBOPEN_TRANSACT, &hdb ); + res = MsiOpenDatabaseA( msifile, MSIDBOPEN_TRANSACT, &hdb ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n"); + ok( GetFileAttributesA( msifile ) != INVALID_FILE_ATTRIBUTES, "database should exist\n"); /* MSIDBOPEN_CREATE deletes the database if MsiCommitDatabase isn't called */ - res = MsiOpenDatabase( msifile, MSIDBOPEN_CREATE, &hdb ); + res = MsiOpenDatabaseA( msifile, MSIDBOPEN_CREATE, &hdb ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); - ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n"); + ok( GetFileAttributesA( msifile ) != INVALID_FILE_ATTRIBUTES, "database should exist\n"); res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - ok( INVALID_FILE_ATTRIBUTES == GetFileAttributes( msifile ), "database should exist\n"); + ok( GetFileAttributesA( msifile ) == INVALID_FILE_ATTRIBUTES, "database should exist\n"); - res = MsiOpenDatabase( msifile, MSIDBOPEN_CREATE, &hdb ); + res = MsiOpenDatabaseA( msifile, MSIDBOPEN_CREATE, &hdb ); ok( res == ERROR_SUCCESS , "Failed to open database\n" ); res = MsiDatabaseCommit( hdb ); ok( res == ERROR_SUCCESS , "Failed to commit database\n" ); - ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n"); + ok( GetFileAttributesA( msifile ) != INVALID_FILE_ATTRIBUTES, "database should exist\n"); res = MsiCloseHandle( hdb ); ok( res == ERROR_SUCCESS , "Failed to close database\n" ); - res = DeleteFile( msifile2 ); + res = DeleteFileA( msifile2 ); ok( res == TRUE, "Failed to delete database\n" ); - res = DeleteFile( msifile ); + res = DeleteFileA( msifile ); ok( res == TRUE, "Failed to delete database\n" ); } @@ -153,7 +153,7 @@ static UINT do_query(MSIHANDLE hdb, const char *query, MSIHANDLE *phrec) *phrec = 0; /* open a select query */ - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); if (r != ERROR_SUCCESS) return r; r = MsiViewExecute(hview, 0); @@ -174,7 +174,7 @@ static UINT run_query( MSIHANDLE hdb, MSIHANDLE hrec, const char *query ) MSIHANDLE hview = 0; UINT r; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); if( r != ERROR_SUCCESS ) return r; @@ -303,17 +303,17 @@ static void test_msiinsert(void) char buf[80]; DWORD sz; - DeleteFile(msifile); + DeleteFileA(msifile); /* just MsiOpenDatabase should not create a file */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); /* create a table */ query = "CREATE TABLE `phone` ( " "`id` INT, `name` CHAR(32), `number` CHAR(32) " "PRIMARY KEY `id`)"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -323,7 +323,7 @@ static void test_msiinsert(void) ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); query = "SELECT * FROM phone WHERE number = '8675309'"; - r = MsiDatabaseOpenView(hdb, query, &hview2); + r = MsiDatabaseOpenViewA(hdb, query, &hview2); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview2, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -333,7 +333,7 @@ static void test_msiinsert(void) /* insert a value into it */ query = "INSERT INTO `phone` ( `id`, `name`, `number` )" "VALUES('1', 'Abe', '8675309')"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -370,11 +370,11 @@ static void test_msiinsert(void) r = MsiRecordGetInteger(hrec, 1); ok(r == 1, "field 1 contents wrong\n"); sz = sizeof buf; - r = MsiRecordGetString(hrec, 2, buf, &sz); + r = MsiRecordGetStringA(hrec, 2, buf, &sz); ok(r == ERROR_SUCCESS, "field 2 content fetch failed\n"); ok(!strcmp(buf,"Abe"), "field 2 content incorrect\n"); sz = sizeof buf; - r = MsiRecordGetString(hrec, 3, buf, &sz); + r = MsiRecordGetStringA(hrec, 3, buf, &sz); ok(r == ERROR_SUCCESS, "field 3 content fetch failed\n"); ok(!strcmp(buf,"8675309"), "field 3 content incorrect\n"); @@ -410,22 +410,22 @@ static void test_msiinsert(void) /* now try a few bad INSERT xqueries */ query = "INSERT INTO `phone` ( `id`, `name`, `number` )" "VALUES(?, ?)"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_BAD_QUERY_SYNTAX, "MsiDatabaseOpenView failed\n"); /* construct a record to insert */ hrec = MsiCreateRecord(4); r = MsiRecordSetInteger(hrec, 1, 2); ok(r == ERROR_SUCCESS, "MsiRecordSetInteger failed\n"); - r = MsiRecordSetString(hrec, 2, "Adam"); + r = MsiRecordSetStringA(hrec, 2, "Adam"); ok(r == ERROR_SUCCESS, "MsiRecordSetString failed\n"); - r = MsiRecordSetString(hrec, 3, "96905305"); + r = MsiRecordSetStringA(hrec, 3, "96905305"); ok(r == ERROR_SUCCESS, "MsiRecordSetString failed\n"); /* insert another value, using a record and wildcards */ query = "INSERT INTO `phone` ( `id`, `name`, `number` )" "VALUES(?, ?, ?)"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); if (r == ERROR_SUCCESS) @@ -449,7 +449,7 @@ static void test_msiinsert(void) r = MsiCloseHandle(hdb); ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); - r = DeleteFile(msifile); + r = DeleteFileA(msifile); ok(r == TRUE, "file didn't exist after commit\n"); } @@ -462,7 +462,7 @@ static void test_msidecomposedesc(void) DWORD len; HMODULE hmod; - hmod = GetModuleHandle("msi.dll"); + hmod = GetModuleHandleA("msi.dll"); pMsiDecomposeDescriptorA = (void*)GetProcAddress(hmod, "MsiDecomposeDescriptorA"); if (!pMsiDecomposeDescriptorA) return; @@ -527,7 +527,7 @@ static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec ) MSIHANDLE htab = 0; UINT res; - res = MsiDatabaseOpenView( hdb, szQuery, &htab ); + res = MsiDatabaseOpenViewA( hdb, szQuery, &htab ); if(res == ERROR_SUCCESS ) { UINT r; @@ -558,7 +558,7 @@ static UINT try_insert_query( MSIHANDLE hdb, LPCSTR szQuery ) UINT r; hrec = MsiCreateRecord( 1 ); - MsiRecordSetString( hrec, 1, "Hello"); + MsiRecordSetStringA( hrec, 1, "Hello"); r = try_query_param( hdb, szQuery, hrec ); @@ -571,10 +571,10 @@ static void test_msibadqueries(void) MSIHANDLE hdb = 0; UINT r; - DeleteFile(msifile); + DeleteFileA(msifile); /* just MsiOpenDatabase should not create a file */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); r = MsiDatabaseCommit( hdb ); @@ -584,7 +584,7 @@ static void test_msibadqueries(void) ok(r == ERROR_SUCCESS , "Failed to close database\n"); /* open it readonly */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_READONLY, &hdb ); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_READONLY, &hdb ); ok(r == ERROR_SUCCESS , "Failed to open database r/o\n"); /* add a table to it */ @@ -595,7 +595,7 @@ static void test_msibadqueries(void) ok(r == ERROR_SUCCESS , "Failed to close database r/o\n"); /* open it read/write */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_TRANSACT, &hdb ); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_TRANSACT, &hdb ); ok(r == ERROR_SUCCESS , "Failed to open database r/w\n"); /* a bunch of test queries that fail with the native MSI */ @@ -781,7 +781,7 @@ static void test_msibadqueries(void) r = MsiCloseHandle( hdb ); ok(r == ERROR_SUCCESS , "Failed to close database transact\n"); - r = DeleteFile( msifile ); + r = DeleteFileA( msifile ); ok(r == TRUE, "file didn't exist after commit\n"); } @@ -794,10 +794,10 @@ static void test_viewmodify(void) char buffer[0x100]; DWORD sz; - DeleteFile(msifile); + DeleteFileA(msifile); /* just MsiOpenDatabase should not create a file */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); query = "CREATE TABLE `phone` ( " @@ -822,39 +822,39 @@ static void test_viewmodify(void) /* check what the error function reports without doing anything */ sz = 0; /* passing NULL as the 3rd param make function to crash on older platforms */ - err = MsiViewGetError( 0, NULL, &sz ); + err = MsiViewGetErrorA( 0, NULL, &sz ); ok(err == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n"); /* open a view */ query = "SELECT * FROM `phone`"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); /* see what happens with a good hview and bad args */ - err = MsiViewGetError( hview, NULL, NULL ); + err = MsiViewGetErrorA( hview, NULL, NULL ); ok(err == MSIDBERROR_INVALIDARG || err == MSIDBERROR_NOERROR, "MsiViewGetError returns %u (expected -3)\n", err); - err = MsiViewGetError( hview, buffer, NULL ); + err = MsiViewGetErrorA( hview, buffer, NULL ); ok(err == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n"); /* see what happens with a zero length buffer */ sz = 0; buffer[0] = 'x'; - err = MsiViewGetError( hview, buffer, &sz ); + err = MsiViewGetErrorA( hview, buffer, &sz ); ok(err == MSIDBERROR_MOREDATA, "MsiViewGetError return\n"); ok(buffer[0] == 'x', "buffer cleared\n"); ok(sz == 0, "size not zero\n"); /* ok this one is strange */ sz = 0; - err = MsiViewGetError( hview, NULL, &sz ); + err = MsiViewGetErrorA( hview, NULL, &sz ); ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); ok(sz == 0, "size not zero\n"); /* see if it really has an error */ sz = sizeof buffer; buffer[0] = 'x'; - err = MsiViewGetError( hview, buffer, &sz ); + err = MsiViewGetErrorA( hview, buffer, &sz ); ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); ok(buffer[0] == 0, "buffer not cleared\n"); ok(sz == 0, "size not zero\n"); @@ -875,7 +875,7 @@ static void test_viewmodify(void) sz = sizeof buffer; buffer[0] = 'x'; - err = MsiViewGetError( hview, buffer, &sz ); + err = MsiViewGetErrorA( hview, buffer, &sz ); ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); ok(buffer[0] == 0, "buffer not cleared\n"); ok(sz == 0, "size not zero\n"); @@ -888,9 +888,9 @@ static void test_viewmodify(void) r = MsiRecordSetInteger(hrec, 1, 1); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "bob"); + r = MsiRecordSetStringA(hrec, 2, "bob"); ok(r == ERROR_SUCCESS, "failed to set string\n"); - r = MsiRecordSetString(hrec, 3, "7654321"); + r = MsiRecordSetStringA(hrec, 3, "7654321"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewExecute(hview, 0); @@ -907,7 +907,7 @@ static void test_viewmodify(void) sz = sizeof buffer; buffer[0] = 'x'; - err = MsiViewGetError( hview, buffer, &sz ); + err = MsiViewGetErrorA( hview, buffer, &sz ); ok(err == MSIDBERROR_DUPLICATEKEY, "MsiViewGetError returned %u\n", err); ok(!strcmp(buffer, "id"), "expected \"id\" c, got \"%s\"\n", buffer); ok(sz == 2, "size not 2\n"); @@ -934,9 +934,9 @@ static void test_viewmodify(void) r = MsiRecordSetInteger(hrec, 1, 10); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "pepe"); + r = MsiRecordSetStringA(hrec, 2, "pepe"); ok(r == ERROR_SUCCESS, "failed to set string\n"); - r = MsiRecordSetString(hrec, 3, "7654321"); + r = MsiRecordSetStringA(hrec, 3, "7654321"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewModify(hview, MSIMODIFY_MERGE, hrec ); @@ -953,7 +953,7 @@ static void test_viewmodify(void) ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); query = "SELECT * FROM `phone`"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); @@ -966,17 +966,17 @@ static void test_viewmodify(void) ok(r == 1, "Expected 1, got %d\n", r); sz = sizeof(buffer); - r = MsiRecordGetString(hrec, 2, buffer, &sz); + r = MsiRecordGetStringA(hrec, 2, buffer, &sz); ok(r == ERROR_SUCCESS, "MsiRecordGetString failed\n"); - ok(!lstrcmp(buffer, "bob"), "Expected bob, got %s\n", buffer); + ok(!lstrcmpA(buffer, "bob"), "Expected bob, got %s\n", buffer); sz = sizeof(buffer); - r = MsiRecordGetString(hrec, 3, buffer, &sz); + r = MsiRecordGetStringA(hrec, 3, buffer, &sz); ok(r == ERROR_SUCCESS, "MsiRecordGetString failed\n"); - ok(!lstrcmp(buffer, "7654321"), "Expected 7654321, got %s\n", buffer); + ok(!lstrcmpA(buffer, "7654321"), "Expected 7654321, got %s\n", buffer); /* update the view, non-primary key */ - r = MsiRecordSetString(hrec, 3, "3141592"); + r = MsiRecordSetStringA(hrec, 3, "3141592"); ok(r == ERROR_SUCCESS, "MsiRecordSetString failed\n"); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); @@ -1002,7 +1002,7 @@ static void test_viewmodify(void) ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); query = "SELECT * FROM `phone`"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); @@ -1015,14 +1015,14 @@ static void test_viewmodify(void) ok(r == 1, "Expected 1, got %d\n", r); sz = sizeof(buffer); - r = MsiRecordGetString(hrec, 2, buffer, &sz); + r = MsiRecordGetStringA(hrec, 2, buffer, &sz); ok(r == ERROR_SUCCESS, "MsiRecordGetString failed\n"); - ok(!lstrcmp(buffer, "bob"), "Expected bob, got %s\n", buffer); + ok(!lstrcmpA(buffer, "bob"), "Expected bob, got %s\n", buffer); sz = sizeof(buffer); - r = MsiRecordGetString(hrec, 3, buffer, &sz); + r = MsiRecordGetStringA(hrec, 3, buffer, &sz); ok(r == ERROR_SUCCESS, "MsiRecordGetString failed\n"); - ok(!lstrcmp(buffer, "3141592"), "Expected 3141592, got %s\n", buffer); + ok(!lstrcmpA(buffer, "3141592"), "Expected 3141592, got %s\n", buffer); r = MsiCloseHandle(hrec); ok(r == ERROR_SUCCESS, "failed to close record\n"); @@ -1033,9 +1033,9 @@ static void test_viewmodify(void) r = MsiRecordSetInteger(hrec, 1, 3); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "jane"); + r = MsiRecordSetStringA(hrec, 2, "jane"); ok(r == ERROR_SUCCESS, "failed to set string\n"); - r = MsiRecordSetString(hrec, 3, "112358"); + r = MsiRecordSetStringA(hrec, 3, "112358"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); @@ -1050,9 +1050,9 @@ static void test_viewmodify(void) r = MsiRecordSetInteger(hrec, 1, 1); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "jane"); + r = MsiRecordSetStringA(hrec, 2, "jane"); ok(r == ERROR_SUCCESS, "failed to set string\n"); - r = MsiRecordSetString(hrec, 3, "112358"); + r = MsiRecordSetStringA(hrec, 3, "112358"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); @@ -1065,9 +1065,9 @@ static void test_viewmodify(void) r = MsiRecordSetInteger(hrec, 1, 2); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "nick"); + r = MsiRecordSetStringA(hrec, 2, "nick"); ok(r == ERROR_SUCCESS, "failed to set string\n"); - r = MsiRecordSetString(hrec, 3, "141421"); + r = MsiRecordSetStringA(hrec, 3, "141421"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewExecute(hview, 0); @@ -1083,7 +1083,7 @@ static void test_viewmodify(void) ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); query = "SELECT * FROM `phone` WHERE `id` = 1"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -1093,7 +1093,7 @@ static void test_viewmodify(void) /* change the id to match the second row */ r = MsiRecordSetInteger(hrec, 1, 2); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "jerry"); + r = MsiRecordSetStringA(hrec, 2, "jerry"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); @@ -1108,7 +1108,7 @@ static void test_viewmodify(void) /* broader search */ query = "SELECT * FROM `phone` ORDER BY `id`"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -1118,7 +1118,7 @@ static void test_viewmodify(void) /* change the id to match the second row */ r = MsiRecordSetInteger(hrec, 1, 2); ok(r == ERROR_SUCCESS, "failed to set integer\n"); - r = MsiRecordSetString(hrec, 2, "jerry"); + r = MsiRecordSetStringA(hrec, 2, "jerry"); ok(r == ERROR_SUCCESS, "failed to set string\n"); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); @@ -1140,10 +1140,10 @@ static MSIHANDLE create_db(void) MSIHANDLE hdb = 0; UINT res; - DeleteFile(msifile); + DeleteFileA(msifile); /* create an empty database */ - res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb ); + res = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb ); ok( res == ERROR_SUCCESS , "Failed to create database\n" ); if( res != ERROR_SUCCESS ) return hdb; @@ -1166,7 +1166,7 @@ static void test_getcolinfo(void) ok( hdb, "failed to create db\n"); /* tables should be present */ - r = MsiDatabaseOpenView(hdb, "select * from _Tables", &hview); + r = MsiDatabaseOpenViewA(hdb, "select * from _Tables", &hview); ok( r == ERROR_SUCCESS, "failed to open query\n"); r = MsiViewExecute(hview, 0); @@ -1177,7 +1177,7 @@ static void test_getcolinfo(void) r = MsiViewGetColumnInfo( hview, MSICOLINFO_NAMES, &rec ); ok( r == ERROR_SUCCESS, "failed to get names\n"); sz = sizeof buffer; - r = MsiRecordGetString(rec, 1, buffer, &sz ); + r = MsiRecordGetStringA(rec, 1, buffer, &sz ); ok( r == ERROR_SUCCESS, "failed to get string\n"); ok( !strcmp(buffer,"Name"), "_Tables has wrong column name\n"); r = MsiCloseHandle( rec ); @@ -1188,7 +1188,7 @@ static void test_getcolinfo(void) r = MsiViewGetColumnInfo( hview, MSICOLINFO_TYPES, &rec ); ok( r == ERROR_SUCCESS, "failed to get names\n"); sz = sizeof buffer; - r = MsiRecordGetString(rec, 1, buffer, &sz ); + r = MsiRecordGetStringA(rec, 1, buffer, &sz ); ok( r == ERROR_SUCCESS, "failed to get string\n"); ok( !strcmp(buffer,"s64"), "_Tables has wrong column type\n"); r = MsiCloseHandle( rec ); @@ -1219,7 +1219,7 @@ static MSIHANDLE get_column_info(MSIHANDLE hdb, const char *query, MSICOLINFO ty MSIHANDLE hview = 0, rec = 0; UINT r; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); if( r != ERROR_SUCCESS ) return r; @@ -1241,7 +1241,7 @@ static UINT get_columns_table_type(MSIHANDLE hdb, const char *table, UINT field) sprintf(query, "select * from `_Columns` where `Table` = '%s'", table ); - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); if( r != ERROR_SUCCESS ) return r; @@ -1271,7 +1271,7 @@ static BOOL check_record( MSIHANDLE rec, UINT field, LPCSTR val ) DWORD sz; sz = sizeof buffer; - r = MsiRecordGetString( rec, field, buffer, &sz ); + r = MsiRecordGetStringA( rec, field, buffer, &sz ); return (r == ERROR_SUCCESS ) && !strcmp(val, buffer); } @@ -1397,17 +1397,17 @@ static void test_msiexport(void) "phone\tid\r\n" "1\tAbe\t8675309\r\n"; - DeleteFile(msifile); + DeleteFileA(msifile); /* just MsiOpenDatabase should not create a file */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); /* create a table */ query = "CREATE TABLE `phone` ( " "`id` INT, `name` CHAR(32), `number` CHAR(32) " "PRIMARY KEY `id`)"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -1419,7 +1419,7 @@ static void test_msiexport(void) /* insert a value into it */ query = "INSERT INTO `phone` ( `id`, `name`, `number` )" "VALUES('1', 'Abe', '8675309')"; - r = MsiDatabaseOpenView(hdb, query, &hview); + r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -1428,32 +1428,32 @@ static void test_msiexport(void) r = MsiCloseHandle(hview); ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); - GetCurrentDirectory(MAX_PATH, path); + GetCurrentDirectoryA(MAX_PATH, path); - r = MsiDatabaseExport(hdb, "phone", path, file); + r = MsiDatabaseExportA(hdb, "phone", path, file); ok(r == ERROR_SUCCESS, "MsiDatabaseExport failed\n"); MsiCloseHandle(hdb); - lstrcat(path, "\\"); - lstrcat(path, file); + lstrcatA(path, "\\"); + lstrcatA(path, file); /* check the data that was written */ length = 0; memset(buffer, 0, sizeof buffer); - handle = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + handle = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); if (handle != INVALID_HANDLE_VALUE) { ReadFile(handle, buffer, sizeof buffer, &length, NULL); CloseHandle(handle); - DeleteFile(path); + DeleteFileA(path); } else ok(0, "failed to open file %s\n", path); ok( length == strlen(expected), "length of data wrong\n"); - ok( !lstrcmp(buffer, expected), "data doesn't match\n"); - DeleteFile(msifile); + ok( !lstrcmpA(buffer, expected), "data doesn't match\n"); + DeleteFileA(msifile); } static void test_longstrings(void) @@ -1466,9 +1466,9 @@ static void test_longstrings(void) UINT r; const DWORD STRING_LENGTH = 0x10005; - DeleteFile(msifile); + DeleteFileA(msifile); /* just MsiOpenDatabase should not create a file */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); /* create a table */ @@ -1491,10 +1491,10 @@ static void test_longstrings(void) ok(r == ERROR_SUCCESS, "MsiDatabaseCommit failed\n"); MsiCloseHandle(hdb); - r = MsiOpenDatabase(msifile, MSIDBOPEN_READONLY, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_READONLY, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); - r = MsiDatabaseOpenView(hdb, "select * from `strings` where `id` = 1", &hview); + r = MsiDatabaseOpenViewA(hdb, "select * from `strings` where `id` = 1", &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); r = MsiViewExecute(hview, 0); @@ -1506,13 +1506,13 @@ static void test_longstrings(void) MsiViewClose(hview); MsiCloseHandle(hview); - r = MsiRecordGetString(hrec, 2, NULL, &len); + r = MsiRecordGetStringA(hrec, 2, NULL, &len); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); ok(len == STRING_LENGTH, "string length wrong\n"); MsiCloseHandle(hrec); MsiCloseHandle(hdb); - DeleteFile(msifile); + DeleteFileA(msifile); } static void create_file_data(LPCSTR name, LPCSTR data, DWORD size) @@ -1564,7 +1564,7 @@ static void test_streamtable(void) MsiCloseHandle( hdb ); - r = MsiOpenDatabase(msifile, MSIDBOPEN_TRANSACT, &hdb ); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_TRANSACT, &hdb ); ok( r == ERROR_SUCCESS , "Failed to open database\n" ); /* check the column types */ @@ -1585,7 +1585,7 @@ static void test_streamtable(void) MsiCloseHandle( rec ); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %u\n", r ); @@ -1611,7 +1611,7 @@ static void test_streamtable(void) MsiCloseHandle( hsi ); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %u\n", r ); @@ -1629,14 +1629,14 @@ static void test_streamtable(void) create_file( "test.txt" ); rec = MsiCreateRecord( 2 ); - MsiRecordSetString( rec, 1, "data" ); + MsiRecordSetStringA( rec, 1, "data" ); - r = MsiRecordSetStream( rec, 2, "test.txt" ); + r = MsiRecordSetStreamA( rec, 2, "test.txt" ); ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r); - DeleteFile("test.txt"); + DeleteFileA("test.txt"); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1651,14 +1651,14 @@ static void test_streamtable(void) create_file( "test1.txt" ); rec = MsiCreateRecord( 2 ); - MsiRecordSetString( rec, 1, "data1" ); + MsiRecordSetStringA( rec, 1, "data1" ); - r = MsiRecordSetStream( rec, 2, "test1.txt" ); + r = MsiRecordSetStreamA( rec, 2, "test1.txt" ); ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r); - DeleteFile("test1.txt"); + DeleteFileA("test1.txt"); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1669,7 +1669,7 @@ static void test_streamtable(void) MsiViewClose( view ); MsiCloseHandle( view ); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1680,21 +1680,21 @@ static void test_streamtable(void) ok( r == ERROR_SUCCESS, "Failed to fetch record: %d\n", r); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, file, &size ); + r = MsiRecordGetStringA( rec, 1, file, &size ); ok( r == ERROR_SUCCESS, "Failed to get string: %d\n", r); - ok( !lstrcmp(file, "data"), "Expected 'data', got %s\n", file); + ok( !lstrcmpA(file, "data"), "Expected 'data', got %s\n", file); size = MAX_PATH; memset(buf, 0, MAX_PATH); r = MsiRecordReadStream( rec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r); - ok( !lstrcmp(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf); + ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf); MsiCloseHandle( rec ); MsiViewClose( view ); MsiCloseHandle( view ); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data1'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1705,15 +1705,15 @@ static void test_streamtable(void) ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, file, &size ); + r = MsiRecordGetStringA( rec, 1, file, &size ); ok( r == ERROR_SUCCESS, "Failed to get string: %d\n", r); - ok( !lstrcmp(file, "data1"), "Expected 'data1', got %s\n", file); + ok( !lstrcmpA(file, "data1"), "Expected 'data1', got %s\n", file); size = MAX_PATH; memset(buf, 0, MAX_PATH); r = MsiRecordReadStream( rec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r); - ok( !lstrcmp(buf, "test1.txt\n"), "Expected 'test1.txt\\n', got %s\n", buf); + ok( !lstrcmpA(buf, "test1.txt\n"), "Expected 'test1.txt\\n', got %s\n", buf); MsiCloseHandle( rec ); MsiViewClose( view ); @@ -1723,12 +1723,12 @@ static void test_streamtable(void) create_file( "test2.txt" ); rec = MsiCreateRecord( 1 ); - r = MsiRecordSetStream( rec, 1, "test2.txt" ); + r = MsiRecordSetStreamA( rec, 1, "test2.txt" ); ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r); - DeleteFile("test2.txt"); + DeleteFileA("test2.txt"); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "UPDATE `_Streams` SET `Data` = ? WHERE `Name` = 'data1'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1739,7 +1739,7 @@ static void test_streamtable(void) MsiViewClose( view ); MsiCloseHandle( view ); - r = MsiDatabaseOpenView( hdb, + r = MsiDatabaseOpenViewA( hdb, "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data1'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1750,21 +1750,21 @@ static void test_streamtable(void) ok( r == ERROR_SUCCESS, "Failed to fetch record: %d\n", r); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, file, &size ); + r = MsiRecordGetStringA( rec, 1, file, &size ); ok( r == ERROR_SUCCESS, "Failed to get string: %d\n", r); - ok( !lstrcmp(file, "data1"), "Expected 'data1', got %s\n", file); + ok( !lstrcmpA(file, "data1"), "Expected 'data1', got %s\n", file); size = MAX_PATH; memset(buf, 0, MAX_PATH); r = MsiRecordReadStream( rec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r); - todo_wine ok( !lstrcmp(buf, "test2.txt\n"), "Expected 'test2.txt\\n', got %s\n", buf); + todo_wine ok( !lstrcmpA(buf, "test2.txt\n"), "Expected 'test2.txt\\n', got %s\n", buf); MsiCloseHandle( rec ); MsiViewClose( view ); MsiCloseHandle( view ); MsiCloseHandle( hdb ); - DeleteFile(msifile); + DeleteFileA(msifile); } static void test_binary(void) @@ -1777,7 +1777,7 @@ static void test_binary(void) UINT r; /* insert a file into the Binary table */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb ); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb ); ok( r == ERROR_SUCCESS , "Failed to open database\n" ); query = "CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT PRIMARY KEY `Name`, `ID`)"; @@ -1786,9 +1786,9 @@ static void test_binary(void) create_file( "test.txt" ); rec = MsiCreateRecord( 1 ); - r = MsiRecordSetStream( rec, 1, "test.txt" ); + r = MsiRecordSetStreamA( rec, 1, "test.txt" ); ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r); - DeleteFile( "test.txt" ); + DeleteFileA( "test.txt" ); query = "INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )"; r = run_query( hdb, rec, query ); @@ -1804,7 +1804,7 @@ static void test_binary(void) ok( r == ERROR_SUCCESS , "Failed to close database\n" ); /* read file from the Stream table */ - r = MsiOpenDatabase( msifile, MSIDBOPEN_READONLY, &hdb ); + r = MsiOpenDatabaseA( msifile, MSIDBOPEN_READONLY, &hdb ); ok( r == ERROR_SUCCESS , "Failed to open database\n" ); query = "SELECT * FROM `_Streams`"; @@ -1812,15 +1812,15 @@ static void test_binary(void) ok( r == ERROR_SUCCESS, "SELECT query failed: %d\n", r ); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, file, &size ); + r = MsiRecordGetStringA( rec, 1, file, &size ); ok( r == ERROR_SUCCESS, "Failed to get string: %d\n", r ); - ok( !lstrcmp(file, "Binary.filename1.1"), "Expected 'Binary.filename1.1', got %s\n", file ); + ok( !lstrcmpA(file, "Binary.filename1.1"), "Expected 'Binary.filename1.1', got %s\n", file ); size = MAX_PATH; memset( buf, 0, MAX_PATH ); r = MsiRecordReadStream( rec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r ); - ok( !lstrcmp(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf ); + ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf ); r = MsiCloseHandle( rec ); ok( r == ERROR_SUCCESS , "Failed to close record handle\n" ); @@ -1831,15 +1831,15 @@ static void test_binary(void) ok( r == ERROR_SUCCESS, "SELECT query failed: %d\n", r ); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, file, &size ); + r = MsiRecordGetStringA( rec, 1, file, &size ); ok( r == ERROR_SUCCESS, "Failed to get string: %d\n", r ); - ok( !lstrcmp(file, "filename1"), "Expected 'filename1', got %s\n", file ); + ok( !lstrcmpA(file, "filename1"), "Expected 'filename1', got %s\n", file ); size = MAX_PATH; memset( buf, 0, MAX_PATH ); r = MsiRecordReadStream( rec, 3, buf, &size ); ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r ); - ok( !lstrcmp(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf ); + ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf ); r = MsiCloseHandle( rec ); ok( r == ERROR_SUCCESS , "Failed to close record handle\n" ); @@ -1847,7 +1847,7 @@ static void test_binary(void) r = MsiCloseHandle( hdb ); ok( r == ERROR_SUCCESS , "Failed to close database\n" ); - DeleteFile( msifile ); + DeleteFileA( msifile ); } static void test_where_not_in_selected(void) @@ -1918,7 +1918,7 @@ static void test_where_not_in_selected(void) ok(r == S_OK, "cannot add entry to CATable table:%d\n", r ); query = "Select IESTable.Condition from CATable, IESTable where " "CATable.Action = IESTable.Action and CATable.Type = 32"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok( r == ERROR_SUCCESS, "failed to open view: %d\n", r ); r = MsiViewExecute(view, 0); @@ -1940,8 +1940,7 @@ static void test_where_not_in_selected(void) MsiCloseHandle(view); MsiCloseHandle( hdb ); - DeleteFile(msifile); - + DeleteFileA(msifile); } @@ -2001,7 +2000,7 @@ static void test_where(void) MsiCloseHandle( rec ); query = "SELECT `DiskId` FROM `Media` WHERE `LastSequence` >= 1 AND DiskId >= 0"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok( r == ERROR_SUCCESS, "failed to open view: %d\n", r ); r = MsiViewExecute(view, 0); @@ -2014,20 +2013,18 @@ static void test_where(void) ok( count == 1, "Expected 1 record fields, got %d\n", count ); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, buf, &size ); + r = MsiRecordGetStringA( rec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); - ok( !lstrcmp( buf, "2" ), - "For (row %d, column 1) expected '%d', got %s\n", 0, 2, buf ); + ok( !lstrcmpA( buf, "2" ), "For (row %d, column 1) expected '%d', got %s\n", 0, 2, buf ); MsiCloseHandle( rec ); r = MsiViewFetch(view, &rec); ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); size = MAX_PATH; - r = MsiRecordGetString( rec, 1, buf, &size ); + r = MsiRecordGetStringA( rec, 1, buf, &size ); ok( r == ERROR_SUCCESS, "failed to get record string: %d\n", r ); - ok( !lstrcmp( buf, "3" ), - "For (row %d, column 1) expected '%d', got %s\n", 1, 3, buf ); + ok( !lstrcmpA( buf, "3" ), "For (row %d, column 1) expected '%d', got %s\n", 1, 3, buf ); MsiCloseHandle( rec ); r = MsiViewFetch(view, &rec); @@ -2069,10 +2066,10 @@ static void test_where(void) MsiCloseHandle( rec ); rec = MsiCreateRecord(1); - MsiRecordSetString(rec, 1, ""); + MsiRecordSetStringA(rec, 1, ""); query = "SELECT * FROM `Media` WHERE `DiskPrompt` = ?"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewExecute(view, rec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -2087,7 +2084,7 @@ static void test_where(void) MsiCloseHandle(view); MsiCloseHandle( hdb ); - DeleteFile(msifile); + DeleteFileA(msifile); } static CHAR CURR_DIR[MAX_PATH]; @@ -2137,9 +2134,8 @@ static void write_file(const CHAR *filename, const char *data, int data_size) { DWORD size; - HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - + HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); WriteFile(hf, data, data_size, &size, NULL); CloseHandle(hf); } @@ -2148,7 +2144,7 @@ static UINT add_table_to_db(MSIHANDLE hdb, LPCSTR table_data) { UINT r; - write_file("temp_file", table_data, (lstrlen(table_data) - 1) * sizeof(char)); + write_file("temp_file", table_data, (lstrlenA(table_data) - 1) * sizeof(char)); r = MsiDatabaseImportA(hdb, CURR_DIR, "temp_file"); DeleteFileA("temp_file"); @@ -2302,7 +2298,7 @@ static void test_msiimport(void) ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", r); query = "SELECT * FROM `TestTable`"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); @@ -2363,7 +2359,7 @@ static void test_msiimport(void) MsiCloseHandle(view); query = "SELECT * FROM `TwoPrimary`"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); @@ -2412,7 +2408,7 @@ static void test_msiimport(void) MsiCloseHandle(view); query = "SELECT * FROM `Table`"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); @@ -2443,7 +2439,7 @@ static void test_msiimport(void) MsiCloseHandle(view); query = "SELECT * FROM `Table`"; - r = MsiDatabaseOpenView(hdb, query, &view); + r = MsiDatabaseOpenViewA(hdb, query, &view); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewExecute(view, 0); @@ -2499,15 +2495,15 @@ static void test_binary_import(void) /* create files to import */ write_file("bin_import.idt", bin_import_dat, (sizeof(bin_import_dat) - 1) * sizeof(char)); - CreateDirectory("bin_import", NULL); + CreateDirectoryA("bin_import", NULL); create_file_data("bin_import/filename1.ibd", "just some words", 15); /* import files into database */ - r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); + r = MsiOpenDatabaseA(msifile, MSIDBOPEN_CREATE, &hdb); ok( r == ERROR_SUCCESS , "Failed to open database\n"); - GetCurrentDirectory(MAX_PATH, path); - r = MsiDatabaseImport(hdb, path, "bin_import.idt"); + GetCurrentDirectoryA(MAX_PATH, path); + r = MsiDatabaseImportA(hdb, path, "bin_import.idt"); ok(r == ERROR_SUCCESS , "Failed to import Binary table\n"); /* read file from the Binary table */ @@ -2516,16 +2512,15 @@ static void test_binary_import(void) ok(r == ERROR_SUCCESS, "SELECT query failed: %d\n", r); size = MAX_PATH; - r = MsiRecordGetString(rec, 1, file, &size); + r = MsiRecordGetStringA(rec, 1, file, &size); ok(r == ERROR_SUCCESS, "Failed to get string: %d\n", r); - ok(!lstrcmp(file, "filename1"), "Expected 'filename1', got %s\n", file); + ok(!lstrcmpA(file, "filename1"), "Expected 'filename1', got %s\n", file); size = MAX_PATH; memset(buf, 0, MAX_PATH); r = MsiRecordReadStream(rec, 2, buf, &size); ok(r == ERROR_SUCCESS, "Failed to get stream: %d\n", r); - ok(!lstrcmp(buf, "just some words"), - "Expected 'just some words', got %s\n", buf); + ok(!lstrcmpA(buf, "just some words"), "Expected 'just some words', got %s\n", buf); r = MsiCloseHandle(rec); ok(r == ERROR_SUCCESS , "Failed to close record handle\n"); @@ -2533,9 +2528,9 @@ static void test_binary_import(void) r = MsiCloseHandle(hdb); ok(r == ERROR_SUCCESS , "Failed to close database\n"); - DeleteFile("bin_import/filename1.ibd"); - RemoveDirectory("bin_import"); - DeleteFile("bin_import.idt"); + DeleteFileA("bin_import/filename1.ibd"); + RemoveDirectoryA("bin_import"); + DeleteFileA("bin_import.idt"); } static void test_markers(void) @@ -2548,9 +2543,9 @@ static void test_markers(void) ok( hdb, "failed to create db\n"); rec = MsiCreateRecord(3); - MsiRecordSetString(rec, 1, "Table"); - MsiRecordSetString(rec, 2, "Apples"); - MsiRecordSetString(rec, 3, "Oranges"); + MsiRecordSetStringA(rec, 1, "Table"); + MsiRecordSetStringA(rec, 2, "Apples"); + MsiRecordSetStringA(rec, 3, "Oranges"); /* try a legit create */ query = "CREATE TABLE `Table` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; @@ -2560,7 +2555,7 @@ static void test_markers(void) /* try table name as marker */ rec = MsiCreateRecord(1); - MsiRecordSetString(rec, 1, "Fable"); + MsiRecordSetStringA(rec, 1, "Fable"); query = "CREATE TABLE `?` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; r = run_query(hdb, rec, query); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -2573,13 +2568,13 @@ static void test_markers(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); /* try table name as marker without backticks */ - MsiRecordSetString(rec, 1, "Mable"); + MsiRecordSetStringA(rec, 1, "Mable"); query = "CREATE TABLE ? ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); /* try one column name as marker */ - MsiRecordSetString(rec, 1, "One"); + MsiRecordSetStringA(rec, 1, "One"); query = "CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2587,8 +2582,8 @@ static void test_markers(void) /* try column names as markers */ rec = MsiCreateRecord(2); - MsiRecordSetString(rec, 1, "One"); - MsiRecordSetString(rec, 2, "Two"); + MsiRecordSetStringA(rec, 1, "One"); + MsiRecordSetStringA(rec, 2, "Two"); query = "CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `One`)"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2596,9 +2591,9 @@ static void test_markers(void) /* try names with backticks */ rec = MsiCreateRecord(3); - MsiRecordSetString(rec, 1, "One"); - MsiRecordSetString(rec, 2, "Two"); - MsiRecordSetString(rec, 3, "One"); + MsiRecordSetStringA(rec, 1, "One"); + MsiRecordSetStringA(rec, 2, "Two"); + MsiRecordSetStringA(rec, 3, "One"); query = "CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2616,7 +2611,7 @@ static void test_markers(void) /* try one long marker */ rec = MsiCreateRecord(1); - MsiRecordSetString(rec, 1, "`One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`"); + MsiRecordSetStringA(rec, 1, "`One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`"); query = "CREATE TABLE `Mable` ( ? )"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2624,10 +2619,10 @@ static void test_markers(void) /* try all names as markers */ rec = MsiCreateRecord(4); - MsiRecordSetString(rec, 1, "Mable"); - MsiRecordSetString(rec, 2, "One"); - MsiRecordSetString(rec, 3, "Two"); - MsiRecordSetString(rec, 4, "One"); + MsiRecordSetStringA(rec, 1, "Mable"); + MsiRecordSetStringA(rec, 2, "One"); + MsiRecordSetStringA(rec, 3, "Two"); + MsiRecordSetStringA(rec, 4, "One"); query = "CREATE TABLE `?` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2644,7 +2639,7 @@ static void test_markers(void) /* try values as markers */ rec = MsiCreateRecord(2); MsiRecordSetInteger(rec, 1, 4); - MsiRecordSetString(rec, 2, "hi"); + MsiRecordSetStringA(rec, 2, "hi"); query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )"; r = run_query(hdb, rec, query); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -2652,10 +2647,10 @@ static void test_markers(void) /* try column names and values as markers */ rec = MsiCreateRecord(4); - MsiRecordSetString(rec, 1, "One"); - MsiRecordSetString(rec, 2, "Two"); + MsiRecordSetStringA(rec, 1, "One"); + MsiRecordSetStringA(rec, 2, "Two"); MsiRecordSetInteger(rec, 3, 5); - MsiRecordSetString(rec, 4, "hi"); + MsiRecordSetStringA(rec, 4, "hi"); query = "INSERT INTO `Table` ( `?`, `?` ) VALUES ( ?, '?' )"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2663,8 +2658,8 @@ static void test_markers(void) /* try column names as markers */ rec = MsiCreateRecord(2); - MsiRecordSetString(rec, 1, "One"); - MsiRecordSetString(rec, 2, "Two"); + MsiRecordSetStringA(rec, 1, "One"); + MsiRecordSetStringA(rec, 2, "Two"); query = "INSERT INTO `Table` ( `?`, `?` ) VALUES ( 3, 'yellow' )"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2672,7 +2667,7 @@ static void test_markers(void) /* try table name as a marker */ rec = MsiCreateRecord(1); - MsiRecordSetString(rec, 1, "Table"); + MsiRecordSetStringA(rec, 1, "Table"); query = "INSERT INTO `?` ( `One`, `Two` ) VALUES ( 2, 'green' )"; r = run_query(hdb, rec, query); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -2680,9 +2675,9 @@ static void test_markers(void) /* try table name and values as markers */ rec = MsiCreateRecord(3); - MsiRecordSetString(rec, 1, "Table"); + MsiRecordSetStringA(rec, 1, "Table"); MsiRecordSetInteger(rec, 2, 10); - MsiRecordSetString(rec, 3, "haha"); + MsiRecordSetStringA(rec, 3, "haha"); query = "INSERT INTO `?` ( `One`, `Two` ) VALUES ( ?, '?' )"; r = run_query(hdb, rec, query); ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", r); @@ -2690,11 +2685,11 @@ static void test_markers(void) /* try all markers */ rec = MsiCreateRecord(5); - MsiRecordSetString(rec, 1, "Table"); - MsiRecordSetString(rec, 1, "One"); - MsiRecordSetString(rec, 1, "Two"); + MsiRecordSetStringA(rec, 1, "Table"); + MsiRecordSetStringA(rec, 1, "One"); + MsiRecordSetStringA(rec, 1, "Two"); MsiRecordSetInteger(rec, 2, 10); - MsiRecordSetString(rec, 3, "haha"); + MsiRecordSetStringA(rec, 3, "haha"); query = "INSERT INTO `?` ( `?`, `?` ) VALUES ( ?, '?' )"; r = run_query(hdb, rec, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); @@ -2702,8 +2697,8 @@ static void test_markers(void) /* insert an integer as a string */ rec = MsiCreateRecord(2); - MsiRecordSetString(rec, 1, "11"); - MsiRecordSetString(rec, 2, "hi"); + MsiRecordSetStringA(rec, 1, "11"); + MsiRecordSetStringA(rec, 2, "hi"); query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )"; r = run_query(hdb, rec, query); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -2712,7 +2707,7 @@ static void test_markers(void) /* leave off the '' for the string */ rec = MsiCreateRecord(2); MsiRecordSetInteger(rec, 1, 12); - MsiRecordSetString(rec, 2, "hi"); + MsiRecordSetStringA(rec, 2, "hi"); query = "INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, ? )"; r = run_query(hdb, rec, query); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -2739,7 +2734,7 @@ static void test_handle_limit(void) for (i=0; i