James Hawkins : msi: Implement MsiSourceListGetInfoA.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 2 09:52:14 CDT 2007


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

Author: James Hawkins <truiken at gmail.com>
Date:   Fri Jun 29 14:12:38 2007 -0700

msi: Implement MsiSourceListGetInfoA.

---

 dlls/msi/msi.spec |    2 +-
 dlls/msi/source.c |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec
index c419ee7..6aa8957 100644
--- a/dlls/msi/msi.spec
+++ b/dlls/msi/msi.spec
@@ -258,7 +258,7 @@
 262 stub MsiSourceListForceResolutionExW
 263 stub MsiSourceListEnumSourcesA
 264 stub MsiSourceListEnumSourcesW
-265 stub MsiSourceListGetInfoA
+265 stdcall MsiSourceListGetInfoA(str str long long str ptr ptr)
 266 stub MsiSourceListGetInfoW
 267 stub MsiSourceListSetInfoA
 268 stub MsiSourceListSetInfoW
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 3b3e47f..49b7e4e 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -150,6 +150,58 @@ static UINT find_given_source(HKEY key, LPCWSTR szSource, media_info *ss)
 }
 
 /******************************************************************
+ *  MsiSourceListGetInfoA   (MSI.@)
+ */
+UINT WINAPI MsiSourceListGetInfoA( LPCSTR szProduct, LPCSTR szUserSid,
+                                   MSIINSTALLCONTEXT dwContext, DWORD dwOptions,
+                                   LPCSTR szProperty, LPSTR szValue,
+                                   LPDWORD pcchValue)
+{
+    UINT ret;
+    LPWSTR product = NULL;
+    LPWSTR usersid = NULL;
+    LPWSTR property = NULL;
+    LPWSTR value = NULL;
+    DWORD len = 0;
+
+    if (szValue && !pcchValue)
+        return ERROR_INVALID_PARAMETER;
+
+    if (szProduct) product = strdupAtoW(szProduct);
+    if (szUserSid) usersid = strdupAtoW(szUserSid);
+    if (szProperty) property = strdupAtoW(szProperty);
+
+    ret = MsiSourceListGetInfoW(product, usersid, dwContext, dwOptions,
+                                property, NULL, &len);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    value = msi_alloc(++len * sizeof(WCHAR));
+    if (!value)
+        return ERROR_OUTOFMEMORY;
+
+    ret = MsiSourceListGetInfoW(product, usersid, dwContext, dwOptions,
+                                property, value, &len);
+    if (ret != ERROR_SUCCESS)
+        goto done;
+
+    len = WideCharToMultiByte(CP_ACP, 0, value, -1, NULL, 0, NULL, NULL);
+    if (*pcchValue >= len)
+        WideCharToMultiByte(CP_ACP, 0, value, -1, szValue, len, NULL, NULL);
+    else if (szValue)
+        ret = ERROR_MORE_DATA;
+
+    *pcchValue = len - 1;
+
+done:
+    msi_free(product);
+    msi_free(usersid);
+    msi_free(property);
+    msi_free(value);
+    return ret;
+}
+
+/******************************************************************
  *  MsiSourceListGetInfoW   (MSI.@)
  */
 UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
@@ -173,7 +225,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
         FIXME("Unhandled options MSICODE_PATCH\n");
         return ERROR_FUNCTION_FAILED;
     }
-    
+
     if (szUserSid)
         FIXME("Unhandled UserSid %s\n",debugstr_w(szUserSid));
 




More information about the wine-cvs mailing list