--- truecrypt/common/tcdefs.h 2018/04/24 16:41:21 1.1.1.6 +++ truecrypt/common/tcdefs.h 2018/04/24 16:42:50 1.1.1.8 @@ -1,25 +1,27 @@ -/* The source code contained in this file has been derived from the source code - of Encryption for the Masses 2.02a by Paul Le Roux. Modifications and - additions to that source code contained in this file are Copyright (c) 2004 - TrueCrypt Foundation and Copyright (c) 2004 TrueCrypt Team. Unmodified - parts are Copyright (c) 1998-99 Paul Le Roux. This is a TrueCrypt Foundation - release. Please see the file license.txt for full license details. */ +/* Legal Notice: The source code contained in this file has been derived from + the source code of Encryption for the Masses 2.02a, which is Copyright (c) + 1998-99 Paul Le Roux and which is covered by the 'License Agreement for + Encryption for the Masses'. Modifications and additions to that source code + contained in this file are Copyright (c) 2004-2005 TrueCrypt Foundation and + Copyright (c) 2004 TrueCrypt Team, and are covered by TrueCrypt License 2.0 + the full text of which is contained in the file License.txt included in + TrueCrypt binary and source code distribution archives. */ // Version displayed to user -#define VERSION_STRING "3.0a" +#define VERSION_STRING "4.0" // Version number to compare against driver -#define VERSION_NUM 0x030a +#define VERSION_NUM 0x0400 // Version number written to volume header during format, // specifies the minimum program version required to mount the volume -#define VOL_REQ_PROG_VERSION 0x0100 +#define VOL_REQ_PROG_VERSION 0x0100 // Volume header version #define VOLUME_HEADER_VERSION 0x0002 #define TC_MAX_PATH 260 /* Includes the null terminator */ -#define SECTOR_SIZE 512 /* sector size */ +#define SECTOR_SIZE 512 /* Filesystem sector size */ #define BYTES_PER_KB 1024I64 #define BYTES_PER_MB 1048576I64 @@ -46,6 +48,9 @@ #define ERR_VOL_READING 15 #define ERR_DRIVER_VERSION 16 #define ERR_NEW_VERSION_REQUIRED 17 +#define ERR_CIPHER_INIT_FAILURE 18 +#define ERR_CIPHER_INIT_WEAK_KEY 19 +#define ERR_SELF_TESTS_FAILED 20 #define ERR_VOL_ALREADY_MOUNTED 32 #define ERR_NO_FREE_SLOTS 33 @@ -55,6 +60,8 @@ #define ERR_INVALID_DEVICE 37 #define ERR_ACCESS_DENIED 38 +#define ERR_DONT_REPORT 100 + #define MIN_VOLUME_SIZE 19456 #define MIN_HIDDEN_VOLUME_HOST_SIZE ( MIN_VOLUME_SIZE * 2 + HIDDEN_VOL_HEADER_OFFSET + HEADER_SIZE ) #define MAX_VOLUME_SIZE 0x7fffFFFFffffFFFFI64 @@ -68,7 +75,9 @@ #define WIDE(x) (LPWSTR)L##x +#ifndef LINUX_DRIVER #include +#endif #pragma intrinsic(memcmp, memcpy, memset, strcat, strcmp, strcpy, strlen) @@ -107,45 +116,6 @@ #define DEVICE_DRIVER -#endif /* NT4_DRIVER */ - - -#ifdef WIN9X_DRIVER - -#pragma warning( disable : 4047 ) - -#include "iosdcls.inc" /* VMM and IOS headers */ - -#pragma warning( default : 4047 ) - -#include -#include -#undef WANTVDXWRAPS -#pragma warning( disable : 4229 ) -#include -#pragma warning( default : 4229 ) -#pragma hdrstop -#include -#include -#include "ifs.h" -#include -#define MBYTE16 3967 -#define UWORD unsigned short -#define UBYTE unsigned char - -#define MBYTE16 3967 - -#define TCalloc(size) _PageAllocate(size % 4096 ? (size/4096)+1 : size/4096,\ - PG_SYS,0,0,0,MBYTE16,NULL,PAGEZEROINIT|PAGEFIXED|PAGECONTIG|PAGEUSEALIGN); - -#define TCfree(memblock) _PageFree(memblock,0) - -#define DEVICE_DRIVER - -#endif /* WIN9X_DRIVER */ - -#ifdef DEVICE_DRIVER - #ifndef BOOL typedef int BOOL; #endif @@ -161,7 +131,7 @@ typedef int BOOL; /* Define dummies for the drivers */ typedef int HFILE; typedef unsigned int WPARAM; -typedef unsigned long LPARAM; +typedef unsigned __int32 LPARAM; #define CALLBACK #ifndef UINT @@ -169,14 +139,16 @@ typedef unsigned int UINT; #endif #ifndef LRESULT -typedef unsigned long LRESULT; +typedef unsigned __int32 LRESULT; #endif -#else // #ifdef DEVICE_DRIVER +#else /* NT4_DRIVER */ #define TCalloc malloc #define TCfree free +#ifdef _WIN32 + #pragma warning( disable : 4201 ) #pragma warning( disable : 4214 ) #pragma warning( disable : 4115 ) @@ -200,8 +172,13 @@ typedef unsigned long LRESULT; incorrectly to atoi64 when it should be _atoi64 */ #define atoi64 _atoi64 -#endif /* DEVICE_DRIVER */ +#endif /* _WIN32 */ -typedef UINT (_stdcall * diskio_f) (int, void *, UINT); +#endif /* NT4_DRIVER */ + +#ifdef _WIN32 +typedef UINT (_stdcall * diskio_f) (int, void *, UINT); #pragma hdrstop + +#endif