[USETUP] Check for invalid INF handles before doing operations.

This commit is contained in:
Hermès Bélusca-Maïto 2018-12-23 16:53:39 +01:00
parent 34e9290821
commit 9f1c8ac020
No known key found for this signature in database
GPG Key ID: 3B2539C65E7B93D0

View File

@ -43,6 +43,8 @@ WINAPI
SetupCloseInfFile(
IN HINF InfHandle)
{
if (InfHandle == INVALID_HANDLE_VALUE)
return;
InfCloseFile(InfHandle);
}
@ -58,6 +60,9 @@ SetupFindFirstLineW(
PINFCONTEXT pContext;
BOOL ret;
if (InfHandle == INVALID_HANDLE_VALUE)
return FALSE;
ret = InfFindFirstLine(InfHandle, Section, Key, &pContext);
if (!ret)
return FALSE;