msi: Enumerate the current user's patches if szUserSid is NULL.

This commit is contained in:
James Hawkins 2009-03-22 14:30:03 -07:00 committed by Alexandre Julliard
parent 3956bb5b0e
commit f7c615b188
1 changed files with 8 additions and 0 deletions

View File

@ -1883,8 +1883,15 @@ static UINT msi_enum_patches(LPCWSTR szProductCode, LPCWSTR szUserSid,
MSIINSTALLCONTEXT *pdwTargetProductContext, LPWSTR szTargetUserSid, MSIINSTALLCONTEXT *pdwTargetProductContext, LPWSTR szTargetUserSid,
LPDWORD pcchTargetUserSid, LPWSTR *szTransforms) LPDWORD pcchTargetUserSid, LPWSTR *szTransforms)
{ {
LPWSTR usersid = NULL;
UINT r = ERROR_INVALID_PARAMETER; UINT r = ERROR_INVALID_PARAMETER;
if (!szUserSid)
{
get_user_sid(&usersid);
szUserSid = usersid;
}
if (dwContext & MSIINSTALLCONTEXT_USERMANAGED) if (dwContext & MSIINSTALLCONTEXT_USERMANAGED)
{ {
r = msi_check_product_patches(szProductCode, szUserSid, r = msi_check_product_patches(szProductCode, szUserSid,
@ -1922,6 +1929,7 @@ static UINT msi_enum_patches(LPCWSTR szProductCode, LPCWSTR szUserSid,
} }
done: done:
LocalFree(usersid);
return r; return r;
} }