📄 setupx.h
字号:
typedef struct tagVCPFILESTAT
{
UINT uDate;
UINT uTime;
DWORD dwSize;
} VCPFILESTAT, FAR *LPVCPFILESTAT;
/*---------------------------------------------------------------------------*
* VIRTNODEEX
*---------------------------------------------------------------------------*/
typedef struct tagVIRTNODEEX
{ /* vnex */
HFILE hFileSrc;
HFILE hFileDst;
VCPFATTR fAttr;
WORD dosError; // The first/last error encountered
VHSTR vhstrFileName; // The original destination name.
WPARAM vcpm; // The message that was being processed.
} VIRTNODEEX, FAR *LPCVIRTNODEEX, FAR *LPVIRTNODEEX ;
/*---------------------------------------------------------------------------*
* VIRTNODE
*---------------------------------------------------------------------------*/
typedef struct tagVIRTNODE { /* vn */
WORD cbSize;
VCPFILESPEC vfsSrc;
VCPFILESPEC vfsDst;
WORD fl;
LPARAM lParam;
LPEXPANDVTBL lpExpandVtbl;
LPVIRTNODEEX lpvnex;
VHSTR vhstrDstFinalName;
VCPFILESTAT vFileStat;
} VIRTNODE, FAR *LPCVIRTNODE, FAR *LPVIRTNODE ;
/*---------------------------------------------------------------------------*
* VCPDESTINFO
*---------------------------------------------------------------------------*/
typedef struct tagVCPDESTINFO { /* destinfo */
WORD flDevAttr; /* Device attributes */
LONG cbCapacity; /* Disk capacity */
WORD cbCluster; /* Bytes per cluster */
WORD cRootDir; /* Size of root directory */
} VCPDESTINFO, FAR *LPVCPDESTINFO;
#define DIFL_FIXED 0x0001 /* Nonremoveable media */
#define DIFL_CHANGELINE 0x0002 /* Change line support */
// Now also used by the virtnode as we dont have copy nodes any more.
// #define CNFL_BACKUP 0x0001 /* This is a backup node */
#define CNFL_DELETEONFAILURE 0x0002 /* Dest should be deleted on failure */
#define CNFL_RENAMEONSUCCESS 0x0004 /* Dest needs to be renamed */
#define CNFL_CONTINUATION 0x0008 /* Dest is continued onto difft disk */
#define CNFL_SKIPPED 0x0010 /* User asked to skip file */
#define CNFL_IGNOREERRORS 0x0020 // An error has occured on this file already
#define CNFL_RETRYFILE 0x0040 // Retry the file (error ocurred)
#define CNFL_COPIED 0x0080 // Node has already been copied.
// BUGBUG: verify the use and usefullness of these flags
// #define VNFL_UNIQUE 0x0000 /* Default */
#define VNFL_MULTIPLEOK 0x0100 /* Do not search PATH for duplicates */
#define VNFL_DESTROYOLD 0x0200 /* Do not back up files */
// #define VNFL_NOW 0x0400 /* Use by vcp Flush */
// To deternime what kind of node it is.
#define VNFL_COPY 0x0000 // A simple copy node.
#define VNFL_DELETE 0x0800 // A delete node
#define VNFL_RENAME 0x1000 // A rename node
#define VNFL_NODE_TYPE ( VNFL_RENAME|VNFL_DELETE|VNFL_COPY )
/* Read-only flag bits */
#define VNFL_CREATED 0x2000 /* VCPM_NODECREATE has been sent */
#define VNFL_REJECTED 0x4000 /* Node has been rejected */
#define VNFL_DEVICEINSTALLER 0x8000 /* Node was added by the Device Installer */
/*---------------------------------------------------------------------------*
* VCPSTATUS
*---------------------------------------------------------------------------*/
typedef struct tagVCPSTATUS { /* vstat */
WORD cbSize; /* Size of this structure */
VCPPROGRESS prgDiskRead;
VCPPROGRESS prgFileRead;
VCPPROGRESS prgByteRead;
VCPPROGRESS prgDiskWrite;
VCPPROGRESS prgFileWrite;
VCPPROGRESS prgByteWrite;
LPVCPDISKINFO lpvdiIn; /* Current input disk */
LPVCPDISKINFO lpvdiOut; /* Current output disk */
LPVIRTNODE lpvn; /* Current file */
} VCPSTATUS, FAR *LPVCPSTATUS;
/*---------------------------------------------------------------------------*
* VCPVERCONFLICT
*---------------------------------------------------------------------------*/
typedef struct tagVCPVERCONFLICT {
LPCSTR lpszOldFileName;
LPCSTR lpszNewFileName;
DWORD dwConflictType; /* Same values as VerInstallFiles */
LPVOID lpvinfoOld; /* Version information resources */
LPVOID lpvinfoNew;
WORD wAttribOld; /* File attributes for original */
LPARAM lparamRef; /* Reference data for callback */
} VCPVERCONFLICT, FAR *LPVCPVERCONFLICT;
/*****************************************************************************
* Callback functions
*****************************************************************************/
typedef LRESULT (CALLBACK *VIFPROC)(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
LRESULT CALLBACK vcpDefCallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
// callback for default UI.
// lparamRef --> a VCPUIINFO structure
LRESULT CALLBACK vcpUICallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
/*---------------------------------------------------------------------------*
* VCPUIINFO
*
* This structure is passed in as the lparamRef of vcpUICallbackProc.
*
* on using vcpUICallbackProc:
* - to use, have vcpUICallbackProc as the callback for vcpOpen with
* an appropriately filled in VCPUIINFO structure as the lparamRef.
*
* - based on flags, hwndProgress is created and maintained
* - lpfnStatCallback is called with only status messages
* returning VCPM_ABORT indicates that the copy should be aborted
* - if hwndProgress is non-NULL, the control with idProgress will
* receive progress gauge messages as appropriate
*
*---------------------------------------------------------------------------*/
#define VCPUI_CREATEPROGRESS 0x0001 // callback should create and manage progress gauge dialog
#define VCPUI_NOBROWSE 0x0002 // no browse button in InsertDisk
#define VCPUI_RENAMEREQUIRED 0x0004 // as a result of a file being in use at copy, reboot required
#define VCPUI_BACKUPVER 0x0008 // backup version conflicts instead of displaying UI
typedef struct {
UINT flags;
HWND hwndParent; // window of parent
HWND hwndProgress; // window to get progress updates (nonzero ids)
UINT idPGauge; // id for progress gauge
VIFPROC lpfnStatCallback; // callback for status info (or NULL)
LPARAM lUserData; // caller definable data
LOGDISKID ldidCurrent; // reserved. do not touch.
} VCPUIINFO, FAR *LPVCPUIINFO;
/******************************************************************************
* Callback notification codes
*****************************************************************************/
/* BUGBUG -- VCPN_ABORT should match VCPERROR_INTERRUPTED */
#define VCPN_OK 0 /* All is hunky-dory */
#define VCPN_PROCEED 0 /* The same as VCPN_OK */
#define VCPN_ABORT (-1) /* Cancel current operation */
#define VCPN_RETRY (-2) /* Retry current operation */
#define VCPN_IGNORE (-3) /* Ignore error and continue */
#define VCPN_SKIP (-4) /* Skip this file and continue */
#define VCPN_FORCE (-5) /* Force an action */
#define VCPN_DEFER (-6) /* Save the action for later */
#define VCPN_FAIL (-7) /* Return failure back to caller */
#define VCPN_RETRYFILE (-8) // An error ocurred during file copy, do it again.
/*****************************************************************************
* Callback message numbers
*****************************************************************************/
#define VCPM_CLASSOF(uMsg) HIBYTE(uMsg)
#define VCPM_TYPEOF(uMsg) (0x00FF & (uMsg)) // LOBYTE(uMsg)
/*---------------------------------------------------------------------------*
* ERRORs
*---------------------------------------------------------------------------*/
#define VCPM_ERRORCLASSDELTA 0x80
#define VCPM_ERRORDELTA 0x8000 /* Where the errors go */
/*---------------------------------------------------------------------------*
* Disk information callbacks
*---------------------------------------------------------------------------*/
#define VCPM_DISKCLASS 0x01
#define VCPM_DISKFIRST 0x0100
#define VCPM_DISKLAST 0x01FF
enum tagVCPM_DISK {
VCPM_DISKCREATEINFO = VCPM_DISKFIRST,
VCPM_DISKGETINFO,
VCPM_DISKDESTROYINFO,
VCPM_DISKPREPINFO,
VCPM_DISKENSURE,
VCPM_DISKPROMPT,
VCPM_DISKFORMATBEGIN,
VCPM_DISKFORMATTING,
VCPM_DISKFORMATEND,
/* Remaining messages reserved for future use */
};
/*---------------------------------------------------------------------------*
* File copy callbacks
*---------------------------------------------------------------------------*/
// BUGBUG: this needs to be merged back with other internal errors
#define VCPERROR_IO (VCP_ERROR - ERR_VCP_IO) /* Hardware error encountered */
#define VCPM_FILEINCLASS 0x02
#define VCPM_FILEOUTCLASS 0x03
#define VCPM_FILEFIRSTIN 0x0200
#define VCPM_FILEFIRSTOUT 0x0300
#define VCPM_FILELAST 0x03FF
enum tagVCPM_FILE {
VCPM_FILEOPENIN = VCPM_FILEFIRSTIN,
VCPM_FILEGETFATTR,
VCPM_FILECLOSEIN,
VCPM_FILECOPY,
VCPM_FILENEEDED,
VCPM_FILEOPENOUT = VCPM_FILEFIRSTOUT,
VCPM_FILESETFATTR,
VCPM_FILECLOSEOUT,
VCPM_FILEFINALIZE,
VCPM_FILEDELETE,
VCPM_FILERENAME,
/* Remaining messages reserved for future use */
};
/*---------------------------------------------------------------------------*
* VIRTNODE callbacks
*---------------------------------------------------------------------------*/
#define VCPM_NODECLASS 0x04
#define VCPM_NODEFIRST 0x0400
#define VCPM_NODELAST 0x04FF
enum tagVCPM_NODE {
VCPM_NODECREATE = VCPM_NODEFIRST,
VCPM_NODEACCEPT,
VCPM_NODEREJECT,
VCPM_NODEDESTROY,
VCPM_NODECHANGEDESTDIR,
VCPM_NODECOMPARE,
/* Remaining messages reserved for future use */
};
/*---------------------------------------------------------------------------*
* TALLY callbacks
*---------------------------------------------------------------------------*/
#define VCPM_TALLYCLASS 0x05
#define VCPM_TALLYFIRST 0x0500
#define VCPM_TALLYLAST 0x05FF
enum tagVCPM_TALLY {
VCPM_TALLYSTART = VCPM_TALLYFIRST,
VCPM_TALLYEND,
VCPM_TALLYFILE,
VCPM_TALLYDISK,
/* Remaining messages reserved for future use */
};
/*---------------------------------------------------------------------------*
* VER callbacks
*---------------------------------------------------------------------------*/
#define VCPM_VERCLASS 0x06
#define VCPM_VERFIRST 0x0600
#define VCPM_VERLAST 0x06FF
enum tagVCPM_VER {
VCPM_VERCHECK = VCPM_VERFIRST,
VCPM_VERCHECKDONE,
VCPM_VERRESOLVECONFLICT,
/* Remaining messages reserved for future use */
};
/*---------------------------------------------------------------------------*
* VSTAT callbacks
*---------------------------------------------------------------------------*/
#define VCPM_VSTATCLASS 0x07
#define VCPM_VSTATFIRST 0x0700
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -