https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d20dc08f6171136c90eb8e...
commit d20dc08f6171136c90eb8e9aa1efb487aff1ae17 Author: winesync ros-dev@reactos.org AuthorDate: Sat Mar 12 15:12:04 2022 +0100 Commit: Mark Jansen mark.jansen@reactos.org CommitDate: Sun Mar 20 19:27:41 2022 +0100
[WINESYNC] msi: Make MsiSetInstallLevel() 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 5ab576b8a09f715401a1de2bb384ccc9ffb37750 by Zebediah Figura z.figura12@gmail.com --- dll/win32/msi/install.c | 13 +------------ dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 6 ++++++ 4 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 0ec1f241b61..b9290b4a8d0 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -1428,22 +1428,11 @@ UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel) if (!package) { MSIHANDLE remote; - HRESULT hr;
if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE;
- hr = remote_SetInstallLevel(remote, iInstallLevel); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetInstallLevel(remote, iInstallLevel); }
r = MSI_SetInstallLevel( package, iInstallLevel ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 98b283df502..ca671f690c4 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2557,10 +2557,9 @@ LANGID __cdecl remote_GetLanguage(MSIHANDLE hinst) return MsiGetLanguage(hinst); }
-HRESULT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) +UINT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) { - UINT r = MsiSetInstallLevel(hinst, level); - return HRESULT_FROM_WIN32(r); + return MsiSetInstallLevel(hinst, level); }
HRESULT __cdecl remote_FormatRecord(MSIHANDLE hinst, MSIHANDLE record, diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index b75f32f46b1..a8e9348ecdf 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -86,7 +86,7 @@ interface IWineMsiRemote UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); LANGID remote_GetLanguage( [in] MSIHANDLE hinst ); - HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); + UINT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value ); HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition ); HRESULT remote_GetFeatureCost( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index e9561d6a36c..35b1543407e 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -652,6 +652,12 @@ static void test_misc(MSIHANDLE hinst)
lang = MsiGetLanguage(hinst); ok(hinst, lang == 1033, "got %u\n", lang); + + check_prop(hinst, "INSTALLLEVEL", "3"); + r = MsiSetInstallLevel(hinst, 123); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "INSTALLLEVEL", "123"); + MsiSetInstallLevel(hinst, 3); }
static void test_feature_states(MSIHANDLE hinst)