unit SETUPAPI2;

interface

uses
  Windows,Messages,CommCtrl;

const
//
// Define maximum string length constants as specified by
// Windows 95.
//
  LINE_LEN = 256; // Win95-compatible maximum for displayable
/// strings coming from a device INF.
  MAX_INF_STRING_LENGTH = 4096; // Actual maximum size of an INF string (including
/// string substitutions).
  MAX_TITLE_LEN = 60;
  MAX_INSTRUCTION_LEN = 256;
  MAX_LABEL_LEN = 30;
  MAX_SERVICE_NAME_LEN = 256;

///
/// Define maximum length of a machine name in the format expected by ConfigMgr32
/// CM_Connect_Machine (i.e., "\\MachineName\0").
///
  SP_MAX_MACHINENAME_LENGTH = (MAX_COMPUTERNAME_LENGTH + 3);

///
/// Define type for reference to loaded inf file
///
type
  PVOID = Pointer;
//  LPCVOID = Pointer;
  HINF = PVOID;
  PCSTR = LPCSTR;
  PSTR = LPSTR;
  PWSTR = LPWSTR;
  PCWSTR = LPCWSTR;
  USHORT = WORD;

const
  ANYSIZE_ARRAY = 1; // ntdef.h
  APPLICATION_ERROR_MASK  =     $20000000;
  ERROR_SEVERITY_SUCCESS  =     $00000000;
  ERROR_SEVERITY_INFORMATIONAL =$40000000;
  ERROR_SEVERITY_WARNING       =$80000000;
  ERROR_SEVERITY_ERROR         =$C0000000;
///
/// Inf context structure. Applications must not interpret or
/// overwrite values in these structures.
///
type
  {$EXTERNALSYM _INFCONTEXT}
  _INFCONTEXT = packed record
    Inf: PVOID;
    CurrentInf: PVOID;
    Section: Word;
    Line: Word;
  end;
  TINFCONTEXT = _INFCONTEXT;
  PINFCONTEXT = ^_INFCONTEXT;

///
/// Inf file information structure.
///
type
  {$EXTERNALSYM _SP_INF_INFORMATION}
  _SP_INF_INFORMATION = packed record
    InfStyle: LongInt;
    InfCount: LongInt;
    VersionData: Array[0..ANYSIZE_ARRAY-1] of BYTE;
  end;
  TSP_INF_INFORMATION = _SP_INF_INFORMATION;
  PSP_INF_INFORMATION = ^_SP_INF_INFORMATION;

///
/// SP_INF_INFORMATION.InfStyle values
///
const
  INF_STYLE_NONE = 0;	 // unrecognized or non-existent
  INF_STYLE_OLDNT = 1;	 // winnt 3.x
  INF_STYLE_WIN4 = 2;	 // Win95

///
/// Target directory specs.
///
const
  DIRID_ABSOLUTE = -1; // real 32-bit -1
  DIRID_ABSOLUTE_16BIT = $ffff; // 16-bit -1 for compat w/setupx
  DIRID_NULL = 0;
  DIRID_SRCPATH = 1;
  DIRID_WINDOWS = 10;
  DIRID_SYSTEM = 11; // system32
  DIRID_DRIVERS = 12;
  DIRID_IOSUBSYS = DIRID_DRIVERS;
  DIRID_INF = 17;
  DIRID_HELP = 18;
  DIRID_FONTS = 20;
  DIRID_VIEWERS = 21;
  DIRID_COLOR = 23;
  DIRID_APPS = 24;
  DIRID_SHARED = 25;
  DIRID_BOOT = 30;

  DIRID_SYSTEM16 = 50;
  DIRID_SPOOL = 51;
  DIRID_SPOOLDRIVERS = 52;
  DIRID_USERPROFILE = 53;
  DIRID_LOADER = 54;
  DIRID_PRINTPROCESSOR = 55;

  DIRID_DEFAULT = DIRID_SYSTEM;

/// 
/// First user-definable dirid. See SetupSetDirectoryId(). 
/// 
const
  DIRID_USER = $8000;

/// 
/// Setup callback notification routine type 
/// 
type
  PSP_FILE_CALLBACK_A = function(  CONTEXT: PVOID; NOTIFICATION: UINT;PARAM1: UINT;PARAM2:UINT ):UINT; stdcall;
  PSP_FILE_CALLBACK_W = function(  CONTEXT: PVOID; NOTIFICATION: UINT;PARAM1: UINT;PARAM2:UINT ):UINT; stdcall;
  PSP_FILE_CALLBACK = PSP_FILE_CALLBACK_A;


/// 
/// Operation/queue start/end notification. These are ordinal values. 
/// 
const
  SPFILENOTIFY_STARTQUEUE	 = $00000001;
  SPFILENOTIFY_ENDQUEUE		 = $00000002;
  SPFILENOTIFY_STARTSUBQUEUE = $00000003;
  SPFILENOTIFY_ENDSUBQUEUE	 = $00000004;
  SPFILENOTIFY_STARTDELETE	 = $00000005;
  SPFILENOTIFY_ENDDELETE	 = $00000006;
  SPFILENOTIFY_DELETEERROR	 = $00000007;
  SPFILENOTIFY_STARTRENAME	 = $00000008;
  SPFILENOTIFY_ENDRENAME	 = $00000009;
  SPFILENOTIFY_RENAMEERROR	 = $0000000a;
  SPFILENOTIFY_STARTCOPY	 = $0000000b;
  SPFILENOTIFY_ENDCOPY		 = $0000000c;
  SPFILENOTIFY_COPYERROR	 = $0000000d;
  SPFILENOTIFY_NEEDMEDIA	 = $0000000e;
  SPFILENOTIFY_QUEUESCAN	 = $0000000;

/// 
/// These are used with SetupIterateCabinet(). 
/// 
  SPFILENOTIFY_CABINETINFO	 = $00000010;
  SPFILENOTIFY_FILEINCABINET = $00000011;
  SPFILENOTIFY_NEEDNEWCABINET = $00000012;
  SPFILENOTIFY_FILEEXTRACTED = $00000013;
  SPFILENOTIFY_FILEOPDELAYED = $00000014;

/// 
/// Copy notification. These are bit flags that may be combined. 
/// 
  SPFILENOTIFY_LANGMISMATCH = $00010000;
  SPFILENOTIFY_TARGETEXISTS = $00020000;
  SPFILENOTIFY_TARGETNEWER = $00040000;

/// 
/// File operation codes and callback outcomes. 
/// 
const
  FILEOP_COPY = 0;
  FILEOP_RENAME = 1;
  FILEOP_DELETE = 2;

  FILEOP_ABORT = 0;
  FILEOP_DOIT = 1;
  FILEOP_SKIP = 2;
  FILEOP_RETRY = FILEOP_DOIT;
  FILEOP_NEWPATH = 4;

/// 
/// Flags in inf copy sections 
/// 
const
  COPYFLG_WARN_IF_SKIP = $00000001; // warn if user tries to skip file
  COPYFLG_NOSKIP = $00000002; // disallow skipping this file
  COPYFLG_NOVERSIONCHECK = $00000004; // ignore versions and overwrite target
  COPYFLG_FORCE_FILE_IN_USE = $00000008; // force file-in-use behavior
  COPYFLG_NO_OVERWRITE = $00000010; // do not copy if file exists on target
  COPYFLG_NO_VERSION_DIALOG = $00000020; // do not copy if target is newer
  COPYFLG_OVERWRITE_OLDER_ONLY = $00000040; // leave target alone if version same as source
  COPYFLG_REPLACEONLY = $00000400; // copy only if file exists on target

/// 
/// Flags in inf delete sections
/// New flags go in high word 
/// 
const
  DELFLG_IN_USE = $00000001; // queue in-use file for delete
  DELFLG_IN_USE1 = $00010000; // high-word version of DELFLG_IN_USE

/// 
/// Source and file paths. Used when notifying queue callback 
/// of SPFILENOTIFY_STARTxxx, SPFILENOTIFY_ENDxxx, and SPFILENOTIFY_xxxERROR. 
/// 
type
  {$EXTERNALSYM _FILEPATHS_A}
  _FILEPATHS_A = packed record
    Target: PCSTR;
    Source: PCSTR;
    Win32Error: Word;
    Flags: LongInt;
  end;
  TFILEPATHS_A = _FILEPATHS_A;
  PFILEPATHS_A = ^_FILEPATHS_A;

  {$EXTERNALSYM _FILEPATHS_W}
  _FILEPATHS_W = packed record
    Target: PCWSTR;
    Source: PCWSTR;
    Win32Error: Word;
    Flags: LongInt;
  end;
  TFILEPATHS_W = _FILEPATHS_W;
  PFILEPATHS_W = ^_FILEPATHS_W;
  TFILEPATHS = TFILEPATHS_A;
  PFILEPATHS = PFILEPATHS_A;


/// 
/// Structure used with SPFILENOTIFY_NEEDMEDIA 
/// 
type
  {$EXTERNALSYM _SOURCE_MEDIA_A}
  _SOURCE_MEDIA_A = packed record
    Reserved: PCSTR;
    Tagfile: PCSTR;
    Description: PCSTR;
/// 
/// Pathname part and filename part of source file 
/// that caused us to need the media. 
/// 
    SourcePath: PCSTR;
    SourceFile: PCSTR;
    Flags: LongInt;
  end;
  TSOURCE_MEDIA_A = _SOURCE_MEDIA_A;
  PSOURCE_MEDIA_A = ^_SOURCE_MEDIA_A;

type
  {$EXTERNALSYM _SOURCE_MEDIA_W}
  _SOURCE_MEDIA_W = packed record
    Reserved: PCWSTR;
    Tagfile: PCWSTR;
    Description: PCWSTR;
/// 
/// Pathname part and filename part of source file 
/// that caused us to need the media. 
/// 
    SourcePath: PCWSTR;
    SourceFile: PCWSTR;
    Flags: LongInt;
  end;
  TSOURCE_MEDIA_W = _SOURCE_MEDIA_W;
  PSOURCE_MEDIA_W = ^_SOURCE_MEDIA_W;
  TSOURCE_MEDIA = TSOURCE_MEDIA_A;
  PSOURCE_MEDIA = PSOURCE_MEDIA_A;

/// 
/// Structure used with SPFILENOTIFY_CABINETINFO and 
/// SPFILENOTIFY_NEEDNEWCABINET 
/// 
type
  {$EXTERNALSYM _CABINET_INFO_A}
  _CABINET_INFO_A = packed record
    CabinetPath: PCSTR;
    CabinetFile: PCSTR;
    DiskName: PCSTR;
    SetId: USHORT;
    CabinetNumber: USHORT;
  end;
  TCABINET_INFO_A = _CABINET_INFO_A;
  PCABINET_INFO_A = ^_CABINET_INFO_A;

  {$EXTERNALSYM _CABINET_INFO_W}
  _CABINET_INFO_W = packed record
    CabinetPath: PCWSTR;
    CabinetFile: PCWSTR;
    DiskName: PCWSTR;
    SetId: USHORT;
    CabinetNumber: USHORT;
  end;
  TCABINET_INFO_W = _CABINET_INFO_W;
  PCABINET_INFO_W = ^_CABINET_INFO_W;
  TCABINET_INFO = TCABINET_INFO_A;
  PCABINET_INFO = PCABINET_INFO_A;

/// 
/// Structure used with SPFILENOTIFY_FILEINCABINET 
/// 
type
  {$EXTERNALSYM _FILE_IN_CABINET_INFO_A}
  _FILE_IN_CABINET_INFO_A = packed record
    NameInCabinet: PCSTR;
    FileSize: LongInt;
    Win32Error: LongInt;
    DosDate: Word;
    DosTime: Word;
    DosAttribs: Word;
    FullTargetName: Array[0..MAX_PATH-1] of Char;
  end;
  TFILE_IN_CABINET_INFO_A = _FILE_IN_CABINET_INFO_A;
  PFILE_IN_CABINET_INFO_A = ^_FILE_IN_CABINET_INFO_A;

  {$EXTERNALSYM _FILE_IN_CABINET_INFO_W}
  _FILE_IN_CABINET_INFO_W = packed record
    NameInCabinet: PCWSTR;
    FileSize: LongInt;
    Win32Error: LongInt;
    DosDate: Word;
    DosTime: Word;
    DosAttribs: Word;
    FullTargetName: Array[0..MAX_PATH-1] of WCHAR;
  end;
  TFILE_IN_CABINET_INFO_W = _FILE_IN_CABINET_INFO_W;
  PFILE_IN_CABINET_INFO_W = ^_FILE_IN_CABINET_INFO_W;
  TFILE_IN_CABINET_INFO = TFILE_IN_CABINET_INFO_A;
  PFILE_IN_CABINET_INFO = PFILE_IN_CABINET_INFO_A;


/// 
/// Define type for setup file queue 
/// 
type
  HSPFILEQ = PVOID;

/// 
/// Define type for setup disk space list 
/// 
type
  HDSKSPC = PVOID;

/// 
/// Define type for reference to device information set 
/// 
type
  HDEVINFO = PVOID;

/// 
/// Device information structure (references a device instance 
/// that is a member of a device information set) 
/// 
type
  {$EXTERNALSYM _SP_DEVINFO_DATA}
  _SP_DEVINFO_DATA = packed record
    cbSize: LongInt;
    ClassGuid: TGUID;
    DevInst: LongInt;
    Reserved: LongInt;
  end;
  TSP_DEVINFO_DATA = _SP_DEVINFO_DATA;
  PSP_DEVINFO_DATA = ^_SP_DEVINFO_DATA;

/// 
/// Device interface information structure (references a device 
/// interface that is associated with the device information 
/// element that owns it). 
/// 
  {$EXTERNALSYM _SP_DEVICE_INTERFACE_DATA}
  _SP_DEVICE_INTERFACE_DATA = packed record
    cbSize: LongInt;
    InterfaceClassGuid: TGUID;
    Flags: LongInt;
    Reserved: LongInt;
  end;
  TSP_DEVICE_INTERFACE_DATA = _SP_DEVICE_INTERFACE_DATA;
  PSP_DEVICE_INTERFACE_DATA = ^_SP_DEVICE_INTERFACE_DATA;

/// 
/// Flags for SP_DEVICE_INTERFACE_DATA.Flags field. 
/// 
const
  SPINT_ACTIVE = $00000001;
  SPINT_DEFAULT = $00000002;
  SPINT_REMOVED = $00000004;

/// 
/// Backward compatibility--do not use. 
/// 
type
  SP_INTERFACE_DEVICE_DATA = TSP_DEVICE_INTERFACE_DATA;
  PSP_INTERFACE_DEVICE_DATA = PSP_DEVICE_INTERFACE_DATA;

const
  SPID_ACTIVE = SPINT_ACTIVE;
  SPID_DEFAULT = SPINT_DEFAULT;
  SPID_REMOVED = SPINT_REMOVED;


type
  {$EXTERNALSYM _SP_DEVICE_INTERFACE_DETAIL_DATA_A}
  _SP_DEVICE_INTERFACE_DETAIL_DATA_A = packed record
    cbSize: LongInt;
    DevicePath: Array[0..ANYSIZE_ARRAY-1] of Char;
  end;
  TSP_DEVICE_INTERFACE_DETAIL_DATA_A = _SP_DEVICE_INTERFACE_DETAIL_DATA_A;
  PSP_DEVICE_INTERFACE_DETAIL_DATA_A = ^_SP_DEVICE_INTERFACE_DETAIL_DATA_A;

  {$EXTERNALSYM _SP_DEVICE_INTERFACE_DETAIL_DATA_W}
  _SP_DEVICE_INTERFACE_DETAIL_DATA_W = packed record
    cbSize: LongInt;
    DevicePath: Array[0..ANYSIZE_ARRAY-1] of WCHAR;
  end;
  TSP_DEVICE_INTERFACE_DETAIL_DATA_W = _SP_DEVICE_INTERFACE_DETAIL_DATA_W;
  PSP_DEVICE_INTERFACE_DETAIL_DATA_W = ^_SP_DEVICE_INTERFACE_DETAIL_DATA_W;
  SP_DEVICE_INTERFACE_DETAIL_DATA = TSP_DEVICE_INTERFACE_DETAIL_DATA_A;
  PSP_DEVICE_INTERFACE_DETAIL_DATA = PSP_DEVICE_INTERFACE_DETAIL_DATA_A;

/// 
/// Backward compatibility--do not use. 
/// 
type
  TSP_INTERFACE_DEVICE_DETAIL_DATA_W = TSP_DEVICE_INTERFACE_DETAIL_DATA_W;
  PSP_INTERFACE_DEVICE_DETAIL_DATA_W = PSP_DEVICE_INTERFACE_DETAIL_DATA_W;
  TSP_INTERFACE_DEVICE_DETAIL_DATA_A = TSP_DEVICE_INTERFACE_DETAIL_DATA_A;
  PSP_INTERFACE_DEVICE_DETAIL_DATA_A = PSP_DEVICE_INTERFACE_DETAIL_DATA_A;
  TSP_INTERFACE_DEVICE_DETAIL_DATA = TSP_INTERFACE_DEVICE_DETAIL_DATA_A;
  PSP_INTERFACE_DEVICE_DETAIL_DATA = PSP_INTERFACE_DEVICE_DETAIL_DATA_A;


/// 
/// Structure for detailed information on a device information set (used for 
/// SetupDiGetDeviceInfoListDetail which supercedes the functionality of 
/// SetupDiGetDeviceInfoListClass). 
/// 
type
  {$EXTERNALSYM _SP_DEVINFO_LIST_DETAIL_DATA_A}
  _SP_DEVINFO_LIST_DETAIL_DATA_A = packed record
    cbSize: LongInt;
    ClassGuid: TGUID;
    RemoteMachineHandle: THandle;
    RemoteMachineName: Array[0..SP_MAX_MACHINENAME_LENGTH-1] of Char;
  end;
  TSP_DEVINFO_LIST_DETAIL_DATA_A = _SP_DEVINFO_LIST_DETAIL_DATA_A;
  PSP_DEVINFO_LIST_DETAIL_DATA_A = ^_SP_DEVINFO_LIST_DETAIL_DATA_A;

  {$EXTERNALSYM _SP_DEVINFO_LIST_DETAIL_DATA_W}
  _SP_DEVINFO_LIST_DETAIL_DATA_W = packed record
    cbSize: LongInt;
    ClassGuid: TGUID;
    RemoteMachineHandle: THandle;
    RemoteMachineName: Array[0..SP_MAX_MACHINENAME_LENGTH-1] of WCHAR;
  end;
  TSP_DEVINFO_LIST_DETAIL_DATA_W = _SP_DEVINFO_LIST_DETAIL_DATA_W;
  PSP_DEVINFO_LIST_DETAIL_DATA_W = ^_SP_DEVINFO_LIST_DETAIL_DATA_W;
  TSP_DEVINFO_LIST_DETAIL_DATA = TSP_DEVINFO_LIST_DETAIL_DATA_A;
  PSP_DEVINFO_LIST_DETAIL_DATA = PSP_DEVINFO_LIST_DETAIL_DATA_A;


/// 
/// Class installer function codes 
/// 
const
  DIF_SELECTDEVICE = $00000001;
  DIF_INSTALLDEVICE = $00000002;
  DIF_ASSIGNRESOURCES = $00000003;
  DIF_PROPERTIES = $00000004;
  DIF_REMOVE = $00000005;
  DIF_FIRSTTIMESETUP = $00000006;
  DIF_FOUNDDEVICE = $00000007;
  DIF_SELECTCLASSDRIVERS = $00000008;
  DIF_VALIDATECLASSDRIVERS = $00000009;
  DIF_INSTALLCLASSDRIVERS = $0000000A;
  DIF_CALCDISKSPACE = $0000000B;
  DIF_DESTROYPRIVATEDATA = $0000000C;
  DIF_VALIDATEDRIVER = $0000000D;
  DIF_MOVEDEVICE = $0000000E;
  DIF_DETECT = $0000000;
  DIF_INSTALLWIZARD = $00000010;
  DIF_DESTROYWIZARDDATA = $00000011;
  DIF_PROPERTYCHANGE = $00000012;
  DIF_ENABLECLASS = $00000013;
  DIF_DETECTVERIFY = $00000014;
  DIF_INSTALLDEVICEFILES = $00000015;
  DIF_UNREMOVE = $00000016;
  DIF_SELECTBESTCOMPATDRV = $00000017;
  DIF_ALLOW_INSTALL = $00000018;
  DIF_REGISTERDEVICE = $00000019;
  DIF_INSTALLINTERFACES = $00000020;
  DIF_DETECTCANCEL = $00000021;
  DIF_REGISTER_COINSTALLERS = $00000022;

type
  DI_FUNCTION = Word;


/// 
/// Device installation parameters structure (associated with a 
/// particular device information element, or globally with a device 
/// information set) 
/// 
type
  {$EXTERNALSYM _SP_DEVINSTALL_PARAMS_A}
  _SP_DEVINSTALL_PARAMS_A = packed record
    cbSize: LongInt;
    Flags: LongInt;
    FlagsEx: LongInt;
    hwndParent: HWND;
    InstallMsgHandler: PSP_FILE_CALLBACK;
    InstallMsgHandlerContext: PVOID;
    FileQueue: HSPFILEQ;
    ClassInstallReserved: LongInt;
    Reserved: LongInt;
    DriverPath: Array[0..MAX_PATH-1] of Char;
  end;
  TSP_DEVINSTALL_PARAMS_A = _SP_DEVINSTALL_PARAMS_A;
  PSP_DEVINSTALL_PARAMS_A = ^_SP_DEVINSTALL_PARAMS_A;

  {$EXTERNALSYM _SP_DEVINSTALL_PARAMS_W}
  _SP_DEVINSTALL_PARAMS_W = packed record
    cbSize: LongInt;
    Flags: LongInt;
    FlagsEx: LongInt;
    hwndParent: HWND;
    InstallMsgHandler: PSP_FILE_CALLBACK;
    InstallMsgHandlerContext: PVOID;
    FileQueue: HSPFILEQ;
    ClassInstallReserved: LongInt;
    Reserved: LongInt;
    DriverPath: Array[0..MAX_PATH-1] of WCHAR;
  end;
  TSP_DEVINSTALL_PARAMS_W = _SP_DEVINSTALL_PARAMS_W;
  PSP_DEVINSTALL_PARAMS_W = ^_SP_DEVINSTALL_PARAMS_W;

  SP_DEVINSTALL_PARAMS = TSP_DEVINSTALL_PARAMS_A;
  PSP_DEVINSTALL_PARAMS = PSP_DEVINSTALL_PARAMS_A;


/// 
/// SP_DEVINSTALL_PARAMS.Flags values 
/// 
/// Flags for choosing a device 
/// 
const
  DI_SHOWOEM = $00000001; // support Other... button
  DI_SHOWCOMPAT = $00000002; // show compatibility list
  DI_SHOWCLASS = $00000004; // show class list
  DI_SHOWALL = $00000007; // both class & compat list shown
  DI_NOVCP = $00000008; // don't create a new copy queue--use
/// caller-supplied FileQueue 
  DI_DIDCOMPAT = $00000010; // Searched for compatible devices
  DI_DIDCLASS = $00000020; // Searched for class devices
  DI_AUTOASSIGNRES = $00000040; // No UI for resources if possible

/// flags returned by DiInstallDevice to indicate need to reboot/restart 
  DI_NEEDRESTART = $00000080; // Reboot required to take effect
  DI_NEEDREBOOT = $00000100; // ''

/// flags for device installation 
  DI_NOBROWSE = $00000200; // no Browse... in InsertDisk

/// Flags set by DiBuildDriverInfoList 
  DI_MULTMFGS = $00000400; // Set if multiple manufacturers in
/// class driver list 

/// Flag indicates that device is disabled 
  DI_DISABLED = $00000800; // Set if device disabled

/// Flags for Device/Class Properties 
  DI_GENERALPAGE_ADDED = $00001000;
  DI_RESOURCEPAGE_ADDED = $00002000;

/// Flag to indicate the setting properties for this Device (or class) caused a change 
/// so the Dev Mgr UI probably needs to be updatd. 
  DI_PROPERTIES_CHANGE = $00004000;

/// Flag to indicate that the sorting from the INF file should be used. 
  DI_INF_IS_SORTED = $00008000;

/// Flag to indicate that only the the INF specified by SP_DEVINSTALL_PARAMS.DriverPath 
/// should be searched. 
  DI_ENUMSINGLEINF = $00010000;

/// Flag that prevents ConfigMgr from removing/re-enumerating devices during device 
/// registration, installation, and deletion. 
  DI_DONOTCALLCONFIGMG = $00020000;

/// The following flag can be used to install a device disabled 
  DI_INSTALLDISABLED = $00040000;

/// Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver 
/// list from its existing class driver list, instead of the normal INF search. 
  DI_COMPAT_FROM_CLASS = $00080000;

/// This flag is set if the Class Install params should be used. 
  DI_CLASSINSTALLPARAMS = $00100000;

/// This flag is set if the caller of DiCallClassInstaller does NOT 
/// want the internal default action performed if the Class installer 
/// returns ERROR_DI_DO_DEFAULT. 
  DI_NODI_DEFAULTACTION = $00200000;

/// The setupx flag, DI_NOSYNCPROCESSING ($00400000L) is not support in the Setup APIs. 

/// flags for device installation 
  DI_QUIETINSTALL = $00800000; // don't confuse the user with
/// questions or excess info 
  DI_NOFILECOPY = $01000000; // No file Copy necessary
  DI_FORCECOPY = $02000000; // Force files to be copied from install path
  DI_DRIVERPAGE_ADDED = $04000000; // Prop provider added Driver page.
  DI_USECI_SELECTSTRINGS = $08000000; // Use Class Installer Provided strings in the Select Device Dlg
  DI_OVERRIDE_INFFLAGS = $10000000; // Override INF flags
  DI_PROPS_NOCHANGEUSAGE = $20000000; // No Enable/Disable in General Props

  DI_NOSELECTICONS = $40000000; // No small icons in select device dialogs

  DI_NOWRITE_IDS = $80000000; // Don't write HW & Compat IDs on install


/// 
/// SP_DEVINSTALL_PARAMS.FlagsEx values 
/// 
  DI_FLAGSEX_USEOLDINFSEARCH = $00000001; // Inf Search functions should not use Index Search
  DI_FLAGSEX_AUTOSELECTRANK0 = $00000002; // SetupDiSelectDevice doesn't prompt user if rank 0 match
  DI_FLAGSEX_CI_FAILED = $00000004; // Failed to Load/Call class installer

  DI_FLAGSEX_DIDINFOLIST = $00000010; // Did the Class Info List
  DI_FLAGSEX_DIDCOMPATINFO = $00000020; // Did the Compat Info List

  DI_FLAGSEX_FILTERCLASSES = $00000040;
  DI_FLAGSEX_SETFAILEDINSTALL = $00000080;
  DI_FLAGSEX_DEVICECHANGE = $00000100;
  DI_FLAGSEX_ALWAYSWRITEIDS = $00000200;
  DI_FLAGSEX_ALLOWEXCLUDEDDRVS = $00000800;
  DI_FLAGSEX_NOUIONQUERYREMOVE = $00001000;
  DI_FLAGSEX_USECLASSFORCOMPAT = $00002000; // Use the device's class when building compat drv list.
/// (Ignored if DI_COMPAT_FROM_CLASS flag is specified.) 
  DI_FLAGSEX_OLDINF_IN_CLASSLIST = $00004000; // Search legacy INFs when building class driver list.
  DI_FLAGSEX_NO_DRVREG_MODIFY = $00008000; // Don't run AddReg and DelReg for device's software (driver) key.
  DI_FLAGSEX_IN_SYSTEM_SETUP = $00010000; // Installation is occurring during initial system setup.
  DI_FLAGSEX_INET_DRIVER = $00020000; // Driver came from Windows Update
  DI_FLAGSEX_APPENDDRIVERLIST = $00040000; // Cause SetupDiBuildDriverInfoList to append
/// a new driver list to an existing list. 


/// 
/// Class installation parameters header. This must be the first field of any class install 
/// parameter structure. The InstallFunction field must be set to the function code 
/// corresponding to the structure, and the cbSize field must be set to the size of the 
/// header structure. E.g., 
/// 
/// SP_ENABLECLASS_PARAMS EnableClassParams; 
/// 
/// EnableClassParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER); 
/// EnableClassParams.ClassInstallHeader.InstallFunction = DIF_ENABLECLASS; 
/// 
type
  {$EXTERNALSYM _SP_CLASSINSTALL_HEADER}
  _SP_CLASSINSTALL_HEADER = packed record
    cbSize: LongInt;
    InstallFunction: DI_FUNCTION;
  end;
  TSP_CLASSINSTALL_HEADER = _SP_CLASSINSTALL_HEADER;
  PSP_CLASSINSTALL_HEADER = ^_SP_CLASSINSTALL_HEADER;


/// 
/// Structure corresponding to a DIF_ENABLECLASS install function. 
/// 
type
  {$EXTERNALSYM _SP_ENABLECLASS_PARAMS}
  _SP_ENABLECLASS_PARAMS = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    ClassGuid: TGUID;
    EnableMessage: LongInt;
  end;
  TSP_ENABLECLASS_PARAMS = _SP_ENABLECLASS_PARAMS;
  PSP_ENABLECLASS_PARAMS = ^_SP_ENABLECLASS_PARAMS;

const
  ENABLECLASS_QUERY = 0;
  ENABLECLASS_SUCCESS = 1;
  ENABLECLASS_FAILURE = 2;


/// 
/// Structure corresponding to a DIF_MOVEDEVICE install function. 
/// 
type
  {$EXTERNALSYM _SP_MOVEDEV_PARAMS}
  _SP_MOVEDEV_PARAMS = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    SourceDeviceInfoData: TSP_DEVINFO_DATA;
  end;
  TSP_MOVEDEV_PARAMS = _SP_MOVEDEV_PARAMS;
  PSP_MOVEDEV_PARAMS = ^_SP_MOVEDEV_PARAMS;


/// 
/// Values indicating a change in a device's state 
/// 
const
  DICS_ENABLE = $00000001;
  DICS_DISABLE = $00000002;
  DICS_PROPCHANGE = $00000003;
  DICS_START = $00000004;
  DICS_STOP = $00000005;
/// 
/// Values specifying the scope of a device property change 
/// 
  DICS_FLAG_GLOBAL = $00000001; // make change in all hardware profiles
  DICS_FLAG_CONFIGSPECIFIC = $00000002; // make change in specified profile only
  DICS_FLAG_CONFIGGENERAL = $00000004; // 1 or more hardware profile-specific
/// changes to follow. 
/// 
/// Structure corresponding to a DIF_PROPERTYCHANGE install function. 
/// 
type
  {$EXTERNALSYM _SP_PROPCHANGE_PARAMS}
  _SP_PROPCHANGE_PARAMS = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    StateChange: LongInt;
    Scope: LongInt;
    HwProfile: LongInt;
  end;
  TSP_PROPCHANGE_PARAMS = _SP_PROPCHANGE_PARAMS;
  PSP_PROPCHANGE_PARAMS = ^_SP_PROPCHANGE_PARAMS;


/// 
/// Structure corresponding to a DIF_REMOVE install function. 
/// 
type
  {$EXTERNALSYM _SP_REMOVEDEVICE_PARAMS}
  _SP_REMOVEDEVICE_PARAMS = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    Scope: LongInt;
    HwProfile: LongInt;
  end;
  TSP_REMOVEDEVICE_PARAMS = _SP_REMOVEDEVICE_PARAMS;
  PSP_REMOVEDEVICE_PARAMS = ^_SP_REMOVEDEVICE_PARAMS;

const
  DI_REMOVEDEVICE_GLOBAL = $00000001;
  DI_REMOVEDEVICE_CONFIGSPECIFIC = $00000002;


/// 
/// Structure corresponding to a DIF_UNREMOVE install function. 
/// 
type
  {$EXTERNALSYM _SP_UNREMOVEDEVICE_PARAMS}
  _SP_UNREMOVEDEVICE_PARAMS = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    Scope: LongInt;
    HwProfile: LongInt;
  end;
  TSP_UNREMOVEDEVICE_PARAMS = _SP_UNREMOVEDEVICE_PARAMS;
  PSP_UNREMOVEDEVICE_PARAMS = ^_SP_UNREMOVEDEVICE_PARAMS;

const
  DI_UNREMOVEDEVICE_CONFIGSPECIFIC = $00000002;


/// 
/// Structure corresponding to a DIF_SELECTDEVICE install function. 
/// 
type
  {$EXTERNALSYM _SP_SELECTDEVICE_PARAMS_A}
  _SP_SELECTDEVICE_PARAMS_A = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    Title: Array[0..MAX_TITLE_LEN-1] of Char;
    Instructions: Array[0..MAX_INSTRUCTION_LEN-1] of Char;
    ListLabel: Array[0..MAX_LABEL_LEN-1] of Char;
    Reserved: Array[0..2-1] of BYTE;
  end;
  TSP_SELECTDEVICE_PARAMS_A = _SP_SELECTDEVICE_PARAMS_A;
  PSP_SELECTDEVICE_PARAMS_A = ^_SP_SELECTDEVICE_PARAMS_A;

type
  {$EXTERNALSYM _SP_SELECTDEVICE_PARAMS_W}
  _SP_SELECTDEVICE_PARAMS_W = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    Title: Array[0..MAX_TITLE_LEN-1] of WCHAR;
    Instructions: Array[0..MAX_INSTRUCTION_LEN-1] of WCHAR;
    ListLabel: Array[0..MAX_LABEL_LEN-1] of WCHAR;
  end;
  TSP_SELECTDEVICE_PARAMS_W = _SP_SELECTDEVICE_PARAMS_W;
  PSP_SELECTDEVICE_PARAMS_W = ^_SP_SELECTDEVICE_PARAMS_W;

  SP_SELECTDEVICE_PARAMS = TSP_SELECTDEVICE_PARAMS_A;
  PSP_SELECTDEVICE_PARAMS = PSP_SELECTDEVICE_PARAMS_A;


/// 
/// Structure corresponding to a DIF_DETECT install function. 
/// 

type
  PDETECT_PROGRESS_NOTIFY = function(PROGRESSNOTIFYPARAM: PVOID;DETECTCOMPLETE:DWORD ):BOOL; stdcall;

/// where: 
/// ProgressNotifyParam - value supplied by caller requesting detection. 
/// DetectComplete - Percent completion, to be incremented by class 
/// installer, as it steps thru its detection. 
/// 
/// Return Value - If TRUE, then detection is cancelled. Allows caller 
/// requesting detection to stop detection asap. 
/// 

type
  {$EXTERNALSYM _SP_DETECTDEVICE_PARAMS}
  _SP_DETECTDEVICE_PARAMS = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    DetectProgressNotify: PDETECT_PROGRESS_NOTIFY;
    ProgressNotifyParam: PVOID;
  end;
  TSP_DETECTDEVICE_PARAMS = _SP_DETECTDEVICE_PARAMS;
  PSP_DETECTDEVICE_PARAMS = ^_SP_DETECTDEVICE_PARAMS;


/// 
/// 'Add New Device' installation wizard structure 
/// 
/// Structure corresponding to a DIF_INSTALLWIZARD install function. 
/// (NOTE: This structure is also applicable for DIF_DESTROYWIZARDDATA, 
/// but DIF_INSTALLWIZARD is the associated function code in the class 
/// installation parameter structure in both cases.) 
/// 
/// Define maximum number of dynamic wizard pages that can be added to 
/// hardware install wizard. 
/// 
const
  MAX_INSTALLWIZARD_DYNAPAGES = 20;

type
  {$EXTERNALSYM _SP_INSTALLWIZARD_DATA}
  _SP_INSTALLWIZARD_DATA = packed record
    ClassInstallHeader: TSP_CLASSINSTALL_HEADER;
    Flags: LongInt;
    DynamicPages: Array[0..MAX_INSTALLWIZARD_DYNAPAGES-1] of HPROPSHEETPAGE;
    NumDynamicPages: LongInt;
    DynamicPageFlags: LongInt;
    PrivateFlags: LongInt;
    PrivateData: LPARAM;
    hwndWizardDlg: HWND;
  end;
  TSP_INSTALLWIZARD_DATA = _SP_INSTALLWIZARD_DATA;
  PSP_INSTALLWIZARD_DATA = ^_SP_INSTALLWIZARD_DATA;

/// 
/// SP_INSTALLWIZARD_DATA.Flags values 
/// 
const
  NDW_INSTALLFLAG_DIDFACTDEFS = $00000001;
  NDW_INSTALLFLAG_HARDWAREALLREADYIN = $00000002;
  NDW_INSTALLFLAG_NEEDRESTART = DI_NEEDRESTART;
  NDW_INSTALLFLAG_NEEDREBOOT = DI_NEEDREBOOT;
  NDW_INSTALLFLAG_NEEDSHUTDOWN = $00000200;
  NDW_INSTALLFLAG_EXPRESSINTRO = $00000400;
  NDW_INSTALLFLAG_SKIPISDEVINSTALLED = $00000800;
  NDW_INSTALLFLAG_NODETECTEDDEVS = $00001000;
  NDW_INSTALLFLAG_INSTALLSPECIFIC = $00002000;
  NDW_INSTALLFLAG_SKIPCLASSLIST = $00004000;
  NDW_INSTALLFLAG_CI_PICKED_OEM = $00008000;
  NDW_INSTALLFLAG_PCMCIAMODE = $00010000;
  NDW_INSTALLFLAG_PCMCIADEVICE = $00020000;
  NDW_INSTALLFLAG_USERCANCEL = $00040000;
  NDW_INSTALLFLAG_KNOWNCLASS = $00080000;


/// 
/// SP_INSTALLWIZARD_DATA.DynamicPageFlags values 
/// 
/// This flag is set if a Class installer has added pages to the 
/// install wizard. 
/// 
  DYNAWIZ_FLAG_PAGESADDED = $00000001;

/// 
/// The following flags will control the button states when displaying 
/// the InstallDetectedDevs dialog. 
/// 
  DYNAWIZ_FLAG_INSTALLDET_NEXT = $00000002;
  DYNAWIZ_FLAG_INSTALLDET_PREV = $00000004;

/// Set this flag if you jump to the analyze page, and want it to 
/// handle conflicts for you. NOTE. You will not get control back 
/// in the event of a conflict if you set this flag. 
/// 
/// BUGBUG (lonnym): Not currently implemented! 
/// 
  DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT = $00000008;

/// 
/// Define wizard page resource IDs to be used when adding custom pages 
/// to the hardware install wizard. 
/// 
/// Resource ID for the first page that the install wizard will go to after 
/// adding the class installer pages. 
/// 
  IDD_DYNAWIZ_FIRSTPAGE = 10000;

/// 
/// Resource ID for the page that the Select Device page will go back to. 
/// 
  IDD_DYNAWIZ_SELECT_PREVPAGE = 10001;

/// 
/// Resource ID for the page that the Select Device page will go forward to. 
/// 
  IDD_DYNAWIZ_SELECT_NEXTPAGE = 10002;

/// 
/// Resource ID for the page that the Analyze dialog should go back to 
/// This will only be used in the event that there is a problem, and the user 
/// selects Back from the analyze proc. 
/// 
  IDD_DYNAWIZ_ANALYZE_PREVPAGE = 10003;

/// 
/// Resource ID for the page that the Analyze dialog should go to if it 
/// continue from the analyze proc. the wAnalyzeResult in the INSTALLDATA 
/// struct will contain the anaysis results. 
/// 
  IDD_DYNAWIZ_ANALYZE_NEXTPAGE = 10004;

/// 
/// Resource ID for that page that the Install detected devices page will go 
/// back to. 
/// 
  IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE = 10006;

/// 
/// Resource ID for the page that the Install detected devices page will go 
/// forward to. 
/// 
  IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE = 10007;

/// 
/// Resource ID for the page that the Install detected devices page will go 
/// to in the event that no devices are detected. 
/// 
  IDD_DYNAWIZ_INSTALLDETECTED_NODEVS = 10008;

/// 
/// Resource ID of the hardware install wizard's select device page. 
/// This ID can be used to go directly to the hardware install wizard's select 
/// device page. 
/// 
  IDD_DYNAWIZ_SELECTDEV_PAGE = 10009;

/// 
/// Resource ID of the hardware install wizard's device analysis page. 
/// This ID can be use to go directly to the hardware install wizard's analysis 
/// page. 
/// 
  IDD_DYNAWIZ_ANALYZEDEV_PAGE = 10010;

/// 
/// Resource ID of the hardware install wizard's install detected devices page. 
/// This ID can be use to go directly to the hardware install wizard's install 
/// detected devices page. 
/// 
  IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE = 10011;

/// 
/// Resource ID of the hardware install wizard's select class page. 
/// This ID can be use to go directly to the hardware install wizard's select 
/// class page. 
/// 
  IDD_DYNAWIZ_SELECTCLASS_PAGE = 10012;


/// 
/// Driver information structure (member of a driver info list that may be associated 
/// with a particular device instance, or (globally) with a device information set) 
/// 
type
  {$EXTERNALSYM _SP_DRVINFO_DATA_A}
  _SP_DRVINFO_DATA_A = packed record
    cbSize: LongInt;
    DriverType: LongInt;
    Reserved: LongInt;
    Description: Array[0..LINE_LEN-1] of Char;
    MfgName: Array[0..LINE_LEN-1] of Char;
    ProviderName: Array[0..LINE_LEN-1] of Char;
  end;
  TSP_DRVINFO_DATA_A = _SP_DRVINFO_DATA_A;
  PSP_DRVINFO_DATA_A = ^_SP_DRVINFO_DATA_A;

  {$EXTERNALSYM _SP_DRVINFO_DATA_W}
  _SP_DRVINFO_DATA_W = packed record
    cbSize: LongInt;
    DriverType: LongInt;
    Reserved: LongInt;
    Description: Array[0..LINE_LEN-1] of WCHAR;
    MfgName: Array[0..LINE_LEN-1] of WCHAR;
    ProviderName: Array[0..LINE_LEN-1] of WCHAR;
  end;
  TSP_DRVINFO_DATA_W = _SP_DRVINFO_DATA_W;
  PSP_DRVINFO_DATA_W = ^_SP_DRVINFO_DATA_W;

  TSP_DRVINFO_DATA = TSP_DRVINFO_DATA_A;
  PSP_DRVINFO_DATA = PSP_DRVINFO_DATA_A;


/// 
/// Driver information details structure (provides detailed information about a 
/// particular driver information structure) 
/// 
type
  {$EXTERNALSYM _SP_DRVINFO_DETAIL_DATA_A}
  _SP_DRVINFO_DETAIL_DATA_A = packed record
    cbSize: LongInt;
    InfDate: FILETIME;
    CompatIDsOffset: LongInt;
    CompatIDsLength: LongInt;
    Reserved: LongInt;
    SectionName: Array[0..LINE_LEN-1] of Char;
    InfFileName: Array[0..MAX_PATH-1] of Char;
    DrvDescription: Array[0..LINE_LEN-1] of Char;
    HardwareID: Array[0..ANYSIZE_ARRAY-1] of Char;
  end;
  TSP_DRVINFO_DETAIL_DATA_A = _SP_DRVINFO_DETAIL_DATA_A;
  PSP_DRVINFO_DETAIL_DATA_A = ^_SP_DRVINFO_DETAIL_DATA_A;

  {$EXTERNALSYM _SP_DRVINFO_DETAIL_DATA_W}
  _SP_DRVINFO_DETAIL_DATA_W = packed record
    cbSize: LongInt;
    InfDate: FILETIME;
    CompatIDsOffset: LongInt;
    CompatIDsLength: LongInt;
    Reserved: LongInt;
    SectionName: Array[0..LINE_LEN-1] of WCHAR;
    InfFileName: Array[0..MAX_PATH-1] of WCHAR;
    DrvDescription: Array[0..LINE_LEN-1] of WCHAR;
    HardwareID: Array[0..ANYSIZE_ARRAY-1] of WCHAR;
  end;
  TSP_DRVINFO_DETAIL_DATA_W = _SP_DRVINFO_DETAIL_DATA_W;
  PSP_DRVINFO_DETAIL_DATA_W = ^_SP_DRVINFO_DETAIL_DATA_W;

  SP_DRVINFO_DETAIL_DATA = TSP_DRVINFO_DETAIL_DATA_A;
  PSP_DRVINFO_DETAIL_DATA = PSP_DRVINFO_DETAIL_DATA_A;


/// 
/// Driver installation parameters (associated with a particular driver 
/// information element) 
/// 
type
  {$EXTERNALSYM _SP_DRVINSTALL_PARAMS}
  _SP_DRVINSTALL_PARAMS = packed record
    cbSize: LongInt;
    Rank: LongInt;
    Flags: LongInt;
    PrivateData: LongInt;
    Reserved: LongInt;
  end;
  TSP_DRVINSTALL_PARAMS = _SP_DRVINSTALL_PARAMS;
  PSP_DRVINSTALL_PARAMS = ^_SP_DRVINSTALL_PARAMS;

/// 
/// SP_DRVINSTALL_PARAMS.Flags values 
/// 
const
  DNF_DUPDESC = $00000001; // Multiple providers have same desc
  DNF_OLDDRIVER = $00000002; // Driver node specifies old/current driver
  DNF_EXCLUDEFROMLIST = $00000004; // If set, this driver node will not be
/// displayed in any driver select dialogs. 
  DNF_NODRIVER = $00000008; // if we want to install no driver
/// (e.g no mouse drv) 
  DNF_LEGACYINF = $00000010; // this driver node comes from an old-style INF


/// 
/// Setup callback routine for comparing detection signatures 
/// 
type
  PSP_DETSIG_CMPPROC = function(DEVICEINFOSET:HDEVINFO;NEWDEVICEDATA: PSP_DEVINFO_DATA ;EXISTINGDEVICEDATA: PSP_DEVINFO_DATA; COMPARECONTEXT:PVOID  ):DWORD; stdcall;


/// 
/// Define context structure handed to co-installers 
/// 
type
  {$EXTERNALSYM _COINSTALLER_CONTEXT_DATA}
  _COINSTALLER_CONTEXT_DATA = packed record
    PostProcessing: BOOL;
    InstallResult: LongInt;
    PrivateData: PVOID;
  end;
  TCOINSTALLER_CONTEXT_DATA = _COINSTALLER_CONTEXT_DATA;
  PCOINSTALLER_CONTEXT_DATA = ^_COINSTALLER_CONTEXT_DATA;


/// 
/// Structure containing class image list information. 
/// 
type
  {$EXTERNALSYM _SP_CLASSIMAGELIST_DATA}
  _SP_CLASSIMAGELIST_DATA = packed record
    cbSize: LongInt;
    ImageList: HIMAGELIST;
    Reserved: LongInt;
  end;
  TSP_CLASSIMAGELIST_DATA = _SP_CLASSIMAGELIST_DATA;
  PSP_CLASSIMAGELIST_DATA = ^_SP_CLASSIMAGELIST_DATA;


/// 
/// Structure to be passed as first parameter (LPVOID lpv) to ExtensionPropSheetPageProc 
/// entry point in setupapi.dll or to "EnumPropPages32" or "BasicProperties32" entry
/// points provided by class/device property page providers. Used to retrieve a handle 
/// (or, potentially, multiple handles) to property pages for a specified property page type. 
/// 
type
  {$EXTERNALSYM _SP_PROPSHEETPAGE_REQUEST}
  _SP_PROPSHEETPAGE_REQUEST = packed record
    cbSize: LongInt;
    PageRequested: LongInt;
    DeviceInfoSet: HDEVINFO;
    DeviceInfoData: PSP_DEVINFO_DATA;
  end;
  TSP_PROPSHEETPAGE_REQUEST = _SP_PROPSHEETPAGE_REQUEST;
  PSP_PROPSHEETPAGE_REQUEST = ^_SP_PROPSHEETPAGE_REQUEST;

