📄 setupapi.h
字号:
#define SPFILENOTIFY_STARTRENAME 0x00000008
#define SPFILENOTIFY_ENDRENAME 0x00000009
#define SPFILENOTIFY_RENAMEERROR 0x0000000a
#define SPFILENOTIFY_STARTCOPY 0x0000000b
#define SPFILENOTIFY_ENDCOPY 0x0000000c
#define SPFILENOTIFY_COPYERROR 0x0000000d
#define SPFILENOTIFY_NEEDMEDIA 0x0000000e
#define SPFILENOTIFY_QUEUESCAN 0x0000000f
//
// These are used with SetupIterateCabinet().
//
#define SPFILENOTIFY_CABINETINFO 0x00000010
#define SPFILENOTIFY_FILEINCABINET 0x00000011
#define SPFILENOTIFY_NEEDNEWCABINET 0x00000012
#define SPFILENOTIFY_FILEEXTRACTED 0x00000013
#define SPFILENOTIFY_FILEOPDELAYED 0x00000014
//
// These are used for backup operations
//
#define SPFILENOTIFY_STARTBACKUP 0x00000015
#define SPFILENOTIFY_BACKUPERROR 0x00000016
#define SPFILENOTIFY_ENDBACKUP 0x00000017
//
// Extended notification for SetupScanFileQueue(Flags=SPQ_SCAN_USE_CALLBACKEX)
//
#define SPFILENOTIFY_QUEUESCAN_EX 0x00000018
#define SPFILENOTIFY_STARTREGISTRATION 0x00000019
#define SPFILENOTIFY_ENDREGISTRATION 0x00000020
#if _SETUPAPI_VER >= 0x0501
//
// Extended notification for SetupScanFileQueue(Flags=SPQ_SCAN_USE_CALLBACK_SIGNERINFO)
//
#define SPFILENOTIFY_QUEUESCAN_SIGNERINFO 0x00000040
#endif
//
// Copy notification. These are bit flags that may be combined.
//
#define SPFILENOTIFY_LANGMISMATCH 0x00010000
#define SPFILENOTIFY_TARGETEXISTS 0x00020000
#define SPFILENOTIFY_TARGETNEWER 0x00040000
//
// File operation codes and callback outcomes.
//
#define FILEOP_COPY 0
#define FILEOP_RENAME 1
#define FILEOP_DELETE 2
#define FILEOP_BACKUP 3
#define FILEOP_ABORT 0
#define FILEOP_DOIT 1
#define FILEOP_SKIP 2
#define FILEOP_RETRY FILEOP_DOIT
#define FILEOP_NEWPATH 4
//
// Flags in inf copy sections
//
#define COPYFLG_WARN_IF_SKIP 0x00000001 // warn if user tries to skip file
#define COPYFLG_NOSKIP 0x00000002 // disallow skipping this file
#define COPYFLG_NOVERSIONCHECK 0x00000004 // ignore versions and overwrite target
#define COPYFLG_FORCE_FILE_IN_USE 0x00000008 // force file-in-use behavior
#define COPYFLG_NO_OVERWRITE 0x00000010 // do not copy if file exists on target
#define COPYFLG_NO_VERSION_DIALOG 0x00000020 // do not copy if target is newer
#define COPYFLG_OVERWRITE_OLDER_ONLY 0x00000040 // leave target alone if version same as source
#define COPYFLG_REPLACEONLY 0x00000400 // copy only if file exists on target
#define COPYFLG_NODECOMP 0x00000800 // don't attempt to decompress file; copy as-is
#define COPYFLG_REPLACE_BOOT_FILE 0x00001000 // file must be present upon reboot (i.e., it's
// needed by the loader); this flag implies a reboot
#define COPYFLG_NOPRUNE 0x00002000 // never prune this file
//
// Flags in inf delete sections
// New flags go in high word
//
#define DELFLG_IN_USE 0x00000001 // queue in-use file for delete
#define DELFLG_IN_USE1 0x00010000 // high-word version of DELFLG_IN_USE
//
// Source and file paths. Used when notifying queue callback
// of SPFILENOTIFY_STARTxxx, SPFILENOTIFY_ENDxxx, and SPFILENOTIFY_xxxERROR.
//
typedef struct _FILEPATHS_A {
PCSTR Target;
PCSTR Source; // not used for delete operations
UINT Win32Error;
DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
} FILEPATHS_A, *PFILEPATHS_A;
typedef struct _FILEPATHS_W {
PCWSTR Target;
PCWSTR Source; // not used for delete operations
UINT Win32Error;
DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
} FILEPATHS_W, *PFILEPATHS_W;
#ifdef UNICODE
typedef FILEPATHS_W FILEPATHS;
typedef PFILEPATHS_W PFILEPATHS;
#else
typedef FILEPATHS_A FILEPATHS;
typedef PFILEPATHS_A PFILEPATHS;
#endif
#if _SETUPAPI_VER >= 0x0501
typedef struct _FILEPATHS_SIGNERINFO_A {
PCSTR Target;
PCSTR Source; // not used for delete operations
UINT Win32Error;
DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
PCSTR DigitalSigner;
PCSTR Version;
PCSTR CatalogFile;
} FILEPATHS_SIGNERINFO_A, *PFILEPATHS_SIGNERINFO_A;
typedef struct _FILEPATHS_SIGNERINFO_W {
PCWSTR Target;
PCWSTR Source; // not used for delete operations
UINT Win32Error;
DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
PCWSTR DigitalSigner;
PCWSTR Version;
PCWSTR CatalogFile;
} FILEPATHS_SIGNERINFO_W, *PFILEPATHS_SIGNERINFO_W;
#ifdef UNICODE
typedef FILEPATHS_SIGNERINFO_W FILEPATHS_SIGNERINFO;
typedef PFILEPATHS_SIGNERINFO_W PFILEPATHS_SIGNERINFO;
#else
typedef FILEPATHS_SIGNERINFO_A FILEPATHS_SIGNERINFO;
typedef PFILEPATHS_SIGNERINFO_A PFILEPATHS_SIGNERINFO;
#endif
#endif // _SETUPAPI_VER >= 0x0501
//
// Structure used with SPFILENOTIFY_NEEDMEDIA
//
typedef struct _SOURCE_MEDIA_A {
PCSTR Reserved;
PCSTR Tagfile; // may be NULL
PCSTR Description;
//
// Pathname part and filename part of source file
// that caused us to need the media.
//
PCSTR SourcePath;
PCSTR SourceFile;
DWORD Flags; // subset of SP_COPY_xxx
} SOURCE_MEDIA_A, *PSOURCE_MEDIA_A;
typedef struct _SOURCE_MEDIA_W {
PCWSTR Reserved;
PCWSTR Tagfile; // may be NULL
PCWSTR Description;
//
// Pathname part and filename part of source file
// that caused us to need the media.
//
PCWSTR SourcePath;
PCWSTR SourceFile;
DWORD Flags; // subset of SP_COPY_xxx
} SOURCE_MEDIA_W, *PSOURCE_MEDIA_W;
#ifdef UNICODE
typedef SOURCE_MEDIA_W SOURCE_MEDIA;
typedef PSOURCE_MEDIA_W PSOURCE_MEDIA;
#else
typedef SOURCE_MEDIA_A SOURCE_MEDIA;
typedef PSOURCE_MEDIA_A PSOURCE_MEDIA;
#endif
//
// Structure used with SPFILENOTIFY_CABINETINFO and
// SPFILENOTIFY_NEEDNEWCABINET
//
typedef struct _CABINET_INFO_A {
PCSTR CabinetPath;
PCSTR CabinetFile;
PCSTR DiskName;
USHORT SetId;
USHORT CabinetNumber;
} CABINET_INFO_A, *PCABINET_INFO_A;
typedef struct _CABINET_INFO_W {
PCWSTR CabinetPath;
PCWSTR CabinetFile;
PCWSTR DiskName;
USHORT SetId;
USHORT CabinetNumber;
} CABINET_INFO_W, *PCABINET_INFO_W;
#ifdef UNICODE
typedef CABINET_INFO_W CABINET_INFO;
typedef PCABINET_INFO_W PCABINET_INFO;
#else
typedef CABINET_INFO_A CABINET_INFO;
typedef PCABINET_INFO_A PCABINET_INFO;
#endif
//
// Structure used with SPFILENOTIFY_FILEINCABINET
//
typedef struct _FILE_IN_CABINET_INFO_A {
PCSTR NameInCabinet;
DWORD FileSize;
DWORD Win32Error;
WORD DosDate;
WORD DosTime;
WORD DosAttribs;
CHAR FullTargetName[MAX_PATH];
} FILE_IN_CABINET_INFO_A, *PFILE_IN_CABINET_INFO_A;
typedef struct _FILE_IN_CABINET_INFO_W {
PCWSTR NameInCabinet;
DWORD FileSize;
DWORD Win32Error;
WORD DosDate;
WORD DosTime;
WORD DosAttribs;
WCHAR FullTargetName[MAX_PATH];
} FILE_IN_CABINET_INFO_W, *PFILE_IN_CABINET_INFO_W;
#ifdef UNICODE
typedef FILE_IN_CABINET_INFO_W FILE_IN_CABINET_INFO;
typedef PFILE_IN_CABINET_INFO_W PFILE_IN_CABINET_INFO;
#else
typedef FILE_IN_CABINET_INFO_A FILE_IN_CABINET_INFO;
typedef PFILE_IN_CABINET_INFO_A PFILE_IN_CABINET_INFO;
#endif
//
// Structure used for SPFILENOTIFY_***REGISTRATION
// callback
//
typedef struct _SP_REGISTER_CONTROL_STATUSA {
DWORD cbSize;
PCSTR FileName;
DWORD Win32Error;
DWORD FailureCode;
} SP_REGISTER_CONTROL_STATUSA, *PSP_REGISTER_CONTROL_STATUSA;
typedef struct _SP_REGISTER_CONTROL_STATUSW {
DWORD cbSize;
PCWSTR FileName;
DWORD Win32Error;
DWORD FailureCode;
} SP_REGISTER_CONTROL_STATUSW, *PSP_REGISTER_CONTROL_STATUSW;
#ifdef UNICODE
typedef SP_REGISTER_CONTROL_STATUSW SP_REGISTER_CONTROL_STATUS;
typedef PSP_REGISTER_CONTROL_STATUSW PSP_REGISTER_CONTROL_STATUS;
#else
typedef SP_REGISTER_CONTROL_STATUSA SP_REGISTER_CONTROL_STATUS;
typedef PSP_REGISTER_CONTROL_STATUSA PSP_REGISTER_CONTROL_STATUS;
#endif
//
// valid values for SP_REGISTER_CONTROL_STATUS.FailureCode field
//
#define SPREG_SUCCESS 0x00000000
#define SPREG_LOADLIBRARY 0x00000001
#define SPREG_GETPROCADDR 0x00000002
#define SPREG_REGSVR 0x00000003
#define SPREG_DLLINSTALL 0x00000004
#define SPREG_TIMEOUT 0x00000005
#define SPREG_UNKNOWN 0xFFFFFFFF
//
// Define type for setup file queue
//
typedef PVOID HSPFILEQ;
//
// Structure used with SetupQueueCopyIndirect
//
typedef struct _SP_FILE_COPY_PARAMS_A {
DWORD cbSize;
HSPFILEQ QueueHandle;
PCSTR SourceRootPath; OPTIONAL
PCSTR SourcePath; OPTIONAL
PCSTR SourceFilename;
PCSTR SourceDescription; OPTIONAL
PCSTR SourceTagfile; OPTIONAL
PCSTR TargetDirectory;
PCSTR TargetFilename; OPTIONAL
DWORD CopyStyle;
HINF LayoutInf; OPTIONAL
PCSTR SecurityDescriptor; OPTIONAL
} SP_FILE_COPY_PARAMS_A, *PSP_FILE_COPY_PARAMS_A;
typedef struct _SP_FILE_COPY_PARAMS_W {
DWORD cbSize;
HSPFILEQ QueueHandle;
PCWSTR SourceRootPath; OPTIONAL
PCWSTR SourcePath; OPTIONAL
PCWSTR SourceFilename;
PCWSTR SourceDescription; OPTIONAL
PCWSTR SourceTagfile; OPTIONAL
PCWSTR TargetDirectory;
PCWSTR TargetFilename; OPTIONAL
DWORD CopyStyle;
HINF LayoutInf; OPTIONAL
PCWSTR SecurityDescriptor; OPTIONAL
} SP_FILE_COPY_PARAMS_W, *PSP_FILE_COPY_PARAMS_W;
#ifdef UNICODE
typedef SP_FILE_COPY_PARAMS_W SP_FILE_COPY_PARAMS;
typedef PSP_FILE_COPY_PARAMS_W PSP_FILE_COPY_PARAMS;
#else
typedef SP_FILE_COPY_PARAMS_A SP_FILE_COPY_PARAMS;
typedef PSP_FILE_COPY_PARAMS_A PSP_FILE_COPY_PARAMS;
#endif
//
// Define type for setup disk space list
//
typedef PVOID HDSKSPC;
//
// Define type for reference to device information set
//
typedef PVOID HDEVINFO;
//
// Device information structure (references a device instance
// that is a member of a device information set)
//
typedef struct _SP_DEVINFO_DATA {
DWORD cbSize;
GUID ClassGuid;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -