Zebediah Figura : msi: Make MsiSetMode() RPC-compatible.
Alexandre Julliard
julliard at winehq.org
Tue Apr 24 18:46:09 CDT 2018
Module: wine
Branch: master
Commit: 1723536058c73b71894f60ab2c030e78948abe45
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1723536058c73b71894f60ab2c030e78948abe45
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Mon Apr 23 23:18:14 2018 -0500
msi: Make MsiSetMode() RPC-compatible.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msi/install.c | 13 +------------
dlls/msi/package.c | 5 ++---
dlls/msi/tests/custom.c | 9 +++++++++
dlls/msi/winemsi.idl | 2 +-
4 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index 3ac151d..17a0cd5 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -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)
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 3ea5afc..6d2610d 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -2518,10 +2518,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,
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index d596f1e..5f2ff5d 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -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;
}
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl
index 7282c77..c4c7e88 100644
--- a/dlls/msi/winemsi.idl
+++ b/dlls/msi/winemsi.idl
@@ -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 );
More information about the wine-cvs
mailing list