///
/// Property sheet codes used in SP_PROPSHEETPAGE_REQUEST.PageRequested 
/// 
const
  SPPSR_SELECT_DEVICE_RESOURCES = 1; // supplied by setupapi.dll
  SPPSR_ENUM_BASIC_DEVICE_PROPERTIES = 2; // supplied by device's BasicProperties32 provider
  SPPSR_ENUM_ADV_DEVICE_PROPERTIES = 3; // supplied by class and/or device's EnumPropPages32 provider


/// 
/// Setupapi-specific error codes 
/// 
/// Inf parse outcomes 
/// 
  ERROR_EXPECTED_SECTION_NAME = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or 0);
  ERROR_BAD_SECTION_NAME_LINE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or 1);
  ERROR_SECTION_NAME_TOO_LONG = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or 2);
  ERROR_GENERAL_SYNTAX = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or 3);
/// 
/// Inf runtime errors 
/// 
  ERROR_WRONG_INF_STYLE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $100);
  ERROR_SECTION_NOT_FOUND = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $101);
  ERROR_LINE_NOT_FOUND = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $102);
/// 
/// Device Installer errors 
/// 
  ERROR_NO_ASSOCIATED_CLASS = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $200);
  ERROR_CLASS_MISMATCH = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $201);
  ERROR_DUPLICATE_FOUND = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $202);
  ERROR_NO_DRIVER_SELECTED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $203);
  ERROR_KEY_DOES_NOT_EXIST = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $204);
  ERROR_INVALID_DEVINST_NAME = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $205);
  ERROR_INVALID_CLASS = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $206);
  ERROR_DEVINST_ALREADY_EXISTS = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $207);
  ERROR_DEVINFO_NOT_REGISTERED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $208);
  ERROR_INVALID_REG_PROPERTY = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $209);
  ERROR_NO_INF = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $20A);
  ERROR_NO_SUCH_DEVINST = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $20B);
  ERROR_CANT_LOAD_CLASS_ICON = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $20C);
  ERROR_INVALID_CLASS_INSTALLER = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $20D);
  ERROR_DI_DO_DEFAULT = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $20E);
  ERROR_DI_NOFILECOPY = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $20);
  ERROR_INVALID_HWPROFILE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $210);
  ERROR_NO_DEVICE_SELECTED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $211);
  ERROR_DEVINFO_LIST_LOCKED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $212);
  ERROR_DEVINFO_DATA_LOCKED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $213);
  ERROR_DI_BAD_PATH = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $214);
  ERROR_NO_CLASSINSTALL_PARAMS = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $215);
  ERROR_FILEQUEUE_LOCKED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $216);
  ERROR_BAD_SERVICE_INSTALLSECT = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $217);
  ERROR_NO_CLASS_DRIVER_LIST = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $218);
  ERROR_NO_ASSOCIATED_SERVICE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $219);
  ERROR_NO_DEFAULT_DEVICE_INTERFACE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $21A);
  ERROR_DEVICE_INTERFACE_ACTIVE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $21B);
  ERROR_DEVICE_INTERFACE_REMOVED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $21C);
  ERROR_BAD_INTERFACE_INSTALLSECT = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $21D);
  ERROR_NO_SUCH_INTERFACE_CLASS = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $21E);
  ERROR_INVALID_REFERENCE_STRING = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $21);
  ERROR_INVALID_MACHINENAME = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $220);
  ERROR_REMOTE_COMM_FAILURE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $221);
  ERROR_MACHINE_UNAVAILABLE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $222);
  ERROR_NO_CONFIGMGR_SERVICES = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $223);
  ERROR_INVALID_PROPPAGE_PROVIDER = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $224);
  ERROR_NO_SUCH_DEVICE_INTERFACE = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $225);
  ERROR_DI_POSTPROCESSING_REQUIRED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $226);
  ERROR_INVALID_COINSTALLER = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $227);
  ERROR_NO_COMPAT_DRIVERS = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $228);
  ERROR_NO_DEVICE_ICON = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $229);
  ERROR_INVALID_INF_LOGCONFIG = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $22A);
  ERROR_DI_DONT_INSTALL = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $22B);
  ERROR_INVALID_FILTER_DRIVER = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $22C);

/// 
/// Backward compatibility--do not use. 
///
  ERROR_NO_DEFAULT_INTERFACE_DEVICE = ERROR_NO_DEFAULT_DEVICE_INTERFACE;
  ERROR_INTERFACE_DEVICE_ACTIVE = ERROR_DEVICE_INTERFACE_ACTIVE;
  ERROR_INTERFACE_DEVICE_REMOVED = ERROR_DEVICE_INTERFACE_REMOVED;
  ERROR_NO_SUCH_INTERFACE_DEVICE = ERROR_NO_SUCH_DEVICE_INTERFACE;


/// 
/// Win9x migration DLL error code 
/// 
  ERROR_NOT_INSTALLED = (APPLICATION_ERROR_MASK or ERROR_SEVERITY_ERROR or $1000);



function SetupGetInfInformationA(const InfSpec;
                                 SearchControl:  DWORD;
                                 ReturnBuffer:  PSP_INF_INFORMATION;
                                 ReturnBufferSize:   DWORD;
                                 REQUIREDSIZE: PDWORD): BOOL; stdcall;


function SetupGetInfInformationW(const InfSpec;
                                 SearchControl:  DWORD;
                                 ReturnBuffer:  PSP_INF_INFORMATION;
                                 ReturnBufferSize:   DWORD;
                                 REQUIREDSIZE: PDWORD): BOOL; stdcall;

function SetupGetInfInformation(const InfSpec;
                                 SearchControl:  DWORD;
                                 ReturnBuffer:  PSP_INF_INFORMATION;
                                 ReturnBufferSize:   DWORD;
                                 REQUIREDSIZE: PDWORD): BOOL; stdcall;

///
/// SearchControl flags for SetupGetInfInformation
///
const
  INFINFO_INF_SPEC_IS_HINF = 1;
  INFINFO_INF_NAME_IS_ABSOLUTE = 2;
  INFINFO_DEFAULT_SEARCH = 3;
  INFINFO_REVERSE_DEFAULT_SEARCH = 4;
  INFINFO_INF_PATH_LIST_SEARCH = 5;


function SetupQueryInfFileInformationA(InfInformation:  PSP_INF_INFORMATION;
                                       InfIndex:  UINT;
                                       ReturnBuffer:  PSTR;
                                       ReturnBufferSize:   DWORD;
                                       REQUIREDSIZE: PDWORD): BOOL; stdcall;


function SetupQueryInfFileInformationW(InfInformation:  PSP_INF_INFORMATION; 
                                       InfIndex:  UINT; 
                                       ReturnBuffer:  PWSTR; 
                                       ReturnBufferSize:   DWORD; 
                                       REQUIREDSIZE:  PDWORD): BOOL; stdcall;

function SetupQueryInfFileInformation(InfInformation:  PSP_INF_INFORMATION; 
                                       InfIndex:  UINT; 
                                       ReturnBuffer:  PWSTR; 
                                       ReturnBufferSize:   DWORD; 
                                       REQUIREDSIZE:  PDWORD): BOOL; stdcall;


function SetupQueryInfVersionInformationA(InfInformation:  PSP_INF_INFORMATION; 
                                          InfIndex:  UINT; 
                                          Key:  PCSTR; 
                                          ReturnBuffer:   PSTR; 
                                          ReturnBufferSize:   DWORD; 
                                          REQUIREDSIZE:  PDWORD): BOOL; stdcall;


function SetupQueryInfVersionInformationW(InfInformation:  PSP_INF_INFORMATION; 
                                          InfIndex:  UINT; 
                                          Key:  PCWSTR; 
                                          ReturnBuffer:   PWSTR; 
                                          ReturnBufferSize:   DWORD; 
                                          REQUIREDSIZE:  PDWORD): BOOL; stdcall;

function SetupQueryInfVersionInformation(InfInformation:  PSP_INF_INFORMATION; 
                                          InfIndex:  UINT; 
                                          Key:  PCSTR; 
                                          ReturnBuffer:   PSTR; 
                                          ReturnBufferSize:   DWORD; 
                                          REQUIREDSIZE:  PDWORD): BOOL; stdcall;

function SetupGetInfFileListA(DirectoryPath:  PCSTR; 
                              InfStyle:   DWORD; 
                              ReturnBuffer:  PSTR; 
                              ReturnBufferSize:   DWORD; 
                              REQUIREDSIZE:  PDWORD): BOOL; stdcall;


function SetupGetInfFileListW(DirectoryPath:  PCWSTR; 
                              InfStyle:   DWORD; 
                              ReturnBuffer:  PWSTR; 
                              ReturnBufferSize:   DWORD; 
                              REQUIREDSIZE:  PDWORD): BOOL; stdcall;

function SetupGetInfFileList(DirectoryPath:  PCSTR; 
                              InfStyle:   DWORD; 
                              ReturnBuffer:  PSTR; 
                              ReturnBufferSize:   DWORD; 
                              REQUIREDSIZE:  PDWORD): BOOL; stdcall;


function SetupOpenInfFileW(FileName:  PCWSTR; 
                           InfClass:  PCWSTR; 
                           InfStyle:   DWORD; 
                           ERRORLINE: PUINT): HINF; stdcall;


function SetupOpenInfFileA(FileName:  PCSTR; 
                           InfClass:  PCSTR; 
                           InfStyle:   DWORD; 
                           ERRORLINE: PUINT): HINF; stdcall;

function SetupOpenInfFile(FileName:  PCSTR; 
                           InfClass:  PCSTR; 
                           InfStyle:   DWORD; 
                           ERRORLINE: PUINT): HINF; stdcall;


function SetupOpenMasterInf: HINF; stdcall;



function SetupOpenAppendInfFileW(FileName:  PCWSTR; 
                                 InfHandle:   HINF; 
                                 ERRORLINE: PUINT): BOOL; stdcall;


function SetupOpenAppendInfFileA(FileName:  PCSTR; 
                                 InfHandle:   HINF; 
                                 ERRORLINE: PUINT): BOOL; stdcall; 

function SetupOpenAppendInfFile(FileName:  PCSTR; 
                                 InfHandle:   HINF; 
                                 ERRORLINE: PUINT): BOOL; stdcall; 


procedure SetupCloseInfFile(InfHandle:  HINF); stdcall; 



function SetupFindFirstLineA(InfHandle:  HINF; 
                             Section:  PCSTR; 
                             Key:  PCSTR; 
                             Context:   PINFCONTEXT): BOOL; stdcall; 

function SetupFindFirstLineW(InfHandle:  HINF; 
                             Section:  PCWSTR; 
                             Key:  PCWSTR; 
                             Context:   PINFCONTEXT): BOOL; stdcall; 

function SetupFindFirstLine(InfHandle:  HINF; 
                             Section:  PCSTR; 
                             Key:  PCSTR; 
                             Context:   PINFCONTEXT): BOOL; stdcall; 

function SetupFindNextLine(ContextIn:  PINFCONTEXT; 
                           ContextOut:  PINFCONTEXT): BOOL; stdcall; 



function SetupFindNextMatchLineA(ContextIn:  PINFCONTEXT; 
                                 Key:  PCSTR; 
                                 ContextOut:   PINFCONTEXT): BOOL; stdcall; 


function SetupFindNextMatchLineW(ContextIn:  PINFCONTEXT; 
                                 Key:  PCWSTR; 
                                 ContextOut:   PINFCONTEXT): BOOL; stdcall; 

function SetupFindNextMatchLine(ContextIn:  PINFCONTEXT; 
                                 Key:  PCSTR; 
                                 ContextOut:   PINFCONTEXT): BOOL; stdcall; 

function SetupGetLineByIndexA(InfHandle:  HINF; 
                              Section:  PCSTR; 
                              Index:  DWORD; 
                              Context:  PINFCONTEXT): BOOL; stdcall; 


function SetupGetLineByIndexW(InfHandle:  HINF; 
                              Section:  PCWSTR; 
                              Index:  DWORD; 
                              Context:  PINFCONTEXT): BOOL; stdcall; 

function SetupGetLineByIndex(InfHandle:  HINF; 
                              Section:  PCSTR; 
                              Index:  DWORD; 
                              Context:  PINFCONTEXT): BOOL; stdcall; 

function SetupGetLineCountA(InfHandle:  HINF;
                            Section:  PCSTR): LONGINT; stdcall;


function SetupGetLineCountW(InfHandle:  HINF;
                            Section:  PCWSTR): LONGINT; stdcall;

function SetupGetLineCount(InfHandle:  HINF;
                            Section:  PCSTR): LONGINT; stdcall;

