diff options
Diffstat (limited to 'src/Common/Tcdefs.h')
-rw-r--r-- | src/Common/Tcdefs.h | 95 |
1 files changed, 79 insertions, 16 deletions
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h index 050c1018..1118e522 100644 --- a/src/Common/Tcdefs.h +++ b/src/Common/Tcdefs.h @@ -52,18 +52,30 @@ extern unsigned short _rotl16(unsigned short value, unsigned char shift); #endif // defined(_UEFI) +#ifdef TC_WINDOWS_BOOT +#include <stddef.h> +#endif + #define TC_APP_NAME "VeraCrypt" // Version displayed to user -#define VERSION_STRING "1.22-BETA4" +#define VERSION_STRING "1.26.10" + +#ifdef VC_EFI_CUSTOM_MODE +#define VERSION_STRING_SUFFIX "-CustomEFI" +#elif defined(VC_SKIP_OS_DRIVER_REQ_CHECK) +#define VERSION_STRING_SUFFIX "-TESTSIGNING" +#else +#define VERSION_STRING_SUFFIX "" +#endif // Version number to compare against driver -#define VERSION_NUM 0x0122 +#define VERSION_NUM 0x0126 // Release date -#define TC_STR_RELEASE_DATE L"December 8, 2017" -#define TC_RELEASE_DATE_YEAR 2017 -#define TC_RELEASE_DATE_MONTH 12 +#define TC_STR_RELEASE_DATE L"November 8, 2023" +#define TC_RELEASE_DATE_YEAR 2023 +#define TC_RELEASE_DATE_MONTH 11 #define BYTES_PER_KB 1024LL #define BYTES_PER_MB 1048576LL @@ -84,6 +96,7 @@ typedef __int8 int8; typedef __int16 int16; typedef __int32 int32; typedef unsigned __int8 byte; +typedef unsigned __int8 uint8; typedef unsigned __int16 uint16; typedef unsigned __int32 uint32; @@ -110,6 +123,7 @@ typedef int16_t int16; typedef int32_t int32; typedef int64_t int64; typedef uint8_t byte; +typedef uint8_t uint8; typedef uint16_t uint16; typedef uint32_t uint32; typedef uint64_t uint64; @@ -174,10 +188,10 @@ typedef uint64 uint_64t; typedef CHAR16 wchar_t; typedef int LONG; -#define wcscpy StrCpy +#define StringCchCopyW StrCpyS #define wcslen StrLen #define wcscmp StrCmp -#define wcscat StrCat +#define StringCchCatW StrCatS #define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count)) #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch)) @@ -189,7 +203,7 @@ typedef int LONG; #define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch) #define strcmp AsciiStrCmp #define strncmp(string1,string2,count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count))) -#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource) +#define StringCchCopyA(strDest,strMaxSize,strSource) AsciiStrCpyS(strDest,strMaxSize,strSource) #define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count) #define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE)) #define strstr AsciiStrStr @@ -242,9 +256,14 @@ void ThrowFatalException(int line); /* variables used in the implementation of enhanced protection of NX pool under Windows 8 and later */ extern POOL_TYPE ExDefaultNonPagedPoolType; extern ULONG ExDefaultMdlProtection; +#ifdef _WIN64 +extern ULONG AllocTag; +#else +#define AllocTag 'MMCV' +#endif -#define TCalloc(size) ((void *) ExAllocatePoolWithTag( ExDefaultNonPagedPoolType, size, 'MMCV' )) -#define TCfree(memblock) ExFreePoolWithTag( memblock, 'MMCV' ) +#define TCalloc(size) ((void *) ExAllocatePoolWithTag( ExDefaultNonPagedPoolType, size, AllocTag )) +#define TCfree(memblock) ExFreePoolWithTag( memblock, AllocTag ) #define DEVICE_DRIVER @@ -252,6 +271,14 @@ extern ULONG ExDefaultMdlProtection; typedef int BOOL; #endif +#ifndef WORD +typedef USHORT WORD; +#endif + +#ifndef BOOLEAN +typedef unsigned char BOOLEAN; +#endif + #ifndef TRUE #define TRUE 1 #endif @@ -270,16 +297,44 @@ typedef VOID (NTAPI *KeRestoreExtendedProcessorStateFn) ( PXSTATE_SAVE XStateSave ); -extern NTSTATUS NTAPI KeSaveExtendedProcessorState ( +typedef NTSTATUS (NTAPI *ExGetFirmwareEnvironmentVariableFn) ( + PUNICODE_STRING VariableName, + LPGUID VendorGuid, + PVOID Value, + PULONG ValueLength, + PULONG Attributes +); + +typedef ULONG64 (NTAPI *KeQueryInterruptTimePreciseFn)( + PULONG64 QpcTimeStamp +); + +typedef BOOLEAN (NTAPI *KeAreAllApcsDisabledFn) (); + +typedef void (NTAPI *KeSetSystemGroupAffinityThreadFn)( + PGROUP_AFFINITY Affinity, + PGROUP_AFFINITY PreviousAffinity +); + +typedef USHORT (NTAPI *KeQueryActiveGroupCountFn)(); + +typedef ULONG (NTAPI *KeQueryActiveProcessorCountExFn)( + USHORT GroupNumber +); + +extern NTSTATUS NTAPI KeSaveExtendedProcessorStateVC ( __in ULONG64 Mask, PXSTATE_SAVE XStateSave ); -extern VOID NTAPI KeRestoreExtendedProcessorState ( +extern VOID NTAPI KeRestoreExtendedProcessorStateVC ( PXSTATE_SAVE XStateSave ); +extern BOOLEAN VC_KeAreAllApcsDisabled (VOID); + + #else /* !TC_WINDOWS_DRIVER */ #if !defined(_UEFI) #define TCalloc malloc @@ -293,7 +348,11 @@ extern VOID NTAPI KeRestoreExtendedProcessorState ( #ifndef TC_LOCAL_WIN32_WINNT_OVERRIDE # undef _WIN32_WINNT -# define _WIN32_WINNT 0x0501 /* Does not apply to the driver */ +#ifdef _M_ARM64 +# define _WIN32_WINNT 0x0A00 +#else +# define _WIN32_WINNT 0x0601 /* Does not apply to the driver */ +#endif #endif #include <windows.h> /* Windows header */ @@ -324,6 +383,9 @@ extern VOID NTAPI KeRestoreExtendedProcessorState ( # define Dump(...) # define DumpMem(...) # endif +#elif !defined (TC_WINDOWS_BOOT) +# define Dump(...) +# define DumpMem(...) #endif #if !defined (trace_msg) && !defined (TC_WINDOWS_BOOT) @@ -356,6 +418,8 @@ extern VOID NTAPI KeRestoreExtendedProcessorState ( #define burn(mem,size) do { volatile char *burnm = (volatile char *)(mem); int burnc = size; while (burnc--) *burnm++ = 0; } while (0) #endif +#define volatile_memcpy(d,s,size) do { volatile char *destm = (volatile char *)(d); volatile char *srcm = (volatile char *)(s); size_t memc = size; while (memc--) *destm++ = *srcm++; } while (0) + // The size of the memory area to wipe is in bytes amd it must be a multiple of 8. #ifndef TC_NO_COMPILER_INT64 # define FAST_ERASE64(mem,size) do { volatile uint64 *burnm = (volatile uint64 *)(mem); int burnc = size >> 3; while (burnc--) *burnm++ = 0; } while (0) @@ -431,9 +495,8 @@ enum ERR_SYS_HIDVOL_HEAD_REENC_MODE_WRONG = 31, ERR_NONSYS_INPLACE_ENC_INCOMPLETE = 32, ERR_USER_ABORT = 33, - ERR_UNSUPPORTED_TRUECRYPT_FORMAT = 34, - ERR_RAND_INIT_FAILED = 35, - ERR_CAPI_INIT_FAILED = 36 + ERR_RAND_INIT_FAILED = 34, + ERR_CAPI_INIT_FAILED = 35 }; #endif // #ifndef TCDEFS_H |