Hans Leidekker : msi: Forward MsiDetermineApplicablePatchesA to MsiDetermineApplicablePatchesW.

Alexandre Julliard julliard at winehq.org
Wed May 5 11:08:37 CDT 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed May  5 14:37:24 2010 +0200

msi: Forward MsiDetermineApplicablePatchesA to MsiDetermineApplicablePatchesW.

---

 dlls/msi/msi.c |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 2d33487..646963d 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -486,10 +486,43 @@ UINT WINAPI MsiApplyMultiplePatchesW(LPCWSTR szPatchPackages,
 UINT WINAPI MsiDetermineApplicablePatchesA(LPCSTR szProductPackagePath,
         DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOA pPatchInfo)
 {
-    FIXME("(%s, %d, %p): stub!\n", debugstr_a(szProductPackagePath),
-          cPatchInfo, pPatchInfo);
+    UINT i, r;
+    WCHAR *package_path = NULL;
+    MSIPATCHSEQUENCEINFOW *psi;
 
-    return ERROR_CALL_NOT_IMPLEMENTED;
+    TRACE("(%s, %d, %p)\n", debugstr_a(szProductPackagePath), cPatchInfo, pPatchInfo);
+
+    if (szProductPackagePath && !(package_path = strdupAtoW( szProductPackagePath )))
+        return ERROR_OUTOFMEMORY;
+
+    psi = msi_alloc( cPatchInfo * sizeof(*psi) );
+    if (!psi)
+    {
+        msi_free( package_path );
+        return ERROR_OUTOFMEMORY;
+    }
+
+    for (i = 0; i < cPatchInfo; i++)
+    {
+        psi[i].szPatchData = strdupAtoW( pPatchInfo[i].szPatchData );
+        psi[i].ePatchDataType = pPatchInfo[i].ePatchDataType;
+    }
+
+    r = MsiDetermineApplicablePatchesW( package_path, cPatchInfo, psi );
+    if (r == ERROR_SUCCESS)
+    {
+        for (i = 0; i < cPatchInfo; i++)
+        {
+            pPatchInfo[i].dwOrder = psi[i].dwOrder;
+            pPatchInfo[i].uStatus = psi[i].uStatus;
+        }
+    }
+
+    msi_free( package_path );
+    for (i = 0; i < cPatchInfo; i++)
+        msi_free( (WCHAR *)psi[i].szPatchData );
+    msi_free( psi );
+    return r;
 }
 
 static UINT MSI_ApplicablePatchW( MSIPACKAGE *package, LPCWSTR patch )




More information about the wine-cvs mailing list