Commit ff0dc44f authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Return ERROR_INVALID_PARAMETER if szProduct is invalid.

parent 33c1e6ef
......@@ -567,6 +567,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
UINT r;
HKEY hkey;
LPWSTR val = NULL;
WCHAR squished_pc[GUID_SIZE];
TRACE("%s %s %p %p\n", debugstr_w(szProduct),
debugstr_w(szAttribute), szValue, pcchValueBuf);
......@@ -575,7 +576,10 @@ 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 || !szProduct[0] || !szAttribute)
if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szAttribute)
return ERROR_INVALID_PARAMETER;
if (!squash_guid(szProduct, squished_pc))
return ERROR_INVALID_PARAMETER;
/* check for special properties */
......
......@@ -2080,11 +2080,8 @@ static void test_MsiGetProductInfo(void)
sz = MAX_PATH;
lstrcpyA(buf, "apple");
r = MsiGetProductInfoA("garbage", INSTALLPROPERTY_HELPLINK, buf, &sz);
todo_wine
{
ok(r == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", r);
}
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %d\n", sz);
......@@ -2093,11 +2090,8 @@ static void test_MsiGetProductInfo(void)
lstrcpyA(buf, "apple");
r = MsiGetProductInfoA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D",
INSTALLPROPERTY_HELPLINK, buf, &sz);
todo_wine
{
ok(r == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", r);
}
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %d\n", sz);
......@@ -2116,11 +2110,8 @@ static void test_MsiGetProductInfo(void)
lstrcpyA(buf, "apple");
r = MsiGetProductInfoA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93",
INSTALLPROPERTY_HELPLINK, buf, &sz);
todo_wine
{
ok(r == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", r);
}
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %d\n", sz);
......
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