SetupGetInflnformation  XQ5ZY9 

[New - Windows NT]

The SetUpGetInfInformation function returns the SP_INF_INFORMATION_LVXGE structure for the specified INF file to a caller-supplied buffer.

BOOL SetupGetInflnformation(

    LPCVOID InfSpec,

// handle or filename of the INF file

    DWORD SearchControl,

// how to search for the INF file

    PSP_INF_INFORMATION Return Buffer,

// optional, receives the INF info

    DWORD ReturnBufferSize,

// size of the supplied buffer

    PDWORD RequiredSize

// optional, buffer size needed

   );

 

 

Parameters

InfSpec

A handle or a filename for an INF file, depending on the value of SearchControl.

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.

INFINFO_DEFAULT_SEARCH

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.

INFINFO_REVERSE_DEFAULT_SEARCH

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

INFINFO_INF_PATH_LIST_SEARCH

Search for the INF in each of the directories listed in the DevicePath value entry under:

  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

 

ReturnBuffer

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

ReturnBufferSize

Size of the ReturnBuffer.

RequiredSize

If not NULL, points to a caller-supplied variable in which this function returns the required size 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 GetLastError11C2VS7 returns ERROR_INSUFFICIENT_BUFFER.

 

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To get extended error information, call GetLastError11C2VS7.

If the INF file could not be located, the function returns FALSE and a subsequent call to GetLastError11C2VS7 returns ERROR_FILE_NOT_FOUND.

Remarks

For the Unicode version of this function, the buffer sizes ReturnBufferSize and RequiredSize are specified in number of characters. This number includes the null terminator. For the ANSI version of this function, the sizes are specified in number of bytes.

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

Thus, you can call the function once 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.

See Also

SetupQueryInfFileInformation, SetupQueryInfVersionInformation