function SetupGetLineTextA(Context:  PINFCONTEXT;
                           InfHandle:   HINF;
                           Section:   PCSTR;
                           Key:   PCSTR;
                           ReturnBuffer:   PSTR;
                           ReturnBufferSize:   DWORD; 
                           REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetLineTextW(Context:  PINFCONTEXT; 
                           InfHandle:   HINF; 
                           Section:   PCWSTR; 
                           Key:   PCWSTR; 
                           ReturnBuffer:   PWSTR; 
                           ReturnBufferSize:   DWORD; 
                           REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupGetLineText(Context:  PINFCONTEXT; 
                           InfHandle:   HINF; 
                           Section:   PCSTR; 
                           Key:   PCSTR; 
                           ReturnBuffer:   PSTR; 
                           ReturnBufferSize:   DWORD; 
                           REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetFieldCount(Context:  PINFCONTEXT): DWORD; stdcall; 



function SetupGetStringFieldA(Context:  PINFCONTEXT; 
                              FieldIndex:  DWORD; 
                              ReturnBuffer:  PSTR; 
                              ReturnBufferSize:   DWORD; 
                              REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetStringFieldW(Context:  PINFCONTEXT; 
                              FieldIndex:  DWORD; 
                              ReturnBuffer:  PWSTR; 
                              ReturnBufferSize:   DWORD; 
                              REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupGetStringField(Context:  PINFCONTEXT; 
                              FieldIndex:  DWORD; 
                              ReturnBuffer:  PSTR; 
                              ReturnBufferSize:   DWORD; 
                              REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupGetIntField(Context:  PINFCONTEXT; 
                          FieldIndex:  DWORD; 
                          IntegerValue:  PINT): BOOL; stdcall; 


function SetupGetMultiSzFieldA(Context:  PINFCONTEXT; 
                               FieldIndex:  DWORD; 
                               ReturnBuffer:  PSTR; 
                               ReturnBufferSize:   DWORD; 
                               REQUIREDSIZE: LPDWORD): BOOL; stdcall; 


function SetupGetMultiSzFieldW(Context:  PINFCONTEXT; 
                               FieldIndex:  DWORD; 
                               ReturnBuffer:  PWSTR; 
                               ReturnBufferSize:   DWORD; 
                               REQUIREDSIZE: LPDWORD): BOOL; stdcall; 

function SetupGetMultiSzField(Context:  PINFCONTEXT; 
                               FieldIndex:  DWORD; 
                               ReturnBuffer:  PSTR; 
                               ReturnBufferSize:   DWORD; 
                               REQUIREDSIZE: LPDWORD): BOOL; stdcall; 


function SetupGetBinaryField(Context:  PINFCONTEXT; 
                             FieldIndex:  DWORD; 
                             ReturnBuffer:  PBYTE; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: LPDWORD): BOOL; stdcall; 



function SetupGetFileCompressionInfoA(SourceFileName:  PCSTR; 
                                      var ActualSourceFileName:  PSTR; 
                                      SourceFileSize:  PDWORD; 
                                      TargetFileSize:  PDWORD; 
                                      CompressionType:  PUINT): DWORD; stdcall; 


function SetupGetFileCompressionInfoW(SourceFileName:  PCWSTR; 
                                      var ActualSourceFileName:  PWSTR; 
                                      SourceFileSize:  PDWORD; 
                                      TargetFileSize:  PDWORD; 
                                      CompressionType:  PUINT): DWORD; stdcall; 

function SetupGetFileCompressionInfo(SourceFileName:  PCSTR; 
                                      var ActualSourceFileName:  PSTR; 
                                      SourceFileSize:  PDWORD; 
                                      TargetFileSize:  PDWORD; 
                                      CompressionType:  PUINT): DWORD; stdcall; 


/// 
/// Compression types 
/// 
const
  FILE_COMPRESSION_NONE = 0;
  FILE_COMPRESSION_WINLZA = 1;
  FILE_COMPRESSION_MSZIP = 2;


function SetupDecompressOrCopyFileA(SourceFileName:  PCSTR;
                                    TargetFileName:  PCSTR; 
                                    COMPRESSIONTYPE: PUINT): DWORD; stdcall; 


function SetupDecompressOrCopyFileW(SourceFileName:  PCWSTR; 
                                    TargetFileName:  PCWSTR; 
                                    COMPRESSIONTYPE:  PUINT): DWORD; stdcall; 

function SetupDecompressOrCopyFile(SourceFileName:  PCSTR; 
                                    TargetFileName:  PCSTR; 
                                    COMPRESSIONTYPE: PUINT): DWORD; stdcall; 


function SetupGetSourceFileLocationA(InfHandle:  HINF; 
                                     InfContext:  PINFCONTEXT; 
                                     FileName:   PCSTR; 
                                     SourceId:   PUINT; 
                                     ReturnBuffer:  PSTR; 
                                     ReturnBufferSize:   DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetSourceFileLocationW(InfHandle:  HINF; 
                                     InfContext:  PINFCONTEXT; 
                                     FileName:   PCWSTR; 
                                     SourceId:   PUINT; 
                                     ReturnBuffer:  PWSTR; 
                                     ReturnBufferSize:   DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupGetSourceFileLocation(InfHandle:  HINF; 
                                     InfContext:  PINFCONTEXT; 
                                     FileName:   PCSTR; 
                                     SourceId:   PUINT; 
                                     ReturnBuffer:  PSTR; 
                                     ReturnBufferSize:   DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetSourceFileSizeA(InfHandle:  HINF; 
                                 InfContext:  PINFCONTEXT; 
                                 FileName:   PCSTR; 
                                 Section:   PCSTR; 
                                 FileSize:   PDWORD; 
                                 ROUNDINGFACTOR:  UINT): BOOL; stdcall; 


function SetupGetSourceFileSizeW(InfHandle:  HINF; 
                                 InfContext:  PINFCONTEXT; 
                                 FileName:   PCWSTR; 
                                 Section:   PCWSTR; 
                                 FileSize:   PDWORD; 
                                 ROUNDINGFACTOR:  UINT): BOOL; stdcall; 


function SetupGetSourceFileSize(InfHandle:  HINF; 
                                 InfContext:  PINFCONTEXT; 
                                 FileName:   PCSTR; 
                                 Section:   PCSTR; 
                                 FileSize:   PDWORD; 
                                 ROUNDINGFACTOR:  UINT): BOOL; stdcall; 


function SetupGetTargetPathA(InfHandle:  HINF; 
                             InfContext:  PINFCONTEXT; 
                             Section:   PCSTR; 
                             ReturnBuffer:   PSTR; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetTargetPathW(InfHandle:  HINF; 
                             InfContext:  PINFCONTEXT; 
                             Section:   PCWSTR; 
                             ReturnBuffer:   PWSTR; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupGetTargetPath(InfHandle:  HINF; 
                             InfContext:  PINFCONTEXT; 
                             Section:   PCSTR; 
                             ReturnBuffer:   PSTR; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: PDWORD): BOOL; stdcall; 


/// 
/// Define flags for SourceList APIs. 
/// 
const
  SRCLIST_TEMPORARY = $00000001;
  SRCLIST_NOBROWSE = $00000002;
  SRCLIST_SYSTEM = $00000010;
  SRCLIST_USER = $00000020;
  SRCLIST_SYSIFADMIN = $00000040;
  SRCLIST_SUBDIRS = $00000100;
  SRCLIST_APPEND = $00000200;
  SRCLIST_NOSTRIPPLATFORM = $00000400;


function SetupSetSourceListA(Flags:  DWORD;
                             var SourceList:  PCSTR; 
                             SourceCount:  UINT): BOOL; stdcall; 


function SetupSetSourceListW(Flags:  DWORD; 
                             var SourceList:  PCWSTR; 
                             SourceCount:  UINT): BOOL; stdcall; 

function SetupSetSourceList(Flags:  DWORD; 
                             var SourceList:  PCSTR; 
                             SourceCount:  UINT): BOOL; stdcall; 

function SetupCancelTemporarySourceList: BOOL; stdcall; 



function SetupAddToSourceListA(Flags:  DWORD; 
                               Source:  PCSTR): BOOL; stdcall; 


function SetupAddToSourceListW(Flags:  DWORD; 
                               Source:  PCWSTR): BOOL; stdcall; 

function SetupAddToSourceList(Flags:  DWORD; 
                               Source:  PCSTR): BOOL; stdcall; 


function SetupRemoveFromSourceListA(Flags:  DWORD; 
                                    Source:  PCSTR): BOOL; stdcall; 


function SetupRemoveFromSourceListW(Flags:  DWORD; 
                                    Source:  PCWSTR): BOOL; stdcall; 

function SetupRemoveFromSourceList(Flags:  DWORD; 
                                    Source:  PCSTR): BOOL; stdcall; 


function SetupQuerySourceListA(Flags:  DWORD; 
                               var List:  PCSTR; 
                               Count:  PUINT): BOOL; stdcall; 


function SetupQuerySourceListW(Flags:  DWORD; 
                               var List:  PCWSTR; 
                               Count:  PUINT): BOOL; stdcall; 

function SetupQuerySourceList(Flags:  DWORD; 
                               var List:  PCSTR; 
                               Count:  PUINT): BOOL; stdcall; 


function SetupFreeSourceListA(var List:   PCSTR; 
                              Count:  UINT): BOOL; stdcall; 


function SetupFreeSourceListW(var List:   PCWSTR; 
                              Count:  UINT): BOOL; stdcall; 

function SetupFreeSourceList(var List:   PCSTR; 
                              Count:  UINT): BOOL; stdcall; 


function SetupPromptForDiskA(hwndParent:  HWND; 
                             DialogTitle:  PCSTR; 
                             DiskName:   PCSTR; 
                             PathToSource:   PCSTR; 
                             FileSought:   PCSTR; 
                             TagFile:  PCSTR; 
                             DiskPromptStyle:   DWORD; 
                             PathBuffer:  PSTR; 
                             PathBufferSize: DWORD;
                             PathRequiredSize : PDWORD
                             )
: UINT; stdcall; 

function SetupPromptForDiskW(hwndParent:  HWND; 
                             DialogTitle:  PCWSTR; 
                             DiskName:   PCWSTR; 
                             PathToSource:   PCWSTR; 
                             FileSought:   PCWSTR; 
                             TagFile:  PCWSTR; 
                             DiskPromptStyle:   DWORD; 
                             PathBuffer:  PWSTR; 
                             PathBufferSize: DWORD;
                             PathRequiredSize : PDWORD
                             )
: UINT; stdcall; 

function SetupPromptForDisk(hwndParent:  HWND; 
                             DialogTitle:  PCSTR; 
                             DiskName:   PCSTR; 
                             PathToSource:   PCSTR; 
                             FileSought:   PCSTR; 
                             TagFile:  PCSTR; 
                             DiskPromptStyle:   DWORD; 
                             PathBuffer:  PSTR; 
                             PathBufferSize: DWORD;
                             PathRequiredSize : PDWORD
                             )
: UINT; stdcall; 

function SetupCopyErrorA(hwndParent:  HWND; 
                         DialogTitle:  PCSTR; 
                         DiskName:   PCSTR; 
                         PathToSource:   PCSTR; 
                         SourceFile:  PCSTR; 
                         TargetPathFile:  PCSTR; 
                         Win32ErrorCode:   UINT; 
                         Style:  DWORD; 
                         PathBuff:  PSTR; 
                         PathBufferSize: DWORD;
                         PathRequiredSize : PDWORD
                         )
: UINT; stdcall; 

function SetupCopyErrorW(hwndParent:  HWND; 
                         DialogTitle:  PCWSTR; 
                         DiskName:   PCWSTR; 
                         PathToSource:   PCWSTR; 
                         SourceFile:  PCWSTR; 
                         TargetPathFile:  PCWSTR; 
                         Win32ErrorCode:   UINT; 
                         Style:  DWORD; 
                         PathBuff:  PWSTR; 
                         PathBufferSize: DWORD;
                         PathRequiredSize : PDWORD
                         )
: UINT; stdcall; 

function SetupCopyError(hwndParent:  HWND; 
                         DialogTitle:  PCSTR; 
                         DiskName:   PCSTR; 
                         PathToSource:   PCSTR; 
                         SourceFile:  PCSTR; 
                         TargetPathFile:  PCSTR; 
                         Win32ErrorCode:   UINT; 
                         Style:  DWORD; 
                         PathBuff:  PSTR; 
                         PathBufferSize: DWORD;
                         PathRequiredSize : PDWORD
                         )
: UINT; stdcall; 

function SetupRenameErrorA(hwndParent:  HWND; 
                           DialogTitle:  PCSTR; 
                           SourceFile:   PCSTR; 
                           TargetFile:  PCSTR; 
                           Win32ErrorCode:  UINT; 
                           Style:  DWORD): UINT; stdcall; 


function SetupRenameErrorW(hwndParent:  HWND; 
                           DialogTitle:  PCWSTR; 
                           SourceFile:   PCWSTR; 
                           TargetFile:  PCWSTR; 
                           Win32ErrorCode:  UINT; 
                           Style:  DWORD): UINT; stdcall; 

function SetupRenameError(hwndParent:  HWND; 
                           DialogTitle:  PCSTR; 
                           SourceFile:   PCSTR; 
                           TargetFile:  PCSTR; 
                           Win32ErrorCode:  UINT; 
                           Style:  DWORD): UINT; stdcall; 

function SetupDeleteErrorA(hwndParent:  HWND; 
                           DialogTitle:  PCSTR; 
                           _File:   PCSTR;
                           Win32ErrorCode:  UINT;
                           Style:  DWORD): UINT; stdcall;


function SetupDeleteErrorW(hwndParent:  HWND;
                           DialogTitle:  PCWSTR;
                           _File:   PCWSTR;
                           Win32ErrorCode:  UINT;
                           Style:  DWORD): UINT; stdcall;

function SetupDeleteError(hwndParent:  HWND;
                           DialogTitle:  PCSTR;
                           _File:   PCSTR;
                           Win32ErrorCode:  UINT;
                           Style:  DWORD): UINT; stdcall; 


/// 
/// Styles for SetupPromptForDisk, SetupCopyError, 
/// SetupRenameError, SetupDeleteError 
/// 
const
  IDF_NOBROWSE = $00000001;
  IDF_NOSKIP = $00000002;
  IDF_NODETAILS = $00000004;
  IDF_NOCOMPRESSED = $00000008;
  IDF_CHECKFIRST = $00000100;
  IDF_NOBEEP = $00000200;
  IDF_NOFOREGROUND = $00000400;
  IDF_WARNIFSKIP = $00000800;
  IDF_OEMDISK = $80000000;

/// 
/// Return values for SetupPromptForDisk, SetupCopyError, 
/// SetupRenameError, SetupDeleteError 
/// 
  DPROMPT_SUCCESS = 0;
  DPROMPT_CANCEL = 1;
  DPROMPT_SKIPFILE = 2;
  DPROMPT_BUFFERTOOSMALL = 3;
  DPROMPT_OUTOFMEMORY = 4;



function SetupSetDirectoryIdA(InfHandle:  HINF;
                              Id:  DWORD; 
                              DIRECTORY:   PCSTR): BOOL; stdcall; 


function SetupSetDirectoryIdW(InfHandle:  HINF; 
                              Id:  DWORD; 
                              DIRECTORY:   PCSTR): BOOL; stdcall; 

function SetupSetDirectoryId(InfHandle:  HINF; 
                              Id:  DWORD; 
                              DIRECTORY:   PCSTR): BOOL; stdcall; 


function SetupSetDirectoryIdExA(InfHandle:  HINF; 
                                Id:  DWORD; 
                                Directory:   PCSTR; 
                                Flags:   DWORD; 
                                Reserved1:  DWORD; 
                                Reserved2:  PVOID): BOOL; stdcall; 


function SetupSetDirectoryIdExW(InfHandle:  HINF; 
                                Id:  DWORD; 
                                Directory:   PCWSTR; 
                                Flags:   DWORD; 
                                Reserved1:  DWORD; 
                                Reserved2:  PVOID): BOOL; stdcall; 

function SetupSetDirectoryIdEx(InfHandle:  HINF; 
                                Id:  DWORD; 
                                Directory:   PCSTR; 
                                Flags:   DWORD; 
                                Reserved1:  DWORD; 
                                Reserved2:  PVOID): BOOL; stdcall; 


/// 
/// Flags for SetupSetDirectoryIdEx 
/// 
const
  SETDIRID_NOT_FULL_PATH = $00000001;



function SetupGetSourceInfoA(InfHandle:  HINF;
                             SourceId:  UINT; 
                             InfoDesired:  UINT; 
                             ReturnBuffer:  PSTR; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupGetSourceInfoW(InfHandle:  HINF; 
                             SourceId:  UINT; 
                             InfoDesired:  UINT; 
                             ReturnBuffer:  PWSTR; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupGetSourceInfo(InfHandle:  HINF; 
                             SourceId:  UINT; 
                             InfoDesired:  UINT; 
                             ReturnBuffer:  PSTR; 
                             ReturnBufferSize:   DWORD; 
                             REQUIREDSIZE: PDWORD): BOOL; stdcall; 


/// 
/// InfoDesired values for SetupGetSourceInfo 
/// 
const
  SRCINFO_PATH = 1;
  SRCINFO_TAGFILE = 2;
  SRCINFO_DESCRIPTION = 3;



function SetupInstallFileA(InfHandle:  HINF;
                           InfContext:   PINFCONTEXT; 
                           SourceFile:   PCSTR; 
                           SourcePathRoot:   PCSTR; 
                           DestinationName:   PCSTR; 
                           CopyStyle:   DWORD; 
                           CopyMsgHandler:  PSP_FILE_CALLBACK_A; 
                           Context: PVOID
                           )
: BOOL; stdcall; 

function SetupInstallFileW(InfHandle:  HINF; 
                           InfContext:   PINFCONTEXT; 
                           SourceFile:   PCWSTR; 
                           SourcePathRoot:   PCWSTR; 
                           DestinationName:   PCWSTR; 
                           CopyStyle:   DWORD; 
                           CopyMsgHandler:  PSP_FILE_CALLBACK_W; 
                           Context: PVOID
                           )
: BOOL; stdcall; 

function SetupInstallFile(InfHandle:  HINF; 
                           InfContext:   PINFCONTEXT; 
                           SourceFile:   PCSTR; 
                           SourcePathRoot:   PCSTR; 
                           DestinationName:   PCSTR; 
                           CopyStyle:   DWORD; 
                           CopyMsgHandler:  PSP_FILE_CALLBACK_A; 
                           Context: PVOID
                           )
: BOOL; stdcall; 

function SetupInstallFileExA(InfHandle:  HINF; 
                             InfContext:   PINFCONTEXT; 
                             SourceFile:   PCSTR; 
                             SourcePathRoot:   PCSTR; 
                             DestinationName:   PCSTR; 
                             CopyStyle:   DWORD; 
                             CopyMsgHandler:  PSP_FILE_CALLBACK_A; 
                             Context: PVOID;
                             FileWasInUse : PBOOL
                             )
: BOOL; stdcall; 

function SetupInstallFileExW(InfHandle:  HINF; 
                             InfContext:   PINFCONTEXT; 
                             SourceFile:   PCWSTR; 
                             SourcePathRoot:   PCWSTR; 
                             DestinationName:   PCWSTR; 
                             CopyStyle:   DWORD; 
                             CopyMsgHandler:  PSP_FILE_CALLBACK_A; 
                             Context: PVOID;
                             FileWasInUse : PBOOL
                             )
: BOOL; stdcall; 

function SetupInstallFileEx(InfHandle:  HINF; 
                             InfContext:   PINFCONTEXT; 
                             SourceFile:   PCSTR; 
                             SourcePathRoot:   PCSTR; 
                             DestinationName:   PCSTR; 
                             CopyStyle:   DWORD; 
                             CopyMsgHandler:  PSP_FILE_CALLBACK_A; 
                             Context: PVOID;
                             FileWasInUse : PBOOL
                             )
: BOOL; stdcall; 

/// 
/// CopyStyle values for copy and queue-related APIs 
/// 
const
  SP_COPY_DELETESOURCE = $0000001; // delete source file on successful copy
  SP_COPY_REPLACEONLY = $0000002; // copy only if target file already present
  SP_COPY_NEWER = $0000004; // copy only if source newer than or same as target
  SP_COPY_NEWER_OR_SAME = SP_COPY_NEWER;
  SP_COPY_NOOVERWRITE = $0000008; // copy only if target doesn't exist
  SP_COPY_NODECOMP = $0000010; // don't decompress source file while copying
  SP_COPY_LANGUAGEAWARE = $0000020; // don't overwrite file of different language
  SP_COPY_SOURCE_ABSOLUTE = $0000040; // SourceFile is a full source path
  SP_COPY_SOURCEPATH_ABSOLUTE = $0000080; // SourcePathRoot is the full path
  SP_COPY_IN_USE_NEEDS_REBOOT = $0000100; // System needs reboot if file in use
  SP_COPY_FORCE_IN_USE = $0000200; // Force target-in-use behavior
  SP_COPY_NOSKIP = $0000400; // Skip is disallowed for this file or section
  SP_FLAG_CABINETCONTINUATION = $0000800; // Used with need media notification
  SP_COPY_FORCE_NOOVERWRITE = $0001000; // like NOOVERWRITE but no callback nofitication
  SP_COPY_FORCE_NEWER = $0002000; // like NEWER but no callback nofitication
  SP_COPY_WARNIFSKIP = $0004000; // system critical file: warn if user tries to skip
  SP_COPY_NOBROWSE = $0008000; // Browsing is disallowed for this file or section
  SP_COPY_NEWER_ONLY = $0010000; // copy only if source file newer than target



function SetupOpenFileQueue: HSPFILEQ; stdcall;


function SetupCloseFileQueue(QueueHandle:  HSPFILEQ): BOOL; stdcall; 



function SetupSetPlatformPathOverrideA(_OVERRIDE:PCSTR): BOOL; stdcall; 

function SetupSetPlatformPathOverrideW( _OVERRIDE:PCWSTR): BOOL; stdcall; 

function SetupSetPlatformPathOverride(_OVERRIDE:PCSTR): BOOL; stdcall; 


function SetupQueueCopyA(QueueHandle:  HSPFILEQ; 
                         SourceRootPath:  PCSTR; 
                         SourcePath:  PCSTR; 
                         SourceFilename:   PCSTR; 
                         SourceDescription:  PCSTR; 
                         SourceTagfile:   PCSTR; 
                         TargetDirectory:   PCSTR; 
                         TargetFilename : PCSTR;
                         CopyStyle : DWORD
                         )
: BOOL; stdcall; 

function SetupQueueCopyW(QueueHandle:  HSPFILEQ; 
                         SourceRootPath:  PCWSTR; 
                         SourcePath:  PCWSTR; 
                         SourceFilename:   PCWSTR; 
                         SourceDescription:  PCWSTR; 
                         SourceTagfile:   PCWSTR; 
                         TargetDirectory:   PCWSTR; 
                         TargetFilename : PCWSTR;
                         CopyStyle : DWORD
                         )
: BOOL; stdcall; 

function SetupQueueCopy(QueueHandle:  HSPFILEQ; 
                         SourceRootPath:  PCSTR; 
                         SourcePath:  PCSTR; 
                         SourceFilename:   PCSTR; 
                         SourceDescription:  PCSTR; 
                         SourceTagfile:   PCSTR; 
                         TargetDirectory:   PCSTR; 
                         TargetFilename : PCSTR;
                         CopyStyle : DWORD
                         )
: BOOL; stdcall; 


function SetupQueueDefaultCopyA(QueueHandle:  HSPFILEQ; 
                                InfHandle:  HINF; 
                                SourceRootPath:  PCSTR; 
                                SourceFilename:  PCSTR; 
                                TargetFilename:  PCSTR; 
                                CopyStyle:  DWORD): BOOL; stdcall; 


function SetupQueueDefaultCopyW(QueueHandle:  HSPFILEQ; 
                                InfHandle:  HINF; 
                                SourceRootPath:  PCWSTR; 
                                SourceFilename:  PCWSTR; 
                                TargetFilename:  PCWSTR; 
                                CopyStyle:  DWORD): BOOL; stdcall; 

function SetupQueueDefaultCopy(QueueHandle:  HSPFILEQ; 
                                InfHandle:  HINF; 
                                SourceRootPath:  PCSTR; 
                                SourceFilename:  PCSTR; 
                                TargetFilename:  PCSTR; 
                                CopyStyle:  DWORD): BOOL; stdcall; 


function SetupQueueCopySectionA(QueueHandle:  HSPFILEQ; 
                                SourceRootPath:  PCSTR; 
                                InfHandle:  HINF; 
                                ListInfHandle:  HINF; 
                                Section:   PCSTR; 
                                CopyStyle:  DWORD): BOOL; stdcall; 


function SetupQueueCopySectionW(QueueHandle:  HSPFILEQ; 
                                SourceRootPath:  PCWSTR; 
                                InfHandle:  HINF; 
                                ListInfHandle:  HINF; 
                                Section:   PCWSTR; 
                                CopyStyle:  DWORD): BOOL; stdcall; 

function SetupQueueCopySection(QueueHandle:  HSPFILEQ; 
                                SourceRootPath:  PCSTR; 
                                InfHandle:  HINF; 
                                ListInfHandle:  HINF; 
                                Section:   PCSTR; 
                                CopyStyle:  DWORD): BOOL; stdcall; 


function SetupQueueDeleteA(QueueHandle:  HSPFILEQ; 
                           PathPart1:  PCSTR; 
                           PATHPART2:  PCSTR): BOOL; stdcall; 


function SetupQueueDeleteW(QueueHandle:  HSPFILEQ; 
                           PathPart1:  PCWSTR; 
                           PATHPART2:  PCWSTR): BOOL; stdcall; 

function SetupQueueDelete(QueueHandle:  HSPFILEQ; 
                           PathPart1:  PCSTR; 
                           PATHPART2:  PCSTR): BOOL; stdcall; 

function SetupQueueDeleteSectionA(QueueHandle:  HSPFILEQ; 
                                  InfHandle:  HINF; 
                                  ListInfHandle:  HINF; 
                                  Section:   PCSTR): BOOL; stdcall; 


function SetupQueueDeleteSectionW(QueueHandle:  HSPFILEQ; 
                                  InfHandle:  HINF; 
                                  ListInfHandle:  HINF; 
                                  Section:   PCWSTR): BOOL; stdcall; 

function SetupQueueDeleteSection(QueueHandle:  HSPFILEQ; 
                                  InfHandle:  HINF; 
                                  ListInfHandle:  HINF; 
                                  Section:   PCSTR): BOOL; stdcall; 


function SetupQueueRenameA(QueueHandle:  HSPFILEQ; 
                           SourcePath:  PCSTR; 
                           SourceFilename:  PCSTR; 
                           TargetPath:   PCSTR; 
                           TargetFilename:   PCSTR): BOOL; stdcall; 


function SetupQueueRenameW(QueueHandle:  HSPFILEQ; 
                           SourcePath:  PCWSTR; 
                           SourceFilename:  PCWSTR; 
                           TargetPath:   PCWSTR; 
                           TargetFilename:   PCWSTR): BOOL; stdcall; 

function SetupQueueRename(QueueHandle:  HSPFILEQ; 
                           SourcePath:  PCSTR; 
                           SourceFilename:  PCSTR; 
                           TargetPath:   PCSTR; 
                           TargetFilename:   PCSTR): BOOL; stdcall; 


function SetupQueueRenameSectionA(QueueHandle:  HSPFILEQ; 
                                  InfHandle:  HINF; 
                                  ListInfHandle:  HINF; 
                                  Section:   PCSTR): BOOL; stdcall; 


function SetupQueueRenameSectionW(QueueHandle:  HSPFILEQ; 
                                  InfHandle:  HINF; 
                                  ListInfHandle:  HINF; 
                                  Section:   PCWSTR): BOOL; stdcall; 

function SetupQueueRenameSection(QueueHandle:  HSPFILEQ; 
                                  InfHandle:  HINF; 
                                  ListInfHandle:  HINF; 
                                  Section:   PCSTR): BOOL; stdcall; 


function SetupCommitFileQueueA(Owner:  HWND; 
                               QueueHandle:   HSPFILEQ; 
                               MsgHandler:  PSP_FILE_CALLBACK_A; 
                               Context:  PVOID): BOOL; stdcall; 


function SetupCommitFileQueueW(Owner:  HWND; 
                               QueueHandle:   HSPFILEQ; 
                               MsgHandler:  PSP_FILE_CALLBACK_W; 
                               Context:  PVOID): BOOL; stdcall; 

function SetupCommitFileQueue(Owner:  HWND; 
                               QueueHandle:   HSPFILEQ; 
                               MsgHandler:  PSP_FILE_CALLBACK_A; 
                               Context:  PVOID): BOOL; stdcall; 


function SetupScanFileQueueA(FileQueue:  HSPFILEQ; 
                             Flags:  DWORD; 
                             Window:  HWND; 
                             CallbackRoutine:   PSP_FILE_CALLBACK_A; 
                             CallbackContext:   PVOID; 
                             Result:   PDWORD): BOOL; stdcall; 


function SetupScanFileQueueW(FileQueue:  HSPFILEQ; 
                             Flags:  DWORD; 
                             Window:  HWND; 
                             CallbackRoutine:   PSP_FILE_CALLBACK_W; 
                             CallbackContext:   PVOID; 
                             Result:   PDWORD): BOOL; stdcall; 

function SetupScanFileQueue(FileQueue:  HSPFILEQ; 
                             Flags:  DWORD; 
                             Window:  HWND; 
                             CallbackRoutine:   PSP_FILE_CALLBACK_A; 
                             CallbackContext:   PVOID; 
                             Result:   PDWORD): BOOL; stdcall; 

/// 
/// Define flags for SetupScanFileQueue. 
/// 
const
  SPQ_SCAN_FILE_PRESENCE = $00000001;
  SPQ_SCAN_FILE_VALIDITY = $00000002;
  SPQ_SCAN_USE_CALLBACK = $00000004;
  SPQ_SCAN_INFORM_USER = $00000010;

/// 
/// Define flags used with Param2 for SPFILENOTIFY_QUEUESCAN 
/// 
  SPQ_DELAYED_COPY = $00000001; // file was in use; registered for delayed copy


/// 
/// Define OEM Source Type values for use in SetupCopyOEMInf. 
/// 
  SPOST_NONE = 0;
  SPOST_PATH = 1;
  SPOST_URL = 2;
  SPOST_MAX = 3;


function SetupCopyOEMInfA(SourceInfFileName:  PCSTR; 
                          OEMSourceMediaLocation:  PCSTR; 
                          OEMSourceMediaType:   DWORD; 
                          CopyStyle:  DWORD; 
                          DestinationInfFileName:  PSTR; 
                          DestinationInfFileNameSize:   DWORD; 
                          RequiredSize : PDWORD;
                          var DestinationInfFileNameComponent: PSTR
                          )
: BOOL; stdcall;

function SetupCopyOEMInfW(SourceInfFileName:  PCWSTR;
                          OEMSourceMediaLocation:  PCWSTR;
                          OEMSourceMediaType:   DWORD;
                          CopyStyle:  DWORD;
                          DestinationInfFileName:  PWSTR;
                          DestinationInfFileNameSize:   DWORD;
                          RequiredSize : PDWORD;
                          var DestinationInfFileNameComponent: PWSTR
                          )
: BOOL; stdcall;

function SetupCopyOEMInf(SourceInfFileName:  PCSTR;
                          OEMSourceMediaLocation:  PCSTR;
                          OEMSourceMediaType:   DWORD;
                          CopyStyle:  DWORD;
                          DestinationInfFileName:  PSTR;
                          DestinationInfFileNameSize:   DWORD;
                          RequiredSize : PDWORD;
                          var DestinationInfFileNameComponent: PSTR
                          )
: BOOL; stdcall; 


/// 
/// Disk space list APIs 
/// 

function SetupCreateDiskSpaceListA(Reserved1:  PVOID; 
                                   Reserved2:  DWORD; 
                                   Flags:  UINT): HDSKSPC; stdcall; 


function SetupCreateDiskSpaceListW(Reserved1:  PVOID; 
                                   Reserved2:  DWORD; 
                                   Flags:  UINT): HDSKSPC; stdcall; 

function SetupCreateDiskSpaceList(Reserved1:  PVOID; 
                                   Reserved2:  DWORD; 
                                   Flags:  UINT): HDSKSPC; stdcall; 

/// 
/// Flags for SetupCreateDiskSpaceList 
/// 
const
  SPDSL_IGNORE_DISK = $00000001; // ignore deletes and on-disk files in copies
  SPDSL_DISALLOW_NEGATIVE_ADJUST = $00000002;



function SetupDuplicateDiskSpaceListA(DiskSpace:  HDSKSPC;
                                      Reserved1:  PVOID; 
                                      Reserved2:  DWORD; 
                                      Flags:  UINT): HDSKSPC; stdcall; 


function SetupDuplicateDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                      Reserved1:  PVOID; 
                                      Reserved2:  DWORD; 
                                      Flags:  UINT): HDSKSPC; stdcall; 

function SetupDuplicateDiskSpaceList(DiskSpace:  HDSKSPC; 
                                      Reserved1:  PVOID; 
                                      Reserved2:  DWORD; 
                                      Flags:  UINT): HDSKSPC; stdcall; 

function SetupDestroyDiskSpaceList(DiskSpace:   HDSKSPC): BOOL; stdcall; 



function SetupQueryDrivesInDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                          ReturnBuffer:  PSTR; 
                                          ReturnBufferSize:   DWORD; 
                                          REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupQueryDrivesInDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                          ReturnBuffer:  PWSTR; 
                                          ReturnBufferSize:   DWORD; 
                                          REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupQueryDrivesInDiskSpaceList(DiskSpace:  HDSKSPC; 
                                          ReturnBuffer:  PSTR; 
                                          ReturnBufferSize:   DWORD; 
                                          REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupQuerySpaceRequiredOnDriveA(DiskSpace:  HDSKSPC; 
                                         DriveSpec:  PCSTR; 
                                         var SpaceRequired:  LONGLONG; 
                                         Reserved1:  PVOID; 
                                         Reserved2:  UINT): BOOL; stdcall; 


function SetupQuerySpaceRequiredOnDriveW(DiskSpace:  HDSKSPC; 
                                         DriveSpec:  PCWSTR; 
                                         var SpaceRequired:  LONGLONG; 
                                         Reserved1:  PVOID; 
                                         Reserved2:  UINT): BOOL; stdcall; 

function SetupQuerySpaceRequiredOnDrive(DiskSpace:  HDSKSPC; 
                                         DriveSpec:  PCSTR; 
                                         var SpaceRequired:  LONGLONG; 
                                         Reserved1:  PVOID; 
                                         Reserved2:  UINT): BOOL; stdcall; 


function SetupAdjustDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                   DriveRoot:  LPCSTR; 
                                   Amount:  LONGLONG; 
                                   Reserved1:  PVOID; 
                                   Reserved2:  UINT): BOOL; stdcall; 


function SetupAdjustDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                   DriveRoot:  LPCWSTR; 
                                   Amount:  LONGLONG; 
                                   Reserved1:  PVOID; 
                                   Reserved2:  UINT): BOOL; stdcall; 

function SetupAdjustDiskSpaceList(DiskSpace:  HDSKSPC; 
                                   DriveRoot:  LPCSTR; 
                                   Amount:  LONGLONG; 
                                   Reserved1:  PVOID; 
                                   Reserved2:  UINT): BOOL; stdcall; 



function SetupAddToDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                  TargetFilespec:  PCSTR; 
                                  FileSize:  LONGLONG; 
                                  Operation:  UINT; 
                                  Reserved1:  PVOID; 
                                  Reserved2:  UINT): BOOL; stdcall; 


function SetupAddToDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                  TargetFilespec:  PCWSTR; 
                                  FileSize:  LONGLONG; 
                                  Operation:  UINT; 
                                  Reserved1:  PVOID; 
                                  Reserved2:  UINT): BOOL; stdcall; 

function SetupAddToDiskSpaceList(DiskSpace:  HDSKSPC; 
                                  TargetFilespec:  PCSTR; 
                                  FileSize:  LONGLONG; 
                                  Operation:  UINT; 
                                  Reserved1:  PVOID; 
                                  Reserved2:  UINT): BOOL; stdcall; 


function SetupAddSectionToDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                         InfHandle:  HINF; 
                                         ListInfHandle:  HINF; 
                                         SectionName:   PCSTR; 
                                         Operation:  UINT; 
                                         Reserved1:  PVOID; 
                                         Reserved2:  UINT): BOOL; stdcall; 


function SetupAddSectionToDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                         InfHandle:  HINF; 
                                         ListInfHandle:  HINF; 
                                         SectionName:   PCWSTR; 
                                         Operation:  UINT; 
                                         Reserved1:  PVOID; 
                                         Reserved2:  UINT): BOOL; stdcall; 

function SetupAddSectionToDiskSpaceList(DiskSpace:  HDSKSPC; 
                                         InfHandle:  HINF; 
                                         ListInfHandle:  HINF; 
                                         SectionName:   PCSTR; 
                                         Operation:  UINT; 
                                         Reserved1:  PVOID; 
                                         Reserved2:  UINT): BOOL; stdcall; 


function SetupAddInstallSectionToDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                                InfHandle:  HINF; 
                                                LayoutInfHandle:  HINF; 
                                                SectionName:   PCSTR; 
                                                Reserved1:  PVOID; 
                                                Reserved2:  UINT): BOOL; stdcall; 


function SetupAddInstallSectionToDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                                InfHandle:  HINF; 
                                                LayoutInfHandle:  HINF; 
                                                SectionName:   PCWSTR; 
                                                Reserved1:  PVOID; 
                                                Reserved2:  UINT): BOOL; stdcall; 

function SetupAddInstallSectionToDiskSpaceList(DiskSpace:  HDSKSPC; 
                                                InfHandle:  HINF; 
                                                LayoutInfHandle:  HINF; 
                                                SectionName:   PCSTR; 
                                                Reserved1:  PVOID; 
                                                Reserved2:  UINT): BOOL; stdcall; 


function SetupRemoveFromDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                       TargetFilespec:  PCSTR; 
                                       Operation:  UINT; 
                                       Reserved1:  PVOID; 
                                       Reserved2:  UINT): BOOL; stdcall; 


function SetupRemoveFromDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                       TargetFilespec:  PCWSTR; 
                                       Operation:  UINT; 
                                       Reserved1:  PVOID; 
                                       Reserved2:  UINT): BOOL; stdcall; 

function SetupRemoveFromDiskSpaceList(DiskSpace:  HDSKSPC; 
                                       TargetFilespec:  PCSTR; 
                                       Operation:  UINT; 
                                       Reserved1:  PVOID; 
                                       Reserved2:  UINT): BOOL; stdcall; 


function SetupRemoveSectionFromDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                              InfHandle:  HINF; 
                                              ListInfHandle:  HINF; 
                                              SectionName:   PCSTR; 
                                              Operation:  UINT; 
                                              Reserved1:  PVOID; 
                                              Reserved2:  UINT): BOOL; stdcall; 


function SetupRemoveSectionFromDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                              InfHandle:  HINF; 
                                              ListInfHandle:  HINF; 
                                              SectionName:   PCWSTR; 
                                              Operation:  UINT; 
                                              Reserved1:  PVOID; 
                                              Reserved2:  UINT): BOOL; stdcall; 

function SetupRemoveSectionFromDiskSpaceList(DiskSpace:  HDSKSPC; 
                                              InfHandle:  HINF; 
                                              ListInfHandle:  HINF; 
                                              SectionName:   PCSTR; 
                                              Operation:  UINT; 
                                              Reserved1:  PVOID; 
                                              Reserved2:  UINT): BOOL; stdcall; 


function SetupRemoveInstallSectionFromDiskSpaceListA(DiskSpace:  HDSKSPC; 
                                                     InfHandle:  HINF; 
                                                     LayoutInfHandle:  HINF; 
                                                     SectionName:   PCSTR; 
                                                     Reserved1:  PVOID; 
                                                     Reserved2:  UINT): BOOL; stdcall; 


function SetupRemoveInstallSectionFromDiskSpaceListW(DiskSpace:  HDSKSPC; 
                                                     InfHandle:  HINF; 
                                                     LayoutInfHandle:  HINF; 
                                                     SectionName:   PCWSTR; 
                                                     Reserved1:  PVOID; 
                                                     Reserved2:  UINT): BOOL; stdcall; 

function SetupRemoveInstallSectionFromDiskSpaceList(DiskSpace:  HDSKSPC; 
                                                     InfHandle:  HINF; 
                                                     LayoutInfHandle:  HINF; 
                                                     SectionName:   PCSTR; 
                                                     Reserved1:  PVOID; 
                                                     Reserved2:  UINT): BOOL; stdcall; 


/// 
/// Cabinet APIs 
/// 


function SetupIterateCabinetA(CabinetFile:  PCSTR; 
                              Reserved:  DWORD; 
                              MsgHandler:  PSP_FILE_CALLBACK_A; 
                              Context:  PVOID): BOOL; stdcall; 


function SetupIterateCabinetW(CabinetFile:  PCWSTR; 
                              Reserved:  DWORD; 
                              MsgHandler:  PSP_FILE_CALLBACK_W; 
                              Context:  PVOID): BOOL; stdcall; 

function SetupIterateCabinet(CabinetFile:  PCSTR; 
                              Reserved:  DWORD; 
                              MsgHandler:  PSP_FILE_CALLBACK_A; 
                              Context:  PVOID): BOOL; stdcall; 


function SetupPromptReboot(FileQueue:  HSPFILEQ; 
                           Owner:   HWND; 
                           ScanOnly:  BOOL): integer; stdcall;

/// 
/// Define flags that are returned by SetupPromptReboot 
/// 
const
  SPFILEQ_FILE_IN_USE = $00000001;
  SPFILEQ_REBOOT_RECOMMENDED = $00000002;
  SPFILEQ_REBOOT_IN_PROGRESS = $00000004;


function SetupInitDefaultQueueCallback(OwnerWindow:  HWND): PVOID; stdcall;


function SetupInitDefaultQueueCallbackEx(OwnerWindow:  HWND; 
                                         AlternateProgressWindow:  HWND; 
                                         ProgressMessage:   UINT; 
                                         Reserved1:  DWORD; 
                                         Reserved2:  PVOID):PVOID; stdcall; 


procedure SetupTermDefaultQueueCallback(Context:  PVOID); stdcall; 


function SetupDefaultQueueCallbackA(Context:  PVOID; 
                                    Notification:  UINT; 
                                    Param1:  UINT; 
                                    Param2:  UINT): UINT; stdcall; 


function SetupDefaultQueueCallbackW(Context:  PVOID; 
                                    Notification:  UINT; 
                                    Param1:  UINT; 
                                    Param2:  UINT): UINT; stdcall; 

function SetupDefaultQueueCallback(Context:  PVOID; 
                                    Notification:  UINT; 
                                    Param1:  UINT; 
                                    Param2:  UINT): UINT; stdcall; 


/// 
/// Flags for AddReg section lines in INF. The corresponding value 
/// is <ValueType> in the AddReg line format given below: 
/// 
/// <RegRootString>,<SubKey>,<ValueName>,<ValueType>,<Value>... 
/// 
/// The low word contains basic flags concerning the general data type 
/// and AddReg action. The high word contains values that more specifically 
/// identify the data type of the registry value. The high word is ignored 
/// by the 16-bit Windows 95 SETUPX APIs. 
/// 
const
  FLG_ADDREG_BINVALUETYPE = ( $00000001 );
  FLG_ADDREG_NOCLOBBER = ( $00000002 );
  FLG_ADDREG_DELVAL = ( $00000004 );
  FLG_ADDREG_APPEND = ( $00000008 ); // Currently supported only
/// for REG_MULTI_SZ values. 
  FLG_ADDREG_KEYONLY = ( $00000010 ); // Just create the key, ignore value
  FLG_ADDREG_OVERWRITEONLY = ( $00000020 ); // Set only if value already exists

  FLG_ADDREG_TYPE_MASK = ( $FFFF0000  or  FLG_ADDREG_BINVALUETYPE );
  FLG_ADDREG_TYPE_SZ = ( $00000000 );
  FLG_ADDREG_TYPE_MULTI_SZ = ( $00010000 );
  FLG_ADDREG_TYPE_EXPAND_SZ = ( $00020000 );
  FLG_ADDREG_TYPE_BINARY = ( $00000000  or  FLG_ADDREG_BINVALUETYPE );
  FLG_ADDREG_TYPE_DWORD = ( $00010000  or  FLG_ADDREG_BINVALUETYPE );
  FLG_ADDREG_TYPE_NONE = ( $00020000  or  FLG_ADDREG_BINVALUETYPE );

/// 
/// The INF may supply any arbitrary data type ordinal in the highword except 
/// for the following: REG_NONE, REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ. If this 
/// technique is used, then the data is given in binary format, one byte per 
/// field. 
/// 


function SetupInstallFromInfSectionA(Owner:  HWND;
                                     InfHandle:  HINF;
                                     SectionName:  PCSTR;
                                     Flags:  UINT;
                                     RelativeKeyRoot:  HKEY;
                                     SourceRootPath:   PCSTR; 
                                     CopyFlags:   UINT; 
                                     MsgHandler:  PSP_FILE_CALLBACK_A; 
                                     Context: PVOID;
                                     DeviceInfoSet: HDEVINFO;
                                     DeviceInfoData:PSP_DEVINFO_DATA
                                     )
: BOOL; stdcall; 

function SetupInstallFromInfSectionW(Owner:  HWND; 
                                     InfHandle:  HINF; 
                                     SectionName:  PCWSTR; 
                                     Flags:  UINT; 
                                     RelativeKeyRoot:  HKEY; 
                                     SourceRootPath:   PCWSTR; 
                                     CopyFlags:   UINT; 
                                     MsgHandler:  PSP_FILE_CALLBACK_W; 
                                     Context: PVOID;
                                     DeviceInfoSet: HDEVINFO;
                                     DeviceInfoData:PSP_DEVINFO_DATA
                                     )
: BOOL; stdcall; 

function SetupInstallFromInfSection(Owner:  HWND; 
                                     InfHandle:  HINF; 
                                     SectionName:  PCSTR; 
                                     Flags:  UINT; 
                                     RelativeKeyRoot:  HKEY; 
                                     SourceRootPath:   PCSTR; 
                                     CopyFlags:   UINT; 
                                     MsgHandler:  PSP_FILE_CALLBACK_A; 
                                     Context: PVOID;
                                     DeviceInfoSet: HDEVINFO;
                                     DeviceInfoData:PSP_DEVINFO_DATA
                                     )
: BOOL; stdcall; 

/// 
/// Flags for SetupInstallFromInfSection 
/// 
const
  SPINST_LOGCONFIG = $00000001;
  SPINST_INIFILES = $00000002;
  SPINST_REGISTRY = $00000004;
  SPINST_INI2REG = $00000008;
  SPINST_FILES = $00000010;
  SPINST_ALL = $0000001;
  SPINST_SINGLESECTION = $00010000;
  SPINST_LOGCONFIG_IS_FORCED = $00020000;
  SPINST_LOGCONFIGS_ARE_OVERRIDES = $00040000;


function SetupInstallFilesFromInfSectionA(InfHandle:  HINF;
                                          LayoutInfHandle:  HINF; 
                                          FileQueue:   HSPFILEQ; 
                                          SectionName:  PCSTR; 
                                          SourceRootPath:  PCSTR; 
                                          CopyFlags:   UINT): BOOL; stdcall; 


function SetupInstallFilesFromInfSectionW(InfHandle:  HINF; 
                                          LayoutInfHandle:  HINF; 
                                          FileQueue:   HSPFILEQ; 
                                          SectionName:  PCWSTR; 
                                          SourceRootPath:  PCWSTR; 
                                          CopyFlags:   UINT): BOOL; stdcall; 

function SetupInstallFilesFromInfSection(InfHandle:  HINF; 
                                          LayoutInfHandle:  HINF; 
                                          FileQueue:   HSPFILEQ; 
                                          SectionName:  PCSTR; 
                                          SourceRootPath:  PCSTR; 
                                          CopyFlags:   UINT): BOOL; stdcall; 


/// 
/// Flags for SetupInstallServicesFromInfSection(Ex). These flags are also used in 
/// the flags field of AddService or DelService lines in a device INF. Some of these 
/// flags are not permitted in the non-Ex API. These flags are marked as such below. 
/// 
const
  SPSVCINST_TAGTOFRONT = ($00000001); // (AddService) move service's tag to front of its group order list
  SPSVCINST_ASSOCSERVICE = ($00000002); // (AddService)**Ex API only** mark this service as the function
/// driver for the device being installed. 
  SPSVCINST_DELETEEVENTLOGENTRY = ($00000004); // (DelService) delete the associated event log entry for a service
/// specified in a DelService entry 

function SetupInstallServicesFromInfSectionA(InfHandle:  HINF;
                                             SectionName:  PCSTR; 
                                             Flags:  DWORD): BOOL; stdcall; 


function SetupInstallServicesFromInfSectionW(InfHandle:  HINF; 
                                             SectionName:  PCWSTR; 
                                             Flags:  DWORD): BOOL; stdcall; 

function SetupInstallServicesFromInfSection(InfHandle:  HINF; 
                                             SectionName:  PCSTR; 
                                             Flags:  DWORD): BOOL; stdcall; 

function SetupInstallServicesFromInfSectionExA(InfHandle:  HINF; 
                                               SectionName:  PCSTR; 
                                               Flags:  DWORD; 
                                               DeviceInfoSet:  HDEVINFO; 
                                               DeviceInfoData:   PSP_DEVINFO_DATA; 
                                               Reserved1:   PVOID; 
                                               Reserved2:  PVOID): BOOL; stdcall; 


function SetupInstallServicesFromInfSectionExW(InfHandle:  HINF; 
                                               SectionName:  PCWSTR; 
                                               Flags:  DWORD; 
                                               DeviceInfoSet:  HDEVINFO; 
                                               DeviceInfoData:   PSP_DEVINFO_DATA; 
                                               Reserved1:   PVOID; 
                                               Reserved2:  PVOID): BOOL; stdcall; 

function SetupInstallServicesFromInfSectionEx(InfHandle:  HINF; 
                                               SectionName:  PCSTR; 
                                               Flags:  DWORD; 
                                               DeviceInfoSet:  HDEVINFO; 
                                               DeviceInfoData:   PSP_DEVINFO_DATA; 
                                               Reserved1:   PVOID; 
                                               Reserved2:  PVOID): BOOL; stdcall; 

/// 
/// Define handle type for Setup file log. 
/// 
type
  HSPFILELOG = PVOID;


function SetupInitializeFileLogA(LogFileName:  PCSTR; 
                                 Flags:   DWORD): HSPFILELOG; stdcall; 


function SetupInitializeFileLogW(LogFileName:  PCWSTR; 
                                 Flags:   DWORD): HSPFILELOG; stdcall; 

function SetupInitializeFileLog(LogFileName:  PCSTR; 
                                 Flags:   DWORD): HSPFILELOG; stdcall; 

/// 
/// Flags for SetupInitializeFileLog 
/// 
const
  SPFILELOG_SYSTEMLOG = $00000001; // use system log -- must be Administrator
  SPFILELOG_FORCENEW = $00000002; // not valid with SPFILELOG_SYSTEMLOG
  SPFILELOG_QUERYONLY = $00000004; // allows non-administrators to read system log


function SetupTerminateFileLog(FileLogHandle:  HSPFILELOG): BOOL; stdcall;



function SetupLogFileA(FileLogHandle:  HSPFILELOG; 
                       LogSectionName:  PCSTR; 
                       SourceFilename:   PCSTR; 
                       TargetFilename:  PCSTR; 
                       Checksum:  DWORD; 
                       DiskTagfile:   PCSTR; 
                       DiskDescription:   PCSTR; 
                       OtherInfo: PCSTR;
                       Flags: DWORD
                       )
: BOOL; stdcall; 

function SetupLogFileW(FileLogHandle:  HSPFILELOG; 
                       LogSectionName:  PCWSTR; 
                       SourceFilename:   PCWSTR; 
                       TargetFilename:  PCWSTR; 
                       Checksum:  DWORD; 
                       DiskTagfile:   PCWSTR; 
                       DiskDescription:   PCWSTR; 
                       OtherInfo: PCWSTR;
                       Flags: DWORD
                       )
: BOOL; stdcall; 

function SetupLogFile(FileLogHandle:  HSPFILELOG; 
                       LogSectionName:  PCSTR; 
                       SourceFilename:   PCSTR; 
                       TargetFilename:  PCSTR; 
                       Checksum:  DWORD; 
                       DiskTagfile:   PCSTR; 
                       DiskDescription:   PCSTR; 
                       OtherInfo: PCSTR;
                       Flags: DWORD
                       )
: BOOL; stdcall; 

/// 
/// Flags for SetupLogFile 
/// 
const
  SPFILELOG_OEMFILE = $00000001;


function SetupRemoveFileLogEntryA(FileLogHandle:  HSPFILELOG;
                                  LogSectionName:  PCSTR; 
                                  TARGETFILENAME:   PCSTR): BOOL; stdcall; 


function SetupRemoveFileLogEntryW(FileLogHandle:  HSPFILELOG; 
                                  LogSectionName:  PCWSTR; 
                                  TARGETFILENAME:   PCWSTR): BOOL; stdcall; 

function SetupRemoveFileLogEntry(FileLogHandle:  HSPFILELOG; 
                                  LogSectionName:  PCSTR; 
                                  TARGETFILENAME:   PCSTR): BOOL; stdcall; 

///
/// Items retrievable from SetupQueryFileLog()
///
type
SETUPFILELOGINFO = (SetupFileLogSourceFilename,
  SetupFileLogChecksum,
  SetupFileLogDiskTagfile,
  SetupFileLogDiskDescription,
  SetupFileLogOtherInfo,
  SetupFileLogMax);

function SetupQueryFileLogA(FileLogHandle:  HSPFILELOG;
                            LogSectionName:  PCSTR;
                            TargetFilename:   PCSTR;
                            DesiredInfo:  SETUPFILELOGINFO;
                            DataOut:  PSTR;
                            ReturnBufferSize:   DWORD;
                            REQUIREDSIZE: PDWORD): BOOL; stdcall;


function SetupQueryFileLogW(FileLogHandle:  HSPFILELOG;
                            LogSectionName:  PCWSTR;
                            TargetFilename:   PCWSTR;
                            DesiredInfo:  SETUPFILELOGINFO;
                            DataOut:  PWSTR;
                            ReturnBufferSize:   DWORD;
                            REQUIREDSIZE: PDWORD): BOOL; stdcall;

function SetupQueryFileLog(FileLogHandle:  HSPFILELOG;
                            LogSectionName:  PCSTR;
                            TargetFilename:   PCSTR;
                            DesiredInfo:  SETUPFILELOGINFO;
                            DataOut:  PSTR;
                            ReturnBufferSize:   DWORD;
                            REQUIREDSIZE: PDWORD): BOOL; stdcall;

///
/// Text logging APIs
///
type
LogSeverity = (
  LogSevInformation,
  LogSevWarning,
  LogSevError,
  LogSevFatalError,
  LogSevMaximum);

function SetupOpenLog(Erase: BOOL): BOOL; stdcall;



function SetupLogErrorA(MessageString:  LPCSTR;
                        Severity:  LOGSEVERITY): BOOL; stdcall;



function SetupLogErrorW(MessageString:  LPCWSTR; 
                        Severity:  LOGSEVERITY): BOOL; stdcall; 

function SetupLogError(MessageString:  LPCSTR; 
                        Severity:  LOGSEVERITY): BOOL; stdcall; 


procedure SetupCloseLog; stdcall; 


//
// Device Installer APIs
//



function SetupDiCreateDeviceInfoList(ClassGuid:  PGUID;
                                     HWNDPARENT:HWND): HDEVINFO; stdcall;




function SetupDiCreateDeviceInfoListExA(ClassGuid:  PGUID;
                                        hwndParent:   HWND;
                                        MachineName:   PCSTR;
                                        Reserved:   PVOID): HDEVINFO; stdcall;



function SetupDiCreateDeviceInfoListExW(ClassGuid:  PGUID;
                                        hwndParent:   HWND;
                                        MachineName:   PCWSTR;
                                        Reserved:   PVOID): HDEVINFO; stdcall;

function SetupDiCreateDeviceInfoListEx(ClassGuid:  PGUID;
                                        hwndParent:   HWND;
                                        MachineName:   PCSTR;
                                        Reserved:   PVOID): HDEVINFO; stdcall;


function SetupDiGetDeviceInfoListClass(DeviceInfoSet:  HDEVINFO;
                                       ClassGuid:  PGUID): BOOL; stdcall;



function SetupDiGetDeviceInfoListDetailA(DeviceInfoSet:  HDEVINFO;
                                         DeviceInfoSetDetailData:  PSP_DEVINFO_LIST_DETAIL_DATA_A): BOOL; stdcall;



function SetupDiGetDeviceInfoListDetailW(DeviceInfoSet:  HDEVINFO;
                                         DeviceInfoSetDetailData:  PSP_DEVINFO_LIST_DETAIL_DATA_W): BOOL; stdcall;

function SetupDiGetDeviceInfoListDetail(DeviceInfoSet:  HDEVINFO;
                                         DeviceInfoSetDetailData:  PSP_DEVINFO_LIST_DETAIL_DATA_A): BOOL; stdcall;


///
/// Flags for SetupDiCreateDeviceInfo
///
const
  DICD_GENERATE_ID = $00000001;
  DICD_INHERIT_CLASSDRVS = $00000002;

function SetupDiCreateDeviceInfoA(DeviceInfoSet:  HDEVINFO;
                                  DeviceName:  PCSTR; 
                                  ClassGuid:  PGUID;
                                  DeviceDescription:  PCSTR;
                                  hwndParent:   HWND;
                                  CreationFlags:   DWORD;
                                  DEVICEINFODATA:  PSP_DEVINFO_DATA): BOOL; stdcall;



function SetupDiCreateDeviceInfoW(DeviceInfoSet:  HDEVINFO;
                                  DeviceName:  PCWSTR;
                                  ClassGuid:  PGUID;
                                  DeviceDescription:  PCWSTR;
                                  hwndParent:   HWND;
                                  CreationFlags:   DWORD;
                                  DEVICEINFODATA:  PSP_DEVINFO_DATA): BOOL; stdcall;

function SetupDiCreateDeviceInfo(DeviceInfoSet:  HDEVINFO;
                                  DeviceName:  PCSTR;
                                  ClassGuid:  PGUID;
                                  DeviceDescription:  PCSTR;
                                  hwndParent:   HWND;
                                  CreationFlags:   DWORD;
                                  DEVICEINFODATA:  PSP_DEVINFO_DATA): BOOL; stdcall;


//
// Flags for SetupDiOpenDeviceInfo
//
const
  DIOD_INHERIT_CLASSDRVS = $00000002;
  DIOD_CANCEL_REMOVE = $00000004;


function SetupDiOpenDeviceInfoA(DeviceInfoSet:  HDEVINFO;
                                DeviceInstanceId:  PCSTR;
                                hwndParent:  HWND;
                                OpenFlags:   DWORD;
                                DEVICEINFODATA:  PSP_DEVINFO_DATA): BOOL; stdcall;



function SetupDiOpenDeviceInfoW(DeviceInfoSet:  HDEVINFO;
                                DeviceInstanceId:  PCWSTR;
                                hwndParent:  HWND;
                                OpenFlags:   DWORD;
                                DEVICEINFODATA:  PSP_DEVINFO_DATA): BOOL; stdcall;

function SetupDiOpenDeviceInfo(DeviceInfoSet:  HDEVINFO;
                                DeviceInstanceId:  PCSTR;
                                hwndParent:  HWND;
                                OpenFlags:   DWORD; 
                                DEVICEINFODATA:  PSP_DEVINFO_DATA): BOOL; stdcall; 


function SetupDiGetDeviceInstanceIdA(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     DeviceInstanceId:  PSTR; 
                                     DeviceInstanceIdSize:  DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiGetDeviceInstanceIdW(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     DeviceInstanceId:  PWSTR; 
                                     DeviceInstanceIdSize:  DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiGetDeviceInstanceId(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     DeviceInstanceId:  PSTR; 
                                     DeviceInstanceIdSize:  DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupDiDeleteDeviceInfo(DeviceInfoSet:  HDEVINFO; 
                                 DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiEnumDeviceInfo(DeviceInfoSet:  HDEVINFO; 
                               MemberIndex:  DWORD; 
                               DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiDestroyDeviceInfoList(DeviceInfoSet:  HDEVINFO): BOOL; stdcall; 




function SetupDiEnumDeviceInterfaces(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     InterfaceClassGuid:   PGUID; 
                                     MemberIndex:  DWORD; 
                                     DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

//
// Backward compatibility--do not use
//
//  SetupDiEnumInterfaceDevice = SetupDiEnumDeviceInterfaces;


function SetupDiCreateDeviceInterfaceA(DeviceInfoSet:  HDEVINFO; 
                                       DeviceInfoData:  PSP_DEVINFO_DATA; 
                                       InterfaceClassGuid:  PGUID; 
                                       ReferenceString:  PCSTR; 
                                       CreationFlags:   DWORD; 
                                       DEVICEINTERFACEDATA:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 



function SetupDiCreateDeviceInterfaceW(DeviceInfoSet:  HDEVINFO; 
                                       DeviceInfoData:  PSP_DEVINFO_DATA; 
                                       InterfaceClassGuid:  PGUID; 
                                       ReferenceString:  PCWSTR; 
                                       CreationFlags:   DWORD; 
                                       DEVICEINTERFACEDATA:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

function SetupDiCreateDeviceInterface(DeviceInfoSet:  HDEVINFO; 
                                       DeviceInfoData:  PSP_DEVINFO_DATA; 
                                       InterfaceClassGuid:  PGUID; 
                                       ReferenceString:  PCSTR; 
                                       CreationFlags:   DWORD; 
                                       DEVICEINTERFACEDATA:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

//
//Backward compatibility--do not use.
//
//type
//  SetupDiCreateInterfaceDeviceW = SetupDiCreateDeviceInterfaceW;
//  SetupDiCreateInterfaceDeviceA = SetupDiCreateDeviceInterfaceA;
//  SetupDiCreateInterfaceDevice = SetupDiCreateDeviceInterfaceA;

function SetupDiOpenDeviceInterfaceA(DeviceInfoSet:  HDEVINFO;
                                     DevicePath:  PCSTR;
                                     OpenFlags:  DWORD;
                                     DEVICEINTERFACEDATA:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall;

function SetupDiOpenDeviceInterfaceW(DeviceInfoSet:  HDEVINFO; 
                                     DevicePath:  PCWSTR; 
                                     OpenFlags:  DWORD; 
                                     DEVICEINTERFACEDATA:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

function SetupDiOpenDeviceInterface(DeviceInfoSet:  HDEVINFO;
                                     DevicePath:  PCSTR;
                                     OpenFlags:  DWORD;
                                     DEVICEINTERFACEDATA:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall;


//
// Backward compatibility--do not use
//
//  SetupDiOpenInterfaceDeviceW = SetupDiOpenDeviceInterfaceW;
//  SetupDiOpenInterfaceDeviceA = SetupDiOpenDeviceInterfaceA;
//  SetupDiOpenInterfaceDevice = SetupDiOpenDeviceInterfaceA;




function SetupDiGetDeviceInterfaceAlias(DeviceInfoSet:  HDEVINFO; 
                                        DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                        AliasInterfaceClassGuid:  PGUID; 
                                        AliasDeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

//
//Backward compatibility--do not use.
//
// type
//  SetupDiGetInterfaceDeviceAlias = SetupDiGetDeviceInterfaceAlias;




function SetupDiDeleteDeviceInterfaceData(DeviceInfoSet:  HDEVINFO; 
                                          DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

//
//Backward compatibility--do not use.
//
//  SetupDiDeleteInterfaceDeviceData = SetupDiDeleteDeviceInterfaceData;




function SetupDiRemoveDeviceInterface(DeviceInfoSet:  HDEVINFO; 
                                      DeviceInterfaceData:   PSP_DEVICE_INTERFACE_DATA): BOOL; stdcall; 

//
//Backward compatibility--do not use.
//
//  SetupDiRemoveInterfaceDevice = SetupDiRemoveDeviceInterface;




function SetupDiGetDeviceInterfaceDetailA(DeviceInfoSet:  HDEVINFO; 
                                          DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                          DeviceInterfaceDetailData:  PSP_DEVICE_INTERFACE_DETAIL_DATA_A; 
                                          DeviceInterfaceDetailDataSize:   DWORD; 
                                          RequiredSize:  PDWORD;
                                          DeviceInfoData: PSP_DEVINFO_DATA
                                          )
: BOOL; stdcall; 


function SetupDiGetDeviceInterfaceDetailW(DeviceInfoSet:  HDEVINFO; 
                                          DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                          DeviceInterfaceDetailData:  PSP_DEVICE_INTERFACE_DETAIL_DATA_W; 
                                          DeviceInterfaceDetailDataSize:   DWORD; 
                                          RequiredSize:  PDWORD;
                                          DeviceInfoData: PSP_DEVINFO_DATA
                                          )
: BOOL; stdcall; 

function SetupDiGetDeviceInterfaceDetail(DeviceInfoSet:  HDEVINFO; 
                                          DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                          DeviceInterfaceDetailData:  PSP_DEVICE_INTERFACE_DETAIL_DATA_A; 
                                          DeviceInterfaceDetailDataSize:   DWORD; 
                                          RequiredSize:  PDWORD;
                                          DeviceInfoData: PSP_DEVINFO_DATA
                                          )
: BOOL; stdcall; 


//
//Backward compatibility--do not use.
//
//  SetupDiGetInterfaceDeviceDetailW = SetupDiGetDeviceInterfaceDetailW;
//  SetupDiGetInterfaceDeviceDetailA = SetupDiGetDeviceInterfaceDetailA;
//  SetupDiGetInterfaceDeviceDetail = SetupDiGetDeviceInterfaceDetailA;


//
//Default install handler for DIF_INSTALLINTERFACES. }
//


function SetupDiInstallDeviceInterfaces(DeviceInfoSet:  HDEVINFO; 
                                        DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 

//
//Backward compatibility--do not use.
//
//  SetupDiInstallInterfaceDevices = SetupDiInstallDeviceInterfaces;


//
//Default install handler for DIF_REGISTERDEVICE }
//

//
//Flags for SetupDiRegisterDeviceInfo }
//
const
  SPRDI_FIND_DUPS = $00000001;


function SetupDiRegisterDeviceInfo(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:   PSP_DEVINFO_DATA; 
                                   Flags:  DWORD; 
                                   CompareProc:  PSP_DETSIG_CMPPROC; 
                                   CompareContext:   PVOID; 
                                   DUPDEVICEINFODATA:   PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Ordinal values distinguishing between class drivers and 
//device drivers. 
//(Passed in 'DriverType' parameter of driver information list APIs)
//
const
  SPDIT_NODRIVER = $00000000;
  SPDIT_CLASSDRIVER = $00000001;
  SPDIT_COMPATDRIVER = $00000002;


function SetupDiBuildDriverInfoList(DeviceInfoSet:  HDEVINFO;
                                    DeviceInfoData:   PSP_DEVINFO_DATA; 
                                    DriverType:   DWORD): BOOL; stdcall; 




function SetupDiCancelDriverInfoSearch(DeviceInfoSet:  HDEVINFO): BOOL; stdcall; 




function SetupDiEnumDriverInfoA(DeviceInfoSet:  HDEVINFO; 
                                DeviceInfoData:  PSP_DEVINFO_DATA; 
                                DriverType:   DWORD; 
                                MemberIndex:  DWORD; 
                                DriverInfoData:  PSP_DRVINFO_DATA_A): BOOL; stdcall; 



function SetupDiEnumDriverInfoW(DeviceInfoSet:  HDEVINFO; 
                                DeviceInfoData:  PSP_DEVINFO_DATA; 
                                DriverType:   DWORD; 
                                MemberIndex:  DWORD; 
                                DriverInfoData:  PSP_DRVINFO_DATA_W): BOOL; stdcall; 

function SetupDiEnumDriverInfo(DeviceInfoSet:  HDEVINFO; 
                                DeviceInfoData:  PSP_DEVINFO_DATA; 
                                DriverType:   DWORD; 
                                MemberIndex:  DWORD; 
                                DriverInfoData:  PSP_DRVINFO_DATA_A): BOOL; stdcall; 


function SetupDiGetSelectedDriverA(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA; 
                                   DriverInfoData:   PSP_DRVINFO_DATA_A): BOOL; stdcall; 



function SetupDiGetSelectedDriverW(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA; 
                                   DriverInfoData:   PSP_DRVINFO_DATA_W): BOOL; stdcall; 

function SetupDiGetSelectedDriver(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA; 
                                   DriverInfoData:   PSP_DRVINFO_DATA_A): BOOL; stdcall; 


function SetupDiSetSelectedDriverA(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA; 
                                   DRIVERINFODATA:    PSP_DRVINFO_DATA_A): BOOL; stdcall; 



function SetupDiSetSelectedDriverW(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA; 
                                   DRIVERINFODATA:    PSP_DRVINFO_DATA_W): BOOL; stdcall; 

function SetupDiSetSelectedDriver(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA; 
                                   DRIVERINFODATA:    PSP_DRVINFO_DATA_A): BOOL; stdcall; 


function SetupDiGetDriverInfoDetailA(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     DriverInfoData:   PSP_DRVINFO_DATA_A; 
                                     DriverInfoDetailData:  PSP_DRVINFO_DETAIL_DATA_A; 
                                     DriverInfoDetailDataSize:   DWORD; 
                                     RequiredSize : PDWORD
                                     )
: BOOL; stdcall; 


function SetupDiGetDriverInfoDetailW(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     DriverInfoData:   PSP_DRVINFO_DATA_W; 
                                     DriverInfoDetailData:  PSP_DRVINFO_DETAIL_DATA_W; 
                                     DriverInfoDetailDataSize:   DWORD; 
                                     RequiredSize : PDWORD
                                     )
: BOOL; stdcall; 

function SetupDiGetDriverInfoDetail(DeviceInfoSet:  HDEVINFO; 
                                     DeviceInfoData:  PSP_DEVINFO_DATA; 
                                     DriverInfoData:   PSP_DRVINFO_DATA_A; 
                                     DriverInfoDetailData:  PSP_DRVINFO_DETAIL_DATA_A; 
                                     DriverInfoDetailDataSize:   DWORD; 
                                     RequiredSize : PDWORD
                                     )
: BOOL; stdcall; 

function SetupDiDestroyDriverInfoList(DeviceInfoSet:  HDEVINFO; 
                                      DeviceInfoData:  PSP_DEVINFO_DATA; 
                                      DriverType:   DWORD): BOOL; stdcall; 


//
//Flags controlling what is included in the device information set built
//by SetupDiGetClassDevs
//
const
  DIGCF_DEFAULT = $00000001; // only valid with DIGCF_DEVICEINTERFACE
  DIGCF_PRESENT = $00000002;
  DIGCF_ALLCLASSES = $00000004;
  DIGCF_PROFILE = $00000008;
  DIGCF_DEVICEINTERFACE = $00000010;

//
//Backward compatibility--do not use. 
//
  DIGCF_INTERFACEDEVICE = DIGCF_DEVICEINTERFACE;


function SetupDiGetClassDevsA(ClassGuid:  PGUID; 
                              Enumerator:   PCSTR; 
                              hwndParent:   HWND; 
                              Flags:   DWORD): HDEVINFO; stdcall; 



function SetupDiGetClassDevsW(ClassGuid:  PGUID; 
                              Enumerator:   PCWSTR; 
                              hwndParent:   HWND; 
                              Flags:   DWORD): HDEVINFO; stdcall; 

function SetupDiGetClassDevs(ClassGuid:  PGUID; 
                              Enumerator:   PCSTR; 
                              hwndParent:   HWND; 
                              Flags:   DWORD): HDEVINFO; stdcall; 


function SetupDiGetClassDevsExA(ClassGuid:  PGUID; 
                                Enumerator:   PCSTR; 
                                hwndParent:   HWND; 
                                Flags:   DWORD; 
                                MachineName:  PCSTR; 
                                Reserved:   PVOID): HDEVINFO; stdcall; 



function SetupDiGetClassDevsExW(ClassGuid:  PGUID; 
                                Enumerator:   PCWSTR; 
                                hwndParent:   HWND; 
                                Flags:   DWORD; 
                                MachineName:  PCWSTR; 
                                Reserved:   PVOID): HDEVINFO; stdcall; 


function SetupDiGetClassDevsEx(ClassGuid:  PGUID; 
                                Enumerator:   PCSTR; 
                                hwndParent:   HWND; 
                                Flags:   DWORD; 
                                MachineName:  PCSTR; 
                                Reserved:   PVOID): HDEVINFO; stdcall; 


function SetupDiGetINFClassA(InfName:  PCSTR; 
                             ClassGuid:  PGUID; 
                             ClassName:  PSTR; 
                             ClassNameSize:  DWORD; 
                             RequiredSize: PDWORD): BOOL; stdcall; 



function SetupDiGetINFClassW(InfName:  PCWSTR; 
                             ClassGuid:  PGUID; 
                             ClassName:  PWSTR; 
                             ClassNameSize:  DWORD; 
                             RequiredSize: PDWORD): BOOL; stdcall; 


function SetupDiGetINFClass(InfName:  PCSTR; 
                             ClassGuid:  PGUID; 
                             ClassName:  PSTR; 
                             ClassNameSize:  DWORD; 
                             RequiredSize: PDWORD): BOOL; stdcall; 


//
//Flags controlling exclusion from the class information list built
//by SetupDiBuildClassInfoList(Ex)
//
const
  DIBCI_NOINSTALLCLASS = $00000001;
  DIBCI_NODISPLAYCLASS = $00000002;


function SetupDiBuildClassInfoList(Flags:  DWORD;
                                   ClassGuidList:  PGUID; 
                                   ClassGuidListSize:  DWORD; 
                                   RequiredSize:  PDWORD): BOOL; stdcall; 




function SetupDiBuildClassInfoListExA(Flags:  DWORD; 
                                      ClassGuidList:  PGUID; 
                                      ClassGuidListSize:  DWORD; 
                                      RequiredSize:  PDWORD; 
                                      MachineName:  PCSTR; 
                                      Reserved:   PVOID): BOOL; stdcall; 



function SetupDiBuildClassInfoListExW(Flags:  DWORD; 
                                      ClassGuidList:  PGUID; 
                                      ClassGuidListSize:  DWORD; 
                                      RequiredSize:  PDWORD; 
                                      MachineName:  PCWSTR; 
                                      Reserved:   PVOID): BOOL; stdcall; 

function SetupDiBuildClassInfoListEx(Flags:  DWORD; 
                                      ClassGuidList:  PGUID; 
                                      ClassGuidListSize:  DWORD; 
                                      RequiredSize:  PDWORD; 
                                      MachineName:  PCSTR; 
                                      Reserved:   PVOID): BOOL; stdcall; 


function SetupDiGetClassDescriptionA(ClassGuid:  PGUID; 
                                     ClassDescription:  PSTR; 
                                     ClassDescriptionSize:  DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 



function SetupDiGetClassDescriptionW(ClassGuid:  PGUID; 
                                     ClassDescription:  PWSTR; 
                                     ClassDescriptionSize:  DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiGetClassDescription(ClassGuid:  PGUID; 
                                     ClassDescription:  PSTR; 
                                     ClassDescriptionSize:  DWORD; 
                                     REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupDiGetClassDescriptionExA(ClassGuid:  PGUID; 
                                       ClassDescription:  PSTR; 
                                       ClassDescriptionSize:  DWORD; 
                                       RequiredSize:  PDWORD; 
                                       MachineName:   PCSTR; 
                                       Reserved:   PVOID): BOOL; stdcall; 

function SetupDiGetClassDescriptionExW(ClassGuid:  PGUID; 
                                       ClassDescription:  PWSTR; 
                                       ClassDescriptionSize:  DWORD; 
                                       RequiredSize:  PDWORD; 
                                       MachineName:   PCWSTR; 
                                       Reserved:   PVOID): BOOL; stdcall; 

function SetupDiGetClassDescriptionEx(ClassGuid:  PGUID; 
                                       ClassDescription:  PSTR; 
                                       ClassDescriptionSize:  DWORD; 
                                       RequiredSize:  PDWORD; 
                                       MachineName:   PCSTR; 
                                       Reserved:   PVOID): BOOL; stdcall; 



function SetupDiCallClassInstaller(InstallFunction:  DI_FUNCTION; 
                                   DeviceInfoSet:  HDEVINFO; 
                                   DEVICEINFODATA: PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_SELECTDEVICE
//


function SetupDiSelectDevice(DeviceInfoSet:  HDEVINFO; 
                             DEVICEINFODATA:   PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_SELECTBESTCOMPATDRV
//


function SetupDiSelectBestCompatDrv(DeviceInfoSet:  HDEVINFO; 
                                    DEVICEINFODATA:   PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_INSTALLDEVICE
//


function SetupDiInstallDevice(DeviceInfoSet:  HDEVINFO; 
                              DeviceInfoData:   PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_INSTALLDEVICEFILES
//


function SetupDiInstallDriverFiles(DeviceInfoSet:  HDEVINFO; 
                                   DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_REGISTER_COINSTALLERS
//


function SetupDiRegisterCoDeviceInstallers(DeviceInfoSet:  HDEVINFO; 
                                           DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_REMOVE
//


function SetupDiRemoveDevice(DeviceInfoSet:  HDEVINFO; 
                             DeviceInfoData:   PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_UNREMOVE
//


function SetupDiUnremoveDevice(DeviceInfoSet:  HDEVINFO; 
                               DeviceInfoData:   PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_MOVEDEVICE
//


function SetupDiMoveDuplicateDevice(DeviceInfoSet:  HDEVINFO; 
                                    DestinationDeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 


//
//Default install handler for DIF_PROPERTYCHANGE
//


function SetupDiChangeState(DeviceInfoSet:  HDEVINFO; 
                            DeviceInfoData:   PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiInstallClassA(hwndParent:  HWND; 
                              InfFileName:   PCSTR; 
                              Flags:  DWORD; 
                              FILEQUEUE:  HSPFILEQ): BOOL; stdcall; 



function SetupDiInstallClassW(hwndParent:  HWND; 
                              InfFileName:   PCWSTR; 
                              Flags:  DWORD; 
                              FILEQUEUE:  HSPFILEQ): BOOL; stdcall; 

function SetupDiInstallClass(hwndParent:  HWND; 
                              InfFileName:   PCSTR; 
                              Flags:  DWORD; 
                              FILEQUEUE:  HSPFILEQ): BOOL; stdcall; 



function SetupDiInstallClassExA(hwndParent:  HWND; 
                                InfFileName:   PCSTR; 
                                Flags:   DWORD; 
                                FileQueue:  HSPFILEQ; 
                                InterfaceClassGuid:   PGUID; 
                                Reserved1:   PVOID; 
                                Reserved2:  PVOID): BOOL; stdcall; 



function SetupDiInstallClassExW(hwndParent:  HWND; 
                                InfFileName:   PCWSTR; 
                                Flags:   DWORD; 
                                FileQueue:  HSPFILEQ; 
                                InterfaceClassGuid:   PGUID; 
                                Reserved1:   PVOID; 
                                Reserved2:  PVOID): BOOL; stdcall; 

function SetupDiInstallClassEx(hwndParent:  HWND; 
                                InfFileName:   PCSTR; 
                                Flags:   DWORD; 
                                FileQueue:  HSPFILEQ; 
                                InterfaceClassGuid:   PGUID; 
                                Reserved1:   PVOID; 
                                Reserved2:  PVOID): BOOL; stdcall; 


function SetupDiOpenClassRegKey(ClassGuid:  PGUID; 
                                samDesired:   REGSAM): HKEY; stdcall; 


//
//Flags for SetupDiOpenClassRegKeyEx
//
const
  DIOCR_INSTALLER = $00000001; // class installer registry branch
  DIOCR_INTERFACE = $00000002; // interface class registry branch



function SetupDiOpenClassRegKeyExA(ClassGuid:  PGUID; 
                                   samDesired:   REGSAM; 
                                   Flags:  DWORD; 
                                   MachineName:  PCSTR; 
                                   Reserved:   PVOID): HKEY; stdcall; 



function SetupDiOpenClassRegKeyExW(ClassGuid:  PGUID; 
                                   samDesired:   REGSAM; 
                                   Flags:  DWORD; 
                                   MachineName:  PCWSTR; 
                                   Reserved:   PVOID): HKEY; stdcall; 

function SetupDiOpenClassRegKeyEx(ClassGuid:  PGUID; 
                                   samDesired:   REGSAM; 
                                   Flags:  DWORD; 
                                   MachineName:  PCSTR; 
                                   Reserved:   PVOID): HKEY; stdcall; 


function SetupDiCreateDeviceInterfaceRegKeyA(DeviceInfoSet:  HDEVINFO; 
                                             DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                             Reserved:  DWORD; 
                                             samDesired:  REGSAM; 
                                             InfHandle:  HINF; 
                                             INFSECTIONNAME:   PCSTR): HKEY; stdcall; 

function SetupDiCreateDeviceInterfaceRegKeyW(DeviceInfoSet:  HDEVINFO; 
                                             DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                             Reserved:  DWORD; 
                                             samDesired:  REGSAM; 
                                             InfHandle:  HINF; 
                                             INFSECTIONNAME:   PCWSTR): HKEY; stdcall; 

function SetupDiCreateDeviceInterfaceRegKey(DeviceInfoSet:  HDEVINFO; 
                                             DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                             Reserved:  DWORD; 
                                             samDesired:  REGSAM; 
                                             InfHandle:  HINF; 
                                             INFSECTIONNAME:   PCSTR): HKEY; stdcall; 

//
//Backward compatibility--do not use.
//
//  SetupDiCreateInterfaceDeviceRegKeyW = SetupDiCreateDeviceInterfaceRegKeyW;
//  SetupDiCreateInterfaceDeviceRegKeyA = SetupDiCreateDeviceInterfaceRegKeyA;
//  SetupDiCreateInterfaceDeviceRegKey = SetupDiCreateDeviceInterfaceRegKeyA;


function SetupDiOpenDeviceInterfaceRegKey(DeviceInfoSet:  HDEVINFO; 
                                          DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                          Reserved:  DWORD; 
                                          samDesired:  REGSAM): HKEY; stdcall; 

//
//Backward compatibility--do not use.
//
//  SetupDiOpenInterfaceDeviceRegKey = SetupDiOpenDeviceInterfaceRegKey;




function SetupDiDeleteDeviceInterfaceRegKey(DeviceInfoSet:  HDEVINFO; 
                                            DeviceInterfaceData:  PSP_DEVICE_INTERFACE_DATA; 
                                            Reserved:  DWORD): BOOL; stdcall; 

//
//Backward compatibility--do not use.
//
//  SetupDiDeleteInterfaceDeviceRegKey = SetupDiDeleteDeviceInterfaceRegKey;


//
//KeyType values for SetupDiCreateDevRegKey, SetupDiOpenDevRegKey, and
//SetupDiDeleteDevRegKey.
//
const
  DIREG_DEV = $00000001; {// Open/Create/Delete device key}
  DIREG_DRV = $00000002; {// Open/Create/Delete driver key}
  DIREG_BOTH = $00000004; {// Delete both driver and Device key}


function SetupDiCreateDevRegKeyA(DeviceInfoSet:  HDEVINFO; 
                                 DeviceInfoData:  PSP_DEVINFO_DATA; 
                                 Scope:  DWORD; 
                                 HwProfile:  DWORD; 
                                 KeyType:  DWORD; 
                                 InfHandle:  HINF; 
                                 INFSECTIONNAME:   PCSTR): HKEY; stdcall; 



function SetupDiCreateDevRegKeyW(DeviceInfoSet:  HDEVINFO; 
                                 DeviceInfoData:  PSP_DEVINFO_DATA; 
                                 Scope:  DWORD; 
                                 HwProfile:  DWORD; 
                                 KeyType:  DWORD; 
                                 InfHandle:  HINF; 
                                 INFSECTIONNAME:   PCWSTR): HKEY; stdcall; 


function SetupDiCreateDevRegKey(DeviceInfoSet:  HDEVINFO; 
                                 DeviceInfoData:  PSP_DEVINFO_DATA; 
                                 Scope:  DWORD; 
                                 HwProfile:  DWORD; 
                                 KeyType:  DWORD; 
                                 InfHandle:  HINF; 
                                 INFSECTIONNAME:   PCSTR): HKEY; stdcall; 



function SetupDiOpenDevRegKey(DeviceInfoSet:  HDEVINFO; 
                              DeviceInfoData:  PSP_DEVINFO_DATA; 
                              Scope:  DWORD; 
                              HwProfile:  DWORD; 
                              KeyType:  DWORD; 
                              samDesired:  REGSAM): HKEY; stdcall; 




function SetupDiDeleteDevRegKey(DeviceInfoSet:  HDEVINFO; 
                                DeviceInfoData:  PSP_DEVINFO_DATA; 
                                Scope:  DWORD; 
                                HwProfile:  DWORD; 
                                KeyType:  DWORD): BOOL; stdcall; 




function SetupDiGetHwProfileList(HwProfileList:  PDWORD; 
                                 HwProfileListSize:  DWORD; 
                                 RequiredSize:  PDWORD; 
                                 CURRENTLYACTIVEINDEX:  PDWORD): BOOL; stdcall; 




function SetupDiGetHwProfileListExA(HwProfileList:  PDWORD; 
                                    HwProfileListSize:  DWORD; 
                                    RequiredSize:  PDWORD; 
                                    CurrentlyActiveIndex:  PDWORD; 
                                    MachineName:   PCSTR; 
                                    Reserved:   PVOID): BOOL; stdcall; 



function SetupDiGetHwProfileListExW(HwProfileList:  PDWORD; 
                                    HwProfileListSize:  DWORD; 
                                    RequiredSize:  PDWORD; 
                                    CurrentlyActiveIndex:  PDWORD; 
                                    MachineName:   PCWSTR; 
                                    Reserved:   PVOID): BOOL; stdcall; 


function SetupDiGetHwProfileListEx(HwProfileList:  PDWORD; 
                                    HwProfileListSize:  DWORD; 
                                    RequiredSize:  PDWORD; 
                                    CurrentlyActiveIndex:  PDWORD; 
                                    MachineName:   PCSTR; 
                                    Reserved:   PVOID): BOOL; stdcall; 


//
//Device registry property codes
//(Codes marked as read-only (R) may only be used for
//SetupDiGetDeviceRegistryProperty)
//
//These values should cover the same set of registry properties
//as defined by the CM_DRP codes in cfgmgr32.h.
//
const
  SPDRP_DEVICEDESC = ($00000000); // DeviceDesc (R/W)
  SPDRP_HARDWAREID = ($00000001); // HardwareID (R/W)
  SPDRP_COMPATIBLEIDS = ($00000002); // CompatibleIDs (R/W)
  SPDRP_NTDEVICEPATHS = ($00000003); // Unsupported, DO NOT USE
  SPDRP_SERVICE = ($00000004); // Service (R/W)
  SPDRP_CONFIGURATION = ($00000005); // Configuration (R)
  SPDRP_CONFIGURATIONVECTOR = ($00000006); // ConfigurationVector (R)
  SPDRP_CLASS = ($00000007); // Class (R--tied to ClassGUID)
  SPDRP_CLASSGUID = ($00000008); // ClassGUID (R/W)
  SPDRP_DRIVER = ($00000009); // Driver (R/W)
  SPDRP_CONFIGFLAGS = ($0000000A); // ConfigFlags (R/W)
  SPDRP_MFG = ($0000000B); // Mfg (R/W)
  SPDRP_FRIENDLYNAME = ($0000000C); // FriendlyName (R/W)
  SPDRP_LOCATION_INFORMATION = ($0000000D); // LocationInformation (R/W)
  SPDRP_PHYSICAL_DEVICE_OBJECT_NAME = ($0000000E); // PhysicalDeviceObjectName (R)
  SPDRP_CAPABILITIES = ($0000000); // Capabilities (R)
  SPDRP_UI_NUMBER = ($00000010); // UiNumber (R)
  SPDRP_UPPERFILTERS = ($00000011); // UpperFilters (R/W)
  SPDRP_LOWERFILTERS = ($00000012); // LowerFilters (R/W)
  SPDRP_MAXIMUM_PROPERTY = ($00000013); // Upper bound on ordinals


function SetupDiGetDeviceRegistryPropertyA(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:  PSP_DEVINFO_DATA;
                                           _Property:  DWORD;
                                           PropertyRegDataType:  PDWORD;
                                           PropertyBuffer:   PBYTE;
                                           PropertyBufferSize:  DWORD;
                                           REQUIREDSIZE: PDWORD
                                           )
: BOOL; stdcall;


function SetupDiGetDeviceRegistryPropertyW(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:  PSP_DEVINFO_DATA;
                                           _Property:  DWORD;
                                           PropertyRegDataType:  PDWORD;
                                           PropertyBuffer:   PBYTE;
                                           PropertyBufferSize:  DWORD;
                                           REQUIREDSIZE: PDWORD
                                           )
: BOOL; stdcall;

function SetupDiGetDeviceRegistryProperty(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:  PSP_DEVINFO_DATA;
                                           _Property:  DWORD;
                                           PropertyRegDataType:  PDWORD;
                                           PropertyBuffer:   PBYTE;
                                           PropertyBufferSize:  DWORD;
                                           REQUIREDSIZE: PDWORD
                                           )
: BOOL; stdcall;


function SetupDiSetDeviceRegistryPropertyA(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:   PSP_DEVINFO_DATA;
                                           _Property:  DWORD;
                                           const PropertyBuffer: BYTE;
                                           PropertyBufferSize:  DWORD): BOOL; stdcall;



function SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:   PSP_DEVINFO_DATA;
                                           _Property:  DWORD;
                                           const PropertyBuffer: BYTE;
                                           PropertyBufferSize:  DWORD): BOOL; stdcall;

function SetupDiSetDeviceRegistryProperty(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:   PSP_DEVINFO_DATA;
                                           _Property:  DWORD;
                                           const PropertyBuffer:  BYTE;
                                           PropertyBufferSize:  DWORD): BOOL; stdcall;


function SetupDiGetDeviceInstallParamsA(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DeviceInstallParams:   PSP_DEVINSTALL_PARAMS_A): BOOL; stdcall;



function SetupDiGetDeviceInstallParamsW(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DeviceInstallParams:   PSP_DEVINSTALL_PARAMS_W): BOOL; stdcall;

function SetupDiGetDeviceInstallParams(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DeviceInstallParams:   PSP_DEVINSTALL_PARAMS_A): BOOL; stdcall;


function SetupDiGetClassInstallParamsA(DeviceInfoSet:  HDEVINFO;
                                       DeviceInfoData:  PSP_DEVINFO_DATA;
                                       ClassInstallParams:   PSP_CLASSINSTALL_HEADER;
                                       ClassInstallParamsSize:   DWORD;
                                       REQUIREDSIZE: PDWORD): BOOL; stdcall;



function SetupDiGetClassInstallParamsW(DeviceInfoSet:  HDEVINFO;
                                       DeviceInfoData:  PSP_DEVINFO_DATA;
                                       ClassInstallParams:   PSP_CLASSINSTALL_HEADER;
                                       ClassInstallParamsSize:   DWORD;
                                       REQUIREDSIZE: PDWORD): BOOL; stdcall;

function SetupDiGetClassInstallParams(DeviceInfoSet:  HDEVINFO;
                                       DeviceInfoData:  PSP_DEVINFO_DATA;
                                       ClassInstallParams:   PSP_CLASSINSTALL_HEADER;
                                       ClassInstallParamsSize:   DWORD;
                                       REQUIREDSIZE: PDWORD): BOOL; stdcall;


function SetupDiSetDeviceInstallParamsA(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DeviceInstallParams:   PSP_DEVINSTALL_PARAMS_A): BOOL; stdcall;



function SetupDiSetDeviceInstallParamsW(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DeviceInstallParams:   PSP_DEVINSTALL_PARAMS_W): BOOL; stdcall;

function SetupDiSetDeviceInstallParams(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DeviceInstallParams:   PSP_DEVINSTALL_PARAMS_A): BOOL; stdcall;


function SetupDiSetClassInstallParamsA(DeviceInfoSet:  HDEVINFO;
                                       DeviceInfoData:  PSP_DEVINFO_DATA;
                                       ClassInstallParams:   PSP_CLASSINSTALL_HEADER;
                                       ClassInstallParamsSize:   DWORD): BOOL; stdcall;

function SetupDiSetClassInstallParamsW(DeviceInfoSet:  HDEVINFO;
                                       DeviceInfoData:  PSP_DEVINFO_DATA;
                                       ClassInstallParams:   PSP_CLASSINSTALL_HEADER;
                                       ClassInstallParamsSize:   DWORD): BOOL; stdcall;

function SetupDiSetClassInstallParams(DeviceInfoSet:  HDEVINFO;
                                       DeviceInfoData:  PSP_DEVINFO_DATA;
                                       ClassInstallParams:   PSP_CLASSINSTALL_HEADER;
                                       ClassInstallParamsSize:   DWORD): BOOL; stdcall;


function SetupDiGetDriverInstallParamsA(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DriverInfoData:   PSP_DRVINFO_DATA_A;
                                        DriverInstallParams:  PSP_DRVINSTALL_PARAMS): BOOL; stdcall;

function SetupDiGetDriverInstallParamsW(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DriverInfoData:   PSP_DRVINFO_DATA_W;
                                        DriverInstallParams:  PSP_DRVINSTALL_PARAMS): BOOL; stdcall;

function SetupDiGetDriverInstallParams(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DriverInfoData:   PSP_DRVINFO_DATA_A;
                                        DriverInstallParams:  PSP_DRVINSTALL_PARAMS): BOOL; stdcall;

function SetupDiSetDriverInstallParamsA(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DriverInfoData:   PSP_DRVINFO_DATA_A;
                                        DriverInstallParams:  PSP_DRVINSTALL_PARAMS): BOOL; stdcall;

function SetupDiSetDriverInstallParamsW(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DriverInfoData:   PSP_DRVINFO_DATA_W;
                                        DriverInstallParams:  PSP_DRVINSTALL_PARAMS): BOOL; stdcall;

function SetupDiSetDriverInstallParams(DeviceInfoSet:  HDEVINFO;
                                        DeviceInfoData:  PSP_DEVINFO_DATA;
                                        DriverInfoData:   PSP_DRVINFO_DATA_A;
                                        DriverInstallParams:  PSP_DRVINSTALL_PARAMS): BOOL; stdcall;


function SetupDiLoadClassIcon(ClassGuid:  PGUID;
                              var LargeIcon:  HICON;
                              MINIICONINDEX : PINT): BOOL; stdcall;


//
//Flags controlling the drawing of mini-icons
//
const
  DMI_MASK = $00000001;
  DMI_BKCOLOR = $00000002;
  DMI_USERECT = $00000004;


function SetupDiDrawMiniIcon(hdc:  HDC;
                             rc:  TRECT;
                             MiniIconIndex:  Integer;
                             Flags:  DWORD): Integer; stdcall;




function SetupDiGetClassBitmapIndex(ClassGuid:  PGUID;
                                    MiniIconIndex:   PINT): BOOL; stdcall;




function SetupDiGetClassImageList(ClassImageListData:  PSP_CLASSIMAGELIST_DATA): BOOL; stdcall;




function SetupDiGetClassImageListExA(ClassImageListData:  PSP_CLASSIMAGELIST_DATA;
                                     MachineName:  PCSTR;
                                     Reserved:   PVOID): BOOL; stdcall;



function SetupDiGetClassImageListExW(ClassImageListData:  PSP_CLASSIMAGELIST_DATA;
                                     MachineName:  PCWSTR;
                                     Reserved:   PVOID): BOOL; stdcall;


function SetupDiGetClassImageListEx(ClassImageListData:  PSP_CLASSIMAGELIST_DATA;
                                     MachineName:  PCSTR;
                                     Reserved:   PVOID): BOOL; stdcall;


function SetupDiGetClassImageIndex(ClassImageListData:  PSP_CLASSIMAGELIST_DATA;
                                   ClassGuid:  PGUID;
                                   ImageIndex:  PINT): BOOL; stdcall;




function SetupDiDestroyClassImageList(ClassImageListData:  PSP_CLASSIMAGELIST_DATA): BOOL; stdcall;


//
//PropertySheetType values for the SetupDiGetClassDevPropertySheets API
//
const
  DIGCDP_FLAG_BASIC = $00000001;
  DIGCDP_FLAG_ADVANCED = $00000002;


function SetupDiGetClassDevPropertySheetsA(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:  PSP_DEVINFO_DATA; 
                                           PropertySheetHeader:   PPROPSHEETHEADERA;
                                           PropertySheetHeaderPageListSize:  DWORD; 
                                           RequiredSize:  PDWORD; 
                                           _Property:   DWORD; 
                                           PropertySheetType: DWORD
                                           )
: BOOL; stdcall; 


function SetupDiGetClassDevPropertySheetsW(DeviceInfoSet:  HDEVINFO; 
                                           DeviceInfoData:  PSP_DEVINFO_DATA; 
                                           PropertySheetHeader:   PPROPSHEETHEADERW;
                                           PropertySheetHeaderPageListSize:  DWORD; 
                                           RequiredSize:  PDWORD; 
                                           _Property:   DWORD; 
                                           PropertySheetType: DWORD
                                           )
: BOOL; stdcall; 

function SetupDiGetClassDevPropertySheets(DeviceInfoSet:  HDEVINFO;
                                           DeviceInfoData:  PSP_DEVINFO_DATA; 
                                           PropertySheetHeader:   PPROPSHEETHEADERA;
                                           PropertySheetHeaderPageListSize:  DWORD;
                                           RequiredSize:  PDWORD; 
                                           _Property:   DWORD; 
                                           PropertySheetType: DWORD
                                           )
: BOOL; stdcall; 

//
//Define ICON IDs publicly exposed from setupapi.
//
const
  IDI_RESOURCEFIRST = 159;
  IDI_RESOURCE = 159;
  IDI_NOCFGDATA = 160;
  IDI_RESOURCELAST = 161;
  IDI_RESOURCEOVERLAYFIRST = 161;
  IDI_RESOURCEOVERLAYLAST = 161;
  IDI_CONFLICT = 161;

  IDI_CLASSICON_OVERLAYFIRST = 500;
  IDI_CLASSICON_OVERLAYLAST = 502;
  IDI_PROBLEM_OVL = 500;
  IDI_DISABLED_OVL = 501;
  IDI_FORCED_OVL = 502;



function SetupDiAskForOEMDisk(DeviceInfoSet:  HDEVINFO; 
                              DEVICEINFODATA: PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiSelectOEMDrv(hwndParent:  HWND; 
                             DeviceInfoSet:   HDEVINFO; 
                             DEVICEINFODATA:   PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiClassNameFromGuidA(ClassGuid:  PGUID; 
                                   ClassName:  PSTR; 
                                   ClassNameSize:  DWORD; 
                                   REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiClassNameFromGuidW(ClassGuid:  PGUID; 
                                   ClassName:  PWSTR; 
                                   ClassNameSize:  DWORD; 
                                   REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiClassNameFromGuid(ClassGuid:  PGUID; 
                                   ClassName:  PSTR; 
                                   ClassNameSize:  DWORD; 
                                   REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiClassNameFromGuidExA(ClassGuid:  PGUID; 
                                     ClassName:  PSTR; 
                                     ClassNameSize:  DWORD; 
                                     RequiredSize:  PDWORD; 
                                     MachineName:   PCSTR; 
                                     Reserved:   PVOID): BOOL; stdcall; 


function SetupDiClassNameFromGuidExW(ClassGuid:  PGUID; 
                                     ClassName:  PWSTR; 
                                     ClassNameSize:  DWORD; 
                                     RequiredSize:  PDWORD; 
                                     MachineName:   PCWSTR; 
                                     Reserved:   PVOID): BOOL; stdcall; 

function SetupDiClassNameFromGuidEx(ClassGuid:  PGUID; 
                                     ClassName:  PSTR; 
                                     ClassNameSize:  DWORD; 
                                     RequiredSize:  PDWORD; 
                                     MachineName:   PCSTR; 
                                     Reserved:   PVOID): BOOL; stdcall; 


function SetupDiClassGuidsFromNameA(ClassName:  PCSTR; 
                                    ClassGuidList:  PGUID; 
                                    ClassGuidListSize:  DWORD; 
                                    RequiredSize:  PDWORD): BOOL; stdcall; 

function SetupDiClassGuidsFromNameW(ClassName:  PCWSTR; 
                                    ClassGuidList:  PGUID; 
                                    ClassGuidListSize:  DWORD; 
                                    RequiredSize:  PDWORD): BOOL; stdcall; 

function SetupDiClassGuidsFromName(ClassName:  PCSTR; 
                                    ClassGuidList:  PGUID; 
                                    ClassGuidListSize:  DWORD; 
                                    RequiredSize:  PDWORD): BOOL; stdcall; 

function SetupDiClassGuidsFromNameExA(ClassName:  PCSTR; 
                                      ClassGuidList:  PGUID; 
                                      ClassGuidListSize:  DWORD; 
                                      RequiredSize:  PDWORD; 
                                      MachineName:  PCSTR; 
                                      Reserved:   PVOID): BOOL; stdcall; 

function SetupDiClassGuidsFromNameExW(ClassName:  PCWSTR; 
                                      ClassGuidList:  PGUID;
                                      ClassGuidListSize:  DWORD; 
                                      RequiredSize:  PDWORD; 
                                      MachineName:  PCWSTR; 
                                      Reserved:   PVOID): BOOL; stdcall; 

function SetupDiClassGuidsFromNameEx(ClassName:  PCSTR; 
                                      ClassGuidList:  PGUID; 
                                      ClassGuidListSize:  DWORD; 
                                      RequiredSize:  PDWORD; 
                                      MachineName:  PCSTR; 
                                      Reserved:   PVOID): BOOL; stdcall; 

function SetupDiGetHwProfileFriendlyNameA(HwProfile:  DWORD; 
                                          FriendlyName:  PSTR; 
                                          FriendlyNameSize:  DWORD; 
                                          REQUIREDSIZE: PDWORD): BOOL; stdcall; 

function SetupDiGetHwProfileFriendlyNameW(HwProfile:  DWORD; 
                                          FriendlyName:  PWSTR; 
                                          FriendlyNameSize:  DWORD; 
                                          REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupDiGetHwProfileFriendlyName(HwProfile:  DWORD; 
                                          FriendlyName:  PSTR; 
                                          FriendlyNameSize:  DWORD; 
                                          REQUIREDSIZE: PDWORD): BOOL; stdcall; 


function SetupDiGetHwProfileFriendlyNameExA(HwProfile:  DWORD; 
                                            FriendlyName:  PSTR; 
                                            FriendlyNameSize:  DWORD; 
                                            RequiredSize:  PDWORD; 
                                            MachineName:   PCSTR; 
                                            Reserved:   PVOID): BOOL; stdcall; 



function SetupDiGetHwProfileFriendlyNameExW(HwProfile:  DWORD; 
                                            FriendlyName:  PWSTR; 
                                            FriendlyNameSize:  DWORD; 
                                            RequiredSize:  PDWORD; 
                                            MachineName:   PCWSTR; 
                                            Reserved:   PVOID): BOOL; stdcall; 


function SetupDiGetHwProfileFriendlyNameEx(HwProfile:  DWORD; 
                                            FriendlyName:  PSTR; 
                                            FriendlyNameSize:  DWORD; 
                                            RequiredSize:  PDWORD; 
                                            MachineName:   PCSTR; 
                                            Reserved:   PVOID): BOOL; stdcall; 

//
//PageType values for SetupDiGetWizardPage API
//
const
  SPWPT_SELECTDEVICE = $00000001;

//
//Flags for SetupDiGetWizardPage API
//
  SPWP_USE_DEVINFO_DATA = $00000001;


function SetupDiGetWizardPage(DeviceInfoSet:  HDEVINFO; 
                              DeviceInfoData:  PSP_DEVINFO_DATA; 
                              InstallWizardData:   PSP_INSTALLWIZARD_DATA; 
                              PageType:  DWORD; 
                              Flags:  DWORD): HPROPSHEETPAGE; stdcall; 




function SetupDiGetSelectedDevice(DeviceInfoSet:  HDEVINFO; 
                                  DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiSetSelectedDevice(DeviceInfoSet:  HDEVINFO; 
                                  DeviceInfoData:  PSP_DEVINFO_DATA): BOOL; stdcall; 




function SetupDiGetActualSectionToInstallA(InfHandle:  HINF; 
                                           InfSectionName:  PCSTR; 
                                           InfSectionWithExt:  PSTR; 
                                           InfSectionWithExtSize:   DWORD; 
                                           RequiredSize:  PDWORD; 
                                           var EXTENSION:PSTR): BOOL; stdcall; 



function SetupDiGetActualSectionToInstallW(InfHandle:  HINF; 
                                           InfSectionName:  PCWSTR; 
                                           InfSectionWithExt:  PWSTR; 
                                           InfSectionWithExtSize:   DWORD; 
                                           RequiredSize:  PDWORD; 
                                           var EXTENSION:PWSTR): BOOL; stdcall; 

function SetupDiGetActualSectionToInstall(InfHandle:  HINF; 
                                           InfSectionName:  PCSTR; 
                                           InfSectionWithExt:  PSTR; 
                                           InfSectionWithExtSize:   DWORD; 
                                           RequiredSize:  PDWORD; 
                                           var EXTENSION:PSTR): BOOL; stdcall; 

implementation

const
	setupapit = 'SETUPAPI.DLL';

function SetupGetInfInformationA; external setupapit name 'SetupGetInfInformationA';
function SetupGetInfInformation; external setupapit name 'SetupGetInfInformationA';
function SetupGetInfInformationW; external setupapit
function SetupQueryInfFileInformationA; external setupapit
function SetupQueryInfFileInformation; external setupapit name 'SetupQueryInfFileInformationA';
function SetupQueryInfFileInformationW; external setupapit
function SetupQueryInfVersionInformationA; external setupapit
function SetupQueryInfVersionInformation; external setupapit name 'SetupQueryInfVersionInformationA';
function SetupQueryInfVersionInformationW; external setupapit
function SetupGetInfFileListA; external setupapit
function SetupGetInfFileList; external setupapit name 'SetupGetInfFileListA';
function SetupGetInfFileListW; external setupapit
function SetupOpenInfFileW; external setupapit
function SetupOpenInfFileA; external setupapit
function SetupOpenInfFile; external setupapit name 'SetupOpenInfFileA';
function SetupOpenMasterInf; external setupapit
function SetupOpenAppendInfFileW; external setupapit
function SetupOpenAppendInfFileA; external setupapit
function SetupOpenAppendInfFile; external setupapit name 'SetupOpenAppendInfFileA';
procedure SetupCloseInfFile; external setupapit
function SetupFindFirstLineA; external setupapit
function SetupFindFirstLine; external setupapit name 'SetupFindFirstLineA';
function SetupFindFirstLineW; external setupapit
function SetupFindNextLine; external setupapit
function SetupFindNextMatchLineA; external setupapit
function SetupFindNextMatchLine; external setupapit name 'SetupFindNextMatchLineA';
function SetupFindNextMatchLineW; external setupapit
function SetupGetLineByIndexA; external setupapit
function SetupGetLineByIndex; external setupapit name 'SetupGetLineByIndexA';
function SetupGetLineByIndexW; external setupapit
function SetupGetLineCountA; external setupapit
function SetupGetLineCount; external setupapit name 'SetupGetLineCountA';
function SetupGetLineCountW; external setupapit
function SetupGetLineTextA; external setupapit
function SetupGetLineText; external setupapit name 'SetupGetLineTextA';
function SetupGetLineTextW; external setupapit
function SetupGetFieldCount; external setupapit
function SetupGetStringFieldA; external setupapit
function SetupGetStringField; external setupapit name 'SetupGetStringFieldA';
function SetupGetStringFieldW; external setupapit
function SetupGetIntField; external setupapit
function SetupGetMultiSzFieldA; external setupapit
function SetupGetMultiSzField; external setupapit name 'SetupGetMultiSzFieldA';
function SetupGetMultiSzFieldW; external setupapit
function SetupGetBinaryField; external setupapit
function SetupGetFileCompressionInfoA; external setupapit
function SetupGetFileCompressionInfo; external setupapit name 'SetupGetFileCompressionInfoA';
function SetupGetFileCompressionInfoW; external setupapit
function SetupDecompressOrCopyFileA; external setupapit
function SetupDecompressOrCopyFile; external setupapit name 'SetupDecompressOrCopyFileA';
function SetupDecompressOrCopyFileW; external setupapit
function SetupGetSourceFileLocationA; external setupapit
function SetupGetSourceFileLocation; external setupapit name 'SetupGetSourceFileLocationA';
function SetupGetSourceFileLocationW; external setupapit
function SetupGetSourceFileSizeA; external setupapit
function SetupGetSourceFileSize; external setupapit name 'SetupGetSourceFileSizeA';
function SetupGetSourceFileSizeW; external setupapit
function SetupGetTargetPathA; external setupapit
function SetupGetTargetPath; external setupapit name 'SetupGetTargetPathA';
function SetupGetTargetPathW; external setupapit
function SetupSetSourceListA; external setupapit
function SetupSetSourceList; external setupapit name 'SetupSetSourceListA';
function SetupSetSourceListW; external setupapit
function SetupCancelTemporarySourceList; external setupapit
function SetupAddToSourceListA; external setupapit
function SetupAddToSourceList; external setupapit name 'SetupAddToSourceListA';
function SetupAddToSourceListW; external setupapit
function SetupRemoveFromSourceListA; external setupapit
function SetupRemoveFromSourceList; external setupapit name 'SetupRemoveFromSourceListA';
function SetupRemoveFromSourceListW; external setupapit
function SetupQuerySourceListA; external setupapit
function SetupQuerySourceListW; external setupapit
function SetupQuerySourceList; external setupapit name 'SetupQuerySourceListA';
function SetupFreeSourceListA; external setupapit
function SetupFreeSourceList; external setupapit name 'SetupFreeSourceListA';
function SetupFreeSourceListW; external setupapit
function SetupPromptForDiskA; external setupapit
function SetupPromptForDisk; external setupapit name 'SetupPromptForDiskA';
function SetupPromptForDiskW; external setupapit
function SetupCopyErrorA; external setupapit
function SetupCopyError; external setupapit name 'SetupCopyErrorA';
function SetupCopyErrorW; external setupapit
function SetupRenameErrorA; external setupapit
function SetupRenameError; external setupapit name 'SetupRenameErrorA';
function SetupRenameErrorW; external setupapit
function SetupDeleteErrorA; external setupapit
function SetupDeleteError; external setupapit name 'SetupDeleteErrorA';
function SetupDeleteErrorW; external setupapit
function SetupSetDirectoryIdA; external setupapit
function SetupSetDirectoryId; external setupapit name 'SetupSetDirectoryIdA';
function SetupSetDirectoryIdW; external setupapit
function SetupSetDirectoryIdExA; external setupapit
function SetupSetDirectoryIdEx; external setupapit name 'SetupSetDirectoryIdExA';
function SetupSetDirectoryIdExW; external setupapit
function SetupGetSourceInfoA; external setupapit
function SetupGetSourceInfo; external setupapit name 'SetupGetSourceInfoA';
function SetupGetSourceInfoW; external setupapit
function SetupInstallFileA; external setupapit
function SetupInstallFile; external setupapit name 'SetupInstallFileA';
function SetupInstallFileW; external setupapit
function SetupInstallFileExA; external setupapit
function SetupInstallFileEx; external setupapit name 'SetupInstallFileExA';
function SetupInstallFileExW; external setupapit
function SetupOpenFileQueue; external setupapit
function SetupCloseFileQueue; external setupapit
function SetupSetPlatformPathOverrideA; external setupapit
function SetupSetPlatformPathOverride; external setupapit name 'SetupSetPlatformPathOverrideA';
function SetupSetPlatformPathOverrideW; external setupapit
function SetupQueueCopyA; external setupapit
function SetupQueueCopy; external setupapit name 'SetupQueueCopyA';
function SetupQueueCopyW; external setupapit
function SetupQueueDefaultCopyA; external setupapit
function SetupQueueDefaultCopy; external setupapit name 'SetupQueueDefaultCopyA';
function SetupQueueDefaultCopyW; external setupapit
function SetupQueueCopySectionA; external setupapit
function SetupQueueCopySection; external setupapit name 'SetupQueueCopySectionA';
function SetupQueueCopySectionW; external setupapit
function SetupQueueDeleteA; external setupapit
function SetupQueueDelete; external setupapit name 'SetupQueueDeleteA';
function SetupQueueDeleteW; external setupapit
function SetupQueueDeleteSectionA; external setupapit
function SetupQueueDeleteSection; external setupapit name 'SetupQueueDeleteSectionA';
function SetupQueueDeleteSectionW; external setupapit
function SetupQueueRenameA; external setupapit
function SetupQueueRename; external setupapit name 'SetupQueueRenameA';
function SetupQueueRenameW; external setupapit
function SetupQueueRenameSectionA; external setupapit
function SetupQueueRenameSection; external setupapit name 'SetupQueueRenameSectionA';
function SetupQueueRenameSectionW; external setupapit
function SetupCommitFileQueueA; external setupapit
function SetupCommitFileQueue; external setupapit name 'SetupCommitFileQueueA';
function SetupCommitFileQueueW; external setupapit
function SetupScanFileQueueA; external setupapit
function SetupScanFileQueue; external setupapit name 'SetupScanFileQueueA';
function SetupScanFileQueueW; external setupapit
function SetupCopyOEMInfA; external setupapit
function SetupCopyOEMInf; external setupapit name 'SetupCopyOEMInfA';
function SetupCopyOEMInfW; external setupapit
function SetupCreateDiskSpaceListA; external setupapit
function SetupCreateDiskSpaceList; external setupapit name 'SetupCreateDiskSpaceListA';
function SetupCreateDiskSpaceListW; external setupapit
function SetupDuplicateDiskSpaceListA; external setupapit
function SetupDuplicateDiskSpaceList; external setupapit name 'SetupDuplicateDiskSpaceListA';
function SetupDuplicateDiskSpaceListW; external setupapit
function SetupDestroyDiskSpaceList; external setupapit
function SetupQueryDrivesInDiskSpaceListA; external setupapit
function SetupQueryDrivesInDiskSpaceList; external setupapit name 'SetupQueryDrivesInDiskSpaceListA';
function SetupQueryDrivesInDiskSpaceListW; external setupapit
function SetupQuerySpaceRequiredOnDriveA; external setupapit
function SetupQuerySpaceRequiredOnDrive; external setupapit name 'SetupQuerySpaceRequiredOnDriveA';
function SetupQuerySpaceRequiredOnDriveW; external setupapit
function SetupAdjustDiskSpaceListA; external setupapit
function SetupAdjustDiskSpaceList; external setupapit name 'SetupAdjustDiskSpaceListA';
function SetupAdjustDiskSpaceListW; external setupapit
function SetupAddToDiskSpaceListA; external setupapit
function SetupAddToDiskSpaceList; external setupapit name 'SetupAddToDiskSpaceListA';
function SetupAddToDiskSpaceListW; external setupapit
function SetupAddSectionToDiskSpaceListA; external setupapit
function SetupAddSectionToDiskSpaceList; external setupapit name 'SetupAddSectionToDiskSpaceListA';
function SetupAddSectionToDiskSpaceListW; external setupapit
function SetupAddInstallSectionToDiskSpaceListA; external setupapit
function SetupAddInstallSectionToDiskSpaceList; external setupapit name 'SetupAddInstallSectionToDiskSpaceListA';
function SetupAddInstallSectionToDiskSpaceListW; external setupapit
function SetupRemoveFromDiskSpaceListA; external setupapit
function SetupRemoveFromDiskSpaceList; external setupapit name 'SetupRemoveFromDiskSpaceListA';
function SetupRemoveFromDiskSpaceListW; external setupapit
function SetupRemoveSectionFromDiskSpaceListA; external setupapit
function SetupRemoveSectionFromDiskSpaceList; external setupapit name 'SetupRemoveSectionFromDiskSpaceListA';
function SetupRemoveSectionFromDiskSpaceListW; external setupapit
function SetupRemoveInstallSectionFromDiskSpaceListA; external setupapit
function SetupRemoveInstallSectionFromDiskSpaceList; external setupapit name 'SetupRemoveInstallSectionFromDiskSpaceListA';
function SetupRemoveInstallSectionFromDiskSpaceListW; external setupapit
function SetupIterateCabinetA; external setupapit
function SetupIterateCabinet; external setupapit name 'SetupIterateCabinetA';
function SetupIterateCabinetW; external setupapit
function SetupPromptReboot; external setupapit
function SetupInitDefaultQueueCallback; external setupapit
function SetupInitDefaultQueueCallbackEx; external setupapit
procedure SetupTermDefaultQueueCallback; external setupapit
function SetupDefaultQueueCallbackA; external setupapit
function SetupDefaultQueueCallback; external setupapit name 'SetupDefaultQueueCallbackA';
function SetupDefaultQueueCallbackW; external setupapit
function SetupInstallFromInfSectionA; external setupapit
function SetupInstallFromInfSection; external setupapit name 'SetupInstallFromInfSectionA';
function SetupInstallFromInfSectionW; external setupapit
function SetupInstallFilesFromInfSectionA; external setupapit
function SetupInstallFilesFromInfSection; external setupapit name 'SetupInstallFilesFromInfSectionA';
function SetupInstallFilesFromInfSectionW; external setupapit
function SetupInstallServicesFromInfSectionA; external setupapit
function SetupInstallServicesFromInfSection; external setupapit name 'SetupInstallServicesFromInfSectionA';
function SetupInstallServicesFromInfSectionW; external setupapit
function SetupInstallServicesFromInfSectionExA; external setupapit
function SetupInstallServicesFromInfSectionEx; external setupapit name 'SetupInstallServicesFromInfSectionExA';
function SetupInstallServicesFromInfSectionExW; external setupapit
function SetupInitializeFileLogA; external setupapit
function SetupInitializeFileLog; external setupapit name 'SetupInitializeFileLogA';
function SetupInitializeFileLogW; external setupapit
function SetupTerminateFileLog; external setupapit
function SetupLogFileA; external setupapit
function SetupLogFile; external setupapit name 'SetupLogFileA';
function SetupLogFileW; external setupapit
function SetupRemoveFileLogEntryA; external setupapit
function SetupRemoveFileLogEntry; external setupapit name 'SetupRemoveFileLogEntryA';
function SetupRemoveFileLogEntryW; external setupapit
function SetupQueryFileLogA; external setupapit
function SetupQueryFileLog; external setupapit name 'SetupQueryFileLogA';
function SetupQueryFileLogW; external setupapit
function SetupOpenLog; external setupapit
function SetupLogErrorA; external setupapit
function SetupLogError; external setupapit name 'SetupLogErrorA';
function SetupLogErrorW; external setupapit
procedure SetupCloseLog; external setupapit
function SetupDiCreateDeviceInfoList; external setupapit
function SetupDiCreateDeviceInfoListExA; external setupapit
function SetupDiCreateDeviceInfoListEx; external setupapit name 'SetupDiCreateDeviceInfoListExA';
function SetupDiCreateDeviceInfoListExW; external setupapit
function SetupDiGetDeviceInfoListClass; external setupapit
function SetupDiGetDeviceInfoListDetailA; external setupapit
function SetupDiGetDeviceInfoListDetail; external setupapit name 'SetupDiGetDeviceInfoListDetailA';
function SetupDiGetDeviceInfoListDetailW; external setupapit
function SetupDiCreateDeviceInfoA; external setupapit
function SetupDiCreateDeviceInfo; external setupapit name 'SetupDiCreateDeviceInfoA';
function SetupDiCreateDeviceInfoW; external setupapit
function SetupDiOpenDeviceInfoA; external setupapit
function SetupDiOpenDeviceInfo; external setupapit name 'SetupDiOpenDeviceInfoA';
function SetupDiOpenDeviceInfoW; external setupapit
function SetupDiGetDeviceInstanceIdA; external setupapit
function SetupDiGetDeviceInstanceId; external setupapit name 'SetupDiGetDeviceInstanceIdA';
function SetupDiGetDeviceInstanceIdW; external setupapit
function SetupDiDeleteDeviceInfo; external setupapit
function SetupDiEnumDeviceInfo; external setupapit
function SetupDiDestroyDeviceInfoList; external setupapit
function SetupDiEnumDeviceInterfaces; external setupapit
function SetupDiCreateDeviceInterfaceA; external setupapit
function SetupDiCreateDeviceInterface; external setupapit name 'SetupDiCreateDeviceInterfaceA';
function SetupDiCreateDeviceInterfaceW; external setupapit
function SetupDiOpenDeviceInterfaceA; external setupapit
function SetupDiOpenDeviceInterface; external setupapit name 'SetupDiOpenDeviceInterfaceA';
function SetupDiOpenDeviceInterfaceW; external setupapit
function SetupDiGetDeviceInterfaceAlias; external setupapit
function SetupDiDeleteDeviceInterfaceData; external setupapit
function SetupDiRemoveDeviceInterface; external setupapit
function SetupDiGetDeviceInterfaceDetailA; external setupapit
function SetupDiGetDeviceInterfaceDetail; external setupapit name 'SetupDiGetDeviceInterfaceDetailA';
function SetupDiGetDeviceInterfaceDetailW; external setupapit
function SetupDiInstallDeviceInterfaces; external setupapit
function SetupDiRegisterDeviceInfo; external setupapit
function SetupDiBuildDriverInfoList; external setupapit
function SetupDiCancelDriverInfoSearch; external setupapit
function SetupDiEnumDriverInfoA; external setupapit
function SetupDiEnumDriverInfo; external setupapit name 'SetupDiEnumDriverInfoA';
function SetupDiEnumDriverInfoW; external setupapit
function SetupDiGetSelectedDriverA; external setupapit
function SetupDiGetSelectedDriver; external setupapit name 'SetupDiGetSelectedDriverA';
function SetupDiGetSelectedDriverW; external setupapit
function SetupDiSetSelectedDriverA; external setupapit
function SetupDiSetSelectedDriver; external setupapit name 'SetupDiSetSelectedDriverA';
function SetupDiSetSelectedDriverW; external setupapit
function SetupDiGetDriverInfoDetailA; external setupapit
function SetupDiGetDriverInfoDetail; external setupapit name 'SetupDiGetDriverInfoDetailA';
function SetupDiGetDriverInfoDetailW; external setupapit
function SetupDiDestroyDriverInfoList; external setupapit
function SetupDiGetClassDevsA; external setupapit
function SetupDiGetClassDevs; external setupapit name 'SetupDiGetClassDevsA';
function SetupDiGetClassDevsW; external setupapit
function SetupDiGetClassDevsExA; external setupapit
function SetupDiGetClassDevsEx; external setupapit name 'SetupDiGetClassDevsExA';
function SetupDiGetClassDevsExW; external setupapit
function SetupDiGetINFClassA; external setupapit
function SetupDiGetINFClass; external setupapit name 'SetupDiGetINFClassA';
function SetupDiGetINFClassW; external setupapit
function SetupDiBuildClassInfoList; external setupapit
function SetupDiBuildClassInfoListExA; external setupapit
function SetupDiBuildClassInfoListEx; external setupapit name 'SetupDiBuildClassInfoListExA';
function SetupDiBuildClassInfoListExW; external setupapit
function SetupDiGetClassDescriptionA; external setupapit
function SetupDiGetClassDescription; external setupapit name 'SetupDiGetClassDescriptionA';
function SetupDiGetClassDescriptionW; external setupapit
function SetupDiGetClassDescriptionExA; external setupapit
function SetupDiGetClassDescriptionEx; external setupapit name 'SetupDiGetClassDescriptionExA';
function SetupDiGetClassDescriptionExW; external setupapit
function SetupDiCallClassInstaller; external setupapit
function SetupDiSelectDevice; external setupapit
function SetupDiSelectBestCompatDrv; external setupapit
function SetupDiInstallDevice; external setupapit
function SetupDiInstallDriverFiles; external setupapit
function SetupDiRegisterCoDeviceInstallers; external setupapit
function SetupDiRemoveDevice; external setupapit
function SetupDiUnremoveDevice; external setupapit
function SetupDiMoveDuplicateDevice; external setupapit
function SetupDiChangeState; external setupapit
function SetupDiInstallClassA; external setupapit
function SetupDiInstallClass; external setupapit name 'SetupDiInstallClassA';
function SetupDiInstallClassW; external setupapit
function SetupDiInstallClassExA; external setupapit
function SetupDiInstallClassEx; external setupapit name 'SetupDiInstallClassExA';
function SetupDiInstallClassExW; external setupapit
function SetupDiOpenClassRegKey; external setupapit
function SetupDiOpenClassRegKeyExA; external setupapit
function SetupDiOpenClassRegKeyEx; external setupapit name 'SetupDiOpenClassRegKeyExA';
function SetupDiOpenClassRegKeyExW; external setupapit
function SetupDiCreateDeviceInterfaceRegKeyA; external setupapit
function SetupDiCreateDeviceInterfaceRegKey; external setupapit name 'SetupDiCreateDeviceInterfaceRegKeyA';
function SetupDiCreateDeviceInterfaceRegKeyW; external setupapit
function SetupDiOpenDeviceInterfaceRegKey; external setupapit
function SetupDiDeleteDeviceInterfaceRegKey; external setupapit
function SetupDiCreateDevRegKeyA; external setupapit
function SetupDiCreateDevRegKey; external setupapit name 'SetupDiCreateDevRegKeyA';
function SetupDiCreateDevRegKeyW; external setupapit
function SetupDiOpenDevRegKey; external setupapit
function SetupDiDeleteDevRegKey; external setupapit
function SetupDiGetHwProfileList; external setupapit
function SetupDiGetHwProfileListExA; external setupapit
function SetupDiGetHwProfileListEx; external setupapit name 'SetupDiGetHwProfileListExA';
function SetupDiGetHwProfileListExW; external setupapit
function SetupDiGetDeviceRegistryPropertyA; external setupapit
function SetupDiGetDeviceRegistryProperty; external setupapit name 'SetupDiGetDeviceRegistryPropertyA';
function SetupDiGetDeviceRegistryPropertyW; external setupapit
function SetupDiSetDeviceRegistryPropertyA; external setupapit
function SetupDiSetDeviceRegistryProperty; external setupapit name 'SetupDiSetDeviceRegistryPropertyA';
function SetupDiSetDeviceRegistryPropertyW; external setupapit
function SetupDiGetDeviceInstallParamsA; external setupapit
function SetupDiGetDeviceInstallParams; external setupapit name 'SetupDiGetDeviceInstallParamsA';
function SetupDiGetDeviceInstallParamsW; external setupapit
function SetupDiGetClassInstallParamsA; external setupapit
function SetupDiGetClassInstallParams; external setupapit name 'SetupDiGetClassInstallParamsA';
function SetupDiGetClassInstallParamsW; external setupapit
function SetupDiSetDeviceInstallParamsA; external setupapit
function SetupDiSetDeviceInstallParams; external setupapit name 'SetupDiSetDeviceInstallParamsA';
function SetupDiSetDeviceInstallParamsW; external setupapit
function SetupDiSetClassInstallParamsA; external setupapit
function SetupDiSetClassInstallParams; external setupapit name 'SetupDiSetClassInstallParamsA';
function SetupDiSetClassInstallParamsW; external setupapit
function SetupDiGetDriverInstallParamsA; external setupapit
function SetupDiGetDriverInstallParams; external setupapit name 'SetupDiGetDriverInstallParamsA';
function SetupDiGetDriverInstallParamsW; external setupapit
function SetupDiSetDriverInstallParamsA; external setupapit
function SetupDiSetDriverInstallParams; external setupapit name 'SetupDiSetDriverInstallParamsA';
function SetupDiSetDriverInstallParamsW; external setupapit
function SetupDiLoadClassIcon; external setupapit
function SetupDiDrawMiniIcon; external setupapit
function SetupDiGetClassBitmapIndex; external setupapit
function SetupDiGetClassImageList; external setupapit
function SetupDiGetClassImageListExA; external setupapit
function SetupDiGetClassImageListEx; external setupapit name 'SetupDiGetClassImageListExA';
function SetupDiGetClassImageListExW; external setupapit
function SetupDiGetClassImageIndex; external setupapit
function SetupDiDestroyClassImageList; external setupapit
function SetupDiGetClassDevPropertySheetsA; external setupapit
function SetupDiGetClassDevPropertySheets; external setupapit name 'SetupDiGetClassDevPropertySheetsA';
function SetupDiGetClassDevPropertySheetsW; external setupapit
function SetupDiAskForOEMDisk; external setupapit
function SetupDiSelectOEMDrv; external setupapit
function SetupDiClassNameFromGuidA; external setupapit
function SetupDiClassNameFromGuid; external setupapit name 'SetupDiClassNameFromGuidA';
function SetupDiClassNameFromGuidW; external setupapit
function SetupDiClassNameFromGuidExA; external setupapit
function SetupDiClassNameFromGuidEx; external setupapit name 'SetupDiClassNameFromGuidExA';
function SetupDiClassNameFromGuidExW; external setupapit
function SetupDiClassGuidsFromNameA; external setupapit
function SetupDiClassGuidsFromName; external setupapit name 'SetupDiClassGuidsFromNameA';
function SetupDiClassGuidsFromNameW; external setupapit
function SetupDiClassGuidsFromNameExA; external setupapit
function SetupDiClassGuidsFromNameEx; external setupapit name 'SetupDiClassGuidsFromNameExA';
function SetupDiClassGuidsFromNameExW; external setupapit
function SetupDiGetHwProfileFriendlyNameA; external setupapit
function SetupDiGetHwProfileFriendlyName; external setupapit name 'SetupDiGetHwProfileFriendlyNameA';
function SetupDiGetHwProfileFriendlyNameW; external setupapit
function SetupDiGetHwProfileFriendlyNameExA; external setupapit
function SetupDiGetHwProfileFriendlyNameEx; external setupapit name 'SetupDiGetHwProfileFriendlyNameExA';
function SetupDiGetHwProfileFriendlyNameExW; external setupapit
function SetupDiGetWizardPage; external setupapit
function SetupDiGetSelectedDevice; external setupapit
function SetupDiSetSelectedDevice; external setupapit
function SetupDiGetActualSectionToInstallA; external setupapit
function SetupDiGetActualSectionToInstall; external setupapit name 'SetupDiGetActualSectionToInstallA';
function SetupDiGetActualSectionToInstallW; external setupapit

end.
