VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-27 23:05:47 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-28 01:06:14 +0200
commitb270a453aa53deed01675bc19f1cb14b05c703d1 (patch)
treed028912c6cb8f675fbd6866d5a2496105b7fad46 /src/Driver
parent61aec8a9a60337f7e3c93576893ca4085ed65b9d (diff)
downloadVeraCrypt-b270a453aa53deed01675bc19f1cb14b05c703d1.tar.gz
VeraCrypt-b270a453aa53deed01675bc19f1cb14b05c703d1.zip
Windows: remove unused code targeting Windows 2000.
Diffstat (limited to 'src/Driver')
-rw-r--r--src/Driver/Ntdriver.c32
-rw-r--r--src/Driver/Ntvol.c4
2 files changed, 13 insertions, 23 deletions
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 94a90bed..188c6647 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -3429,31 +3429,21 @@ void TCDeleteDeviceObject (PDEVICE_OBJECT DeviceObject, PEXTENSION Extension)
if (Extension->SecurityClientContextValid)
{
- if (OsMajorVersion == 5 && OsMinorVersion == 0)
- {
- ObDereferenceObject (Extension->SecurityClientContext.ClientToken);
- }
- else
- {
- // Windows 2000 does not support PsDereferenceImpersonationToken() used by SeDeleteClientSecurity().
- // TODO: Use only SeDeleteClientSecurity() once support for Windows 2000 is dropped.
-
- VOID (*PsDereferenceImpersonationTokenD) (PACCESS_TOKEN ImpersonationToken);
- UNICODE_STRING name;
- RtlInitUnicodeString (&name, L"PsDereferenceImpersonationToken");
+ VOID (*PsDereferenceImpersonationTokenD) (PACCESS_TOKEN ImpersonationToken);
+ UNICODE_STRING name;
+ RtlInitUnicodeString (&name, L"PsDereferenceImpersonationToken");
- PsDereferenceImpersonationTokenD = MmGetSystemRoutineAddress (&name);
- if (!PsDereferenceImpersonationTokenD)
- TC_BUG_CHECK (STATUS_NOT_IMPLEMENTED);
+ PsDereferenceImpersonationTokenD = MmGetSystemRoutineAddress (&name);
+ if (!PsDereferenceImpersonationTokenD)
+ TC_BUG_CHECK (STATUS_NOT_IMPLEMENTED);
-# define PsDereferencePrimaryToken
-# define PsDereferenceImpersonationToken PsDereferenceImpersonationTokenD
+# define PsDereferencePrimaryToken
+# define PsDereferenceImpersonationToken PsDereferenceImpersonationTokenD
- SeDeleteClientSecurity (&Extension->SecurityClientContext);
+ SeDeleteClientSecurity (&Extension->SecurityClientContext);
-# undef PsDereferencePrimaryToken
-# undef PsDereferenceImpersonationToken
- }
+# undef PsDereferencePrimaryToken
+# undef PsDereferenceImpersonationToken
}
VirtualVolumeDeviceObjects[Extension->nDosDriveNo] = NULL;
diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c
index e88105ca..f9e11d3d 100644
--- a/src/Driver/Ntvol.c
+++ b/src/Driver/Ntvol.c
@@ -55,7 +55,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
int volumeType;
char *readBuffer = 0;
NTSTATUS ntStatus = 0;
- BOOL forceAccessCheck = (!bRawDevice && !(OsMajorVersion == 5 &&OsMinorVersion == 0)); // Windows 2000 does not support OBJ_FORCE_ACCESS_CHECK attribute
+ BOOL forceAccessCheck = !bRawDevice;
BOOL disableBuffering = TRUE;
BOOL exclusiveAccess = mount->bExclusiveAccess;
@@ -224,7 +224,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
lDiskLength.QuadPart = pix.PartitionLength.QuadPart;
partitionStartingOffset = pix.StartingOffset.QuadPart;
}
- // Windows 2000 does not support IOCTL_DISK_GET_PARTITION_INFO_EX
+ // If IOCTL_DISK_GET_PARTITION_INFO_EX fails, switch to IOCTL_DISK_GET_PARTITION_INFO
else if (NT_SUCCESS (TCSendHostDeviceIoControlRequest (DeviceObject, Extension, IOCTL_DISK_GET_PARTITION_INFO, (char *) &pi, sizeof (pi))))
{
lDiskLength.QuadPart = pi.PartitionLength.QuadPart;