James Hawkins : msi: Forward MsiSourceListEnumSourcesA to a stub implementation of MsiSourceListEnumSourcesW .

Alexandre Julliard julliard at winehq.org
Wed Feb 20 06:46:45 CST 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Tue Feb 19 20:53:44 2008 -0600

msi: Forward MsiSourceListEnumSourcesA to a stub implementation of MsiSourceListEnumSourcesW.

---

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

diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec
index 9329e7f..2810b82 100644
--- a/dlls/msi/msi.spec
+++ b/dlls/msi/msi.spec
@@ -257,7 +257,7 @@
 261 stub MsiSourceListForceResolutionExA
 262 stub MsiSourceListForceResolutionExW
 263 stdcall MsiSourceListEnumSourcesA(str str long long long ptr ptr)
-264 stub MsiSourceListEnumSourcesW
+264 stdcall MsiSourceListEnumSourcesW(wstr wstr long long long ptr ptr)
 265 stdcall MsiSourceListGetInfoA(str str long long str ptr ptr)
 266 stdcall MsiSourceListGetInfoW(wstr wstr long long wstr ptr ptr)
 267 stdcall MsiSourceListSetInfoA(str str long long str str)
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 1d9a28b..5537122 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -148,8 +148,62 @@ UINT WINAPI MsiSourceListEnumSourcesA(LPCSTR szProductCodeOrPatch, LPCSTR szUser
                                       DWORD dwOptions, DWORD dwIndex,
                                       LPSTR szSource, LPDWORD pcchSource)
 {
-    FIXME("(%s, %s, %d, %d, %d, %p, %p): stub!\n", szProductCodeOrPatch, szUserSid,
-          dwContext, dwOptions, dwIndex, szSource, pcchSource);
+    LPWSTR product = NULL;
+    LPWSTR usersid = NULL;
+    LPWSTR source = NULL;
+    DWORD len = 0;
+    UINT r;
+
+    TRACE("(%s, %s, %d, %d, %d, %p, %p)\n", debugstr_a(szProductCodeOrPatch),
+          debugstr_a(szUserSid), dwContext, dwOptions, dwIndex, szSource, pcchSource);
+
+    if (szSource && !pcchSource)
+        return ERROR_INVALID_PARAMETER;
+
+    if (szProductCodeOrPatch) product = strdupAtoW(szProductCodeOrPatch);
+    if (szUserSid) usersid = strdupAtoW(szUserSid);
+
+    r = MsiSourceListEnumSourcesW(product, usersid, dwContext, dwOptions,
+                                  dwIndex, NULL, &len);
+    if (r != ERROR_SUCCESS)
+        goto done;
+
+    source = msi_alloc(++len * sizeof(WCHAR));
+    if (!source)
+        return ERROR_OUTOFMEMORY;
+
+    *source = '\0';
+    r = MsiSourceListEnumSourcesW(product, usersid, dwContext, dwOptions,
+                                  dwIndex, source, &len);
+    if (r != ERROR_SUCCESS)
+        goto done;
+
+    len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
+    if (*pcchSource >= len)
+        WideCharToMultiByte(CP_ACP, 0, source, -1, szSource, len, NULL, NULL);
+    else if (szSource)
+        r = ERROR_MORE_DATA;
+
+    *pcchSource = len - 1;
+
+done:
+    msi_free(product);
+    msi_free(usersid);
+    msi_free(source);
+
+    return r;
+}
+
+/******************************************************************
+ *  MsiSourceListEnumSourcesA   (MSI.@)
+ */
+UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUserSid,
+                                      MSIINSTALLCONTEXT dwContext,
+                                      DWORD dwOptions, DWORD dwIndex,
+                                      LPWSTR szSource, LPDWORD pcchSource)
+{
+    FIXME("(%s, %s, %d, %d, %d, %p, %p): stub!\n", debugstr_w(szProductCodeOrPatch),
+          debugstr_w(szUserSid), dwContext, dwOptions, dwIndex, szSource, pcchSource);
     return ERROR_CALL_NOT_IMPLEMENTED;
 }
 




More information about the wine-cvs mailing list