diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 643f9cceb7d..93a4e0f4e17 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -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 */ diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index d64f35e91d0..71461a4a077 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -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(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(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(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);