📄 setupx.h
字号:
//**********************************************************************
//
// SETUPX.H
//
// Copyright (c) 1993 - Microsoft Corp.
// All rights reserved.
// Microsoft Confidential
//
// Public include file for Chicago Setup services.
//
//**********************************************************************
#ifndef SETUPX_INC
#define SETUPX_INC 1 // SETUPX.H signature
/***************************************************************************/
// setup PropertySheet support
// NOTE: Always include PRST.H because it is needed later for Class Installer
// stuff, and optionally define the SU prop sheet stuff.
/***************************************************************************/
#include <prsht.h>
#ifndef NOPRSHT
HPROPSHEETPAGE WINAPI SUCreatePropertySheetPage(LPCPROPSHEETPAGE lppsp);
BOOL WINAPI SUDestroyPropertySheetPage(HPROPSHEETPAGE hPage);
int WINAPI SUPropertySheet(LPCPROPSHEETHEADER lppsh);
#endif // NOPRSHT
typedef UINT RETERR; // Return Error code type.
#define OK 0 // success error code
#define IP_ERROR (100) // Inf parsing
#define TP_ERROR (200) // Text processing module
#define VCP_ERROR (300) // Virtual copy module
#define GEN_ERROR (400) // Generic Installer
#define DI_ERROR (500) // Device Installer
// err2ids mappings
enum ERR_MAPPINGS {
E2I_VCPM, // Maps VCPM to strings
E2I_SETUPX, // Maps setupx returns to strings
E2I_SETUPX_MODULE, // Maps setupx returns to appropriate module
E2I_DOS_SOLUTION, // Maps DOS Extended errors to solutions
E2I_DOS_REASON, // Maps DOS extended errors to strings.
E2I_DOS_MEDIA, // Maps DOS extended errors to media icon.
};
#ifndef NOVCP
/***************************************************************************/
//
// Logical Disk ID definitions
//
/***************************************************************************/
// DECLARE_HANDLE(VHSTR); /* VHSTR = VirtCopy Handle to STRing */
typedef UINT VHSTR; /* VirtCopy Handle to String */
VHSTR WINAPI vsmStringAdd(LPCSTR lpszName);
int WINAPI vsmStringDelete(VHSTR vhstr);
VHSTR WINAPI vsmStringFind(LPCSTR lpszName);
int WINAPI vsmGetStringName(VHSTR vhstr, LPSTR lpszBuffer, int cbBuffer);
int WINAPI vsmStringCompare(VHSTR vhstrA, VHSTR vhstrB);
LPCSTR WINAPI vsmGetStringRawName(VHSTR vhstr);
void WINAPI vsmStringCompact(void);
typedef UINT LOGDISKID; /* ldid */
// Logical Disk Descriptor: Structure which describes the physical attributes
// of a logical disk. Every logical disk is assigned a logical disk
// identifier (LDID), and is described by a logical disk descriptor (LDD).
//
// The cbSize structure member must always be set to sizeof(LOGDISKDESC_S),
// but all other unused structure members should be NULL or 0. No validation
// is performed on the size of string arrays; all string pointers, if
// non-NULL and they are to receive a string, must point at string arrays
// whose sizes are as follows:
// sizeof( szPath ) = MAX_PATH_LEN
// sizeof( szVolLabel) = MAX_FILENAME_LEN
// sizeof( szName ) = MAX_STRING_LEN
#define MAX_PATH_LEN 260 // Max. path length.
#define MAX_FILENAME_LEN 20 // Max. filename length. ( > sizeof( "x:\\12345678.123" )
typedef struct _LOGDISKDESC_S { /* ldd */
WORD cbSize; // Size of this structure (bytes)
LOGDISKID ldid; // Logical Disk ID.
LPSTR pszPath; // Ptr. to associated Path string.
LPSTR pszVolLabel; // Ptr. to Volume Label string.
LPSTR pszDiskName; // Ptr. to Disk Name string.
WORD wVolTime; // Volume label modification time.
WORD wVolDate; // Volume label modification date.
DWORD dwSerNum; // Disk serial number.
WORD wFlags; // Flags.
} LOGDISKDESC_S, FAR *LPLOGDISKDESC;
// Range for pre-defined LDIDs.
#define LDID_PREDEF_START 0x0001 // Start of range
#define LDID_PREDEF_END 0x7FFF // End of range
// Range for registry-assigned LDIDs
#define LDID_VAR_START 0x7000
#define LDID_VAR_END 0x7FFF
// Range for dynamically-assigned LDIDs.
#define LDID_ASSIGN_START 0x8000 // Start of range
#define LDID_ASSIGN_END 0xBFFF // End of range
// Pre-defined Logical Disk Identifiers (LDID).
//
#define LDID_NULL 0 // Null (undefined) LDID.
#define LDID_ABSOLUTE ((UINT)-1) // Absolute path
// source path of windows install, this is typically A:\ or a net drive
#define LDID_SRCPATH 1 // source of instilation
// temporary setup directory used by setup, this is only valid durring
// regular install and contains the INF and other binary files. May be
// read-only location.
#define LDID_SETUPTEMP 2 // temporary setup dir for install
// path to uninstall location, this is where we backup files that will
// be overwritten
#define LDID_UNINSTALL 3 // uninstall (backup) dir.
// backup path for the copy engine, this should not be used
#define LDID_BACKUP 4 // BUGBUG: backup dir for the copy engine, not used
// temporary setup directory used by setup, this is only valid durring
// regular install and is guarenteed to be a read/write location for
// scratch space.
#define LDID_SETUPSCRATCH 5 // temporary setup dir for scratch space.
// windows directory, this is the destinatio of the insallation
#define LDID_WIN 10 // destination Windows dir (just user files).
#define LDID_SYS 11 // destination Windows System dir.
#define LDID_IOS 12 // destination Windows Iosubsys dir.
#define LDID_CMD 13 // destination Windows Command (DOS) dir.
#define LDID_CPL 14 // destination Windows Control Panel dir.
#define LDID_PRINT 15 // destination Windows Printer dir.
#define LDID_MAIL 16 // destination Mail dir.
#define LDID_INF 17 // destination Windows *.INF dir.
#define LDID_HELP 18 // destination Windows Help dir.
#define LDID_WINADMIN 19 // admin stuff.
#define LDID_FONTS 20 // destination Windows Font dir.
#define LDID_VIEWERS 21 // destination Windows Viewers dir.
#define LDID_VMM32 22 // destination Windows VMM32 dir.
#define LDID_COLOR 23 // destination Windows Color dir.
#define LDID_APPS 24 // Applications folder location.
// Shared dirs for net install.
#define LDID_SHARED 25 // Bulk of windows files.
#define LDID_WINBOOT 26 // guarenteed boot device for windows.
#define LDID_MACHINE 27 // machine specific files.
#define LDID_HOST_WINBOOT 28
// boot and old win and dos dirs.
#define LDID_BOOT 30 // Root dir of boot drive
#define LDID_BOOT_HOST 31 // Root dir of boot drive host
#define LDID_OLD_WINBOOT 32 // Subdir off of Root (optional)
#define LDID_OLD_WIN 33 // old windows directory (if it exists)
#define LDID_OLD_DOS 34 // old dos directory (if it exists)
#define LDID_OLD_NET 35 // old network root directory, only valid during
// network GenUpgrade
#define LDID_MOUSE 36 // path to MOUSE env. variable if set or same as LDID_WIN
// only valid after mouse class installer.
#define LDID_PATCH 37 // path to Patch related files
#define LDID_WIN3XIE 38 // install path of Internet Explorer on Windows 3.1
// Only defined during system install
#define LDID_UPDATEDFILES 40 //only defined during maint. mode
// Convert Ascii drive letter to Integer drive number ('A'=1, 'B'=2, ...).
#define DriveAtoI( chDrv ) ((int)(chDrv & 31))
// Convert Integer drive number to Ascii drive letter (1='A', 2='B', ...).
#define DriveItoA( iDrv ) ((char) (iDrv - 1 + 'A'))
// BUGBUG: change the names of these
RETERR WINAPI CtlSetLdd ( LPLOGDISKDESC );
RETERR WINAPI CtlGetLdd ( LPLOGDISKDESC );
RETERR WINAPI CtlFindLdd ( LPLOGDISKDESC );
RETERR WINAPI CtlAddLdd ( LPLOGDISKDESC );
RETERR WINAPI CtlDelLdd ( LOGDISKID );
RETERR WINAPI CtlGetLddPath ( LOGDISKID, LPSTR );
RETERR WINAPI CtlSetLddPath ( LOGDISKID, LPSTR );
// Constants that determine ranking of device compatibility
#define FIRST_CID_RANK_FROM_INF 1000
#define FIRST_CID_RANK_FROM_DEVICE 2000
#define BAD_DRIVER_RANK 4000
/***************************************************************************/
//
// Virtual File Copy definitions
//
/***************************************************************************/
typedef DWORD LPEXPANDVTBL; /* BUGBUG -- clean this up */
enum _ERR_VCP
{
ERR_VCP_IOFAIL = (VCP_ERROR + 1), // File I/O failure
ERR_VCP_STRINGTOOLONG, // String length limit exceeded
ERR_VCP_NOMEM, // Insufficient memory to comply
ERR_VCP_QUEUEFULL, // Trying to add a node to a maxed-out queue
ERR_VCP_NOVHSTR, // No string handles available
ERR_VCP_OVERFLOW, // Reference count would overflow
ERR_VCP_BADARG, // Invalid argument to function
ERR_VCP_UNINIT, // String library not initialized
ERR_VCP_NOTFOUND , // String not found in string table
ERR_VCP_BUSY, // Can't do that now
ERR_VCP_INTERRUPTED, // User interrupted operation
ERR_VCP_BADDEST, // Invalid destination directory
ERR_VCP_SKIPPED, // User skipped operation
ERR_VCP_IO, // Hardware error encountered
ERR_VCP_LOCKED, // List is locked
ERR_VCP_WRONGDISK, // The wrong disk is in the drive
ERR_VCP_CHANGEMODE, //
ERR_VCP_LDDINVALID, // Logical Disk ID Invalid.
ERR_VCP_LDDFIND, // Logical Disk ID not found.
ERR_VCP_LDDUNINIT, // Logical Disk Descriptor Uninitialized.
ERR_VCP_LDDPATH_INVALID,
ERR_VCP_NOEXPANSION, // Failed to load expansion dll
ERR_VCP_NOTOPEN, // Copy session not open
ERR_VCP_NO_DIGITAL_SIGNATURE_CATALOG, // Catalog is not digitally signed
ERR_VCP_NO_DIGITAL_SIGNATURE_FILE, // A file is not digitally signed
ERR_VCP_FAILED_PRESERVE_ENUM, // Error occured in enumerating the file queue for files to preserve
};
/*****************************************************************************
* Structures
*****************************************************************************/
/*---------------------------------------------------------------------------*
* VCPPROGRESS
*---------------------------------------------------------------------------*/
typedef struct tagVCPPROGRESS { /* prg */
DWORD dwSoFar; /* Number of units copied so far */
DWORD dwTotal; /* Number of units to copy */
} VCPPROGRESS, FAR *LPVCPPROGRESS;
/*---------------------------------------------------------------------------*
* VCPDISKINFO
*---------------------------------------------------------------------------*/
typedef struct tagVCPDISKINFO {
WORD cbSize; /* Size of this structure in bytes */
LOGDISKID ldid; /* Logical disk ID */
VHSTR vhstrRoot; /* Location of root directory */
VHSTR vhstrVolumeLabel;/* Volume label */
VHSTR vhstrDiskName; // Printed name on the disk.
WORD wVolumeTime; /* Volume label modification time */
WORD wVolumeDate; /* Volume label modification date */
DWORD dwSerialNumber; /* Disk serial number */
WORD fl; /* Flags */
LPARAM lparamRef; /* Reference data for client */
VCPPROGRESS prgFileRead; /* Progress info */
VCPPROGRESS prgByteRead;
VCPPROGRESS prgFileWrite;
VCPPROGRESS prgByteWrite;
} VCPDISKINFO, FAR *LPVCPDISKINFO;
#define VDIFL_VALID 0x0001 /* Fields are valid from a prev. call */
#define VDIFL_EXISTS 0x0002 /* Disk exists; do not format */
RETERR WINAPI DiskInfoFromLdid(LOGDISKID ldid, LPVCPDISKINFO lpdi);
/*---------------------------------------------------------------------------*
* VCPFILESPEC
*---------------------------------------------------------------------------*/
typedef struct tagVCPFILESPEC { /* vfs */
LOGDISKID ldid; /* Logical disk */
VHSTR vhstrDir; /* Directory withing logical disk */
VHSTR vhstrFileName; /* Filename within directory */
} VCPFILESPEC, FAR *LPVCPFILESPEC;
/*---------------------------------------------------------------------------*
* VCPFATTR
*---------------------------------------------------------------------------*/
/*
* BUGBUG -- explain diffce between llenIn and llenOut wrt compression.
*/
typedef struct tagVCPFATTR {
UINT uiMDate; /* Modification date */
UINT uiMTime; /* Modification time */
UINT uiADate; /* Access date */
UINT uiATime; /* Access time */
UINT uiAttr; /* File attribute bits */
DWORD llenIn; /* Original file length */
DWORD llenOut; /* Final file length */
/* (after decompression) */
} VCPFATTR, FAR *LPVCPFATTR;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -