https://git.reactos.org/?p=reactos.git;a=commitdiff;h=10abb6f6bc32cc7a0dc6f…
commit 10abb6f6bc32cc7a0dc6f9ccbf9a2eb9db4071d6
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 15:11:58 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:38 2022 +0100
[WINESYNC] msi: Make MsiSequence() 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 676376d1d3b87a8843e15baf6c7f7b958c2bdf83 by Zebediah Figura
<z.figura12(a)gmail.com>
---
dll/win32/msi/install.c | 23 ++++-------------------
dll/win32/msi/package.c | 5 ++---
dll/win32/msi/winemsi.idl | 2 +-
modules/rostests/winetests/msi/custom.c | 7 +++++++
modules/rostests/winetests/msi/install.c | 7 +++++++
5 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c
index f48867483df..2a5ff403692 100644
--- a/dll/win32/msi/install.c
+++ b/dll/win32/msi/install.c
@@ -117,33 +117,18 @@ UINT WINAPI MsiSequenceW( MSIHANDLE hInstall, LPCWSTR szTable, INT
iSequenceMode
TRACE("%s, %d\n", debugstr_w(szTable), iSequenceMode);
+ if (!szTable)
+ return ERROR_INVALID_PARAMETER;
+
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if (!package)
{
MSIHANDLE remote;
- HRESULT hr;
- BSTR table;
if (!(remote = msi_get_remote(hInstall)))
return ERROR_INVALID_HANDLE;
- table = SysAllocString( szTable );
- if (!table)
- return ERROR_OUTOFMEMORY;
-
- hr = remote_Sequence(remote, table, iSequenceMode);
-
- SysFreeString( table );
-
- if (FAILED(hr))
- {
- if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
- return HRESULT_CODE(hr);
-
- return ERROR_FUNCTION_FAILED;
- }
-
- return ERROR_SUCCESS;
+ return remote_Sequence(remote, szTable, iSequenceMode);
}
ret = MSI_Sequence( package, szTable );
msiobj_release( &package->hdr );
diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c
index 948e70ee266..50bfd2133c5 100644
--- a/dll/win32/msi/package.c
+++ b/dll/win32/msi/package.c
@@ -2476,10 +2476,9 @@ UINT __cdecl remote_DoAction(MSIHANDLE hinst, LPCWSTR action)
return MsiDoActionW(hinst, action);
}
-HRESULT __cdecl remote_Sequence(MSIHANDLE hinst, BSTR table, int sequence)
+UINT __cdecl remote_Sequence(MSIHANDLE hinst, LPCWSTR table, int sequence)
{
- UINT r = MsiSequenceW(hinst, table, sequence);
- return HRESULT_FROM_WIN32(r);
+ return MsiSequenceW(hinst, table, sequence);
}
HRESULT __cdecl remote_GetTargetPath(MSIHANDLE hinst, BSTR folder, BSTR value, DWORD
*size)
diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl
index 57790d12d4e..d103e9aa068 100644
--- a/dll/win32/msi/winemsi.idl
+++ b/dll/win32/msi/winemsi.idl
@@ -75,7 +75,7 @@ interface IWineMsiRemote
UINT remote_SetProperty( [in] MSIHANDLE hinst, [in, string, unique] LPCWSTR property,
[in, string, unique] LPCWSTR value );
int remote_ProcessMessage( [in] MSIHANDLE hinst, [in] INSTALLMESSAGE message, [in]
struct wire_record *record );
UINT remote_DoAction( [in] MSIHANDLE hinst, [in, string] LPCWSTR action );
- HRESULT remote_Sequence( [in] MSIHANDLE hinst, [in] BSTR table, [in] int sequence );
+ UINT remote_Sequence( [in] MSIHANDLE hinst, [in, string] LPCWSTR table, [in] int
sequence );
HRESULT remote_GetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [out,
size_is(*size)] BSTR value, [in, out] DWORD *size );
HRESULT remote_SetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [in] BSTR value
);
HRESULT remote_GetSourcePath( [in] MSIHANDLE hinst, [in] BSTR folder, [out,
size_is(*size)] BSTR value, [in, out] DWORD *size );
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index 5bdb8d2cc55..bfd1e857bfb 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -437,6 +437,13 @@ static void test_doaction(MSIHANDLE hinst)
r = MsiDoActionA(hinst, "nested1");
ok(hinst, !r, "got %u\n", r);
check_prop(hinst, "nested", "2");
+
+ r = MsiSequenceA(hinst, NULL, 0);
+ ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
+
+ r = MsiSequenceA(hinst, "TestSequence", 0);
+ ok(hinst, !r, "got %u\n", r);
+ check_prop(hinst, "nested", "1");
}
UINT WINAPI nested(MSIHANDLE hinst)
diff --git a/modules/rostests/winetests/msi/install.c
b/modules/rostests/winetests/msi/install.c
index b63e5da9686..c5d9243275d 100644
--- a/modules/rostests/winetests/msi/install.c
+++ b/modules/rostests/winetests/msi/install.c
@@ -708,6 +708,12 @@ static const CHAR ca1_custom_action_dat[] =
"Action\tType\tSource\tTarget\n"
"maintest\t1\tcustom.dll\tmain_test\n"
"testretval\t1\tcustom.dll\ttest_retval\n";
+static const CHAR ca1_test_seq_dat[] = "Action\tCondition\tSequence\n"
+ "s72\tS255\tI2\n"
+ "TestSequence\tAction\n"
+ "nested1\t\t1\n"
+ "nested51\t\t2\n";
+
static const CHAR ca51_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
"Component\tComponent\n"
@@ -1706,6 +1712,7 @@ static const msi_table ca1_tables[] =
ADD_TABLE(property),
ADD_TABLE(ca1_install_exec_seq),
ADD_TABLE(ca1_custom_action),
+ ADD_TABLE(ca1_test_seq),
};
static const msi_table ca51_tables[] =