James Hawkins : msi: Handle remote calls to MsiGetFeatureState.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 4 06:56:55 CDT 2007


Module: wine
Branch: master
Commit: 7d93e1a2a5a782f10c5d36d11724584b06fe5dc5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7d93e1a2a5a782f10c5d36d11724584b06fe5dc5

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Jul  3 19:18:44 2007 -0700

msi: Handle remote calls to MsiGetFeatureState.

---

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

diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index c9a34cc..e1a6b88 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -829,7 +829,28 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
 
     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_GetFeatureState(remote_package, (BSTR *)szFeature,
+                                                   piInstalled, piAction);
+
+        if (FAILED(hr))
+        {
+            if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
+                return HRESULT_CODE(hr);
+
+            return ERROR_FUNCTION_FAILED;
+        }
+
+        return ERROR_SUCCESS;
+    }
+
     ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction);
     msiobj_release( &package->hdr );
     return ret;
diff --git a/dlls/msi/msiserver.idl b/dlls/msi/msiserver.idl
index f64c8ae..5708a8b 100644
--- a/dlls/msi/msiserver.idl
+++ b/dlls/msi/msiserver.idl
@@ -48,6 +48,7 @@ interface IWineMsiRemotePackage : IUnknown
     HRESULT SetTargetPath( [in] BSTR *folder, [in] BSTR *value );
     HRESULT GetSourcePath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size );
     HRESULT GetMode( [in] MSIRUNMODE mode, [out] BOOL *ret );
+    HRESULT GetFeatureState( [in] BSTR *feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
     HRESULT SetFeatureState( [in] BSTR *feature, [in] INSTALLSTATE state );
 }
 
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 72eae3b..a47cbda 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -1618,6 +1618,14 @@ HRESULT WINAPI mrp_GetMode( IWineMsiRemotePackage *iface, MSIRUNMODE mode, BOOL
     return S_OK;
 }
 
+HRESULT WINAPI mrp_GetFeatureState( IWineMsiRemotePackage *iface, BSTR *feature,
+                                    INSTALLSTATE *installed, INSTALLSTATE *action )
+{
+    msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
+    UINT r = MsiGetFeatureStateW(This->package, (LPWSTR)feature, installed, action);
+    return HRESULT_FROM_WIN32(r);
+}
+
 HRESULT WINAPI mrp_SetFeatureState( IWineMsiRemotePackage *iface, BSTR *feature, INSTALLSTATE state )
 {
     msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
@@ -1641,6 +1649,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
     mrp_SetTargetPath,
     mrp_GetSourcePath,
     mrp_GetMode,
+    mrp_GetFeatureState,
     mrp_SetFeatureState,
 };
 




More information about the wine-cvs mailing list