The SetUpGetInfInformation function returns the SP_INF_INFORMATION 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
);
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
If the function succeeds, the return value is a non-zero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
If the INF file could not be located, the function returns FALSE and a subsequent call to GetLastError returns ERROR_FILE_NOT_FOUND.
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 a non-zero value. Otherwise, the return value is zero and extended error information can be obtained by calling GetLastError.
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.
Windows NT: Use version 4.0 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in setupapi.h.
Import Library: Link with setupapi.lib.
Overview, Functions, SetupQueryInfFileInformation, SetupQueryInfVersionInformation