msi [6/13]: Handle remote calls to MsiSetTargetPath

James Hawkins truiken at gmail.com
Tue Jul 3 21:16:54 CDT 2007


Hi,

Changelog:
* Handle remote calls to MsiSetTargetPath.

 dlls/msi/install.c     |   23 ++++++++++++++++++++++-
 dlls/msi/msiserver.idl |    1 +
 dlls/msi/package.c     |    8 ++++++++
 3 files changed, 31 insertions(+), 1 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index b4f365e..2d0a365 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -544,7 +544,28 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE 
 
     package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
     if (!package)
-        return ERROR_INVALID_HANDLE;
+    {
+        HRESULT hr;
+        IWineMsiRemotePackage *remote_package;
+
+        remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
+        if (!remote_package)
+            return ERROR_INVALID_HANDLE;
+
+        hr = IWineMsiRemotePackage_SetTargetPath( remote_package, (BSTR *)szFolder, (BSTR *)szFolderPath );
+
+        IWineMsiRemotePackage_Release( remote_package );
+
+        if (FAILED(hr))
+        {
+            if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
+                return HRESULT_CODE(hr);
+
+            return ERROR_FUNCTION_FAILED;
+        }
+
+        return ERROR_SUCCESS;
+    }
 
     ret = MSI_SetTargetPathW( package, szFolder, szFolderPath );
     msiobj_release( &package->hdr );
diff --git a/dlls/msi/msiserver.idl b/dlls/msi/msiserver.idl
index 53dd622..965f672 100644
--- a/dlls/msi/msiserver.idl
+++ b/dlls/msi/msiserver.idl
@@ -43,6 +43,7 @@ interface IWineMsiRemotePackage : IUnkno
     HRESULT DoAction( [in] BSTR *action );
     HRESULT Sequence( [in] BSTR *table, [in] int sequence );
     HRESULT GetTargetPath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size );
+    HRESULT SetTargetPath( [in] BSTR *folder, [in] BSTR *value );
     HRESULT GetSourcePath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size );
 }
 
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 1b83e56..62fa702 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -1597,6 +1597,13 @@ HRESULT WINAPI mrp_GetTargetPath( IWineM
     return HRESULT_FROM_WIN32(r);
 }
 
+HRESULT WINAPI mrp_SetTargetPath( IWineMsiRemotePackage *iface, BSTR *folder, BSTR *value)
+{
+    msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
+    UINT r = MsiSetTargetPathW(This->package, (LPWSTR)folder, (LPWSTR)value);
+    return HRESULT_FROM_WIN32(r);
+}
+
 HRESULT WINAPI mrp_GetSourcePath( IWineMsiRemotePackage *iface, BSTR *folder, BSTR *value, DWORD *size )
 {
     msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
@@ -1617,6 +1624,7 @@ static const IWineMsiRemotePackageVtbl m
     mrp_DoAction,
     mrp_Sequence,
     mrp_GetTargetPath,
+    mrp_SetTargetPath,
     mrp_GetSourcePath,
 };
 
-- 
1.4.1


More information about the wine-patches mailing list