VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Common/Tcdefs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h
index f88ff582..e7eee177 100644
--- a/src/Common/Tcdefs.h
+++ b/src/Common/Tcdefs.h
@@ -213,60 +213,63 @@ typedef int LONG;
#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
// #define rotr32(x,n) (((x) >> n) | ((x) << (32 - n)))
// #define rotl32(x,n) (((x) << n) | ((x) >> (32 - n)))
// #define rotr64(x,n) (((x) >> n) | ((x) << (64 - n)))
// #define rotl64(x,n) (((x) << n) | ((x) >> (64 - n)))
// #define bswap_32(x) (rotl32((((x) & 0xFF00FF00) >> 8) | (((x) & 0x00FF00FF) << 8), 16U))
// #define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U)
#endif
#ifdef TC_WINDOWS_BOOT
# ifdef __cplusplus
extern "C"
# endif
void ThrowFatalException (int line);
# define TC_THROW_FATAL_EXCEPTION ThrowFatalException (__LINE__)
#elif defined (TC_WINDOWS_DRIVER)
# define TC_THROW_FATAL_EXCEPTION KeBugCheckEx (SECURITY_SYSTEM, __LINE__, 0, 0, 'VC')
#elif defined(_UEFI)
void ThrowFatalException(int line);
# define TC_THROW_FATAL_EXCEPTION ThrowFatalException (__LINE__)
#elif (defined(__clang__) && __has_builtin(__builtin_trap)) \
|| (defined(__GNUC__ ) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) \
|| (__has_builtin(__builtin_trap))
# define TC_THROW_FATAL_EXCEPTION __builtin_trap()
+#elif defined(_MSC_VER)
+#include <intrin.h>
+# define TC_THROW_FATAL_EXCEPTION __fastfail(FAST_FAIL_FATAL_APP_EXIT)
#else
# define TC_THROW_FATAL_EXCEPTION *(char *) 0 = 0
#endif
#ifdef __COVERITY__
#undef TC_THROW_FATAL_EXCEPTION
#define TC_THROW_FATAL_EXCEPTION __coverity_panic__()
#endif
#ifdef TC_WINDOWS_DRIVER
#include <ntifs.h>
#include <ntddk.h> /* Standard header file for nt drivers */
#include <ntdddisk.h> /* Standard I/O control codes */
extern ULONG AllocTag;
#define TCalloc(size) ((void *) ExAllocatePool2( POOL_FLAG_NON_PAGED, size, AllocTag ))
#define TCfree(memblock) ExFreePoolWithTag( memblock, AllocTag )
#define DEVICE_DRIVER
#ifndef BOOL
typedef int BOOL;
#endif
#ifndef WORD
typedef USHORT WORD;
#endif