msi: Add MsiSourceListAddSource

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Tue Feb 21 13:24:25 CST 2006


ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    Implement MsiSourceListAddSource
-------------- next part --------------
Subject: [PATCH] Add MsiSourceListAddSource

---

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

e20a9e4be4b2839313f8feda08d6498a68432911
diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec
index 7c0ea81..8dfade1 100644
--- a/dlls/msi/msi.spec
+++ b/dlls/msi/msi.spec
@@ -203,8 +203,8 @@
 207 stub MsiSetFeatureAttributesW
 208 stub MsiSourceListClearAllA
 209 stub MsiSourceListClearAllW
-210 stub MsiSourceListAddSourceA
-211 stub MsiSourceListAddSourceW
+210 stdcall MsiSourceListAddSourceA(str str long str)
+211 stdcall MsiSourceListAddSourceW(wstr wstr long wstr)
 212 stub MsiSourceListForceResolutionA
 213 stub MsiSourceListForceResolutionW
 214 stub MsiIsProductElevatedA
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 4f67e18..e0ed472 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -37,6 +37,7 @@
 #include "winuser.h"
 #include "wine/unicode.h"
 #include "action.h"
+#include "sddl.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
@@ -397,6 +398,61 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWS
 }
 
 /******************************************************************
+ *  MsiSourceListAddSourceW (MSI.@)
+ */
+UINT WINAPI MsiSourceListAddSourceW( LPCWSTR szProduct, LPCWSTR szUserName,
+        DWORD dwReserved, LPCWSTR szSource)
+{
+    INT ret;
+    LPWSTR sidstr = NULL;
+    DWORD sidsize = 0;
+
+    TRACE("%s %s %s\n", debugstr_w(szProduct), debugstr_w(szUserName), debugstr_w(szSource));
+
+    if (LookupAccountNameW(NULL, szUserName, NULL, &sidsize, NULL, NULL, NULL))
+    {
+        PSID psid = msi_alloc(sidsize);
+
+        if (LookupAccountNameW(NULL, szUserName, psid, &sidsize, NULL, NULL, NULL))
+            ConvertSidToStringSidW(psid, &sidstr);
+
+        msi_free(psid);
+    }
+
+    ret = MsiSourceListAddSourceExW(szProduct, sidstr, 
+        MSIINSTALLCONTEXT_USERMANAGED, MSISOURCETYPE_NETWORK, szSource, 0);
+
+    if (sidstr)
+        LocalFree(sidstr);
+
+    return ret;
+}
+
+/******************************************************************
+ *  MsiSourceListAddSourceA (MSI.@)
+ */
+UINT WINAPI MsiSourceListAddSourceA( LPCSTR szProduct, LPCSTR szUserName,
+        DWORD dwReserved, LPCSTR szSource)
+{
+    INT ret;
+    LPWSTR szwproduct;
+    LPWSTR szwusername;
+    LPWSTR szwsource;
+
+    szwproduct = strdupAtoW( szProduct );
+    szwusername = strdupAtoW( szUserName );
+    szwsource = strdupAtoW( szSource );
+
+    ret = MsiSourceListAddSourceW(szwproduct, szwusername, 0, szwsource);
+
+    msi_free(szwproduct);
+    msi_free(szwusername);
+    msi_free(szwsource);
+
+    return ret;
+}
+
+/******************************************************************
  *  MsiSourceListAddSourceExW (MSI.@)
  */
 UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
-- 
1.0.6


More information about the wine-patches mailing list