📄 setupapi.pas
字号:
// Flags for choosing a device
//
const
DI_SHOWOEM = $00000001; // support Other... button
{$EXTERNALSYM DI_SHOWOEM}
DI_SHOWCOMPAT = $00000002; // show compatibility list
{$EXTERNALSYM DI_SHOWCOMPAT}
DI_SHOWCLASS = $00000004; // show class list
{$EXTERNALSYM DI_SHOWCLASS}
DI_SHOWALL = $00000007; // both class & compat list shown
{$EXTERNALSYM DI_SHOWALL}
DI_NOVCP = $00000008; // don't create a new copy queue--use
{$EXTERNALSYM DI_NOVCP} // caller-supplied FileQueue
DI_DIDCOMPAT = $00000010; // Searched for compatible devices
{$EXTERNALSYM DI_DIDCOMPAT}
DI_DIDCLASS = $00000020; // Searched for class devices
{$EXTERNALSYM DI_DIDCLASS}
DI_AUTOASSIGNRES = $00000040; // No UI for resources if possible
{$EXTERNALSYM DI_AUTOASSIGNRES}
// flags returned by DiInstallDevice to indicate need to reboot/restart
DI_NEEDRESTART = $00000080; // Reboot required to take effect
{$EXTERNALSYM DI_NEEDRESTART}
DI_NEEDREBOOT = $00000100; // ""
{$EXTERNALSYM DI_NEEDREBOOT}
// flags for device installation
DI_NOBROWSE = $00000200; // no Browse... in InsertDisk
{$EXTERNALSYM DI_NOBROWSE}
// Flags set by DiBuildDriverInfoList
DI_MULTMFGS = $00000400; // Set if multiple manufacturers in
{$EXTERNALSYM DI_MULTMFGS} // class driver list
// Flag indicates that device is disabled
DI_DISABLED = $00000800; // Set if device disabled
{$EXTERNALSYM DI_DISABLED}
// Flags for Device/Class Properties
DI_GENERALPAGE_ADDED = $00001000;
{$EXTERNALSYM DI_GENERALPAGE_ADDED}
DI_RESOURCEPAGE_ADDED = $00002000;
{$EXTERNALSYM DI_RESOURCEPAGE_ADDED}
// 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;
{$EXTERNALSYM DI_PROPERTIES_CHANGE}
// Flag to indicate that the sorting from the INF file should be used.
DI_INF_IS_SORTED = $00008000;
{$EXTERNALSYM DI_INF_IS_SORTED}
// Flag to indicate that only the the INF specified by SP_DEVINSTALL_PARAMS.DriverPath
// should be searched.
DI_ENUMSINGLEINF = $00010000;
{$EXTERNALSYM DI_ENUMSINGLEINF}
// Flag that prevents ConfigMgr from removing/re-enumerating devices during device
// registration, installation, and deletion.
DI_DONOTCALLCONFIGMG = $00020000;
{$EXTERNALSYM DI_DONOTCALLCONFIGMG}
// The following flag can be used to install a device disabled
DI_INSTALLDISABLED = $00040000;
{$EXTERNALSYM DI_INSTALLDISABLED}
// 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;
{$EXTERNALSYM DI_COMPAT_FROM_CLASS}
// This flag is set if the Class Install params should be used.
DI_CLASSINSTALLPARAMS = $00100000;
{$EXTERNALSYM DI_CLASSINSTALLPARAMS}
// 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;
{$EXTERNALSYM DI_NODI_DEFAULTACTION}
// The setupx flag, DI_NOSYNCPROCESSING (0x00400000L) is not support in the Setup APIs.
// flags for device installation
DI_QUIETINSTALL = $00800000; // don't confuse the user with
{$EXTERNALSYM DI_QUIETINSTALL} // questions or excess info
DI_NOFILECOPY = $01000000; // No file Copy necessary
{$EXTERNALSYM DI_NOFILECOPY}
DI_FORCECOPY = $02000000; // Force files to be copied from install path
{$EXTERNALSYM DI_FORCECOPY}
DI_DRIVERPAGE_ADDED = $04000000; // Prop provider added Driver page.
{$EXTERNALSYM DI_DRIVERPAGE_ADDED}
DI_USECI_SELECTSTRINGS = $08000000; // Use Class Installer Provided strings in the Select Device Dlg
{$EXTERNALSYM DI_USECI_SELECTSTRINGS}
DI_OVERRIDE_INFFLAGS = $10000000; // Override INF flags
{$EXTERNALSYM DI_OVERRIDE_INFFLAGS}
DI_PROPS_NOCHANGEUSAGE = $20000000; // No Enable/Disable in General Props
{$EXTERNALSYM DI_PROPS_NOCHANGEUSAGE}
DI_NOSELECTICONS = $40000000; // No small icons in select device dialogs
{$EXTERNALSYM DI_NOSELECTICONS}
DI_NOWRITE_IDS = DWORD($80000000); // Don't write HW & Compat IDs on install
{$EXTERNALSYM DI_NOWRITE_IDS}
//
// SP_DEVINSTALL_PARAMS.FlagsEx values
//
DI_FLAGSEX_USEOLDINFSEARCH = $00000001; // Inf Search functions should not use Index Search
{$EXTERNALSYM DI_FLAGSEX_USEOLDINFSEARCH}
DI_FLAGSEX_AUTOSELECTRANK0 = $00000002; // SetupDiSelectDevice doesn't prompt user if rank 0 match
{$EXTERNALSYM DI_FLAGSEX_AUTOSELECTRANK0}
DI_FLAGSEX_CI_FAILED = $00000004; // Failed to Load/Call class installer
{$EXTERNALSYM DI_FLAGSEX_CI_FAILED}
DI_FLAGSEX_DIDINFOLIST = $00000010; // Did the Class Info List
{$EXTERNALSYM DI_FLAGSEX_DIDINFOLIST}
DI_FLAGSEX_DIDCOMPATINFO = $00000020; // Did the Compat Info List
{$EXTERNALSYM DI_FLAGSEX_DIDCOMPATINFO}
DI_FLAGSEX_FILTERCLASSES = $00000040;
{$EXTERNALSYM DI_FLAGSEX_FILTERCLASSES}
DI_FLAGSEX_SETFAILEDINSTALL = $00000080;
{$EXTERNALSYM DI_FLAGSEX_SETFAILEDINSTALL}
DI_FLAGSEX_DEVICECHANGE = $00000100;
{$EXTERNALSYM DI_FLAGSEX_DEVICECHANGE}
DI_FLAGSEX_ALWAYSWRITEIDS = $00000200;
{$EXTERNALSYM DI_FLAGSEX_ALWAYSWRITEIDS}
DI_FLAGSEX_PROPCHANGE_PENDING = $00000400; // One or more device property sheets have had changes made
{$EXTERNALSYM DI_FLAGSEX_PROPCHANGE_PENDING} // to them, and need to have a DIF_PROPERTYCHANGE occur.
DI_FLAGSEX_ALLOWEXCLUDEDDRVS = $00000800;
{$EXTERNALSYM DI_FLAGSEX_ALLOWEXCLUDEDDRVS}
DI_FLAGSEX_NOUIONQUERYREMOVE = $00001000;
{$EXTERNALSYM DI_FLAGSEX_NOUIONQUERYREMOVE}
DI_FLAGSEX_USECLASSFORCOMPAT = $00002000; // Use the device's class when building compat drv list.
{$EXTERNALSYM DI_FLAGSEX_USECLASSFORCOMPAT} // (Ignored if DI_COMPAT_FROM_CLASS flag is specified.)
DI_FLAGSEX_OLDINF_IN_CLASSLIST = $00004000; // Search legacy INFs when building class driver list.
{$EXTERNALSYM DI_FLAGSEX_OLDINF_IN_CLASSLIST}
DI_FLAGSEX_NO_DRVREG_MODIFY = $00008000; // Don't run AddReg and DelReg for device's software (driver) key.
{$EXTERNALSYM DI_FLAGSEX_NO_DRVREG_MODIFY}
DI_FLAGSEX_IN_SYSTEM_SETUP = $00010000; // Installation is occurring during initial system setup.
{$EXTERNALSYM DI_FLAGSEX_IN_SYSTEM_SETUP}
DI_FLAGSEX_INET_DRIVER = $00020000; // Driver came from Windows Update
{$EXTERNALSYM DI_FLAGSEX_INET_DRIVER}
DI_FLAGSEX_APPENDDRIVERLIST = $00040000; // Cause SetupDiBuildDriverInfoList to append
{$EXTERNALSYM DI_FLAGSEX_APPENDDRIVERLIST} // a new driver list to an existing list.
DI_FLAGSEX_PREINSTALLBACKUP = $00080000; // backup all files required by old inf before install
{$EXTERNALSYM DI_FLAGSEX_PREINSTALLBACKUP}
DI_FLAGSEX_BACKUPONREPLACE = $00100000; // backup files required by old inf as they are replaced
{$EXTERNALSYM DI_FLAGSEX_BACKUPONREPLACE}
DI_FLAGSEX_DRIVERLIST_FROM_URL = $00200000; // build driver list from INF(s) retrieved from URL specified
{$EXTERNALSYM DI_FLAGSEX_DRIVERLIST_FROM_URL}
// in SP_DEVINSTALL_PARAMS.DriverPath (empty string means
// Windows Update website)
DI_FLAGSEX_RESERVED1 = $00400000;
{$EXTERNALSYM DI_FLAGSEX_RESERVED1}
DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS = $00800000; // Don't include old Internet drivers when building
{$EXTERNALSYM DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS}
// a driver list.
DI_FLAGSEX_POWERPAGE_ADDED = $01000000; // class installer added their own power page
{$EXTERNALSYM DI_FLAGSEX_POWERPAGE_ADDED}
DI_FLAGSEX_FILTERSIMILARDRIVERS = $02000000; // only include similar drivers in class list
{$EXTERNALSYM DI_FLAGSEX_FILTERSIMILARDRIVERS}
DI_FLAGSEX_INSTALLEDDRIVER = $04000000; // only add the installed driver to the class or compat
{$EXTERNALSYM DI_FLAGSEX_INSTALLEDDRIVER}
// driver list. Used in calls to SetupDiBuildDriverInfoList
DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE = $08000000; // Don't remove identical driver nodes from the class list
{$EXTERNALSYM DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE}
DI_FLAGSEX_ALTPLATFORM_DRVSEARCH = $10000000; // Build driver list based on alternate platform information
{$EXTERNALSYM DI_FLAGSEX_ALTPLATFORM_DRVSEARCH}
// specified in associated file queue
DI_FLAGSEX_RESTART_DEVICE_ONLY = $20000000; // only restart the device drivers are being installed on as
{$EXTERNALSYM DI_FLAGSEX_RESTART_DEVICE_ONLY}
//
// 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
PSPClassInstallHeader = ^TSPClassInstallHeader;
SP_CLASSINSTALL_HEADER = packed record
cbSize: DWORD;
InstallFunction: DI_FUNCTION;
end;
{$EXTERNALSYM SP_CLASSINSTALL_HEADER}
TSPClassInstallHeader = SP_CLASSINSTALL_HEADER;
//
// Structure corresponding to a DIF_ENABLECLASS install function.
//
PSPEnableClassParams = ^TSPEnableClassParams;
SP_ENABLECLASS_PARAMS = packed record
ClassInstallHeader: TSPClassInstallHeader;
ClassGuid: TGUID;
EnableMessage: DWORD;
end;
{$EXTERNALSYM SP_ENABLECLASS_PARAMS}
TSPEnableClassParams = SP_ENABLECLASS_PARAMS;
const
ENABLECLASS_QUERY = 0;
{$EXTERNALSYM ENABLECLASS_QUERY}
ENABLECLASS_SUCCESS = 1;
{$EXTERNALSYM ENABLECLASS_SUCCESS}
ENABLECLASS_FAILURE = 2;
{$EXTERNALSYM ENABLECLASS_FAILURE}
//
// Structure corresponding to a DIF_MOVEDEVICE install function.
//
type
PSPMoveDevParams = ^TSPMoveDevParams;
SP_MOVEDEV_PARAMS = packed record
ClassInstallHeader: TSPClassInstallHeader;
SourceDeviceInfoData: TSPDevInfoData;
end;
{$EXTERNALSYM SP_MOVEDEV_PARAMS}
TSPMoveDevParams = SP_MOVEDEV_PARAMS;
//
// Values indicating a change in a device's state
//
const
DICS_ENABLE = $00000001;
{$EXTERNALSYM DICS_ENABLE}
DICS_DISABLE = $00000002;
{$EXTERNALSYM DICS_DISABLE}
DICS_PROPCHANGE = $00000003;
{$EXTERNALSYM DICS_PROPCHANGE}
DICS_START = $00000004;
{$EXTERNALSYM DICS_START}
DICS_STOP = $00000005;
{$EXTERNALSYM DICS_STOP}
//
// Values specifying the scope of a device property change
//
DICS_FLAG_GLOBAL = $00000001; // make change in all hardware profiles
{$EXTERNALSYM DICS_FLAG_GLOBAL}
DICS_FLAG_CONFIGSPECIFIC = $00000002; // make change in specified profile only
{$EXTERNALSYM DICS_FLAG_CONFIGSPECIFIC}
DICS_FLAG_CONFIGGENERAL = $00000004; // 1 or more hardware profile-specific
{$EXTERNALSYM DICS_FLAG_CONFIGGENERAL} // changes to follow.
//
// Structure corresponding to a DIF_PROPERTYCHANGE install function.
//
type
PSPPropChangeParams = ^TSPPropChangeParams;
SP_PROPCHANGE_PARAMS = packed record
ClassInstallHeader: TSPClassInstallHeader;
StateChange: DWORD;
Scope: DWORD;
HwProfile: DWORD;
end;
{$EXTERNALSYM SP_PROPCHANGE_PARAMS}
TSPPropChangeParams = SP_PROPCHANGE_PARAMS;
//
// Structure corresponding to a DIF_REMOVE install function.
//
PSPRemoveDeviceParams = ^TSPRemoveDeviceParams;
SP_REMOVEDEVICE_PARAMS = packed record
ClassInstallHeader: TSPClassInstallHeader;
Scope: DWORD;
HwProfile: DWORD;
end;
{$EXTERNALSYM SP_REMOVEDEVICE_PARAMS}
TSPRemoveDeviceParams = SP_REMOVEDEVICE_PARAMS;
const
DI_REMOVEDEVICE_GLOBAL = $00000001;
{$EXTERNALSYM DI_REMOVEDEVICE_GLOBAL}
DI_REMOVEDEVICE_CONFIGSPECIFIC = $00000002;
{$EXTERNALSYM DI_REMOVEDEVICE_CONFIGSPECIFIC}
//
// Structure corresponding to a DIF_UNREMOVE install function.
//
type
PSPUnremoveDeviceParams = ^TSPUnremoveDeviceParams;
SP_UNREMOVEDEVICE_PARAMS = packed record
ClassInstallHeader: TSPClassInstallHeader;
Scope: DWORD;
HwProfile: DWORD;
end;
{$EXTERNALSYM SP_UNREMOVEDEVICE_PARAMS}
TSPUnremoveDeviceParams = SP_UNREMOVEDEVICE_PARAMS;
const
DI_UNREMOVEDEVICE_CONFIGSPECIFIC = $00000002;
{$EXTERNALSYM DI_UNREMOVEDEVICE_CONFIGSPECIFIC}
//
// Structure corresponding to a DIF_SELECTDEVICE install function.
//
type
PSPSelectDeviceParamsA = ^TSPSelectDeviceParamsA;
PSPSelectDeviceParamsW = ^TSPSelectDeviceParamsW;
SP_SELECTDEVICE_PARAMS_A = packed record
ClassInstallHeader: TSPClassInstallHeader;
Title: array [0..MAX_TITLE_LEN - 1] of AnsiChar;
Instructions: array [0..MAX_INSTRUCTION_LEN - 1] of AnsiChar;
ListLabel: array [0..MAX_LABEL_LEN - 1] of AnsiChar;
SubTitle: array [0..MAX_SUBTITLE_LEN - 1] of AnsiChar;
Reserved: array [0..1] of Byte; // DWORD size alignment
end;
{$EXTERNALSYM SP_SELECTDEVICE_PARAMS_A}
SP_SELECTDEVICE_PARAMS_W = packed record
ClassInstallHeader: TSPClassInstallHeader;
Title: array [0..MAX_TITLE_LEN - 1] of WideChar;
Instructions: array [0..MAX_INSTRUCTION_LEN - 1] of WideChar;
ListLabel: array [0..MAX_LABEL_LEN - 1] of WideChar;
SubTitle: array [0..MAX_SUBTITLE_LEN - 1] of WideChar;
Reserved: array [0..1] of Byte; // DWORD size alignment
end;
{$EXTERNALSYM SP_SELECTDEVICE_PARAMS_W}
TSPSelectdeviceParamsA = SP_SELECTDEVICE_PARAMS_A;
TSPSelectdeviceParamsW = SP_SELECTDEVICE_PARAMS_W;
{$IFDEF UNICODE}
TSPSelectdeviceParams = TSPSelectdeviceParamsW;
PSPSelectDeviceParams = PSPSelectDeviceParamsW;
{$ELSE}
TSPSelectdeviceParams = TSPSelectdeviceParamsA;
PSPSelectDeviceParams = PSPSelectDeviceParamsA;
{$ENDIF UNICODE}
//
// Callback routine for giving progress notification during detection
//
PDetectProgressNotify = function(ProgressNotifyParam: Pointer; 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.
//
//
// Structure corresponding to a DIF_DETECT install function.
//
PSPDetectDeviceParams = ^TSPDetectDeviceParams;
SP_DETECTDEVICE_PARAMS = packed record
ClassInstallHeader: TSPClassInstallHeader;
DetectProgressNotify: PDetectProgressNotify;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -