SetupQueryInfFileInformation  743HAL 

[New - Windows NT]

The SetupQueryInfFileInformation function returns an INF filename from an SP_INF_INFORMATION structure to a caller-supplied buffer.

BOOL SetupQueryInfFileInformation(

    PSP_INF_INFORMATION InfInformation,

// structure that contains the INF info

    UINT InfIndex,

// index of the file to investigate

    PTSTR ReturnBuffer,

// optional, receives the information

    DWORD ReturnBufferSize,

// size of the supplied buffer

    PDWORD Required Size

// optional, buffer size needed

   );

 

 

Parameters

InfInformation

Points to an SP_INF_INFORMATION_LVXGE structure returned from a call to the SetupGetInfInformationLCA0LF function.

InfIndex

The index of the constituent INF filename to retrieve. This index can be in the range [0, InfInformation.InfCount). Meaning that the values zero through, but not including, InfInformation.InfCount are valid.

ReturnBuffer

If not NULL, ReturnBuffer supplies a pointer to a caller-supplied buffer in which this function returns the full INF filename.

ReturnBufferSize

Specifies the size of the buffer pointed to by the ReturnBuffer parameter.

RequiredSize

If not NULL, points to a caller-supplied variable in which this function returns the required size for the buffer pointed to by the ReturnBuffer parameter. If ReturnBuffer is specified and the actual size 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.

Remarks

For the Unicode version of this function, the buffer sizes PathBufferSize, and PathRequiredSize 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

SetupGetInfInformation, SetupQueryInfVersionInformation