Commit c49abc8c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Make MsiDoAction() RPC-compatible.

parent 508ad84b
......@@ -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 );
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -2,3 +2,4 @@
@ stdcall test_retval(long)
@ stdcall da_immediate(long)
@ stdcall da_deferred(long)
@ stdcall nested(long)
......@@ -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";
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment