From c49abc8ce006441163c4a0b25d42ad1e9650d9da Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 21 Apr 2018 19:33:43 -0500 Subject: [PATCH] msi: Make MsiDoAction() RPC-compatible. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/install.c | 20 +------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 21 +++++++++++++++++++++ dlls/msi/tests/custom.spec | 1 + dlls/msi/tests/install.c | 2 ++ dlls/msi/winemsi.idl | 2 +- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 814addc402f..f48867483df 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -75,29 +75,11 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR action; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - action = SysAllocString( szAction ); - if (!action) - return ERROR_OUTOFMEMORY; - - hr = remote_DoAction(remote, action); - - SysFreeString( action ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_DoAction(remote, szAction); } ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE ); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index d18736b0245..06811897f0f 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2464,10 +2464,9 @@ int __cdecl remote_ProcessMessage(MSIHANDLE hinst, INSTALLMESSAGE message, struc return ret; } -HRESULT __cdecl remote_DoAction(MSIHANDLE hinst, BSTR action) +UINT __cdecl remote_DoAction(MSIHANDLE hinst, LPCWSTR action) { - UINT r = MsiDoActionW(hinst, action); - return HRESULT_FROM_WIN32(r); + return MsiDoActionW(hinst, action); } HRESULT __cdecl remote_Sequence(MSIHANDLE hinst, BSTR table, int sequence) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index e782311446f..5bdb8d2cc55 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -426,6 +426,26 @@ static void test_db(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); } +static void test_doaction(MSIHANDLE hinst) +{ + UINT r; + + r = MsiDoActionA(hinst, "nested51"); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "nested", "1"); + + r = MsiDoActionA(hinst, "nested1"); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "nested", "2"); +} + +UINT WINAPI nested(MSIHANDLE hinst) +{ + MsiSetPropertyA(hinst, "nested", "2"); + + return ERROR_SUCCESS; +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -451,6 +471,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_props(hinst); test_db(hinst); + test_doaction(hinst); return ERROR_SUCCESS; } diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index bb400fffe9d..51bb60ec1a4 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -2,3 +2,4 @@ @ stdcall test_retval(long) @ stdcall da_immediate(long) @ stdcall da_deferred(long) +@ stdcall nested(long) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 41a77cdb4ed..b63e5da9686 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -703,6 +703,8 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "s72\ti2\tS64\tS0\n" "CustomAction\tAction\n" "embednull\t51\tembednullprop\ta[~]b\n" + "nested51\t51\tnested\t1\n" + "nested1\t1\tcustom.dll\tnested\n" "maintest\t1\tcustom.dll\tmain_test\n" "testretval\t1\tcustom.dll\ttest_retval\n"; diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 7613fd3e3ad..57790d12d4e 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -74,7 +74,7 @@ interface IWineMsiRemote UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size ); 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 ); - HRESULT remote_DoAction( [in] MSIHANDLE hinst, [in] BSTR action ); + UINT remote_DoAction( [in] MSIHANDLE hinst, [in, string] LPCWSTR action ); HRESULT remote_Sequence( [in] MSIHANDLE hinst, [in] BSTR 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 ); -- 2.11.4.GIT