SetupOpenAppendInfFile

The SetupOpenAppendInfFile function appends the information in an INF file to an INF file previously opened by SetupOpenInfFile.

BOOL SetupOpenAppendInfFile(
  PCTSTR FileName, // optional, name of the file to append
  HINF InfHandle,  // handle of the file to append to
  PUINT ErrorLine  // optional, receives error information
);
 

Parameters

FileName
If not NULL, FileName points to a null-terminated string containing the name (and optionally the 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. If FileName is NULL, the INF filename is retrieved from the LayoutFile value of the Version section in the existing INF file. The same search logic is applied to the filename retrieved from the LayoutFile key.
InfHandle
Existing INF handle to which this INF file will be appended.
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 does not return ERROR_NOT_ENOUGH_MEMORY. If an out-of-memory condition does occur, ErrorLine may be 0.

Return Values

If the function succeeds, the return value is a non-zero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

If FileName was not specified and there was no LayoutFile value in the Version section of the existing INF File, GetLastError returns ERROR_INVALID_DATA.

Remarks

This function can only be called for Windows 95- or Windows NT 4.0-style INF files. Otherwise, the function returns FALSE and GetLastError will return ERROR_INVALID_PARAMETER. The main purpose of this function is to combine an INF file with the source file location information contained in the file specified in the LayoutFile entry of the Version section (typically, LAYOUT.INF).

QuickInfo

  Windows NT: Use version 4.0 and later.
  Windows: Use Windows 95 and later.
  Windows CE: Unsupported.
  Header: Declared in setupapi.h.
  Import Library: Link with setupapi.lib.

See Also

Overview, Functions, SetupOpenInfFile, SetupCloseInfFile