msi: Return ERROR_BAD_CONFIGURATION if the SourceList key does not exist.
This commit is contained in:
parent
3e56d78f2e
commit
381b915b47
|
@ -63,12 +63,16 @@ static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, BOOL user, BOOL create)
|
||||||
rc = MSIREG_OpenProductsKey(szProduct, &rootkey, create);
|
rc = MSIREG_OpenProductsKey(szProduct, &rootkey, create);
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return ERROR_UNKNOWN_PRODUCT;
|
||||||
|
|
||||||
if (create)
|
if (create)
|
||||||
rc = RegCreateKeyW(rootkey, szSourceList, key);
|
rc = RegCreateKeyW(rootkey, szSourceList, key);
|
||||||
else
|
else
|
||||||
rc = RegOpenKeyW(rootkey,szSourceList, key);
|
{
|
||||||
|
rc = RegOpenKeyW(rootkey,szSourceList, key);
|
||||||
|
if (rc != ERROR_SUCCESS)
|
||||||
|
rc = ERROR_BAD_CONFIGURATION;
|
||||||
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +254,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
|
||||||
rc = OpenSourceKey(szProduct, &sourcekey, TRUE, FALSE);
|
rc = OpenSourceKey(szProduct, &sourcekey, TRUE, FALSE);
|
||||||
|
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
return ERROR_UNKNOWN_PRODUCT;
|
return rc;
|
||||||
|
|
||||||
if (strcmpW(szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW) == 0)
|
if (strcmpW(szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW) == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -199,10 +199,7 @@ static void test_MsiSourceListGetInfo(void)
|
||||||
/* user product key exists */
|
/* user product key exists */
|
||||||
r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
|
r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
|
||||||
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size);
|
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size);
|
||||||
todo_wine
|
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
|
||||||
{
|
|
||||||
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
|
|
||||||
}
|
|
||||||
|
|
||||||
res = RegCreateKeyA(userkey, "SourceList", &hkey);
|
res = RegCreateKeyA(userkey, "SourceList", &hkey);
|
||||||
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
|
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
|
||||||
|
|
Loading…
Reference in New Issue