[PATCH v2 2/5] msi: Make MsiSetProperty() RPC-compatible.

Zebediah Figura z.figura12 at gmail.com
Tue Apr 17 10:35:37 CDT 2018


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msi/package.c   | 31 +++----------------------------
 dlls/msi/winemsi.idl |  2 +-
 2 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 4986ec1..b154423 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -2203,35 +2203,11 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue
     if( !package )
     {
         MSIHANDLE remote;
-        HRESULT hr;
-        BSTR name = NULL, value = NULL;
 
         if (!(remote = msi_get_remote(hInstall)))
             return ERROR_INVALID_HANDLE;
 
-        name = SysAllocString( szName );
-        value = SysAllocString( szValue );
-        if ((!name && szName) || (!value && szValue))
-        {
-            SysFreeString( name );
-            SysFreeString( value );
-            return ERROR_OUTOFMEMORY;
-        }
-
-        hr = remote_SetProperty(remote, name, value);
-
-        SysFreeString( name );
-        SysFreeString( value );
-
-        if (FAILED(hr))
-        {
-            if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
-                return HRESULT_CODE(hr);
-
-            return ERROR_FUNCTION_FAILED;
-        }
-
-        return ERROR_SUCCESS;
+        return remote_SetProperty(remote, szName, szValue);
     }
 
     ret = msi_set_property( package->db, szName, szValue, -1 );
@@ -2500,10 +2476,9 @@ UINT __cdecl remote_GetProperty(MSIHANDLE hinst, LPCWSTR property, LPWSTR *value
     return r;
 }
 
-HRESULT __cdecl remote_SetProperty(MSIHANDLE hinst, BSTR property, BSTR value)
+UINT __cdecl remote_SetProperty(MSIHANDLE hinst, LPCWSTR property, LPCWSTR value)
 {
-    UINT r = MsiSetPropertyW(hinst, property, value);
-    return HRESULT_FROM_WIN32(r);
+    return MsiSetPropertyW(hinst, property, value);
 }
 
 HRESULT __cdecl remote_ProcessMessage(MSIHANDLE hinst, INSTALLMESSAGE message, MSIHANDLE record)
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl
index d9695e6..61f7a74 100644
--- a/dlls/msi/winemsi.idl
+++ b/dlls/msi/winemsi.idl
@@ -41,7 +41,7 @@ interface IWineMsiRemote
 
     HRESULT remote_GetActiveDatabase( [in] MSIHANDLE hinst, [out] MSIHANDLE *handle );
     UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size );
-    HRESULT remote_SetProperty( [in] MSIHANDLE hinst, [in] BSTR property, [in] BSTR value );
+    UINT remote_SetProperty( [in] MSIHANDLE hinst, [in, string, unique] LPCWSTR property, [in, string, unique] LPCWSTR value );
     HRESULT remote_ProcessMessage( [in] MSIHANDLE hinst, [in] INSTALLMESSAGE message, [in] MSIHANDLE record );
     HRESULT remote_DoAction( [in] MSIHANDLE hinst, [in] BSTR action );
     HRESULT remote_Sequence( [in] MSIHANDLE hinst, [in] BSTR table, [in] int sequence );
-- 
2.7.4




More information about the wine-devel mailing list