Juan Lang : setupapi: Improve parameter checking in SetupDiInstallClass.
Module: wine Branch: master Commit: 8cacf12fe5dff8a35ed6555e3ca29fb9489a33d2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8cacf12fe5dff8a35ed6555e3c... Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 12 08:24:04 2007 -0700 setupapi: Improve parameter checking in SetupDiInstallClass. --- dlls/setupapi/devinst.c | 10 ++++++++++ dlls/setupapi/tests/devinst.c | 1 - 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 9ad0c03..645211a 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -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); diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index f1f44af..009b94a 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -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);
participants (1)
-
Alexandre Julliard