Commit d800a082 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

msi: Return appropriate values for empty MsiProductInfo parameters.

parent 68bfb397
......@@ -444,7 +444,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
* FIXME: Values seem scattered/duplicated in the registry. Is there a system?
*/
if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szAttribute)
if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szProduct[0] || !szAttribute)
return ERROR_INVALID_PARAMETER;
/* check for special properties */
......@@ -505,6 +505,10 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
RegCloseKey(hkey);
}
else if (!szAttribute[0])
{
return ERROR_UNKNOWN_PROPERTY;
}
else
{
static const WCHAR szDisplayVersion[] = {
......
......@@ -131,7 +131,7 @@ static void test_null(void)
ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
r = MsiGetProductInfoA("", "", NULL, NULL);
todo_wine ok ( r == ERROR_INVALID_PARAMETER, "wrong error %d\n", r);
ok ( r == ERROR_INVALID_PARAMETER, "wrong error %d\n", r);
if (lpData)
{
......@@ -157,7 +157,7 @@ static void test_null(void)
ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
r = MsiGetProductInfoA("{F1C3AF50-8B56-4A69-A00C-00773FE42F30}", "", NULL, NULL);
todo_wine ok ( r == ERROR_UNKNOWN_PROPERTY, "wrong error %d\n", r);
ok ( r == ERROR_UNKNOWN_PROPERTY, "wrong error %d\n", r);
r = RegCloseKey(hkey);
ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
......
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