Commit 8cacf12f authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

setupapi: Improve parameter checking in SetupDiInstallClass.

parent f2c85adb
......@@ -3181,6 +3181,11 @@ BOOL WINAPI SetupDiInstallClassA(
UNICODE_STRING FileNameW;
BOOL Result;
if (!InfFileName)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (!RtlCreateUnicodeStringFromAsciiz(&FileNameW, InfFileName))
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
......@@ -3283,6 +3288,11 @@ BOOL WINAPI SetupDiInstallClassW(
FIXME("\n");
if (!InfFileName)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if ((Flags & DI_NOVCP) && (FileQueue == NULL || FileQueue == INVALID_HANDLE_VALUE))
{
SetLastError(ERROR_INVALID_PARAMETER);
......
......@@ -204,7 +204,6 @@ static void testInstallClass(void)
create_inf_file(tmpfile + 2);
ret = pSetupDiInstallClassA(NULL, NULL, 0, NULL);
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError());
ret = pSetupDiInstallClassA(NULL, NULL, DI_NOVCP, NULL);
......
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