SetupOpenInfFile
[New
- Windows NT]
The SetupOpenInfFile
function opens an INF file and returns a handle to it.
HINF SetupOpenInfFile(
PCTSTR FileName, |
// name of the
INF to open |
PCTSTR InfClass, |
// optional, the
class of the INF file |
DWORD InfStyle, |
// specifies the
style of the INF file |
PUINT ErrorLine |
// optional,
receives error information |
); |
|
Parameters
FileName
Points to a
null-terminated string containing the name (and optional path) of the INF file
to be opened. If the filename does not contain path separator characters, it is
searched for, first in the %windir%\inf directory, and then in
the %windir%\system32 directory. If the filename contains path separator
characters, it is assumed to be a full path specification and no further
processing is performed on it.
InfClass
An optional
parameter that points to a null-terminated string containing the class of INF
file desired. For legacy INF files, this string must match the type specified
in the OptionType value of the Identification section in the INF file
(for example, OptionType=NetAdapter). For Windows 95- or Windows NT 4.0-style
INF files, this string must match the Class value of the Version
InfStyle
Specifies the
style of INF file to open. May be a combination of the following flags:
INF_STYLE_OLDNT
Windows NT
3.x script-based INF files.
INF_STYLE_WIN4
Windows 95-
or Windows NT 4.0-style INF files.
ErrorLine
An optional
parameter that points to a caller-supplied variable to which this function
returns the (1-based) line number where an error occurred during loading of the
INF file. This value is generally reliable only if GetLastError
Return Values
The function
returns a handle to the opened INF file if it is successful. Otherwise, the
return value is INVALID_HANDLE_VALUE. Extended error information can be
retrieved by a call to GetLastError
Remarks
If the load
fails because the INF file type does not match InfClass, the function
returns FALSE and a call to GetLastError
If multiple
INF file styles are specified, the style of the INF file opened can be
determined by calling the SetupGetInfInformation
Since there
may be more than one class GUID with the same class name, callers interested in
INF files of a particular class (that is, a particular class GUID) should
retrieve the ClassGUID value from the INF file by calling SetupQueryInfVersionInformation
See Also