Commit 5f7b95da authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Validate the parameters of MsiEnumClients.

parent 64c75d1e
No related merge requests found
......@@ -1284,6 +1284,9 @@ UINT WINAPI MsiEnumClientsA(LPCSTR szComponent, DWORD index, LPSTR szProduct)
TRACE("%s %d %p\n", debugstr_a(szComponent), index, szProduct);
if ( !szProduct )
return ERROR_INVALID_PARAMETER;
if( szComponent )
{
szwComponent = strdupAtoW( szComponent );
......@@ -1311,7 +1314,7 @@ UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct)
TRACE("%s %d %p\n", debugstr_w(szComponent), index, szProduct);
if (!szComponent || !szProduct)
if (!szComponent || !*szComponent || !szProduct)
return ERROR_INVALID_PARAMETER;
r = MSIREG_OpenComponentsKey(szComponent,&hkeyComp,FALSE);
......
......@@ -1618,18 +1618,12 @@ static void test_MsiEnumClients(void)
/* empty szComponent */
product[0] = '\0';
r = MsiEnumClientsA("", 0, product);
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(product, ""), "Expected product to be unchanged, got %s\n", product);
/* NULL lpProductBuf */
r = MsiEnumClientsA(component, 0, NULL);
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);
/* all params correct, component missing */
product[0] = '\0';
......
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