TrinityCore
CascLib.h
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* CascLib.h Copyright (c) Ladislav Zezula 2014 */
3 /*---------------------------------------------------------------------------*/
4 /* CascLib library v 1.00 */
5 /* */
6 /* Author : Ladislav Zezula */
7 /* E-mail : [email protected] */
8 /* WWW : http://www.zezula.net */
9 /*---------------------------------------------------------------------------*/
10 /* Date Ver Who Comment */
11 /* -------- ---- --- ------- */
12 /* 29.04.14 1.00 Lad Created */
13 /*****************************************************************************/
14 
15 #ifndef __CASCLIB_H__
16 #define __CASCLIB_H__
17 
18 #ifdef _MSC_VER
19 #pragma warning(disable:4668) // 'XXX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
20 #pragma warning(disable:4820) // 'XXX' : '2' bytes padding added after data member 'XXX::yyy'
21 #endif
22 
23 #include "CascPort.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 //-----------------------------------------------------------------------------
30 // Use the apropriate library
31 //
32 // The library type is encoded in the library name as the following
33 // CascLibXYZ.lib
34 //
35 // X - D for Debug version, R for Release version
36 // Y - A for ANSI version, U for Unicode version
37 // Z - S for static-linked CRT library, D for dynamic CRT library (dll)
38 //
39 
40 #if defined(_MSC_VER) && !defined(__CASCLIB_SELF__) && !defined(CASCLIB_NO_AUTO_LINK_LIBRARY)
41  #ifndef WDK_BUILD
42  #ifdef _DEBUG // DEBUG VERSIONS
43  #ifndef _UNICODE
44  #ifdef _DLL
45  #pragma comment(lib, "CascLibDAD.lib") // Debug Ansi CRT-DLL version
46  #else
47  #pragma comment(lib, "CascLibDAS.lib") // Debug Ansi CRT-LIB version
48  #endif
49  #else
50  #ifdef _DLL
51  #pragma comment(lib, "CascLibDUD.lib") // Debug Unicode CRT-DLL version
52  #else
53  #pragma comment(lib, "CascLibDUS.lib") // Debug Unicode CRT-LIB version
54  #endif
55  #endif
56  #else // RELEASE VERSIONS
57  #ifndef _UNICODE
58  #ifdef _DLL
59  #pragma comment(lib, "CascLibRAD.lib") // Release Ansi CRT-DLL version
60  #else
61  #pragma comment(lib, "CascLibRAS.lib") // Release Ansi CRT-LIB version
62  #endif
63  #else
64  #ifdef _DLL
65  #pragma comment(lib, "CascLibRUD.lib") // Release Unicode CRT-DLL version
66  #else
67  #pragma comment(lib, "CascLibRUS.lib") // Release Unicode CRT-LIB version
68  #endif
69  #endif
70  #endif
71  #endif
72 #endif
73 
74 //-----------------------------------------------------------------------------
75 // Defines
76 
77 #define CASCLIB_VERSION 0x0210 // CascLib version - integral (2.1)
78 #define CASCLIB_VERSION_STRING "2.1" // CascLib version - string
79 
80 // Values for CascOpenFile
81 #define CASC_OPEN_BY_NAME 0x00000000 // Open the file by name. This is the default value
82 #define CASC_OPEN_BY_CKEY 0x00000001 // The name is just the content key; skip ROOT file processing
83 #define CASC_OPEN_BY_EKEY 0x00000002 // The name is just the encoded key; skip ROOT file processing
84 #define CASC_OPEN_BY_FILEID 0x00000003 // The name is CASC_FILE_DATA_ID(FileDataId)
85 #define CASC_OPEN_TYPE_MASK 0x0000000F // The mask which gets open type from the dwFlags
86 #define CASC_OPEN_FLAGS_MASK 0xFFFFFFF0 // The mask which gets open type from the dwFlags
87 #define CASC_STRICT_DATA_CHECK 0x00000010 // Verify all data read from a file
88 #define CASC_OVERCOME_ENCRYPTED 0x00000020 // When CascReadFile encounters a block encrypted with a key that is missing, the block is filled with zeros and returned as success
89 
90 #define CASC_LOCALE_ALL 0xFFFFFFFF
91 #define CASC_LOCALE_ALL_WOW 0x0001F3F6 // All except enCN and enTW
92 #define CASC_LOCALE_NONE 0x00000000
93 #define CASC_LOCALE_UNKNOWN1 0x00000001
94 #define CASC_LOCALE_ENUS 0x00000002
95 #define CASC_LOCALE_KOKR 0x00000004
96 #define CASC_LOCALE_RESERVED 0x00000008
97 #define CASC_LOCALE_FRFR 0x00000010
98 #define CASC_LOCALE_DEDE 0x00000020
99 #define CASC_LOCALE_ZHCN 0x00000040
100 #define CASC_LOCALE_ESES 0x00000080
101 #define CASC_LOCALE_ZHTW 0x00000100
102 #define CASC_LOCALE_ENGB 0x00000200
103 #define CASC_LOCALE_ENCN 0x00000400
104 #define CASC_LOCALE_ENTW 0x00000800
105 #define CASC_LOCALE_ESMX 0x00001000
106 #define CASC_LOCALE_RURU 0x00002000
107 #define CASC_LOCALE_PTBR 0x00004000
108 #define CASC_LOCALE_ITIT 0x00008000
109 #define CASC_LOCALE_PTPT 0x00010000
110 
111 // Content flags on WoW
112 #define CASC_CFLAG_LOAD_ON_WINDOWS 0x08
113 #define CASC_CFLAG_LOAD_ON_MAC 0x10
114 #define CASC_CFLAG_LOW_VIOLENCE 0x80
115 #define CASC_CFLAG_DONT_LOAD 0x100
116 #define CASC_CFLAG_NO_NAME_HASH 0x10000000
117 #define CASC_CFLAG_BUNDLE 0x40000000
118 #define CASC_CFLAG_NO_COMPRESSION 0x80000000
119 
120 #ifndef MD5_HASH_SIZE
121 #define MD5_HASH_SIZE 0x10
122 #define MD5_STRING_SIZE 0x20
123 #endif
124 
125 // Return value for CascGetFileSize and CascSetFilePointer
126 #define CASC_INVALID_INDEX 0xFFFFFFFF
127 #define CASC_INVALID_SIZE 0xFFFFFFFF
128 #define CASC_INVALID_POS 0xFFFFFFFF
129 #define CASC_INVALID_ID 0xFFFFFFFF
130 #define CASC_INVALID_OFFS64 0xFFFFFFFFFFFFFFFF
131 #define CASC_INVALID_SIZE64 0xFFFFFFFFFFFFFFFF
132 
133 // Flags for CASC_STORAGE_FEATURES::dwFeatures
134 #define CASC_FEATURE_FILE_NAMES 0x00000001 // File names are supported by the storage
135 #define CASC_FEATURE_ROOT_CKEY 0x00000002 // Present if the storage's ROOT returns CKey
136 #define CASC_FEATURE_TAGS 0x00000004 // Tags are supported by the storage
137 #define CASC_FEATURE_FNAME_HASHES 0x00000008 // The storage contains file name hashes on ALL files
138 #define CASC_FEATURE_FNAME_HASHES_OPTIONAL 0x00000010 // The storage contains file name hashes for SOME files
139 #define CASC_FEATURE_FILE_DATA_IDS 0x00000020 // The storage indexes files by FileDataId
140 #define CASC_FEATURE_LOCALE_FLAGS 0x00000040 // Locale flags are supported
141 #define CASC_FEATURE_CONTENT_FLAGS 0x00000080 // Content flags are supported
142 #define CASC_FEATURE_ONLINE 0x00000100 // The storage is an online storage
143 
144 // Macro to convert FileDataId to the argument of CascOpenFile
145 #define CASC_FILE_DATA_ID(FileDataId) ((LPCSTR)(size_t)FileDataId)
146 #define CASC_FILE_DATA_ID_FROM_STRING(szFileName) ((DWORD)(size_t)szFileName)
147 
148 // Maximum length of encryption key
149 #define CASC_KEY_LENGTH 0x10
150 
151 //-----------------------------------------------------------------------------
152 // Structures
153 
155 {
156  // Returns the number of local files in the storage. Note that files
157  // can exist under different names, so the total number of files in the archive
158  // can be higher than the value returned by this info class
160 
161  // Returns the total file count, including the offline files
163 
164 
165  CascStorageFeatures, // Returns the features flag
166  CascStorageInstalledLocales, // Not supported
167  CascStorageProduct, // Gives CASC_STORAGE_PRODUCT
168  CascStorageTags, // Gives CASC_STORAGE_TAGS structure
169  CascStoragePathProduct, // Gives Path:Product into a LPTSTR buffer
171 
173 
175 {
178  CascFileFullInfo, // Gives CASC_FILE_FULL_INFO structure
179  CascFileSpanInfo, // Gives CASC_FILE_SPAN_INFO structure for each file span
182 
183 // CascLib may provide a fake name, constructed from file data id, CKey or EKey.
184 // This enum helps to see what name was actually returned
185 // Note that any of these names can be passed to CascOpenFile with no extra flags
186 typedef enum _CASC_NAME_TYPE
187 {
188  CascNameFull, // Fully qualified file name
189  CascNameDataId, // Name created from file data id (FILE%08X.dat)
190  CascNameCKey, // Name created as string representation of CKey
191  CascNameEKey // Name created as string representation of EKey
193 
194 // Structure for SFileFindFirstFile and SFileFindNextFile
195 typedef struct _CASC_FIND_DATA
196 {
197  // Full name of the found file. In case when this is CKey/EKey,
198  // this will be just string representation of the key stored in 'FileKey'
200 
201  // Content key. This is present if the CASC_FEATURE_ROOT_CKEY is present
203 
204  // Encoded key. This is always present.
206 
207  // Tag mask. Only valid if the storage supports tags, otherwise 0
209 
210  // Size of the file, as retrieved from CKey entry
212 
213  // Plain name of the found file. Pointing inside the 'szFileName' array
214  char * szPlainName;
215 
216  // File data ID. Only valid if the storage supports file data IDs, otherwise CASC_INVALID_ID
218 
219  // Locale flags. Only valid if the storage supports locale flags, otherwise CASC_INVALID_ID
221 
222  // Content flags. Only valid if the storage supports content flags, otherwise CASC_INVALID_ID
224 
225  // Span count
227 
228  // If true the file is available locally
230 
231  // Name type in 'szFileName'. In case the file name is not known,
232  // CascLib can put FileDataId-like name or a string representation of CKey/EKey
233  CASC_NAME_TYPE NameType;
234 
236 
237 typedef struct _CASC_STORAGE_TAG
238 {
239  LPCSTR szTagName; // Tag name (zero terminated, ANSI)
240  DWORD TagNameLength; // Length of the tag name
241  DWORD TagValue; // Tag value
243 
244 typedef struct _CASC_STORAGE_TAGS
245 {
246  size_t TagCount; // Number of items in the Tags array
247  size_t Reserved; // Reserved for future use
248 
249  CASC_STORAGE_TAG Tags[1]; // Array of CASC tags
250 
252 
253 typedef struct _CASC_STORAGE_PRODUCT
254 {
255  char szCodeName[0x1C]; // Code name of the product ("wowt" = "World of Warcraft PTR")
256  DWORD BuildNumber; // Build number. If zero, then CascLib didn't recognize build number
257 
259 
260 typedef struct _CASC_FILE_FULL_INFO
261 {
264  char DataFileName[0x10]; // Plain name of the data file where the file is stored
265  ULONGLONG StorageOffset; // Offset of the file over the entire storage
266  ULONGLONG SegmentOffset; // Offset of the file in the segment file ("data.###")
267  ULONGLONG TagBitMask; // Bitmask of tags. Zero if not supported
268  ULONGLONG FileNameHash; // Hash of the file name. Zero if not supported
269  ULONGLONG ContentSize; // Content size of all spans
270  ULONGLONG EncodedSize; // Encoded size of all spans
271  DWORD SegmentIndex; // Index of the segment file (aka 0 = "data.000")
272  DWORD SpanCount; // Number of spans forming the file
273  DWORD FileDataId; // File data ID. CASC_INVALID_ID if not supported.
274  DWORD LocaleFlags; // Locale flags. CASC_INVALID_ID if not supported.
275  DWORD ContentFlags; // Locale flags. CASC_INVALID_ID if not supported
276 
278 
279 typedef struct _CASC_FILE_SPAN_INFO
280 {
281  BYTE CKey[MD5_HASH_SIZE]; // Content key of the file span
282  BYTE EKey[MD5_HASH_SIZE]; // Encoded key of the file span
283  ULONGLONG StartOffset; // Starting offset of the file span
284  ULONGLONG EndOffset; // Ending offset of the file span
285  DWORD ArchiveIndex; // Index of the archive
286  DWORD ArchiveOffs; // Offset in the archive
287  DWORD HeaderSize; // Size of encoded frame headers
288  DWORD FrameCount; // Number of frames in this span
289 
291 
292 //-----------------------------------------------------------------------------
293 // Extended version of CascOpenStorage
294 
295 // Some operations (e.g. opening an online storage) may take long time.
296 // This callback allows an application to be notified about loading progress
297 // and even cancel the storage loading process
298 typedef bool (WINAPI * PFNPROGRESSCALLBACK)( // Return 'true' to cancel the loading process
299  void * PtrUserParam, // User-specific parameter passed to the callback
300  LPCSTR szWork, // Text for the current activity (example: "Loading "ENCODING" file")
301  LPCSTR szObject, // (optional) name of the object tied to the activity (example: index file name)
302  DWORD CurrentValue, // (optional) current object being processed
303  DWORD TotalValue // (optional) If non-zero, this is the total number of objects to process
304  );
305 
306 // Some storages support multi-product installation (e.g. World of Warcraft).
307 // With this callback, the calling application can specify which storage to open
308 typedef bool (WINAPI * PFNPRODUCTCALLBACK)( // Return 'true' to cancel the loading process
309  void * PtrUserParam, // User-specific parameter passed to the callback
310  LPCSTR * ProductList, // Array of product codenames found in the storage
311  size_t ProductCount, // Number of products in the ProductList array
312  size_t * PtrSelectedProduct // [out] This is the selected product to open. On input, set to 0 (aka the first product)
313  );
314 
316 {
317  size_t Size; // Length of this structure. Initialize to sizeof(CASC_OPEN_STORAGE_ARGS)
318 
319  LPCTSTR szLocalPath; // Local: Path to the storage directory (where ".build.info: is) or any of the sub-path
320  // Online: Path to the local storage cache
321 
322  LPCTSTR szCodeName; // If non-null, this will specify a product in a multi-product local storage
323  // Has higher priority than PfnProductCallback (if both specified)
324  LPCTSTR szRegion; // If non-null, this will specify a product region.
325 
326  PFNPROGRESSCALLBACK PfnProgressCallback; // Progress callback. If non-NULL, this can inform the caller about state of the opening storage
327  void * PtrProgressParam; // Pointer-sized parameter that will be passed to PfnProgressCallback
328  PFNPRODUCTCALLBACK PfnProductCallback; // Progress callback. If non-NULL, will be called on multi-product storage to select one of the products
329  void * PtrProductParam; // Pointer-sized parameter that will be passed to PfnProgressCallback
330 
331  DWORD dwLocaleMask; // Locale mask to open
332  DWORD dwFlags; // Reserved. Set to zero.
333 
334  //
335  // Any additional member from here on must be checked for availability using the ExtractVersionedArgument function.
336  // Example:
337  //
338  // LPCTSTR szBuildKey = NULL;
339  // ExtractVersionedArgument(pArgs, offsetof(CASC_OPEN_STORAGE_ARGS, szBuildId), &szBuildKey);
340  //
341 
342  LPCTSTR szBuildKey; // If non-null, this will specify a build key (aka MD5 of build config that is different that current online version)
343 
345 
346 //-----------------------------------------------------------------------------
347 // Functions for storage manipulation
348 
349 bool WINAPI CascOpenStorageEx(LPCTSTR szParams, PCASC_OPEN_STORAGE_ARGS pArgs, bool bOnlineStorage, HANDLE * phStorage);
350 bool WINAPI CascOpenStorage(LPCTSTR szParams, DWORD dwLocaleMask, HANDLE * phStorage);
351 bool WINAPI CascOpenOnlineStorage(LPCTSTR szParams, DWORD dwLocaleMask, HANDLE * phStorage);
352 bool WINAPI CascGetStorageInfo(HANDLE hStorage, CASC_STORAGE_INFO_CLASS InfoClass, void * pvStorageInfo, size_t cbStorageInfo, size_t * pcbLengthNeeded);
353 bool WINAPI CascCloseStorage(HANDLE hStorage);
354 
355 bool WINAPI CascOpenFile(HANDLE hStorage, const void * pvFileName, DWORD dwLocaleFlags, DWORD dwOpenFlags, HANDLE * PtrFileHandle);
356 bool WINAPI CascOpenLocalFile(LPCTSTR szFileName, DWORD dwOpenFlags, HANDLE * PtrFileHandle);
357 bool WINAPI CascGetFileInfo(HANDLE hFile, CASC_FILE_INFO_CLASS InfoClass, void * pvFileInfo, size_t cbFileInfo, size_t * pcbLengthNeeded);
358 bool WINAPI CascGetFileSize64(HANDLE hFile, PULONGLONG PtrFileSize);
359 bool WINAPI CascSetFilePointer64(HANDLE hFile, LONGLONG DistanceToMove, PULONGLONG PtrNewPos, DWORD dwMoveMethod);
360 bool WINAPI CascReadFile(HANDLE hFile, void * lpBuffer, DWORD dwToRead, PDWORD pdwRead);
361 bool WINAPI CascCloseFile(HANDLE hFile);
362 
363 DWORD WINAPI CascGetFileSize(HANDLE hFile, PDWORD pdwFileSizeHigh);
364 DWORD WINAPI CascSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * PtrFilePosHigh, DWORD dwMoveMethod);
365 
366 HANDLE WINAPI CascFindFirstFile(HANDLE hStorage, LPCSTR szMask, PCASC_FIND_DATA pFindData, LPCTSTR szListFile);
367 bool WINAPI CascFindNextFile(HANDLE hFind, PCASC_FIND_DATA pFindData);
368 bool WINAPI CascFindClose(HANDLE hFind);
369 
370 bool WINAPI CascAddEncryptionKey(HANDLE hStorage, ULONGLONG KeyName, LPBYTE Key);
371 bool WINAPI CascAddStringEncryptionKey(HANDLE hStorage, ULONGLONG KeyName, LPCSTR szKey);
372 bool WINAPI CascImportKeysFromString(HANDLE hStorage, LPCSTR szKeyList);
375 bool WINAPI CascGetNotFoundEncryptionKey(HANDLE hStorage, ULONGLONG * KeyName);
376 
377 //-----------------------------------------------------------------------------
378 // Error code support
379 
380 void SetCascError(DWORD dwErrCode);
382 
383 #ifdef __cplusplus
384 } // extern "C"
385 #endif
386 
387 #endif // __CASCLIB_H__
enum _CASC_FILE_INFO_CLASS CASC_FILE_INFO_CLASS
bool WINAPI CascGetNotFoundEncryptionKey(HANDLE hStorage, ULONGLONG *KeyName)
Definition: CascDecrypt.cpp:817
struct _CASC_STORAGE_PRODUCT CASC_STORAGE_PRODUCT
void SetCascError(DWORD dwErrCode)
Definition: Common.cpp:91
const TCHAR * LPCTSTR
Definition: CascPort.h:177
DWORD dwFileDataId
Definition: CascLib.h:217
ULONGLONG TagBitMask
Definition: CascLib.h:267
PFNPROGRESSCALLBACK PfnProgressCallback
Definition: CascLib.h:326
ULONGLONG SegmentOffset
Definition: CascLib.h:266
bool WINAPI CascOpenStorage(LPCTSTR szParams, DWORD dwLocaleMask, HANDLE *phStorage)
Definition: CascOpenStorage.cpp:1402
struct _CASC_FILE_FULL_INFO * PCASC_FILE_FULL_INFO
Definition: CascLib.h:169
enum _CASC_NAME_TYPE * PCASC_NAME_TYPE
void * HANDLE
Definition: CascPort.h:168
DWORD WINAPI CascSetFilePointer(HANDLE hFile, LONG lFilePos, LONG *PtrFilePosHigh, DWORD dwMoveMethod)
Definition: CascReadFile.cpp:1161
Definition: CascLib.h:253
unsigned long long ULONGLONG
Definition: CascPort.h:166
DWORD * PDWORD
Definition: CascPort.h:172
struct _CASC_FILE_SPAN_INFO * PCASC_FILE_SPAN_INFO
DWORD bFileAvailable
Definition: CascLib.h:229
DWORD TagValue
Definition: CascLib.h:241
DWORD TagNameLength
Definition: CascLib.h:240
ULONGLONG EndOffset
Definition: CascLib.h:284
ULONGLONG TagBitMask
Definition: CascLib.h:208
char * szPlainName
Definition: CascLib.h:214
_CASC_NAME_TYPE
Definition: CascLib.h:186
Definition: CascLib.h:244
struct _CASC_OPEN_STORAGE_ARGS CASC_OPEN_STORAGE_ARGS
const char * LPCSTR
Definition: CascPort.h:175
struct _CASC_STORAGE_TAGS CASC_STORAGE_TAGS
struct _CASC_FILE_FULL_INFO CASC_FILE_FULL_INFO
bool WINAPI CascGetFileSize64(HANDLE hFile, PULONGLONG PtrFileSize)
Definition: CascReadFile.cpp:1045
#define MAX_PATH
Definition: CascPort.h:185
bool WINAPI CascOpenOnlineStorage(LPCTSTR szParams, DWORD dwLocaleMask, HANDLE *phStorage)
Definition: CascOpenStorage.cpp:1415
bool WINAPI CascOpenLocalFile(LPCTSTR szFileName, DWORD dwOpenFlags, HANDLE *PtrFileHandle)
Definition: CascOpenFile.cpp:416
ULONGLONG EncodedSize
Definition: CascLib.h:270
Definition: CascLib.h:168
_CASC_STORAGE_INFO_CLASS
Definition: CascLib.h:154
BYTE CKey[MD5_HASH_SIZE]
Definition: CascLib.h:202
void * PtrProgressParam
Definition: CascLib.h:327
Definition: CascLib.h:178
size_t Size
Definition: CascLib.h:317
void * PtrProductParam
Definition: CascLib.h:329
struct _CASC_FIND_DATA * PCASC_FIND_DATA
struct _CASC_OPEN_STORAGE_ARGS * PCASC_OPEN_STORAGE_ARGS
int LONG
Definition: CascPort.h:161
size_t TagCount
Definition: CascLib.h:246
Definition: CascLib.h:180
BYTE * LPBYTE
Definition: CascPort.h:173
struct _CASC_STORAGE_TAGS * PCASC_STORAGE_TAGS
ULONGLONG ContentSize
Definition: CascLib.h:269
long long LONGLONG
Definition: CascPort.h:163
#define WINAPI
Definition: CascPort.h:188
DWORD dwLocaleMask
Definition: CascLib.h:331
#define bool
Definition: CascPort.h:16
bool(WINAPI * PFNPRODUCTCALLBACK)(void *PtrUserParam, LPCSTR *ProductList, size_t ProductCount, size_t *PtrSelectedProduct)
Definition: CascLib.h:308
BYTE EKey[MD5_HASH_SIZE]
Definition: CascLib.h:205
struct _CASC_FILE_SPAN_INFO CASC_FILE_SPAN_INFO
Definition: CascLib.h:195
Definition: CascLib.h:315
Definition: CascLib.h:279
DWORD ArchiveOffs
Definition: CascLib.h:286
Definition: CascLib.h:191
Definition: CascLib.h:179
struct _CASC_STORAGE_TAG * PCASC_STORAGE_TAG
#define MD5_HASH_SIZE
Definition: CascLib.h:121
ULONGLONG StartOffset
Definition: CascLib.h:283
bool WINAPI CascCloseStorage(HANDLE hStorage)
Definition: CascOpenStorage.cpp:1487
Definition: CascLib.h:165
DWORD SegmentIndex
Definition: CascLib.h:271
unsigned long long * PULONGLONG
Definition: CascPort.h:167
ULONGLONG StorageOffset
Definition: CascLib.h:265
Definition: CascLib.h:189
bool WINAPI CascGetStorageInfo(HANDLE hStorage, CASC_STORAGE_INFO_CLASS InfoClass, void *pvStorageInfo, size_t cbStorageInfo, size_t *pcbLengthNeeded)
Definition: CascOpenStorage.cpp:1423
ULONGLONG FileNameHash
Definition: CascLib.h:268
Definition: CascLib.h:177
Definition: CascLib.h:237
bool(WINAPI * PFNPROGRESSCALLBACK)(void *PtrUserParam, LPCSTR szWork, LPCSTR szObject, DWORD CurrentValue, DWORD TotalValue)
Definition: CascLib.h:298
bool WINAPI CascOpenFile(HANDLE hStorage, const void *pvFileName, DWORD dwLocaleFlags, DWORD dwOpenFlags, HANDLE *PtrFileHandle)
Definition: CascOpenFile.cpp:305
DWORD LocaleFlags
Definition: CascLib.h:274
bool WINAPI CascGetFileInfo(HANDLE hFile, CASC_FILE_INFO_CLASS InfoClass, void *pvFileInfo, size_t cbFileInfo, size_t *pcbLengthNeeded)
Definition: CascReadFile.cpp:961
Definition: CascLib.h:188
LPBYTE WINAPI CascFindEncryptionKey(HANDLE hStorage, ULONGLONG KeyName)
Definition: CascDecrypt.cpp:801
Definition: CascLib.h:190
DWORD ArchiveIndex
Definition: CascLib.h:285
bool WINAPI CascSetFilePointer64(HANDLE hFile, LONGLONG DistanceToMove, PULONGLONG PtrNewPos, DWORD dwMoveMethod)
Definition: CascReadFile.cpp:1092
Definition: CascLib.h:162
DWORD dwFlags
Definition: CascLib.h:332
DWORD ContentFlags
Definition: CascLib.h:275
struct _CASC_STORAGE_TAG CASC_STORAGE_TAG
bool WINAPI CascImportKeysFromFile(HANDLE hStorage, LPCTSTR szFileName)
Definition: CascDecrypt.cpp:898
DWORD WINAPI CascGetFileSize(HANDLE hFile, PDWORD pdwFileSizeHigh)
Definition: CascReadFile.cpp:1078
_CASC_FILE_INFO_CLASS
Definition: CascLib.h:174
struct _CASC_STORAGE_PRODUCT * PCASC_STORAGE_PRODUCT
enum _CASC_STORAGE_INFO_CLASS * PCASC_STORAGE_INFO_CLASS
unsigned int DWORD
Definition: CascPort.h:162
bool WINAPI CascFindNextFile(HANDLE hFind, PCASC_FIND_DATA pFindData)
Definition: CascFindFile.cpp:241
Definition: CascLib.h:166
HANDLE WINAPI CascFindFirstFile(HANDLE hStorage, LPCSTR szMask, PCASC_FIND_DATA pFindData, LPCTSTR szListFile)
Definition: CascFindFile.cpp:196
char szFileName[MAX_PATH]
Definition: CascLib.h:199
size_t Reserved
Definition: CascLib.h:247
CASC_NAME_TYPE NameType
Definition: CascLib.h:233
bool WINAPI CascImportKeysFromString(HANDLE hStorage, LPCSTR szKeyList)
Definition: CascDecrypt.cpp:840
DWORD BuildNumber
Definition: CascLib.h:256
bool WINAPI CascFindClose(HANDLE hFind)
Definition: CascFindFile.cpp:258
DWORD HeaderSize
Definition: CascLib.h:287
bool WINAPI CascCloseFile(HANDLE hFile)
Definition: CascOpenFile.cpp:428
DWORD dwLocaleFlags
Definition: CascLib.h:220
bool WINAPI CascOpenStorageEx(LPCTSTR szParams, PCASC_OPEN_STORAGE_ARGS pArgs, bool bOnlineStorage, HANDLE *phStorage)
Definition: CascOpenStorage.cpp:1343
bool WINAPI CascReadFile(HANDLE hFile, void *lpBuffer, DWORD dwToRead, PDWORD pdwRead)
Definition: CascReadFile.cpp:1179
DWORD FileDataId
Definition: CascLib.h:273
LPCTSTR szLocalPath
Definition: CascLib.h:319
enum _CASC_STORAGE_INFO_CLASS CASC_STORAGE_INFO_CLASS
Definition: CascLib.h:176
LPCTSTR szBuildKey
Definition: CascLib.h:342
LPCSTR szTagName
Definition: CascLib.h:239
Definition: CascLib.h:159
DWORD dwContentFlags
Definition: CascLib.h:223
unsigned char BYTE
Definition: CascPort.h:159
bool WINAPI CascAddStringEncryptionKey(HANDLE hStorage, ULONGLONG KeyName, LPCSTR szKey)
Definition: CascDecrypt.cpp:780
DWORD SpanCount
Definition: CascLib.h:272
Definition: CascLib.h:170
struct _CASC_FIND_DATA CASC_FIND_DATA
Definition: CascLib.h:167
LPCTSTR szCodeName
Definition: CascLib.h:322
LPCTSTR szRegion
Definition: CascLib.h:324
DWORD dwSpanCount
Definition: CascLib.h:226
bool WINAPI CascAddEncryptionKey(HANDLE hStorage, ULONGLONG KeyName, LPBYTE Key)
Definition: CascDecrypt.cpp:764
DWORD GetCascError()
Definition: Common.cpp:82
enum _CASC_FILE_INFO_CLASS * PCASC_FILE_INFO_CLASS
enum _CASC_NAME_TYPE CASC_NAME_TYPE
PFNPRODUCTCALLBACK PfnProductCallback
Definition: CascLib.h:328
DWORD FrameCount
Definition: CascLib.h:288
Definition: CascLib.h:260
ULONGLONG FileSize
Definition: CascLib.h:211