Commit 252dd11f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Make MsiDatabaseIsTablePersistent() RPC-compatible.

parent a6934768
......@@ -1906,10 +1906,9 @@ MSIDBSTATE WINAPI MsiGetDatabaseState( MSIHANDLE handle )
return ret;
}
HRESULT __cdecl remote_DatabaseIsTablePersistent(MSIHANDLE db, LPCWSTR table, MSICONDITION *persistent)
MSICONDITION __cdecl remote_DatabaseIsTablePersistent(MSIHANDLE db, LPCWSTR table)
{
*persistent = MsiDatabaseIsTablePersistentW(db, table);
return S_OK;
return MsiDatabaseIsTablePersistentW(db, table);
}
HRESULT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, MSIHANDLE *keys)
......
......@@ -1024,19 +1024,12 @@ MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(
db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE );
if( !db )
{
HRESULT hr;
MSICONDITION condition;
MSIHANDLE remote;
if (!(remote = msi_get_remote(hDatabase)))
return MSICONDITION_ERROR;
hr = remote_DatabaseIsTablePersistent(remote, szTableName, &condition);
if (FAILED(hr))
return MSICONDITION_ERROR;
return condition;
return remote_DatabaseIsTablePersistent(remote, szTableName);
}
r = MSI_DatabaseIsTablePersistent( db, szTableName );
......
......@@ -249,6 +249,9 @@ static void test_db(MSIHANDLE hinst)
hdb = MsiGetActiveDatabase(hinst);
ok(hinst, hdb, "MsiGetActiveDatabase failed\n");
r = MsiDatabaseIsTablePersistentA(hdb, "Test");
ok(hinst, r == MSICONDITION_TRUE, "got %u\n", r);
r = MsiCloseHandle(hdb);
ok(hinst, !r, "got %u\n", r);
}
......
......@@ -4108,11 +4108,25 @@ static INT CALLBACK ok_callback(void *context, UINT message_type, MSIHANDLE reco
static void test_customaction1(void)
{
MSIHANDLE hdb, record;
UINT r;
create_database(msifile, ca1_tables, sizeof(ca1_tables) / sizeof(msi_table));
add_custom_dll();
/* create a test table */
MsiOpenDatabaseW(msifileW, MSIDBOPEN_TRANSACT, &hdb);
run_query(hdb, 0, "CREATE TABLE `Test` (`Name` CHAR(10), `Number` INTEGER, `Data` OBJECT PRIMARY KEY `Name`)");
create_file("unus", 10);
create_file("duo", 10);
record = MsiCreateRecord(1);
MsiRecordSetStreamA(record, 1, "unus");
run_query(hdb, record, "INSERT INTO `Test` (`Name`, `Number`, `Data`) VALUES ('one', 1, ?)");
MsiRecordSetStreamA(record, 1, "duo");
run_query(hdb, record, "INSERT INTO `Test` (`Name`, `Number`, `Data`) VALUES ('two', 2, ?)");
MsiDatabaseCommit(hdb);
MsiCloseHandle(hdb);
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiInstallProductA(msifile, "MAIN_TEST=1");
......@@ -4136,6 +4150,8 @@ static void test_customaction1(void)
ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
DeleteFileA(msifile);
DeleteFileA("unus");
DeleteFileA("duo");
}
static void test_customaction51(void)
......
......@@ -56,7 +56,7 @@ struct wire_record {
]
interface IWineMsiRemote
{
HRESULT remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSICONDITION *persistent );
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table );
HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys );
HRESULT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo );
HRESULT remote_DatabaseOpenView( [in] MSIHANDLE db, [in] LPCWSTR query, [out] MSIHANDLE *view );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment