setupapi: Improve parameter checking in SetupDiInstallClass.
This commit is contained in:
parent
f2c85adbc3
commit
8cacf12fe5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue