VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-12-11 23:26:45 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-12-11 23:42:08 +0100
commitb48d437c80f8011548383a2e1ae88649a030c1ae (patch)
tree8de0d72b96937eb166524d0e28335689359717e4
parentc44127fe3bbecbd5df38a77efe899b8e98d2b4b3 (diff)
downloadVeraCrypt-b48d437c80f8011548383a2e1ae88649a030c1ae.tar.gz
VeraCrypt-b48d437c80f8011548383a2e1ae88649a030c1ae.zip
Windows Driver: Fix build error using Windows 10 WDK caused by name conflict for KeSaveExtendedProcessorState/KeRestoreExtendedProcessorState functions
-rw-r--r--src/Common/Pkcs5.c16
-rw-r--r--src/Common/Tcdefs.h4
-rw-r--r--src/Crypto/Camellia.c8
-rw-r--r--src/Driver/DriveFilter.c4
-rw-r--r--src/Driver/Ntdriver.c4
5 files changed, 18 insertions, 18 deletions
diff --git a/src/Common/Pkcs5.c b/src/Common/Pkcs5.c
index 93e748a1..3c0c6a97 100644
--- a/src/Common/Pkcs5.c
+++ b/src/Common/Pkcs5.c
@@ -91,9 +91,9 @@ void hmac_sha256
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
if (g_isIntel && HasSAVX())
- saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
+ saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
if (HasSSE2())
saveStatus = KeSaveFloatingPointState (&floatingPointState);
@@ -142,9 +142,9 @@ void hmac_sha256
#if defined (DEVICE_DRIVER)
if (NT_SUCCESS (saveStatus))
#ifdef _WIN64
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
#else
KeRestoreFloatingPointState (&floatingPointState);
#endif
#endif
@@ -218,9 +218,9 @@ void derive_key_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
if (g_isIntel && HasSAVX())
- saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
+ saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
if (HasSSE2())
saveStatus = KeSaveFloatingPointState (&floatingPointState);
@@ -291,9 +291,9 @@ void derive_key_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
#if defined (DEVICE_DRIVER)
if (NT_SUCCESS (saveStatus))
#ifdef _WIN64
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
#else
KeRestoreFloatingPointState (&floatingPointState);
#endif
#endif
@@ -361,9 +361,9 @@ void hmac_sha512
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
if (g_isIntel && HasSAVX())
- saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
+ saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
if (HasSSSE3() && HasMMX())
saveStatus = KeSaveFloatingPointState (&floatingPointState);
@@ -413,9 +413,9 @@ void hmac_sha512
#if defined (DEVICE_DRIVER)
if (NT_SUCCESS (saveStatus))
#ifdef _WIN64
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
#else
KeRestoreFloatingPointState (&floatingPointState);
#endif
#endif
@@ -463,9 +463,9 @@ void derive_key_sha512 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
if (g_isIntel && HasSAVX())
- saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
+ saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
if (HasSSSE3() && HasMMX())
saveStatus = KeSaveFloatingPointState (&floatingPointState);
@@ -536,9 +536,9 @@ void derive_key_sha512 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
#if defined (DEVICE_DRIVER)
if (NT_SUCCESS (saveStatus))
#ifdef _WIN64
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
#else
KeRestoreFloatingPointState (&floatingPointState);
#endif
#endif
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h
index e3ed65fa..95aaf153 100644
--- a/src/Common/Tcdefs.h
+++ b/src/Common/Tcdefs.h
@@ -309,15 +309,15 @@ typedef USHORT (NTAPI *KeQueryActiveGroupCountFn)();
typedef ULONG (NTAPI *KeQueryActiveProcessorCountExFn)(
USHORT GroupNumber
);
-extern NTSTATUS NTAPI KeSaveExtendedProcessorState (
+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);
diff --git a/src/Crypto/Camellia.c b/src/Crypto/Camellia.c
index b3a35784..f4fde8aa 100644
--- a/src/Crypto/Camellia.c
+++ b/src/Crypto/Camellia.c
@@ -1099,9 +1099,9 @@ void camellia_encrypt_blocks(unsigned __int8 *instance, const byte* in_blk, byte
if ((blockCount >= 16) && IsCpuIntel() && IsAesHwCpuSupported () && HasSAVX()) /* on AMD cpu, AVX is too slow */
{
#if defined (TC_WINDOWS_DRIVER)
XSTATE_SAVE SaveState;
- if (NT_SUCCESS (KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState)))
+ if (NT_SUCCESS (KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState)))
{
#endif
while (blockCount >= 16)
{
@@ -1110,9 +1110,9 @@ void camellia_encrypt_blocks(unsigned __int8 *instance, const byte* in_blk, byte
in_blk += 16 * 16;
blockCount -= 16;
}
#if defined (TC_WINDOWS_DRIVER)
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
}
#endif
}
#endif
@@ -1135,9 +1135,9 @@ void camellia_decrypt_blocks(unsigned __int8 *instance, const byte* in_blk, byte
if ((blockCount >= 16) && IsCpuIntel() && IsAesHwCpuSupported () && HasSAVX()) /* on AMD cpu, AVX is too slow */
{
#if defined (TC_WINDOWS_DRIVER)
XSTATE_SAVE SaveState;
- if (NT_SUCCESS (KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState)))
+ if (NT_SUCCESS (KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState)))
{
#endif
while (blockCount >= 16)
{
@@ -1146,9 +1146,9 @@ void camellia_decrypt_blocks(unsigned __int8 *instance, const byte* in_blk, byte
in_blk += 16 * 16;
blockCount -= 16;
}
#if defined (TC_WINDOWS_DRIVER)
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
}
#endif
}
#endif
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c
index f89e6e9a..a12b1ec0 100644
--- a/src/Driver/DriveFilter.c
+++ b/src/Driver/DriveFilter.c
@@ -362,9 +362,9 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
if (g_isIntel && HasSAVX())
- saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
+ saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
if (HasISSE() || (HasSSSE3() && HasMMX()))
saveStatus = KeSaveFloatingPointState (&floatingPointState);
@@ -404,9 +404,9 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
}
if (NT_SUCCESS (saveStatus))
#ifdef _WIN64
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
#else
KeRestoreFloatingPointState (&floatingPointState);
#endif
}
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 957853cd..a05335f2 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -4939,9 +4939,9 @@ BOOL IsOSAtLeast (OSVersionEnum reqMinOS)
return ((OsMajorVersion << 16 | OsMinorVersion << 8)
>= (major << 16 | minor << 8));
}
-NTSTATUS NTAPI KeSaveExtendedProcessorState (
+NTSTATUS NTAPI KeSaveExtendedProcessorStateVC (
__in ULONG64 Mask,
PXSTATE_SAVE XStateSave
)
{
@@ -4954,9 +4954,9 @@ NTSTATUS NTAPI KeSaveExtendedProcessorState (
return STATUS_SUCCESS;
}
}
-VOID NTAPI KeRestoreExtendedProcessorState (
+VOID NTAPI KeRestoreExtendedProcessorStateVC (
PXSTATE_SAVE XStateSave
)
{
if (KeRestoreExtendedProcessorStatePtr)