diff --git a/dll/win32/setupapi/parser.c b/dll/win32/setupapi/parser.c index d5e83a481ac..6cdc3b83d2a 100644 --- a/dll/win32/setupapi/parser.c +++ b/dll/win32/setupapi/parser.c @@ -1235,11 +1235,18 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err TRACE("%s %s %lx %p\n", debugstr_w(name), debugstr_w(class), style, error); +#ifdef __REACTOS__ if (style & ~(INF_STYLE_OLDNT | INF_STYLE_WIN4)) { SetLastError(ERROR_INVALID_PARAMETER); return (HINF)INVALID_HANDLE_VALUE; } + if (!name) + { + SetLastError(ERROR_INVALID_PARAMETER); + return (HINF)INVALID_HANDLE_VALUE; + } +#endif // __REACTOS__ if (strchrW( name, '\\' ) || strchrW( name, '/' )) { @@ -2326,6 +2333,12 @@ SetupDiGetINFClassW( TRACE("%s %p %p %ld %p\n", debugstr_w(InfName), ClassGuid, ClassName, ClassNameSize, RequiredSize); + if (!InfName || !ClassGuid || !ClassName || ClassNameSize == 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + /* Open .inf file */ hInf = SetupOpenInfFileW(InfName, NULL, INF_STYLE_WIN4, NULL); if (hInf == INVALID_HANDLE_VALUE)