SetupGetInfInformationW 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 SetUpGetInfInformation function returns the SP_INF_INFORMATION structure for the specified INF file to a buffer.

Syntax

WINSETUPAPI BOOL SetupGetInfInformationW(
  [in]      LPCVOID             InfSpec,
  [in]      DWORD               SearchControl,
  [in, out] PSP_INF_INFORMATION ReturnBuffer,
  [in]      DWORD               ReturnBufferSize,
  [in, out] PDWORD              RequiredSize
);

Parameters

[in] InfSpec

Handle or a file name for an INF file, depending on the value of SearchControl.

[in] SearchControl

This parameter can be one of the following constants.

INFINFO_INF_SPEC_IS_HINF

InfSpec is an INF handle. A single INF handle may reference multiple INF files if they have been append-loaded together. If it does, the structure returned by this function contains multiple sets of information.

INFINFO_INF_NAME_IS_ABSOLUTE

The string specified for InfSpec is a full path. No further processing is performed on InfSpec.

Search the default locations for the INF file specified for InfSpec, which is assumed to be a filename only. The default locations are %windir%\inf, followed by %windir%\system32.

Same as INFINFO_DEFAULT_SEARCH, except the default locations are searched in reverse order.

Search for the INF in each of the directories listed in the DevicePath value entry under the following:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

[in, out] ReturnBuffer

If not NULL, points to a buffer in which this function returns the SP_INF_INFORMATION structure.

You can call the function one time to get the required buffer size, allocate the necessary memory, and then call the function a second time to retrieve the data. Using this technique, you can avoid errors due to an insufficient buffer size. For more information, see the Remarks section of this topic.

[in] ReturnBufferSize

Size of ReturnBuffer, in bytes.

[in, out] RequiredSize

If not NULL, points to a variable in which this function returns the required size, in bytes, for the buffer pointed to by ReturnBuffer.

If ReturnBuffer is specified and the size needed is larger than ReturnBufferSize, the function fails and a call to GetLastError returns ERROR_INSUFFICIENT_BUFFER.

Return value

If the function succeeds, the return value is a nonzero value.

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

If the INF file cannot be located, the function returns FALSE and a subsequent call to GetLastError returns ERROR_FILE_NOT_FOUND.

Remarks

If this function is called with a ReturnBuffer of NULL and a ReturnBufferSize of 0 (zero), the function puts the buffer size needed to hold the specified data into the variable pointed to by RequiredSize. If the function succeeds, the return value is a nonzero value. Otherwise, the return value is 0 (zero), and extended error information can be obtained by calling GetLastError.

Note

The setupapi.h header defines SetupGetInfInformation 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

See also

Functions

Overview

SetupQueryInfFileInformation

SetupQueryInfVersionInformation