[WINESYNC] msi: Make MsiSetMode() 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>

wine commit id 1723536058c73b71894f60ab2c030e78948abe45 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync
2022-03-12 15:12:01 +01:00
committed by Mark Jansen
parent 83bbe8c85b
commit 5219367eac
4 changed files with 13 additions and 16 deletions

View File

@@ -644,22 +644,11 @@ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
if (!package)
{
MSIHANDLE remote;
HRESULT hr;
if (!(remote = msi_get_remote(hInstall)))
return FALSE;
hr = remote_SetMode(remote, iRunMode, fState);
if (FAILED(hr))
{
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
return HRESULT_CODE(hr);
return ERROR_FUNCTION_FAILED;
}
return ERROR_SUCCESS;
return remote_SetMode(remote, iRunMode, fState);
}
switch (iRunMode)

View File

@@ -2525,10 +2525,9 @@ BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode)
return MsiGetMode(hinst, mode);
}
HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state)
UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state)
{
UINT r = MsiSetMode(hinst, mode, state);
return HRESULT_FROM_WIN32(r);
return MsiSetMode(hinst, mode, state);
}
HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature,

View File

@@ -80,7 +80,7 @@ interface IWineMsiRemote
UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value );
UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value );
BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode );
HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state );
UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state );
HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state );
HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );

View File

@@ -642,6 +642,14 @@ static void test_targetpath(MSIHANDLE hinst)
ok(hinst, sz == srcsz, "got size %u\n", sz);
}
static void test_mode(MSIHANDLE hinst)
{
UINT r;
r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE);
ok(hinst, !r, "got %u\n", r);
}
/* 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)
@@ -669,6 +677,7 @@ UINT WINAPI main_test(MSIHANDLE hinst)
test_db(hinst);
test_doaction(hinst);
test_targetpath(hinst);
test_mode(hinst);
return ERROR_SUCCESS;
}