Commit 9d389ec0 authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

msi: Implement MsiSourceListAddSource.

parent 7aa3be47
......@@ -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
......
......@@ -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( LPCWSTR szProduct, LPCWSTR szUserSid,
}
/******************************************************************
* 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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment