fci.h (5.2.3790.3959-Windows 5.0) | | fci.h (6.0.6001.18000-Windows 6.0) |
| | |
skipping to change at line 166 | | skipping to change at line 166 |
#include <poppack.h> | | #include <poppack.h> |
#endif | | #endif |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
} | | } |
#endif /* __cplusplus */ | | #endif /* __cplusplus */ |
| | |
#endif // !INCLUDED_TYPES_FCI_FDI | | #endif // !INCLUDED_TYPES_FCI_FDI |
/*** fci_int.h - File Compression Interface definitions | | /*** fci_int.h - File Compression Interface definitions |
* | | * |
|
* Microsoft Confidential | | |
* Copyright (C) Microsoft Corporation 1993-1994 | | * Copyright (C) Microsoft Corporation 1993-1994 |
* All Rights Reserved. | | * All Rights Reserved. |
* | | * |
* Author: | | * Author: |
* Chuck Strouss | | * Chuck Strouss |
* | | * |
* History: | | * History: |
* 09-Jan-1994 chuckst Contents moved to bfol.h, this file is a | | * 09-Jan-1994 chuckst Contents moved to bfol.h, this file is a |
* placeholder for the new 'higher-level' fci | | * placeholder for the new 'higher-level' fci |
* 14-Feb-1994 bens Cleaned up some comments. | | * 14-Feb-1994 bens Cleaned up some comments. |
* 09-Mar-1994 bens Added error codes (moved from buildcab.h); | | * 09-Mar-1994 bens Added error codes (moved from buildcab.h); |
* Added RESERVE control | | * Added RESERVE control |
* 17-Mar-1994 bens Specify structure packing explicitly | | * 17-Mar-1994 bens Specify structure packing explicitly |
* 21-Mar-1994 bens Cleaned up names | | * 21-Mar-1994 bens Cleaned up names |
* 22-Mar-1994 bens Documented error cods | | * 22-Mar-1994 bens Documented error cods |
* 29-Mar-1994 bens Add FCIFlushFolder, renamed FCIFlushCabinet | | * 29-Mar-1994 bens Add FCIFlushFolder, renamed FCIFlushCabinet |
* 18-Apr-1994 bens Changed CDECL to DIAMONDAPI | | * 18-Apr-1994 bens Changed CDECL to DIAMONDAPI |
* 18-May-1994 bens Add ccab.fFailOnIncompressible field for | | * 18-May-1994 bens Add ccab.fFailOnIncompressible field for |
* Chicago M6 hack. | | * Chicago M6 hack. |
|
| | * 11-Nov-2005 kinshu SAL annotation |
*/ | | */ |
| | |
#ifndef INCLUDED_FCI | | #ifndef INCLUDED_FCI |
#define INCLUDED_FCI 1 | | #define INCLUDED_FCI 1 |
| | |
|
| | #include <specstrings.h> |
| | typedef __nullterminated char* LPSTR; |
#include <basetsd.h> | | #include <basetsd.h> |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
extern "C" { /* Assume C declarations for C++ */ | | extern "C" { /* Assume C declarations for C++ */ |
#endif /* __cplusplus */ | | #endif /* __cplusplus */ |
| | |
//** Specify structure packing explicitly for clients of FCI | | //** Specify structure packing explicitly for clients of FCI |
| | |
#ifndef _WIN64 | | #ifndef _WIN64 |
|
#pragma pack(4) | | #include <pshpack4.h> |
#endif | | #endif |
| | |
/*** FCIERROR - Error codes returned in erf.erfOper field | | /*** FCIERROR - Error codes returned in erf.erfOper field |
* | | * |
*/ | | */ |
typedef enum { | | typedef enum { |
FCIERR_NONE, // No error | | FCIERR_NONE, // No error |
| | |
FCIERR_OPEN_SRC, // Failure opening file to be stored in cabinet | | FCIERR_OPEN_SRC, // Failure opening file to be stored in cabinet |
// erf.erfTyp has C run-time *errno* value | | // erf.erfTyp has C run-time *errno* value |
| | |
skipping to change at line 229 | | skipping to change at line 231 |
| | |
FCIERR_BAD_COMPR_TYPE, // Unknown compression type | | FCIERR_BAD_COMPR_TYPE, // Unknown compression type |
| | |
FCIERR_CAB_FILE, // Could not create cabinet file | | FCIERR_CAB_FILE, // Could not create cabinet file |
// erf.erfTyp has C run-time *errno* value | | // erf.erfTyp has C run-time *errno* value |
| | |
FCIERR_USER_ABORT, // Client requested abort | | FCIERR_USER_ABORT, // Client requested abort |
| | |
FCIERR_MCI_FAIL, // Failure compressing data | | FCIERR_MCI_FAIL, // Failure compressing data |
| | |
|
| | FCIERR_CAB_FORMAT_LIMIT // Data-size or file-count exceeded CAB format limit |
| | s |
| | // i.e. Total-bytes (uncompressed) in a CAB-folder e |
| | xceeded 0x7FFF8000 (~ 2GB) |
| | // or, CAB size (compressed) exceeded 0x7FFFFFFF |
| | // or, File-count in CAB exceeded 0xFFFF |
| | |
} FCIERROR; | | } FCIERROR; |
| | |
/* | | /* |
* FAT file attribute flag used by FCI/FDI to indicate that | | * FAT file attribute flag used by FCI/FDI to indicate that |
* the filename in the CAB is a UTF string | | * the filename in the CAB is a UTF string |
*/ | | */ |
#ifndef _A_NAME_IS_UTF | | #ifndef _A_NAME_IS_UTF |
#define _A_NAME_IS_UTF 0x80 | | #define _A_NAME_IS_UTF 0x80 |
#endif | | #endif |
| | |
| | |
skipping to change at line 307 | | skipping to change at line 314 |
* PFNALLOC calls and allocation sizes! | | * PFNALLOC calls and allocation sizes! |
*/ | | */ |
//** Memory functions for FCI | | //** Memory functions for FCI |
typedef void HUGE * (FAR DIAMONDAPI *PFNFCIALLOC)(ULONG cb); /* pfna */ | | typedef void HUGE * (FAR DIAMONDAPI *PFNFCIALLOC)(ULONG cb); /* pfna */ |
#define FNFCIALLOC(fn) void HUGE * FAR DIAMONDAPI fn(ULONG cb) | | #define FNFCIALLOC(fn) void HUGE * FAR DIAMONDAPI fn(ULONG cb) |
| | |
typedef void (FAR DIAMONDAPI *PFNFCIFREE)(void HUGE *memory); /* pfnf */ | | typedef void (FAR DIAMONDAPI *PFNFCIFREE)(void HUGE *memory); /* pfnf */ |
#define FNFCIFREE(fn) void FAR DIAMONDAPI fn(void HUGE *memory) | | #define FNFCIFREE(fn) void FAR DIAMONDAPI fn(void HUGE *memory) |
| | |
//** File I/O functions for FCI | | //** File I/O functions for FCI |
|
typedef INT_PTR (FAR DIAMONDAPI *PFNFCIOPEN) (char FAR *pszFile, int oflag, int
pmode, int FAR *err, void FAR *pv); | | typedef INT_PTR (FAR DIAMONDAPI *PFNFCIOPEN) (__in LPSTR pszFile, int oflag, int
pmode, int FAR *err, void FAR *pv); |
typedef UINT (FAR DIAMONDAPI *PFNFCIREAD) (INT_PTR hf, void FAR *memory, UINT cb
, int FAR *err, void FAR *pv); | | typedef UINT (FAR DIAMONDAPI *PFNFCIREAD) (INT_PTR hf, void FAR *memory, UINT cb
, int FAR *err, void FAR *pv); |
typedef UINT (FAR DIAMONDAPI *PFNFCIWRITE)(INT_PTR hf, void FAR *memory, UINT cb
, int FAR *err, void FAR *pv); | | typedef UINT (FAR DIAMONDAPI *PFNFCIWRITE)(INT_PTR hf, void FAR *memory, UINT cb
, int FAR *err, void FAR *pv); |
typedef int (FAR DIAMONDAPI *PFNFCICLOSE)(INT_PTR hf, int FAR *err, void FAR *p
v); | | typedef int (FAR DIAMONDAPI *PFNFCICLOSE)(INT_PTR hf, int FAR *err, void FAR *p
v); |
typedef long (FAR DIAMONDAPI *PFNFCISEEK) (INT_PTR hf, long dist, int seektype,
int FAR *err, void FAR *pv); | | typedef long (FAR DIAMONDAPI *PFNFCISEEK) (INT_PTR hf, long dist, int seektype,
int FAR *err, void FAR *pv); |
|
typedef int (FAR DIAMONDAPI *PFNFCIDELETE) (char FAR *pszFile, int FAR *err, vo
id FAR *pv); | | typedef int (FAR DIAMONDAPI *PFNFCIDELETE) (__in LPSTR pszFile, int FAR *err, v
oid FAR *pv); |
| | |
|
#define FNFCIOPEN(fn) INT_PTR FAR DIAMONDAPI fn(char FAR *pszFile, int oflag, in
t pmode, int FAR *err, void FAR *pv) | | #define FNFCIOPEN(fn) INT_PTR FAR DIAMONDAPI fn(__in LPSTR pszFile, int oflag, i
nt pmode, int FAR *err, void FAR *pv) |
#define FNFCIREAD(fn) UINT FAR DIAMONDAPI fn(INT_PTR hf, void FAR *memory, UINT
cb, int FAR *err, void FAR *pv) | | #define FNFCIREAD(fn) UINT FAR DIAMONDAPI fn(INT_PTR hf, void FAR *memory, UINT
cb, int FAR *err, void FAR *pv) |
#define FNFCIWRITE(fn) UINT FAR DIAMONDAPI fn(INT_PTR hf, void FAR *memory, UINT
cb, int FAR *err, void FAR *pv) | | #define FNFCIWRITE(fn) UINT FAR DIAMONDAPI fn(INT_PTR hf, void FAR *memory, UINT
cb, int FAR *err, void FAR *pv) |
#define FNFCICLOSE(fn) int FAR DIAMONDAPI fn(INT_PTR hf, int FAR *err, void FAR
*pv) | | #define FNFCICLOSE(fn) int FAR DIAMONDAPI fn(INT_PTR hf, int FAR *err, void FAR
*pv) |
#define FNFCISEEK(fn) long FAR DIAMONDAPI fn(INT_PTR hf, long dist, int seektype
, int FAR *err, void FAR *pv) | | #define FNFCISEEK(fn) long FAR DIAMONDAPI fn(INT_PTR hf, long dist, int seektype
, int FAR *err, void FAR *pv) |
|
#define FNFCIDELETE(fn) int FAR DIAMONDAPI fn(char FAR *pszFile, int FAR *err, v
oid FAR *pv) | | #define FNFCIDELETE(fn) int FAR DIAMONDAPI fn(__in LPSTR pszFile, int FAR *err,
void FAR *pv) |
| | |
/*** FNFCIGETNEXTCABINET - Callback used to request new cabinet info | | /*** FNFCIGETNEXTCABINET - Callback used to request new cabinet info |
* | | * |
* Entry: | | * Entry: |
* pccab - Points to copy of old ccab structure to modify | | * pccab - Points to copy of old ccab structure to modify |
* cbPrevCab - Estimate of size of previous cabinet | | * cbPrevCab - Estimate of size of previous cabinet |
* pv - Has the caller's context pointer | | * pv - Has the caller's context pointer |
* | | * |
* Exit-Success: | | * Exit-Success: |
* returns TRUE; | | * returns TRUE; |
| | |
skipping to change at line 358 | | skipping to change at line 365 |
* fContinuation - true if this is a later segment of a continued file | | * fContinuation - true if this is a later segment of a continued file |
* pv - the context of the client | | * pv - the context of the client |
* | | * |
* Exit-Success: | | * Exit-Success: |
* return value anything but -1 | | * return value anything but -1 |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* return value -1 means to abort | | * return value -1 means to abort |
*/ | | */ |
typedef int (DIAMONDAPI *PFNFCIFILEPLACED)(PCCAB pccab, | | typedef int (DIAMONDAPI *PFNFCIFILEPLACED)(PCCAB pccab, |
|
char *pszFile, | | __in char *pszFile, |
long cbFile, | | long cbFile, |
BOOL fContinuation, | | BOOL fContinuation, |
void FAR *pv); /* pfnfcifp */ | | void FAR *pv); /* pfnfcifp */ |
| | |
|
#define FNFCIFILEPLACED(fn) int DIAMONDAPI fn(PCCAB pccab, \ | | #define FNFCIFILEPLACED(fn) int DIAMONDAPI fn(PCCAB pccab, \ |
char *pszFile, \ | | __in char *pszFile, \ |
long cbFile, \ | | long cbFile, \ |
BOOL fContinuation, \ | | BOOL fContinuation, \ |
void FAR *pv) | | void FAR *pv) |
| | |
/*** FNCDIGETOPENINFO - Open source file, get date/time/attribs | | /*** FNCDIGETOPENINFO - Open source file, get date/time/attribs |
* | | * |
* Entry: | | * Entry: |
* pszName -- complete path to filename | | * pszName -- complete path to filename |
* pdate -- location to return FAT-style date code | | * pdate -- location to return FAT-style date code |
* ptime -- location to return FAT-style time code | | * ptime -- location to return FAT-style time code |
* pattribs -- location to return FAT-style attributes | | * pattribs -- location to return FAT-style attributes |
* pv -- client's context | | * pv -- client's context |
* | | * |
* Exit-Success: | | * Exit-Success: |
* Return value is file handle of open file to read | | * Return value is file handle of open file to read |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* Return value is -1 | | * Return value is -1 |
*/ | | */ |
|
typedef INT_PTR (DIAMONDAPI *PFNFCIGETOPENINFO)(char *pszName, | | typedef INT_PTR (DIAMONDAPI *PFNFCIGETOPENINFO)(__in char *pszName, |
USHORT *pdate, | | USHORT *pdate, |
USHORT *ptime, | | USHORT *ptime, |
USHORT *pattribs, | | USHORT *pattribs, |
int FAR *err, | | int FAR *err, |
void FAR *pv); /* pfnfcigoi */ | | void FAR *pv); /* pfnfcigoi */ |
| | |
|
#define FNFCIGETOPENINFO(fn) INT_PTR DIAMONDAPI fn(char *pszName, \ | | #define FNFCIGETOPENINFO(fn) INT_PTR DIAMONDAPI fn(__in char *pszName, \ |
USHORT *pdate, \ | | USHORT *pdate, \ |
USHORT *ptime, \ | | USHORT *ptime, \ |
USHORT *pattribs, \ | | USHORT *pattribs, \ |
int FAR *err, \ | | int FAR *err, \ |
void FAR *pv) | | void FAR *pv) |
| | |
/*** FNFCISTATUS - Status/Cabinet Size callback | | /*** FNFCISTATUS - Status/Cabinet Size callback |
* | | * |
* Entry: | | * Entry: |
* typeStatus == statusFile if compressing a block into a folder | | * typeStatus == statusFile if compressing a block into a folder |
| | |
skipping to change at line 461 | | skipping to change at line 468 |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* return FALSE; could not create tempfile, or buffer too small | | * return FALSE; could not create tempfile, or buffer too small |
* | | * |
* Note: | | * Note: |
* It is conceivable that this function may return a filename | | * It is conceivable that this function may return a filename |
* that will already exist by the time it is opened. For this | | * that will already exist by the time it is opened. For this |
* reason, the caller should make several attempts to create | | * reason, the caller should make several attempts to create |
* temporary files before giving up. | | * temporary files before giving up. |
*/ | | */ |
|
typedef BOOL (DIAMONDAPI *PFNFCIGETTEMPFILE)(char *pszTempName, | | typedef BOOL (DIAMONDAPI *PFNFCIGETTEMPFILE)(__out_bcount(cbTempName) char *pszT
empName, |
int cbTempName, | | int cbTempName, |
void FAR *pv); /* pfnfcigtf */ | | void FAR *pv); /* pfnfcigtf */ |
| | |
|
#define FNFCIGETTEMPFILE(fn) BOOL DIAMONDAPI fn(char *pszTempName, \ | | #define FNFCIGETTEMPFILE(fn) BOOL DIAMONDAPI fn(__out_bcount(cbTempName) char *p
szTempName, \ |
int cbTempName, \ | | int cbTempName, \ |
void FAR *pv) | | void FAR *pv) |
| | |
/*** FCICreate -- create an FCI context (an open CAB, an open FOL) | | /*** FCICreate -- create an FCI context (an open CAB, an open FOL) |
* | | * |
* Entry: | | * Entry: |
* perf - structure where we return error codes | | * perf - structure where we return error codes |
* pfnfcifp - callback to inform caller of eventual dest of files | | * pfnfcifp - callback to inform caller of eventual dest of files |
* pfna - memory allocation function callback | | * pfna - memory allocation function callback |
* pfnf - memory free function callback | | * pfnf - memory free function callback |
| | |
skipping to change at line 493 | | skipping to change at line 500 |
* (2) The perf pointer is stored in the compression context (HCI), | | * (2) The perf pointer is stored in the compression context (HCI), |
* and any errors from subsequent FCI calls are stored in the | | * and any errors from subsequent FCI calls are stored in the |
* erf that was passed in on *this* call. | | * erf that was passed in on *this* call. |
* | | * |
* Exit-Success: | | * Exit-Success: |
* Returns non-NULL handle to an FCI context. | | * Returns non-NULL handle to an FCI context. |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* Returns NULL, perf filled in. | | * Returns NULL, perf filled in. |
*/ | | */ |
|
HFCI DIAMONDAPI FCICreate(PERF perf, | | HFCI DIAMONDAPI FCICreate(__in PERF perf, |
PFNFCIFILEPLACED pfnfcifp, | | __callback PFNFCIFILEPLACED pfnfcifp, |
PFNFCIALLOC pfna, | | __callback PFNFCIALLOC pfna, |
PFNFCIFREE pfnf, | | __callback PFNFCIFREE pfnf, |
PFNFCIOPEN pfnopen, | | __callback PFNFCIOPEN pfnopen, |
PFNFCIREAD pfnread, | | __callback PFNFCIREAD pfnread, |
PFNFCIWRITE pfnwrite, | | __callback PFNFCIWRITE pfnwrite, |
PFNFCICLOSE pfnclose, | | __callback PFNFCICLOSE pfnclose, |
PFNFCISEEK pfnseek, | | __callback PFNFCISEEK pfnseek, |
PFNFCIDELETE pfndelete, | | __callback PFNFCIDELETE pfndelete, |
PFNFCIGETTEMPFILE pfnfcigtf, | | __callback PFNFCIGETTEMPFILE pfnfcigtf, |
PCCAB pccab, | | __in PCCAB pccab, |
void FAR * pv | | __in_opt void FAR *pv |
); | | ); |
| | |
/*** FCIAddFile - Add a disk file to a folder/cabinet | | /*** FCIAddFile - Add a disk file to a folder/cabinet |
* | | * |
* Entry: | | * Entry: |
* hfci - FCI context handle | | * hfci - FCI context handle |
* pszSourceFile - Name of file to add to folder | | * pszSourceFile - Name of file to add to folder |
* pszFileName - Name to store into folder/cabinet | | * pszFileName - Name to store into folder/cabinet |
* fExecute - Flag indicating execute on extract | | * fExecute - Flag indicating execute on extract |
* pfn_progress - Progress callback | | * pfn_progress - Progress callback |
| | |
skipping to change at line 535 | | skipping to change at line 542 |
* Exit-Failure: | | * Exit-Failure: |
* returns FALSE, error filled in | | * returns FALSE, error filled in |
* | | * |
* This is the main function used to add file(s) to a cabinet | | * This is the main function used to add file(s) to a cabinet |
* or series of cabinets. If the current file causes the current | | * or series of cabinets. If the current file causes the current |
* folder/cabinet to overflow the disk image currently being built, | | * folder/cabinet to overflow the disk image currently being built, |
* the cabinet will be terminated, and a new cabinet/disk name will | | * the cabinet will be terminated, and a new cabinet/disk name will |
* be prompted for via a callback. The pending folder will be trimmed | | * be prompted for via a callback. The pending folder will be trimmed |
* of the data which has already been generated in the finished cabinet. | | * of the data which has already been generated in the finished cabinet. |
*/ | | */ |
|
BOOL DIAMONDAPI FCIAddFile(HFCI hfci, | | BOOL DIAMONDAPI FCIAddFile(__in HFCI hfci, |
char *pszSourceFile, | | __in LPSTR pszSourceFile, |
char *pszFileName, | | __in LPSTR pszFileName, |
BOOL fExecute, | | BOOL fExecute, |
PFNFCIGETNEXTCABINET pfnfcignc, | | __callback PFNFCIGETNEXTCABINET pfnfcignc, |
PFNFCISTATUS pfnfcis, | | __callback PFNFCISTATUS pfnfcis, |
PFNFCIGETOPENINFO pfnfcigoi, | | __callback PFNFCIGETOPENINFO pfnfcigoi, |
TCOMP typeCompress | | TCOMP typeCompress |
); | | ); |
| | |
/*** FCIFlushCabinet - Complete the current cabinet under construction | | /*** FCIFlushCabinet - Complete the current cabinet under construction |
* | | * |
* This will cause the current cabinet (assuming it is not empty) to | | * This will cause the current cabinet (assuming it is not empty) to |
* be gathered together and written to disk. | | * be gathered together and written to disk. |
* | | * |
* Entry: | | * Entry: |
* hfci - FCI context | | * hfci - FCI context |
* fGetNextCab - TRUE => Call GetNextCab to get continuation info; | | * fGetNextCab - TRUE => Call GetNextCab to get continuation info; |
| | |
skipping to change at line 565 | | skipping to change at line 572 |
* pfnfcignc - callback function to get continuation cabinets | | * pfnfcignc - callback function to get continuation cabinets |
* pfnfcis - callback function for progress reporting | | * pfnfcis - callback function for progress reporting |
* pv - caller's internal context for callbacks | | * pv - caller's internal context for callbacks |
* | | * |
* Exit-Success: | | * Exit-Success: |
* return code TRUE | | * return code TRUE |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* return code FALSE, error structure filled in | | * return code FALSE, error structure filled in |
*/ | | */ |
|
BOOL DIAMONDAPI FCIFlushCabinet(HFCI hfci, | | BOOL DIAMONDAPI FCIFlushCabinet(__in HFCI hfci, |
BOOL fGetNextCab, | | BOOL fGetNextCab, |
PFNFCIGETNEXTCABINET pfnfcignc, | | __callback PFNFCIGETNEXTCABINET pfnfcignc, |
PFNFCISTATUS pfnfcis | | __callback PFNFCISTATUS pfnfcis |
); | | ); |
| | |
/*** FCIFlushFolder - Complete the current folder under construction | | /*** FCIFlushFolder - Complete the current folder under construction |
* | | * |
* This will force the termination of the current folder, which may or | | * This will force the termination of the current folder, which may or |
* may not cause one or more cabinet files to be completed. | | * may not cause one or more cabinet files to be completed. |
* | | * |
* Entry: | | * Entry: |
* hfci - FCI context | | * hfci - FCI context |
* GetNextCab - callback function to get continuation cabinets | | * GetNextCab - callback function to get continuation cabinets |
* pfnProgress - callback function for progress reporting | | * pfnProgress - callback function for progress reporting |
* pv - caller's internal context for callbacks | | * pv - caller's internal context for callbacks |
* | | * |
* Exit-Success: | | * Exit-Success: |
* return code TRUE | | * return code TRUE |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* return code FALSE, error structure filled in | | * return code FALSE, error structure filled in |
*/ | | */ |
|
BOOL DIAMONDAPI FCIFlushFolder(HFCI hfci, | | BOOL DIAMONDAPI FCIFlushFolder(__in HFCI hfci, |
PFNFCIGETNEXTCABINET pfnfcignc, | | __callback PFNFCIGETNEXTCABINET pfnfcignc, |
PFNFCISTATUS pfnfcis | | __callback PFNFCISTATUS pfnfcis |
); | | ); |
| | |
/*** FCIDestroy - Destroy a FCI context and delete temp files | | /*** FCIDestroy - Destroy a FCI context and delete temp files |
* | | * |
* Entry: | | * Entry: |
* hfci - FCI context | | * hfci - FCI context |
* | | * |
* Exit-Success: | | * Exit-Success: |
* return code TRUE | | * return code TRUE |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* return code FALSE, error structure filled in | | * return code FALSE, error structure filled in |
*/ | | */ |
|
BOOL DIAMONDAPI FCIDestroy (HFCI hfci); | | BOOL DIAMONDAPI FCIDestroy (__in HFCI hfci); |
| | |
//** Revert to default structure packing | | //** Revert to default structure packing |
| | |
#ifndef _WIN64 | | #ifndef _WIN64 |
|
#pragma pack() | | #include <poppack.h> |
#endif | | #endif |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
} | | } |
#endif /* __cplusplus */ | | #endif /* __cplusplus */ |
| | |
#endif // !INCLUDED_FCI | | #endif // !INCLUDED_FCI |
|
| | |
| | |
End of changes. 22 change blocks. |
45 lines changed or deleted | | 54 lines changed or added |
|
fdi.h (5.2.3790.3959-Windows 5.0) | | fdi.h (6.0.6001.18000-Windows 6.0) |
| | |
skipping to change at line 166 | | skipping to change at line 166 |
#include <poppack.h> | | #include <poppack.h> |
#endif | | #endif |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
} | | } |
#endif /* __cplusplus */ | | #endif /* __cplusplus */ |
| | |
#endif // !INCLUDED_TYPES_FCI_FDI | | #endif // !INCLUDED_TYPES_FCI_FDI |
/*** fdi_int.h - Diamond File Decompression Interface definitions | | /*** fdi_int.h - Diamond File Decompression Interface definitions |
* | | * |
|
* Microsoft Confidential | | |
* Copyright (C) Microsoft Corporation 1993-1997 | | * Copyright (C) Microsoft Corporation 1993-1997 |
* All Rights Reserved. | | * All Rights Reserved. |
* | | * |
* Author: | | * Author: |
* Chuck Strouss, Benjamin W. Slivka | | * Chuck Strouss, Benjamin W. Slivka |
* | | * |
* History: | | * History: |
* 30-Nov-1993 chuckst Created | | * 30-Nov-1993 chuckst Created |
* 21-Dec-1993 bens Updated with comments from 12/21/93 design review | | * 21-Dec-1993 bens Updated with comments from 12/21/93 design review |
* 09-Mar-1994 bens Add new error code | | * 09-Mar-1994 bens Add new error code |
| | |
skipping to change at line 197 | | skipping to change at line 196 |
* 11-May-1994 bens Added setId/iCabinet to fdintNEXT_CABINET | | * 11-May-1994 bens Added setId/iCabinet to fdintNEXT_CABINET |
* 07-Jul-1994 bens Support Quantum virtual file -- PLEASE note the | | * 07-Jul-1994 bens Support Quantum virtual file -- PLEASE note the |
* comments about PFNOPEN/PFNCLOSE changes, and | | * comments about PFNOPEN/PFNCLOSE changes, and |
* about reserving memory, if necessary, before | | * about reserving memory, if necessary, before |
* calling FDICreate()! | | * calling FDICreate()! |
* 19-Aug-1994 bens Add cpuType parameter to FDICreate(). | | * 19-Aug-1994 bens Add cpuType parameter to FDICreate(). |
* 03-Apr-1995 jeffwe Added chaining indicators to FDICABINETINFO | | * 03-Apr-1995 jeffwe Added chaining indicators to FDICABINETINFO |
* 22-Nov-1996 msliger Backed out fdintNEXT_FOLDER, added iFolder to | | * 22-Nov-1996 msliger Backed out fdintNEXT_FOLDER, added iFolder to |
* FDINOTIFICATION for fdintCOPY_FILE calls. | | * FDINOTIFICATION for fdintCOPY_FILE calls. |
* 20-Feb-1997 msliger Added fdintENUMERATE message. | | * 20-Feb-1997 msliger Added fdintENUMERATE message. |
|
| | * 11-Nov-2005 kinshu SAL annotation |
* | | * |
* | | * |
* ATTENTION: | | * ATTENTION: |
* This is the only documentation on the Diamond File Decompression | | * This is the only documentation on the Diamond File Decompression |
* Interface (FDI). Please read it carefully, as there are some subtle | | * Interface (FDI). Please read it carefully, as there are some subtle |
* points in FDI that are carefully explained below. | | * points in FDI that are carefully explained below. |
* | | * |
* Concepts: | | * Concepts: |
* A *cabinet* file contains one or more *folders*. A folder contains | | * A *cabinet* file contains one or more *folders*. A folder contains |
* one or more (pieces of) *files*. A folder is by definition a | | * one or more (pieces of) *files*. A folder is by definition a |
| | |
skipping to change at line 350 | | skipping to change at line 350 |
* target file, you use the write count to update your status! | | * target file, you use the write count to update your status! |
* Since this method is available, there is no separate callback from | | * Since this method is available, there is no separate callback from |
* FDI just for progess indication. | | * FDI just for progess indication. |
*/ | | */ |
| | |
#include <basetsd.h> | | #include <basetsd.h> |
| | |
#ifndef INCLUDED_FDI | | #ifndef INCLUDED_FDI |
#define INCLUDED_FDI 1 | | #define INCLUDED_FDI 1 |
| | |
|
| | #include <specstrings.h> |
| | typedef __nullterminated char* LPSTR; |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
extern "C" { /* Assume C declarations for C++ */ | | extern "C" { /* Assume C declarations for C++ */ |
#endif /* __cplusplus */ | | #endif /* __cplusplus */ |
| | |
//** Specify structure packing explicitly for clients of FDI | | //** Specify structure packing explicitly for clients of FDI |
| | |
#ifndef _WIN64 | | #ifndef _WIN64 |
|
#pragma pack(4) | | #include <pshpack4.h> |
#endif | | #endif |
| | |
/*** FDIERROR - Error codes returned in erf.erfOper field | | /*** FDIERROR - Error codes returned in erf.erfOper field |
* | | * |
* In general, FDI will only fail if one of the passed in memory or | | * In general, FDI will only fail if one of the passed in memory or |
* file I/O functions fails. Other errors are pretty unlikely, and are | | * file I/O functions fails. Other errors are pretty unlikely, and are |
* caused by corrupted cabinet files, passing in a file which is not a | | * caused by corrupted cabinet files, passing in a file which is not a |
* cabinet file, or cabinet files out of order. | | * cabinet file, or cabinet files out of order. |
* | | * |
* Description: Summary of error. | | * Description: Summary of error. |
| | |
skipping to change at line 609 | | skipping to change at line 612 |
* | | * |
* WARNING: You should never assume anything about the sequence of | | * WARNING: You should never assume anything about the sequence of |
* PFNALLOC and PFNFREE calls -- incremental releases of | | * PFNALLOC and PFNFREE calls -- incremental releases of |
* Diamond/FDI may have radically different numbers of | | * Diamond/FDI may have radically different numbers of |
* PFNALLOC calls and allocation sizes! | | * PFNALLOC calls and allocation sizes! |
*/ | | */ |
//** Memory functions for FDI | | //** Memory functions for FDI |
typedef void HUGE * (FAR DIAMONDAPI *PFNALLOC)(ULONG cb); /* pfna */ | | typedef void HUGE * (FAR DIAMONDAPI *PFNALLOC)(ULONG cb); /* pfna */ |
#define FNALLOC(fn) void HUGE * FAR DIAMONDAPI fn(ULONG cb) | | #define FNALLOC(fn) void HUGE * FAR DIAMONDAPI fn(ULONG cb) |
| | |
|
typedef void (FAR DIAMONDAPI *PFNFREE)(void HUGE *pv); /* pfnf */ | | typedef void (FAR DIAMONDAPI *PFNFREE)(__in_opt void HUGE *pv); /* pfnf */ |
#define FNFREE(fn) void FAR DIAMONDAPI fn(void HUGE *pv) | | #define FNFREE(fn) void FAR DIAMONDAPI fn(__in_opt void HUGE *pv) |
| | |
//** File I/O functions for FDI | | //** File I/O functions for FDI |
|
typedef INT_PTR (FAR DIAMONDAPI *PFNOPEN) (char FAR *pszFile, int oflag, int pmo | | typedef INT_PTR (FAR DIAMONDAPI *PFNOPEN) (__in LPSTR pszFile, int oflag, int pm |
de); | | ode); |
typedef UINT (FAR DIAMONDAPI *PFNREAD) (INT_PTR hf, void FAR *pv, UINT cb); | | typedef UINT (FAR DIAMONDAPI *PFNREAD) (__in INT_PTR hf, __out_ecount(cb) void F |
typedef UINT (FAR DIAMONDAPI *PFNWRITE)(INT_PTR hf, void FAR *pv, UINT cb); | | AR *pv, UINT cb); |
typedef int (FAR DIAMONDAPI *PFNCLOSE)(INT_PTR hf); | | typedef UINT (FAR DIAMONDAPI *PFNWRITE)(__in INT_PTR hf, __in_ecount(cb) void FA |
typedef long (FAR DIAMONDAPI *PFNSEEK) (INT_PTR hf, long dist, int seektype); | | R *pv, UINT cb); |
| | typedef int (FAR DIAMONDAPI *PFNCLOSE)(__in INT_PTR hf); |
| | typedef long (FAR DIAMONDAPI *PFNSEEK) (__in INT_PTR hf, long dist, int seektype |
| | ); |
| | |
|
#define FNOPEN(fn) INT_PTR FAR DIAMONDAPI fn(char FAR *pszFile, int oflag, int p | | #define FNOPEN(fn) INT_PTR FAR DIAMONDAPI fn(__in LPSTR pszFile, int oflag, int |
mode) | | pmode) |
#define FNREAD(fn) UINT FAR DIAMONDAPI fn(INT_PTR hf, void FAR *pv, UINT cb) | | #define FNREAD(fn) UINT FAR DIAMONDAPI fn(__in INT_PTR hf, __out_ecount(cb) void |
#define FNWRITE(fn) UINT FAR DIAMONDAPI fn(INT_PTR hf, void FAR *pv, UINT cb) | | FAR *pv, UINT cb) |
#define FNCLOSE(fn) int FAR DIAMONDAPI fn(INT_PTR hf) | | #define FNWRITE(fn) UINT FAR DIAMONDAPI fn(__in INT_PTR hf, __in_ecount(cb) void |
#define FNSEEK(fn) long FAR DIAMONDAPI fn(INT_PTR hf, long dist, int seektype) | | FAR *pv, UINT cb) |
| | #define FNCLOSE(fn) int FAR DIAMONDAPI fn(__in INT_PTR hf) |
| | #define FNSEEK(fn) long FAR DIAMONDAPI fn(__in INT_PTR hf, long dist, int seekty |
| | pe) |
| | |
/*** PFNFDIDECRYPT - FDI Decryption callback | | /*** PFNFDIDECRYPT - FDI Decryption callback |
* | | * |
* If this function is passed on the FDICopy() call, then FDI calls it | | * If this function is passed on the FDICopy() call, then FDI calls it |
* at various times to update the decryption state and to decrypt FCDATA | | * at various times to update the decryption state and to decrypt FCDATA |
* blocks. | | * blocks. |
* | | * |
* Common Entry Conditions: | | * Common Entry Conditions: |
* pfdid->fdidt - Command type | | * pfdid->fdidt - Command type |
* pfdid->pvUser - pvUser value from FDICopy() call | | * pfdid->pvUser - pvUser value from FDICopy() call |
| | |
skipping to change at line 1095 | | skipping to change at line 1098 |
* | | * |
* Special notes for Quantum Decompression: | | * Special notes for Quantum Decompression: |
* If you have used a high setting for CompressionMemory in creating | | * If you have used a high setting for CompressionMemory in creating |
* the cabinet file(s), then FDI will attempt to allocate a lot of | | * the cabinet file(s), then FDI will attempt to allocate a lot of |
* memory (as much as 2Mb, if you specified 21 for CompressionMemory). | | * memory (as much as 2Mb, if you specified 21 for CompressionMemory). |
* Therefore, if you plan to allocate additional memory *after* the | | * Therefore, if you plan to allocate additional memory *after* the |
* FDICreate() call, you should reserve some memory *prior* to calling | | * FDICreate() call, you should reserve some memory *prior* to calling |
* FDICreate(), and then free it up afterwards (or do all your allocation | | * FDICreate(), and then free it up afterwards (or do all your allocation |
* before calling FDICreate(). | | * before calling FDICreate(). |
*/ | | */ |
|
HFDI FAR DIAMONDAPI FDICreate(PFNALLOC pfnalloc, | | HFDI FAR DIAMONDAPI FDICreate(__callback PFNALLOC pfnalloc, |
PFNFREE pfnfree, | | __callback PFNFREE pfnfree, |
PFNOPEN pfnopen, | | __callback PFNOPEN pfnopen, |
PFNREAD pfnread, | | __callback PFNREAD pfnread, |
PFNWRITE pfnwrite, | | __callback PFNWRITE pfnwrite, |
PFNCLOSE pfnclose, | | __callback PFNCLOSE pfnclose, |
PFNSEEK pfnseek, | | __callback PFNSEEK pfnseek, |
int cpuType, | | int cpuType, |
PERF perf); | | __inout PERF perf); |
| | |
/*** FDIIsCabinet - Determines if file is a cabinet, returns info if it is | | /*** FDIIsCabinet - Determines if file is a cabinet, returns info if it is |
* | | * |
* Entry: | | * Entry: |
* hfdi - Handle to FDI context (created by FDICreate()) | | * hfdi - Handle to FDI context (created by FDICreate()) |
* hf - File handle suitable for PFNREAD/PFNSEEK, positioned | | * hf - File handle suitable for PFNREAD/PFNSEEK, positioned |
* at offset 0 in the file to test. | | * at offset 0 in the file to test. |
* pfdici - Buffer to receive info about cabinet if it is one. | | * pfdici - Buffer to receive info about cabinet if it is one. |
* | | * |
* Exit-Success: | | * Exit-Success: |
* Returns TRUE; file is a cabinet, pfdici filled in. | | * Returns TRUE; file is a cabinet, pfdici filled in. |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* Returns FALSE, file is not a cabinet; If an error occurred, | | * Returns FALSE, file is not a cabinet; If an error occurred, |
* perf (passed on FDICreate call!) filled in with error. | | * perf (passed on FDICreate call!) filled in with error. |
*/ | | */ |
|
BOOL FAR DIAMONDAPI FDIIsCabinet(HFDI hfdi, | | BOOL FAR DIAMONDAPI FDIIsCabinet(__in HFDI hfdi, |
INT_PTR hf, | | __in INT_PTR hf, |
PFDICABINETINFO pfdici); | | __out_opt PFDICABINETINFO pfdici); |
| | |
/*** FDICopy - extracts files from a cabinet | | /*** FDICopy - extracts files from a cabinet |
* | | * |
* Entry: | | * Entry: |
* hfdi - handle to FDI context (created by FDICreate()) | | * hfdi - handle to FDI context (created by FDICreate()) |
* pszCabinet - main name of cabinet file | | * pszCabinet - main name of cabinet file |
* pszCabPath - Path to cabinet file(s) | | * pszCabPath - Path to cabinet file(s) |
* flags - Flags to modify behavior | | * flags - Flags to modify behavior |
* pfnfdin - Notification function | | * pfnfdin - Notification function |
* pfnfdid - Decryption function (pass NULL if not used) | | * pfnfdid - Decryption function (pass NULL if not used) |
| | |
skipping to change at line 1150 | | skipping to change at line 1153 |
* error. | | * error. |
* | | * |
* Notes: | | * Notes: |
* (1) If FDICopy() fails while a target file is being written out, then | | * (1) If FDICopy() fails while a target file is being written out, then |
* FDI will use the PFNCLOSE function to close the file handle for that | | * FDI will use the PFNCLOSE function to close the file handle for that |
* target file that was returned from the fdintCOPY_FILE notification. | | * target file that was returned from the fdintCOPY_FILE notification. |
* The client application is then free to delete the target file, since | | * The client application is then free to delete the target file, since |
* it will not be in a valid state (since there was an error while | | * it will not be in a valid state (since there was an error while |
* writing it out). | | * writing it out). |
*/ | | */ |
|
BOOL FAR DIAMONDAPI FDICopy(HFDI hfdi, | | BOOL FAR DIAMONDAPI FDICopy(__in HFDI hfdi, |
char FAR *pszCabinet, | | __in LPSTR pszCabinet, |
char FAR *pszCabPath, | | __in LPSTR pszCabPath, |
int flags, | | int flags, |
PFNFDINOTIFY pfnfdin, | | __callback PFNFDINOTIFY pfnfdin, |
PFNFDIDECRYPT pfnfdid, | | __callback PFNFDIDECRYPT pfnfdid, |
void FAR *pvUser); | | __in_opt void FAR *pvUser); |
| | |
/*** FDIDestroy - Destroy an FDI context | | /*** FDIDestroy - Destroy an FDI context |
* | | * |
* Entry: | | * Entry: |
* hfdi - handle to FDI context (created by FDICreate()) | | * hfdi - handle to FDI context (created by FDICreate()) |
* | | * |
* Exit-Success: | | * Exit-Success: |
* Returns TRUE; | | * Returns TRUE; |
* | | * |
* Exit-Failure: | | * Exit-Failure: |
* Returns FALSE; | | * Returns FALSE; |
*/ | | */ |
|
BOOL FAR DIAMONDAPI FDIDestroy(HFDI hfdi); | | BOOL FAR DIAMONDAPI FDIDestroy(__in HFDI hfdi); |
| | |
/*** FDITruncateCabinet - truncate a cabinet, starting at folder # | | /*** FDITruncateCabinet - truncate a cabinet, starting at folder # |
* | | * |
* Entry: | | * Entry: |
* hfdi - handle to FDI context (created by FDICreate()) | | * hfdi - handle to FDI context (created by FDICreate()) |
* pszCabinet - full pathname of cabinet file | | * pszCabinet - full pathname of cabinet file |
* iFolderToDelete - first folder # to delete | | * iFolderToDelete - first folder # to delete |
* | | * |
* Exit-Success: | | * Exit-Success: |
* Returns TRUE; | | * Returns TRUE; |
| | |
skipping to change at line 1191 | | skipping to change at line 1194 |
* Exit-Failure: | | * Exit-Failure: |
* Returns FALSE; | | * Returns FALSE; |
* | | * |
* Most likely failure is unable to open cabinet for writing. | | * Most likely failure is unable to open cabinet for writing. |
* | | * |
* NOTE: This function relies on additional feature in the | | * NOTE: This function relies on additional feature in the |
* supplied PFNWRITE function, that a write of 0 bytes | | * supplied PFNWRITE function, that a write of 0 bytes |
* will truncate the file at the current position. | | * will truncate the file at the current position. |
*/ | | */ |
| | |
|
BOOL FAR DIAMONDAPI FDITruncateCabinet(HFDI hfdi, | | BOOL FAR DIAMONDAPI FDITruncateCabinet(__in HFDI hfdi, |
char * pszCabinetName, | | __in LPSTR pszCabinetName, |
USHORT iFolderToDelete); | | USHORT iFolderToDelete); |
| | |
//** Revert to default structure packing | | //** Revert to default structure packing |
#ifndef _WIN64 | | #ifndef _WIN64 |
|
#pragma pack() | | #include <poppack.h> |
#endif | | #endif |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
} | | } |
#endif /* __cplusplus */ | | #endif /* __cplusplus */ |
| | |
#endif //!INCLUDED_FDI | | #endif //!INCLUDED_FDI |
|
| | |
| | |
End of changes. 14 change blocks. |
40 lines changed or deleted | | 49 lines changed or added |
|