The SetupGetLineCount function returns the number of lines in a specified section of an INF file.
LONG SetupGetLineCount(
  HINF InfHandle, // handle to the INF file
  PCTSTR Section  // the section in which to count lines
);
 If InfHandle references multiple INF files that have been appended together using SetupOpenAppendInfFile, this function returns the sum of the lines in all the INF files containing the specified section. A return value of 0 specifies an empty section. If the section does not exist, the function returns -1.
To get extended error information, call GetLastError.
  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.