windows-nt/Source/XPSP1/NT/base/ntsetup/legacy/dll/infload.c

92 lines
1.8 KiB
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
#include "precomp.h"
#pragma hdrstop
/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
infload.c
Abstract:
Top-level routines to load and process an INF file.
Author:
Ted Miller (tedm) 10-Spetember-1991
--*/
GRC
LoadINFFile(
LPSTR FileName,
PUCHAR *PreparsedFile,
UINT *PreparsedSize,
PINFLINE *LineArray,
UINT *LineArrayCount
)
{
LPBYTE PreprocessedFile;
UINT PreprocessedSize;
GRC rc;
rc = PreprocessINFFile(FileName,&PreprocessedFile,&PreprocessedSize);
if(rc == grcOkay) {
rc = PreparseINFFile(PreprocessedFile,
PreprocessedSize,
PreparsedFile,
PreparsedSize,
LineArray,
LineArrayCount
);
SFree(PreprocessedFile);
}
return(rc);
}
GRC
APIENTRY
GrcOpenInf(
SZ FileName,
PVOID pInfTempInfo
)
{
PPARSED_INF pParsedInf = ((PINFTEMPINFO)pInfTempInfo)->pParsedInf;
pParsedInf->MasterFile = NULL;
pParsedInf->MasterFileSize = 0;
pParsedInf->MasterLineArray = NULL;
pParsedInf->MasterLineCount = 0;
return(LoadINFFile(FileName,
&(pParsedInf->MasterFile),
&(pParsedInf->MasterFileSize),
&(pParsedInf->MasterLineArray),
&(pParsedInf->MasterLineCount)
)
);
}
BOOL
InfIsOpen(
VOID
)
{
return(! ( !pLocalInfTempInfo()->pParsedInf->MasterLineArray
&& !pLocalInfTempInfo()->pParsedInf->MasterLineCount
&& !pLocalInfTempInfo()->pParsedInf->MasterFile
&& !pLocalInfTempInfo()->pParsedInf->MasterFileSize
)
);
}