Annotation of truecrypt/common/tcdefs.h, revision 1.1.1.4

1.1.1.4 ! root        1: /* The source code contained in this file has been derived from the source code
        !             2:    of Encryption for the Masses 2.02a by Paul Le Roux. Modifications and
        !             3:    additions to that source code contained in this file are Copyright (c) 2004
        !             4:    TrueCrypt Team and Copyright (c) 2004 TrueCrypt Foundation. Unmodified
        !             5:    parts are Copyright (c) 1998-99 Paul Le Roux. This is a TrueCrypt Foundation
        !             6:    release. Please see the file license.txt for full license details. */
1.1       root        7: 
                      8: // Version displayed to user 
1.1.1.4 ! root        9: #define VERSION_STRING                  "2.1"
1.1       root       10: 
                     11: // Version number to compare against driver
1.1.1.4 ! root       12: #define VERSION_NUM                                            0x0210
1.1       root       13: 
                     14: // Version number written to volume header during format,
                     15: // specifies the minimum program version required to mount the volume
                     16: #define VOLUME_VERSION_NUM                             0x0100 
                     17: 
                     18: #define TC_MAX_PATH                                            260     /* Includes the null terminator */
                     19: #define SECTOR_SIZE                     512    /* sector size */
                     20: 
                     21: #define BYTES_PER_KB                    1024   
                     22: #define BYTES_PER_MB                    1048576
                     23: 
                     24: /* GUI/driver errors */
                     25: 
                     26: #define ERR_OS_ERROR                    1
                     27: #define ERR_OUTOFMEMORY                 2
                     28: #define ERR_PASSWORD_WRONG              3
                     29: #define ERR_VOL_FORMAT_BAD              4
                     30: #define ERR_BAD_DRIVE_LETTER            5
                     31: #define ERR_DRIVE_NOT_FOUND             6
                     32: #define ERR_FILES_OPEN                  7
                     33: #define ERR_VOL_SIZE_WRONG              8
                     34: #define ERR_COMPRESSION_NOT_SUPPORTED   9
                     35: #define ERR_PASSWORD_CHANGE_VOL_TYPE    10
                     36: #define ERR_PASSWORD_CHANGE_VOL_VERSION 11
                     37: #define ERR_VOL_SEEKING                 12
                     38: #define ERR_VOL_WRITING                 13
                     39: #define ERR_FILES_OPEN_LOCK             14
                     40: #define ERR_VOL_READING                 15
                     41: #define ERR_DRIVER_VERSION                             16
                     42: #define ERR_NEW_VERSION_REQUIRED               17
                     43: 
                     44: #define ERR_VOL_ALREADY_MOUNTED         32
                     45: #define ERR_NO_FREE_SLOTS               33
                     46: #define ERR_NO_FREE_DRIVES              34
                     47: #define ERR_FILE_OPEN_FAILED            35
                     48: #define ERR_VOL_MOUNT_FAILED            36
                     49: #define ERR_INVALID_DEVICE              37
                     50: #define ERR_ACCESS_DENIED               38
                     51: 
                     52: #define MIN_VOLUME_SIZE                 19456
                     53: #define MAX_VOLUME_SIZE                 0x7fffFFFFffffFFFFI64
                     54: 
                     55: #define burn(mem,size) \
                     56:        memset(mem,0xff,size); \
                     57:        memset(mem,0,size);
                     58: 
                     59: #define WIDE(x) (LPWSTR)L##x
                     60: 
                     61: #include <string.h>
                     62: 
                     63: #pragma intrinsic(memcmp, memcpy, memset, strcat, strcmp, strcpy, strlen)
                     64: 
                     65: #ifdef NT4_DRIVER
                     66: 
                     67: #pragma warning( disable : 4201 )
                     68: #pragma warning( disable : 4214 )
                     69: #pragma warning( disable : 4115 )
                     70: #pragma warning( disable : 4100 )
                     71: #pragma warning( disable : 4101 )
                     72: #pragma warning( disable : 4057 )
                     73: #pragma warning( disable : 4244 )
                     74: #pragma warning( disable : 4514 )
                     75: #pragma warning( disable : 4127 )
                     76: 
                     77: 
                     78: #include <ntddk.h>             /* Standard header file for nt drivers */
                     79: #undef _WIN32_WINNT
                     80: #define        _WIN32_WINNT 0x0501
                     81: #include <ntdddisk.h>          /* Standard I/O control codes  */
                     82: #include <ntiologc.h>
                     83: 
                     84: #pragma warning( default : 4201 )
                     85: #pragma warning( default : 4214 )
                     86: #pragma warning( default : 4115 )
                     87: #pragma warning( default : 4100 )
                     88: #pragma warning( default : 4101 )
                     89: #pragma warning( default : 4057 )
                     90: #pragma warning( default : 4244 )
                     91: #pragma warning( default : 4127 )
                     92: 
                     93: /* #pragma warning( default : 4514 ) this warning remains disabled */
                     94: 
                     95: #define TCalloc(size) ((void *) ExAllocatePoolWithTag( NonPagedPool, size, 'MMCT' ))
                     96: #define TCfree(memblock) ExFreePoolWithTag( memblock, 'MMCT' )
                     97: 
                     98: #define DEVICE_DRIVER
                     99: 
                    100: #endif                         /* NT4_DRIVER */
                    101: 
                    102: 
                    103: #ifdef WIN9X_DRIVER
                    104: 
                    105: #pragma warning( disable : 4047 )
                    106: 
                    107: #include "iosdcls.inc"         /* VMM and IOS headers */
                    108: 
                    109: #pragma warning( default : 4047 )
                    110: 
                    111: #include <vwin32.h>
                    112: #include <winerror.h>
                    113: #undef WANTVDXWRAPS
                    114: #pragma warning( disable : 4229 )
                    115: #include <shell.h>
                    116: #pragma warning( default : 4229 )
                    117: #pragma hdrstop
                    118: #include <malloc.h>
                    119: #include <vmm.h>
                    120: #include "ifs.h"
                    121: #include <dbt.h>
                    122: #define MBYTE16 3967
                    123: #define UWORD unsigned short
                    124: #define UBYTE unsigned char
                    125: 
                    126: #define MBYTE16 3967
                    127: 
                    128: #define TCalloc(size) _PageAllocate(size % 4096 ? (size/4096)+1 : size/4096,\
                    129:        PG_SYS,0,0,0,MBYTE16,NULL,PAGEZEROINIT|PAGEFIXED|PAGECONTIG|PAGEUSEALIGN);
                    130: 
                    131: #define TCfree(memblock) _PageFree(memblock,0)
                    132: 
                    133: #define DEVICE_DRIVER
                    134: 
                    135: #endif                         /* WIN9X_DRIVER */
                    136: 
                    137: #ifdef DEVICE_DRIVER
                    138: 
                    139: #ifndef BOOL
                    140: typedef int BOOL;
                    141: #endif
                    142: 
                    143: #ifndef TRUE
                    144: #define TRUE 1
                    145: #endif
                    146: 
                    147: #ifndef FALSE
                    148: #define FALSE !TRUE
                    149: #endif
                    150: 
                    151: /* Define dummies for the drivers */
                    152: typedef int HFILE;
                    153: typedef unsigned int WPARAM;
                    154: typedef unsigned long LPARAM;
                    155: #define CALLBACK
                    156: 
                    157: #ifndef UINT
                    158: typedef unsigned int UINT;
                    159: #endif
                    160: 
                    161: #ifndef LRESULT
                    162: typedef unsigned long LRESULT;
                    163: #endif
                    164: 
                    165: #else
                    166: 
                    167: #define TCalloc malloc
                    168: #define TCfree free
                    169: 
                    170: #pragma warning( disable : 4201 )
                    171: #pragma warning( disable : 4214 )
                    172: #pragma warning( disable : 4115 )
                    173: #pragma warning( disable : 4514 )
                    174: 
                    175: #undef _WIN32_WINNT
                    176: #define        _WIN32_WINNT 0x0501
                    177: #include <windows.h>           /* Windows header */
                    178: #include <commctrl.h>          /* The common controls */
                    179: #include <process.h>           /* Process control */
                    180: #include <winioctl.h>
                    181: #include <stdio.h>             /* For sprintf */
                    182: 
                    183: #pragma warning( default : 4201 )
                    184: #pragma warning( default : 4214 )
                    185: #pragma warning( default : 4115 )
                    186: 
                    187: /* #pragma warning( default : 4514 ) this warning remains disabled */
                    188: 
                    189: /* This is needed to fix a bug with VC 5, the TCHAR macro _ttoi64 maps
                    190:    incorrectly to atoi64 when it should be _atoi64 */
                    191: #define atoi64 _atoi64
                    192: 
                    193: #endif                         /* DEVICE_DRIVER */
                    194: 
                    195: typedef UINT (_stdcall * diskio_f) (int, void *, UINT);
                    196: 
                    197: #pragma hdrstop

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.