大网数据广告活动
Windows 系统接口

SESSION structure

· 52CE 我爱测

The SESSION structure contains information about the current session.

[This structure contains information required only when using the DeleteExtractedFiles and Extract functions, which are not supported. This documentation is provided for informational purposes only.]

The SESSION structure contains information about the current session.

Syntax

typedef struct {
  ACTION    act;
  HFILELIST hflist;
  BOOL      fAllCabinets;
  BOOL      fOverwrite;
  BOOL      fNoLineFeed;
  BOOL      fSelfExtract;
  long      cbSelfExtractSize;
  long      cbSelfExtractSize;
  int       ahfSelf[cMAX_CAB_FILE_OPEN];
  int       cErrors;
  HFDI      hfdi;
  ERF       erf;
  long      cFiles;
  long      cbTotalBytes;
  PERROR    perr;
  SPILLERR  se;
  long      cbSpill;
  char      achSelf[cbFILE_NAME_MAX];
  char      achMsg[cbMAX_LINE*2];
  char      achLine;
  char      achLocation;
  char      achFile;
  char      achDest;
  char      achCabPath;
  BOOL      fContinuationCabinet;
  BOOL      fShowReserveInfo;
  BOOL      fNextCabCalled;
  CABINET   acab[2];
  char      achZap[cbFILE_NAME_MAX];
  char      achCabinetFile[cbFILE_NAME_MAX];
  int       cArgv;
  char      **pArgv;
  int       fDestructive;
  USHORT    iCurrentFolder;
} SESSION, *PSESSION;

Members

act

The action to perform. This member can be one of the values from the following enumerated type.

typedef enum {
    actBAD,         // Invalid action
    actHELP,        // Show help
    actDEFAULT,     // Perform default action based on command line arguments
    actDIRECTORY,   // Force display of cabinet directory
    actEXTRACT,     // Force file extraction
    actCOPY,        // Do single file-to-file copy
} ACTION;  

hflist

The handle to a list of files specified on the command line. This datatype is declared as follows:

typedef void *HFILELIST;

fAllCabinets

A flag that indicates whether more than one cabinet file should be processed. If this value is TRUE, continuation cabinets are processed.

fOverwrite

A flag that indicates whether existing files should be overwritten. If this value is TRUE, existing files are overwritten.

fNoLineFeed

A flag that indicates whether the last printf call has the newline (\n) characters. If this value is TRUE, the last printf call did not include the newline characters.

fSelfExtract

A flag that indicates whether a cabinet is self extracting. If this value is TRUE, the cabinet is self extracting.

cbSelfExtractSize

The length of the executable (.exe) portion of a self-extracting cabinet.

cbSelfExtractSize

The length of the CAB portion of a self-extracting cabinet.

ahfSelf

The file handles to the cabinet.

#define cMAX_CAB_FILE_OPEN 2

cErrors

The count of errors encountered during the extraction session.

hfdi

A handle to the FDI context. This datatype is declared as follows:

typedef void FAR *HFDI;

erf

The FDI error structure. See ERF.

cFiles

The count of files processed.

cbTotalBytes

The total number of bytes extracted.

perr

The pass through FDI.

se

The spill file error. This member can be one of the values from the following enumerated type.

typedef enum {
    seNONE,                     // No error
    seNOT_ENOUGH_MEMORY,        // Not enough RAM
    seCANNOT_CREATE,            // Cannot create spill file
    seNOT_ENOUGH_SPACE,         // Not enough space for spill file
} SPILLERR;

cbSpill

The size of the spill file requested.

achSelf

The name of the executable (.exe) file.

#define cbFILE_NAME_MAX 256

achMsg

The message formatting buffer.

#define cbMAX_LINE 256

achLine

The line formatting buffer.

achLocation

The output directory.

achFile

The current file name being extracted.

achDest

The forced destination file name.

achCabPath

The path to look at for a cabinet file.

fContinuationCabinet

A flag that indicates whether the current cabinet is the first one processed. If set to TRUE, it is not the first cabinet processed.

fShowReserveInfo

A flag that indicates whether reserve information should be provided. If set to TRUE, the information is made available.

fNextCabCalled

This member provides a way to determine which of the acab entries to use if we are processing all files in a cabinet set (fAllCabinet is set to TRUE).

acab

The last two entries in the cabinet set. This structure is defined as follows:

typedef struct {
    char    achCabPath[cbFILE_NAME_MAX];     // Cabinet file path
    char    achCabFilename[cbFILE_NAME_MAX]; // Cabinet file name.ext
    char    achDiskName[cbFILE_NAME_MAX];    // User readable disk label
    USHORT  setID;
    USHORT  iCabinet;
} CABINET;
typedef CABINET *PCABINET;

achZap

The prefix to strip from the file name.

#define cbFILE_NAME_MAX 256

achCabinetFile

The current cabinet file.

#define cbFILE_NAME_MAX 256

cArgv

The default self-extracting argc.

pArgv

A pointer to a pointer to the default self-extracting argv[].

fDestructive

A flag that minimizes the disk space needed when set to TRUE.

iCurrentFolder

If fDestructive is set to TRUE, extract only the current folder.

See also

DeleteExtractedFiles

Extract

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。