msi: Implement MsiSourceListAddSource.

oldstable
Ulrich Czekalla 2006-02-21 14:24:25 -05:00 committed by Alexandre Julliard
parent 7aa3be4741
commit 9d389ec03f
2 changed files with 58 additions and 2 deletions

View File

@ -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

View File

@ -37,6 +37,7 @@
#include "winuser.h"
#include "wine/unicode.h"
#include "action.h"
#include "sddl.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi);
@ -396,6 +397,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.@)
*/