📄 setupapi.h
字号:
#define DI_GENERALPAGE_ADDED 0x00001000L
#define DI_RESOURCEPAGE_ADDED 0x00002000L
// Flag to indicate the setting properties for this Device (or class) caused a change
// so the Dev Mgr UI probably needs to be updatd.
#define DI_PROPERTIES_CHANGE 0x00004000L
// Flag to indicate that the sorting from the INF file should be used.
#define DI_INF_IS_SORTED 0x00008000L
// Flag to indicate that only the the INF specified by SP_DEVINSTALL_PARAMS.DriverPath
// should be searched.
#define DI_ENUMSINGLEINF 0x00010000L
// Flag that prevents ConfigMgr from removing/re-enumerating devices during device
// registration, installation, and deletion.
#define DI_DONOTCALLCONFIGMG 0x00020000L
// The following flag can be used to install a device disabled
#define DI_INSTALLDISABLED 0x00040000L
// Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver
// list from its existing class driver list, instead of the normal INF search.
#define DI_COMPAT_FROM_CLASS 0x00080000L
// This flag is set if the Class Install params should be used.
#define DI_CLASSINSTALLPARAMS 0x00100000L
// 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.
#define DI_NODI_DEFAULTACTION 0x00200000L
// The setupx flag, DI_NOSYNCPROCESSING (0x00400000L) is not support in the Setup APIs.
// flags for device installation
#define DI_QUIETINSTALL 0x00800000L // don't confuse the user with
// questions or excess info
#define DI_NOFILECOPY 0x01000000L // No file Copy necessary
#define DI_FORCECOPY 0x02000000L // Force files to be copied from install path
#define DI_DRIVERPAGE_ADDED 0x04000000L // Prop provider added Driver page.
#define DI_USECI_SELECTSTRINGS 0x08000000L // Use Class Installer Provided strings in the Select Device Dlg
#define DI_OVERRIDE_INFFLAGS 0x10000000L // Override INF flags
#define DI_PROPS_NOCHANGEUSAGE 0x20000000L // No Enable/Disable in General Props
#define DI_NOSELECTICONS 0x40000000L // No small icons in select device dialogs
#define DI_NOWRITE_IDS 0x80000000L // Don't write HW & Compat IDs on install
//
// SP_DEVINSTALL_PARAMS.FlagsEx values
//
#define DI_FLAGSEX_USEOLDINFSEARCH 0x00000001L // Inf Search functions should not use Index Search
#define DI_FLAGSEX_AUTOSELECTRANK0 0x00000002L // SetupDiSelectDevice doesn't prompt user if rank 0 match
#define DI_FLAGSEX_CI_FAILED 0x00000004L // Failed to Load/Call class installer
#define DI_FLAGSEX_DIDINFOLIST 0x00000010L // Did the Class Info List
#define DI_FLAGSEX_DIDCOMPATINFO 0x00000020L // Did the Compat Info List
#define DI_FLAGSEX_FILTERCLASSES 0x00000040L
#define DI_FLAGSEX_SETFAILEDINSTALL 0x00000080L
#define DI_FLAGSEX_DEVICECHANGE 0x00000100L
#define DI_FLAGSEX_ALWAYSWRITEIDS 0x00000200L
#define DI_FLAGSEX_PROPCHANGE_PENDING 0x00000400L // One or more device property sheets have had changes made
// to them, and need to have a DIF_PROPERTYCHANGE occur.
#define DI_FLAGSEX_ALLOWEXCLUDEDDRVS 0x00000800L
#define DI_FLAGSEX_NOUIONQUERYREMOVE 0x00001000L
#define DI_FLAGSEX_USECLASSFORCOMPAT 0x00002000L // Use the device's class when building compat drv list.
// (Ignored if DI_COMPAT_FROM_CLASS flag is specified.)
#define DI_FLAGSEX_OLDINF_IN_CLASSLIST 0x00004000L // Search legacy INFs when building class driver list.
#define DI_FLAGSEX_NO_DRVREG_MODIFY 0x00008000L // Don't run AddReg and DelReg for device's software (driver) key.
#define DI_FLAGSEX_IN_SYSTEM_SETUP 0x00010000L // Installation is occurring during initial system setup.
#define DI_FLAGSEX_INET_DRIVER 0x00020000L // Driver came from Windows Update
#define DI_FLAGSEX_APPENDDRIVERLIST 0x00040000L // Cause SetupDiBuildDriverInfoList to append
// a new driver list to an existing list.
#define DI_FLAGSEX_PREINSTALLBACKUP 0x00080000L // backup all files required by old inf before install
#define DI_FLAGSEX_BACKUPONREPLACE 0x00100000L // backup files required by old inf as they are replaced
#define DI_FLAGSEX_DRIVERLIST_FROM_URL 0x00200000L // build driver list from INF(s) retrieved from URL specified
// in SP_DEVINSTALL_PARAMS.DriverPath (empty string means
// Windows Update website)
#define DI_FLAGSEX_RESERVED1 0x00400000L
#define DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS 0x00800000L // Don't include old Internet drivers when building
// a driver list.
#define DI_FLAGSEX_POWERPAGE_ADDED 0x01000000L // class installer added their own power page
//
// 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;
//
typedef struct _SP_CLASSINSTALL_HEADER {
DWORD cbSize;
DI_FUNCTION InstallFunction;
} SP_CLASSINSTALL_HEADER, *PSP_CLASSINSTALL_HEADER;
//
// Structure corresponding to a DIF_ENABLECLASS install function.
//
typedef struct _SP_ENABLECLASS_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
GUID ClassGuid;
DWORD EnableMessage;
} SP_ENABLECLASS_PARAMS, *PSP_ENABLECLASS_PARAMS;
#define ENABLECLASS_QUERY 0
#define ENABLECLASS_SUCCESS 1
#define ENABLECLASS_FAILURE 2
//
// Structure corresponding to a DIF_MOVEDEVICE install function.
//
typedef struct _SP_MOVEDEV_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
SP_DEVINFO_DATA SourceDeviceInfoData;
} SP_MOVEDEV_PARAMS, *PSP_MOVEDEV_PARAMS;
//
// Values indicating a change in a device's state
//
#define DICS_ENABLE 0x00000001
#define DICS_DISABLE 0x00000002
#define DICS_PROPCHANGE 0x00000003
#define DICS_START 0x00000004
#define DICS_STOP 0x00000005
//
// Values specifying the scope of a device property change
//
#define DICS_FLAG_GLOBAL 0x00000001 // make change in all hardware profiles
#define DICS_FLAG_CONFIGSPECIFIC 0x00000002 // make change in specified profile only
#define DICS_FLAG_CONFIGGENERAL 0x00000004 // 1 or more hardware profile-specific
// changes to follow.
//
// Structure corresponding to a DIF_PROPERTYCHANGE install function.
//
typedef struct _SP_PROPCHANGE_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
DWORD StateChange;
DWORD Scope;
DWORD HwProfile;
} SP_PROPCHANGE_PARAMS, *PSP_PROPCHANGE_PARAMS;
//
// Structure corresponding to a DIF_REMOVE install function.
//
typedef struct _SP_REMOVEDEVICE_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
DWORD Scope;
DWORD HwProfile;
} SP_REMOVEDEVICE_PARAMS, *PSP_REMOVEDEVICE_PARAMS;
#define DI_REMOVEDEVICE_GLOBAL 0x00000001
#define DI_REMOVEDEVICE_CONFIGSPECIFIC 0x00000002
//
// Structure corresponding to a DIF_UNREMOVE install function.
//
typedef struct _SP_UNREMOVEDEVICE_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
DWORD Scope;
DWORD HwProfile;
} SP_UNREMOVEDEVICE_PARAMS, *PSP_UNREMOVEDEVICE_PARAMS;
#define DI_UNREMOVEDEVICE_CONFIGSPECIFIC 0x00000002
//
// Structure corresponding to a DIF_SELECTDEVICE install function.
//
typedef struct _SP_SELECTDEVICE_PARAMS_A {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
CHAR Title[MAX_TITLE_LEN];
CHAR Instructions[MAX_INSTRUCTION_LEN];
CHAR ListLabel[MAX_LABEL_LEN];
CHAR SubTitle[MAX_SUBTITLE_LEN];
BYTE Reserved[2]; // DWORD size alignment
} SP_SELECTDEVICE_PARAMS_A, *PSP_SELECTDEVICE_PARAMS_A;
typedef struct _SP_SELECTDEVICE_PARAMS_W {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
WCHAR Title[MAX_TITLE_LEN];
WCHAR Instructions[MAX_INSTRUCTION_LEN];
WCHAR ListLabel[MAX_LABEL_LEN];
WCHAR SubTitle[MAX_SUBTITLE_LEN];
} SP_SELECTDEVICE_PARAMS_W, *PSP_SELECTDEVICE_PARAMS_W;
#ifdef UNICODE
typedef SP_SELECTDEVICE_PARAMS_W SP_SELECTDEVICE_PARAMS;
typedef PSP_SELECTDEVICE_PARAMS_W PSP_SELECTDEVICE_PARAMS;
#else
typedef SP_SELECTDEVICE_PARAMS_A SP_SELECTDEVICE_PARAMS;
typedef PSP_SELECTDEVICE_PARAMS_A PSP_SELECTDEVICE_PARAMS;
#endif
//
// Callback routine for giving progress notification during detection
//
typedef BOOL (CALLBACK* PDETECT_PROGRESS_NOTIFY)(
IN PVOID ProgressNotifyParam,
IN DWORD DetectComplete
);
// 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.
//
typedef struct _SP_DETECTDEVICE_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
PDETECT_PROGRESS_NOTIFY DetectProgressNotify;
PVOID ProgressNotifyParam;
} SP_DETECTDEVICE_PARAMS, *PSP_DETECTDEVICE_PARAMS;
//
// 'Add New Device' installation wizard structure (backward-compatibility
// only--respond to DIF_NEWDEVICEWIZARD_* requests instead).
//
// 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.
//
#define MAX_INSTALLWIZARD_DYNAPAGES 20
typedef struct _SP_INSTALLWIZARD_DATA {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
DWORD Flags;
HPROPSHEETPAGE DynamicPages[MAX_INSTALLWIZARD_DYNAPAGES];
DWORD NumDynamicPages;
DWORD DynamicPageFlags;
DWORD PrivateFlags;
LPARAM PrivateData;
HWND hwndWizardDlg;
} SP_INSTALLWIZARD_DATA, *PSP_INSTALLWIZARD_DATA;
//
// SP_INSTALLWIZARD_DATA.Flags values
//
#define NDW_INSTALLFLAG_DIDFACTDEFS 0x00000001
#define NDW_INSTALLFLAG_HARDWAREALLREADYIN 0x00000002
#define NDW_INSTALLFLAG_NEEDRESTART DI_NEEDRESTART
#define NDW_INSTALLFLAG_NEEDREBOOT DI_NEEDREBOOT
#define NDW_INSTALLFLAG_NEEDSHUTDOWN 0x00000200
#define NDW_INSTALLFLAG_EXPRESSINTRO 0x00000400
#define NDW_INSTALLFLAG_SKIPISDEVINSTALLED 0x00000800
#define NDW_INSTALLFLAG_NODETECTEDDEVS 0x00001000
#define NDW_INSTALLFLAG_INSTALLSPECIFIC 0x00002000
#define NDW_INSTALLFLAG_SKIPCLASSLIST 0x00004000
#define NDW_INSTALLFLAG_CI_PICKED_OEM 0x00008000
#define NDW_INSTALLFLAG_PCMCIAMODE 0x00010000
#define NDW_INSTALLFLAG_PCMCIADEVICE 0x00020000
#define NDW_INSTALLFLAG_USERCANCEL 0x00040000
#define NDW_INSTALLFLAG_KNOWNCLASS 0x00080000
//
// SP_INSTALLWIZARD_DATA.DynamicPageFlags values
//
// This flag is set if a Class installer has added pages to the install wizard.
//
#define DYNAWIZ_FLAG_PAGESADDED 0x00000001
//
// 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.
//
#define DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT 0x00000008
//
// The following flags are not used by the Windows NT hardware wizard.
//
#define DYNAWIZ_FLAG_INSTALLDET_NEXT 0x00000002
#define DYNAWIZ_FLAG_INSTALLDET_PREV 0x00000004
//
// Reserve a range of wizard page resource IDs for internal use. Some of
// these IDs are for use by class installers that respond to the obsolete
// DIF_INSTALLWIZARD/DIF_DESTROYWIZARDDATA messages. These IDs are listed
// below.
//
#define MIN_IDD_DYNAWIZ_RESOURCE_ID 10000
#define MAX_IDD_DYNAWIZ_RESOURCE_ID 11000
//
// Define wizard page resource IDs to be used when adding custom pages to the
// hardware install wizard via DIF_INSTALLWIZARD. Pages marked with
// (CLASS INSTALLER PROVIDED) _must_ be supplied by the class installer if it
// responds to the DIF_INSTALLWIZARD request.
//
//
// Resource ID for the first page that the install wizard will go to after
// adding the class installer pages. (CLASS INSTALLER PROVIDED)
//
#define IDD_DYNAWIZ_FIRSTPAGE 10000
//
// Resource ID for the page that the Select Device page will go back to.
// (CLASS INSTALLER PROVIDED)
//
#define IDD_DYNAWIZ_SELECT_PREVPAGE 10001
//
// Resource ID for the page that the Select Device page will go forward to.
// (CLASS INSTALLER PROVIDED)
//
#define 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. (CLASS INSTALLER PROVIDED)
//
#define IDD_DYNAWIZ_ANALYZE_PREVPAGE 10003
//
// Resource ID for the page that the Analyze dialog should go to if it
// continues from the analyze proc. (CLASS INSTALLER PROVIDED)
//
#define IDD_DYNAWIZ_ANALYZE_NEXTPAGE 10004
//
// 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. (This is the resource ID of the Select Device wizard page
// retrieved via SetupDiGetWizardPage when SPWPT_SELECTDEVICE is the requested
// PageType.)
//
#define 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.
//
#define 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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -