SetupOpenAppendInfFileA function (setupapi.h)
[This function is available for use in the operating systems indicated in the Requirements section. It may be altered or unavailable in subsequent versions. SetupAPI should no longer be used for installing applications. Instead, use the Windows Installer for developing application installers. SetupAPI continues to be used for installing device drivers.]
The SetupOpenAppendInfFile function appends the information in an INF file to an INF file previously opened by SetupOpenInfFile.
Syntax
WINSETUPAPI BOOL SetupOpenAppendInfFileA(
[in] PCSTR FileName,
[in] HINF InfHandle,
[in, out] PUINT ErrorLine
);
Parameters
[in] 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.
[in] InfHandle
Existing INF handle to which this INF file will be appended.
[in, out] ErrorLine
Optional pointer to a 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 value
If the function succeeds, the return value is a nonzero 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 requires a Windows INF file. Some older INF file formats may not be supported. In this case, 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).
The ERROR_WRONG_INF_STYLE may also be returned by SetupOpenAppendInfFile if the INF file uses an older format.
Note
The setupapi.h header defines SetupOpenAppendInfFile as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | setupapi.h |
Library | Setupapi.lib |
DLL | Setupapi.dll |