https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f8e5d88d98d4725ea8b3…
commit 6f8e5d88d98d4725ea8b381af67f1c6dc7b64aa1
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 15:11:57 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:38 2022 +0100
[WINESYNC] msi: Make MsiGetSummaryInformation() RPC-compatible.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id bf5589311de8ac2c74e3bd73bef32337a2ce8df2 by Zebediah Figura
<z.figura12(a)gmail.com>
---
dll/win32/msi/database.c | 5 ++---
dll/win32/msi/suminfo.c | 17 +++++------------
dll/win32/msi/winemsi.idl | 2 +-
modules/rostests/winetests/msi/custom.c | 11 ++++++++++-
4 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/dll/win32/msi/database.c b/dll/win32/msi/database.c
index 26a274c9a84..1657a353ba0 100644
--- a/dll/win32/msi/database.c
+++ b/dll/win32/msi/database.c
@@ -2033,10 +2033,9 @@ UINT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR
table, struct w
return r;
}
-HRESULT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount,
MSIHANDLE *suminfo)
+UINT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount,
MSIHANDLE *suminfo)
{
- UINT r = MsiGetSummaryInformationW(db, NULL, updatecount, suminfo);
- return HRESULT_FROM_WIN32(r);
+ return MsiGetSummaryInformationW(db, NULL, updatecount, suminfo);
}
UINT __cdecl remote_DatabaseOpenView(MSIHANDLE db, LPCWSTR query, MSIHANDLE *view)
diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c
index eabd399c39b..0268f631288 100644
--- a/dll/win32/msi/suminfo.c
+++ b/dll/win32/msi/suminfo.c
@@ -538,23 +538,16 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE );
if( !db )
{
- MSIHANDLE remote;
- HRESULT hr;
+ MSIHANDLE remote, remote_suminfo;
if (!(remote = msi_get_remote(hDatabase)))
return ERROR_INVALID_HANDLE;
- hr = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, pHandle);
+ ret = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount,
&remote_suminfo);
+ if (!ret)
+ *pHandle = alloc_msi_remote_handle(remote_suminfo);
- if (FAILED(hr))
- {
- if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
- return HRESULT_CODE(hr);
-
- return ERROR_FUNCTION_FAILED;
- }
-
- return ERROR_SUCCESS;
+ return ret;
}
}
diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl
index 28c3ab10003..7613fd3e3ad 100644
--- a/dll/win32/msi/winemsi.idl
+++ b/dll/win32/msi/winemsi.idl
@@ -67,7 +67,7 @@ interface IWineMsiRemote
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table
);
UINT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in, string] LPCWSTR table,
[out] struct wire_record **keys );
- HRESULT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT
updatecount, [out] MSIHANDLE *suminfo );
+ UINT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount,
[out] MSIHANDLE *suminfo );
UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out]
MSIHANDLE *view );
MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst );
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index cdefefd6cdd..e782311446f 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -243,7 +243,7 @@ static void test_props(MSIHANDLE hinst)
static void test_db(MSIHANDLE hinst)
{
- MSIHANDLE hdb, view, rec, rec2;
+ MSIHANDLE hdb, view, rec, rec2, suminfo;
char buffer[10];
DWORD sz;
UINT r;
@@ -413,6 +413,15 @@ static void test_db(MSIHANDLE hinst)
r = MsiCloseHandle(rec);
ok(hinst, !r, "got %u\n", r);
+ r = MsiGetSummaryInformationA(hdb, NULL, 1, NULL);
+ ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
+
+ r = MsiGetSummaryInformationA(hdb, NULL, 1, &suminfo);
+ ok(hinst, !r, "got %u\n", r);
+
+ r = MsiCloseHandle(suminfo);
+ ok(hinst, !r, "got %u\n", r);
+
r = MsiCloseHandle(hdb);
ok(hinst, !r, "got %u\n", r);
}