SetupFindFirstLineA 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 SetupFindFirstLine function locates a line in the specified section of an INF file. If the Key parameter is NULL, SetupFindFirstLine returns the first line of the section.

Syntax

WINSETUPAPI BOOL SetupFindFirstLineA(
  [in]      HINF        InfHandle,
  [in]      PCSTR       Section,
  [in]      PCSTR       Key,
  [in, out] PINFCONTEXT Context
);

Parameters

[in] InfHandle

Handle to the INF file to query.

[in] Section

Pointer to a null-terminated string specifying the section of the INF files to search in.

[in] Key

Optional pointer to a null-terminated string specifying the key to search for within the section. The null-terminated string should not exceed the size of the destination buffer. This parameter can be NULL. If Key is NULL, the first line in the section is returned.

[in, out] Context

Pointer to a structure that receives the context information used internally by the INF handle. Applications must not overwrite values in this structure.

Return value

If the function could not find a line, the return value is zero. To get extended error information, call GetLastError.

Remarks

If the InfHandle parameter references multiple INF files that have been appended together using SetupOpenAppendInfFile, the SetupFindFirstLine function searches across the specified section in all of the files referenced by the specified HINF.

Note

The setupapi.h header defines SetupFindFirstLine 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
API set ext-ms-win-setupapi-inf-l1-1-0 (introduced in Windows 8)

See also

Functions

Overview

SetupFindNextLine

SetupFindNextMatchLine

SetupGetLineByIndex