James Hawkins : msi: Handle remote calls to MsiGetProperty.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 3 08:01:29 CDT 2007


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

Author: James Hawkins <truiken at gmail.com>
Date:   Mon Jul  2 20:16:33 2007 -0700

msi: Handle remote calls to MsiGetProperty.

---

 dlls/msi/package.c |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index cafa656..d096466 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -1343,7 +1343,7 @@ static UINT MSI_GetProperty( MSIHANDLE handle, LPCWSTR name,
     static const WCHAR empty[] = {0};
     MSIPACKAGE *package;
     MSIRECORD *row = NULL;
-    UINT r;
+    UINT r = ERROR_FUNCTION_FAILED;
     LPCWSTR val = NULL;
 
     TRACE("%lu %s %p %p\n", handle, debugstr_w(name),
@@ -1354,7 +1354,50 @@ static UINT MSI_GetProperty( MSIHANDLE handle, LPCWSTR name,
 
     package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE );
     if (!package)
-        return ERROR_INVALID_HANDLE;
+    {
+        HRESULT hr;
+        IWineMsiRemotePackage *remote_package;
+        LPWSTR value = NULL;
+        DWORD len;
+
+        remote_package = (IWineMsiRemotePackage *)msi_get_remote( handle );
+        if (!remote_package)
+            return ERROR_INVALID_HANDLE;
+
+        len = 0;
+        hr = IWineMsiRemotePackage_GetProperty( remote_package, (BSTR *)name, NULL, &len );
+        if (FAILED(hr))
+            goto done;
+
+        len++;
+        value = msi_alloc(len * sizeof(WCHAR));
+        if (!value)
+        {
+            r = ERROR_OUTOFMEMORY;
+            goto done;
+        }
+
+        hr = IWineMsiRemotePackage_GetProperty( remote_package, (BSTR *)name, (BSTR *)value, &len );
+        if (FAILED(hr))
+            goto done;
+
+        r = msi_strcpy_to_awstring( value, szValueBuf, pchValueBuf );
+        *pchValueBuf *= sizeof(WCHAR); /* Bug required by Adobe installers */
+
+done:
+        IWineMsiRemotePackage_Release(remote_package);
+        msi_free(value);
+
+        if (FAILED(hr))
+        {
+            if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
+                return HRESULT_CODE(hr);
+
+            return ERROR_FUNCTION_FAILED;
+        }
+
+        return r;
+    }
 
     row = MSI_GetPropertyRow( package, name );
     if (row)




More information about the wine-cvs mailing list