diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-07-18 23:37:19 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-07-18 23:37:19 +0200 |
| commit | fe4d11c65a512c61ccb924fbf3dc20c8cfc84dc7 (patch) | |
| tree | 86888deb22268503d70ae7259bbf17add4dcdc1f /dep/CascLib/src/common | |
| parent | a9a13d10f7c510bb392539608cb276435a78b688 (diff) | |
Tools: Extractor updates
* VMAP extractor does not work due to a bug in CascLib
Diffstat (limited to 'dep/CascLib/src/common')
| -rw-r--r-- | dep/CascLib/src/common/FileStream.cpp | 8 | ||||
| -rw-r--r-- | dep/CascLib/src/common/FileStream.h | 22 |
2 files changed, 26 insertions, 4 deletions
diff --git a/dep/CascLib/src/common/FileStream.cpp b/dep/CascLib/src/common/FileStream.cpp index ccd3a65318d..cb49f7f4ac1 100644 --- a/dep/CascLib/src/common/FileStream.cpp +++ b/dep/CascLib/src/common/FileStream.cpp @@ -1,7 +1,7 @@ /*****************************************************************************/ /* FileStream.cpp Copyright (c) Ladislav Zezula 2010 */ /*---------------------------------------------------------------------------*/ -/* File stream support for CascLib */ +/* File stream support */ /* */ /* Windows support: Written by Ladislav Zezula */ /* Mac support: Written by Sam Wilkins */ @@ -162,7 +162,7 @@ static bool BaseFile_Read( #ifdef PLATFORM_WINDOWS { - // Note: CascLib no longer supports Windows 9x. + // Note: We no longer support Windows 9x. // Thus, we can use the OVERLAPPED structure to specify // file offset to read from file. This allows us to skip // one system call to SetFilePointer @@ -233,7 +233,7 @@ static bool BaseFile_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const #ifdef PLATFORM_WINDOWS { - // Note: CascLib no longer supports Windows 9x. + // Note: We no longer support Windows 9x. // Thus, we can use the OVERLAPPED structure to specify // file offset to read from file. This allows us to skip // one system call to SetFilePointer @@ -2097,7 +2097,7 @@ static TFileStream * EncrStream_Open(const TCHAR * szFileName, DWORD dwStreamFla // Cleanup the stream and return FileStream_Close(pStream); - SetLastError(ERROR_UNKNOWN_FILE_KEY); + SetLastError(ERROR_FILE_ENCRYPTED); return NULL; } diff --git a/dep/CascLib/src/common/FileStream.h b/dep/CascLib/src/common/FileStream.h index 1e51acfc845..1c72619e393 100644 --- a/dep/CascLib/src/common/FileStream.h +++ b/dep/CascLib/src/common/FileStream.h @@ -12,6 +12,28 @@ #define __FILESTREAM_H__ //----------------------------------------------------------------------------- +// Flags for file stream + +#define BASE_PROVIDER_FILE 0x00000000 // Base data source is a file +#define BASE_PROVIDER_MAP 0x00000001 // Base data source is memory-mapped file +#define BASE_PROVIDER_HTTP 0x00000002 // Base data source is a file on web server +#define BASE_PROVIDER_MASK 0x0000000F // Mask for base provider value + +#define STREAM_PROVIDER_FLAT 0x00000000 // Stream is linear with no offset mapping +#define STREAM_PROVIDER_PARTIAL 0x00000010 // Stream is partial file (.part) +#define STREAM_PROVIDER_ENCRYPTED 0x00000020 // Stream is an encrypted archive +#define STREAM_PROVIDER_BLOCK4 0x00000030 // 0x4000 per block, text MD5 after each block, max 0x2000 blocks per file +#define STREAM_PROVIDER_MASK 0x000000F0 // Mask for stream provider value + +#define STREAM_FLAG_READ_ONLY 0x00000100 // Stream is read only +#define STREAM_FLAG_WRITE_SHARE 0x00000200 // Allow write sharing when open for write +#define STREAM_FLAG_USE_BITMAP 0x00000400 // If the file has a file bitmap, load it and use it +#define STREAM_OPTIONS_MASK 0x0000FF00 // Mask for stream options + +#define STREAM_PROVIDERS_MASK 0x000000FF // Mask to get stream providers +#define STREAM_FLAGS_MASK 0x0000FFFF // Mask for all stream flags (providers+options) + +//----------------------------------------------------------------------------- // Function prototypes typedef void (*STREAM_INIT)( |
