msi: Make MsiDoAction() 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>
This commit is contained in:
Zebediah Figura 2018-04-21 19:33:43 -05:00 committed by Alexandre Julliard
parent 508ad84bbe
commit c49abc8ce0
6 changed files with 28 additions and 23 deletions

View File

@ -75,29 +75,11 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction )
if (!package) if (!package)
{ {
MSIHANDLE remote; MSIHANDLE remote;
HRESULT hr;
BSTR action;
if (!(remote = msi_get_remote(hInstall))) if (!(remote = msi_get_remote(hInstall)))
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
action = SysAllocString( szAction ); return remote_DoAction(remote, 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;
} }
ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE ); ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE );

View File

@ -2464,10 +2464,9 @@ int __cdecl remote_ProcessMessage(MSIHANDLE hinst, INSTALLMESSAGE message, struc
return ret; return ret;
} }
HRESULT __cdecl remote_DoAction(MSIHANDLE hinst, BSTR action) UINT __cdecl remote_DoAction(MSIHANDLE hinst, LPCWSTR action)
{ {
UINT r = MsiDoActionW(hinst, action); return MsiDoActionW(hinst, action);
return HRESULT_FROM_WIN32(r);
} }
HRESULT __cdecl remote_Sequence(MSIHANDLE hinst, BSTR table, int sequence) HRESULT __cdecl remote_Sequence(MSIHANDLE hinst, BSTR table, int sequence)

View File

@ -426,6 +426,26 @@ static void test_db(MSIHANDLE hinst)
ok(hinst, !r, "got %u\n", r); 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 /* Main test. Anything that doesn't depend on a specific install configuration
* or have undesired side effects should go here. */ * or have undesired side effects should go here. */
UINT WINAPI main_test(MSIHANDLE hinst) UINT WINAPI main_test(MSIHANDLE hinst)
@ -451,6 +471,7 @@ UINT WINAPI main_test(MSIHANDLE hinst)
test_props(hinst); test_props(hinst);
test_db(hinst); test_db(hinst);
test_doaction(hinst);
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }

View File

@ -2,3 +2,4 @@
@ stdcall test_retval(long) @ stdcall test_retval(long)
@ stdcall da_immediate(long) @ stdcall da_immediate(long)
@ stdcall da_deferred(long) @ stdcall da_deferred(long)
@ stdcall nested(long)

View File

@ -703,6 +703,8 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
"s72\ti2\tS64\tS0\n" "s72\ti2\tS64\tS0\n"
"CustomAction\tAction\n" "CustomAction\tAction\n"
"embednull\t51\tembednullprop\ta[~]b\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" "maintest\t1\tcustom.dll\tmain_test\n"
"testretval\t1\tcustom.dll\ttest_retval\n"; "testretval\t1\tcustom.dll\ttest_retval\n";

View File

@ -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_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 ); 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 ); 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_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_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_SetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [in] BSTR value );