mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[WINESYNC] msi: Make MsiDatabaseOpenView() RPC-compatible.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c6bd4d8c35de1ae452a5b5bec69d4779c813b37f by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
parent
b4fb978270
commit
00684fb410
4 changed files with 27 additions and 21 deletions
|
@ -2034,8 +2034,7 @@ HRESULT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updateco
|
||||||
return HRESULT_FROM_WIN32(r);
|
return HRESULT_FROM_WIN32(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __cdecl remote_DatabaseOpenView(MSIHANDLE db, LPCWSTR query, MSIHANDLE *view)
|
UINT __cdecl remote_DatabaseOpenView(MSIHANDLE db, LPCWSTR query, MSIHANDLE *view)
|
||||||
{
|
{
|
||||||
UINT r = MsiDatabaseOpenViewW(db, query, view);
|
return MsiDatabaseOpenViewW(db, query, view);
|
||||||
return HRESULT_FROM_WIN32(r);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,9 +116,6 @@ UINT MSI_DatabaseOpenViewW(MSIDATABASE *db,
|
||||||
|
|
||||||
TRACE("%s %p\n", debugstr_w(szQuery), pView);
|
TRACE("%s %p\n", debugstr_w(szQuery), pView);
|
||||||
|
|
||||||
if( !szQuery)
|
|
||||||
return ERROR_INVALID_PARAMETER;
|
|
||||||
|
|
||||||
/* pre allocate a handle to hold a pointer to the view */
|
/* pre allocate a handle to hold a pointer to the view */
|
||||||
query = alloc_msiobject( MSIHANDLETYPE_VIEW, sizeof (MSIQUERY),
|
query = alloc_msiobject( MSIHANDLETYPE_VIEW, sizeof (MSIQUERY),
|
||||||
MSI_CloseView );
|
MSI_CloseView );
|
||||||
|
@ -247,26 +244,24 @@ UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb,
|
||||||
|
|
||||||
TRACE("%s %p\n", debugstr_w(szQuery), phView);
|
TRACE("%s %p\n", debugstr_w(szQuery), phView);
|
||||||
|
|
||||||
|
if (!phView)
|
||||||
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
if (!szQuery)
|
||||||
|
return ERROR_BAD_QUERY_SYNTAX;
|
||||||
|
|
||||||
db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
|
db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
|
||||||
if( !db )
|
if( !db )
|
||||||
{
|
{
|
||||||
MSIHANDLE remote;
|
MSIHANDLE remote, remote_view;
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
if (!(remote = msi_get_remote(hdb)))
|
if (!(remote = msi_get_remote(hdb)))
|
||||||
return ERROR_INVALID_HANDLE;
|
return ERROR_INVALID_HANDLE;
|
||||||
|
|
||||||
hr = remote_DatabaseOpenView(remote, szQuery, phView);
|
ret = remote_DatabaseOpenView(remote, szQuery, &remote_view);
|
||||||
|
if (!ret)
|
||||||
if (FAILED(hr))
|
*phView = alloc_msi_remote_handle(remote_view);
|
||||||
{
|
return ret;
|
||||||
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
|
|
||||||
return HRESULT_CODE(hr);
|
|
||||||
|
|
||||||
return ERROR_FUNCTION_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = MSI_DatabaseOpenViewW( db, szQuery, &query );
|
ret = MSI_DatabaseOpenViewW( db, szQuery, &query );
|
||||||
|
|
|
@ -59,7 +59,7 @@ interface IWineMsiRemote
|
||||||
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table );
|
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table );
|
||||||
HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys );
|
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_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo );
|
||||||
HRESULT remote_DatabaseOpenView( [in] MSIHANDLE db, [in] LPCWSTR query, [out] MSIHANDLE *view );
|
UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view );
|
||||||
|
|
||||||
MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst );
|
MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst );
|
||||||
UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size );
|
UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size );
|
||||||
|
|
|
@ -243,7 +243,7 @@ static void test_props(MSIHANDLE hinst)
|
||||||
|
|
||||||
static void test_db(MSIHANDLE hinst)
|
static void test_db(MSIHANDLE hinst)
|
||||||
{
|
{
|
||||||
MSIHANDLE hdb;
|
MSIHANDLE hdb, view;
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
hdb = MsiGetActiveDatabase(hinst);
|
hdb = MsiGetActiveDatabase(hinst);
|
||||||
|
@ -252,6 +252,18 @@ static void test_db(MSIHANDLE hinst)
|
||||||
r = MsiDatabaseIsTablePersistentA(hdb, "Test");
|
r = MsiDatabaseIsTablePersistentA(hdb, "Test");
|
||||||
ok(hinst, r == MSICONDITION_TRUE, "got %u\n", r);
|
ok(hinst, r == MSICONDITION_TRUE, "got %u\n", r);
|
||||||
|
|
||||||
|
r = MsiDatabaseOpenViewA(hdb, NULL, &view);
|
||||||
|
ok(hinst, r == ERROR_BAD_QUERY_SYNTAX, "got %u\n", r);
|
||||||
|
|
||||||
|
r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `Test`", NULL);
|
||||||
|
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
|
||||||
|
|
||||||
|
r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `Test`", &view);
|
||||||
|
ok(hinst, !r, "got %u\n", r);
|
||||||
|
|
||||||
|
r = MsiCloseHandle(view);
|
||||||
|
ok(hinst, !r, "got %u\n", r);
|
||||||
|
|
||||||
r = MsiCloseHandle(hdb);
|
r = MsiCloseHandle(hdb);
|
||||||
ok(hinst, !r, "got %u\n", r);
|
ok(hinst, !r, "got %u\n", r);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue