diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2020-06-27 23:05:47 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2020-06-28 01:06:14 +0200 |
commit | b270a453aa53deed01675bc19f1cb14b05c703d1 (patch) | |
tree | d028912c6cb8f675fbd6866d5a2496105b7fad46 /src | |
parent | 61aec8a9a60337f7e3c93576893ca4085ed65b9d (diff) | |
download | VeraCrypt-b270a453aa53deed01675bc19f1cb14b05c703d1.tar.gz VeraCrypt-b270a453aa53deed01675bc19f1cb14b05c703d1.zip |
Windows: remove unused code targeting Windows 2000.
Diffstat (limited to 'src')
-rw-r--r-- | src/Common/BootEncryption.cpp | 5 | ||||
-rw-r--r-- | src/Common/Dlgcode.c | 6 | ||||
-rw-r--r-- | src/Driver/Ntdriver.c | 32 | ||||
-rw-r--r-- | src/Driver/Ntvol.c | 4 | ||||
-rw-r--r-- | src/Format/Tcformat.c | 16 | ||||
-rw-r--r-- | src/Mount/Mount.c | 20 | ||||
-rw-r--r-- | src/Setup/Wizard.c | 16 |
7 files changed, 22 insertions, 77 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index e9566951..0a2afb12 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -5169,10 +5169,7 @@ namespace VeraCrypt #endif #ifndef SETUP void BootEncryption::CheckRequirements () - { - if (nCurrentOS == WIN_2000) - throw ErrorException ("SYS_ENCRYPTION_UNSUPPORTED_ON_CURRENT_OS", SRC_POS); - + { if (CurrentOSMajor == 6 && CurrentOSMinor == 0 && CurrentOSServicePack < 1) throw ErrorException ("SYS_ENCRYPTION_UNSUPPORTED_ON_VISTA_SP0", SRC_POS); diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index fc1cdc31..63a13083 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -10069,12 +10069,6 @@ wchar_t GetSystemDriveLetter (void) void TaskBarIconDisplayBalloonTooltip (HWND hwnd, wchar_t *headline, wchar_t *text, BOOL warning) { - if (nCurrentOS == WIN_2000) - { - MessageBoxW (MainDlg, text, headline, warning ? MB_ICONWARNING : MB_ICONINFORMATION); - return; - } - NOTIFYICONDATAW tnid; ZeroMemory (&tnid, sizeof (tnid)); 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; diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 7d9bbb69..dd999f0c 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -8523,13 +8523,7 @@ retryCDDriveCheck: if (fileSystem == FILESYS_NTFS || fileSystem == FILESYS_EXFAT) // The file system may have been changed in the previous block { - if (nCurrentOS == WIN_2000) - { - Error("HIDDEN_VOL_HOST_UNSUPPORTED_FILESYS_WIN2000", hwndDlg); - bVolTransformThreadToRun = FALSE; - return 1; - } - else if ((fileSystem == FILESYS_NTFS) && (GetVolumeDataAreaSize (FALSE, nVolumeSize) <= TC_MAX_FAT_SECTOR_COUNT * GetFormatSectorSize()) + if ((fileSystem == FILESYS_NTFS) && (GetVolumeDataAreaSize (FALSE, nVolumeSize) <= TC_MAX_FAT_SECTOR_COUNT * GetFormatSectorSize()) && AskYesNo("HIDDEN_VOL_HOST_NTFS_ASK", hwndDlg) == IDNO) { bVolTransformThreadToRun = FALSE; @@ -9714,12 +9708,6 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi // NTFS bool bIsNtfs = (0 == wcsncmp (szFileSystemNameBuffer, L"NTFS", 4)); - if (nCurrentOS == WIN_2000) - { - Error("HIDDEN_VOL_HOST_UNSUPPORTED_FILESYS_WIN2000", hwndDlg); - return 0; - } - if (bIsNtfs && bHiddenVolDirect && GetVolumeDataAreaSize (FALSE, hiddenVolHostSize) <= TC_MAX_FAT_SECTOR_COUNT * GetFormatSectorSize()) Info ("HIDDEN_VOL_HOST_NTFS", hwndDlg); @@ -9750,7 +9738,7 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi { // Unsupported file system - Error ((nCurrentOS == WIN_2000) ? "HIDDEN_VOL_HOST_UNSUPPORTED_FILESYS_WIN2000" : "HIDDEN_VOL_HOST_UNSUPPORTED_FILESYS", hwndDlg); + Error ("HIDDEN_VOL_HOST_UNSUPPORTED_FILESYS", hwndDlg); return 0; } diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 9dd5c479..e73859f5 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -5181,9 +5181,6 @@ static BOOL Dismount (HWND hwndDlg, int nDosDriveNo) if (bBeep) MessageBeep (0xFFFFFFFF); RefreshMainDlg (hwndDlg); - - if (nCurrentOS == WIN_2000 && RemoteSession && !IsAdmin ()) - LoadDriveLetters (hwndDlg, GetDlgItem (hwndDlg, IDC_DRIVELIST), 0); } NormalCursor (); @@ -5358,9 +5355,6 @@ retry: RefreshMainDlg (hwndDlg); - if (nCurrentOS == WIN_2000 && RemoteSession && !IsAdmin ()) - LoadDriveLetters (hwndDlg, GetDlgItem (hwndDlg, IDC_DRIVELIST), 0); - NormalCursor(); if (unmount.nReturnCode != 0) @@ -8692,12 +8686,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa WaitCursor (); - if (!(nCurrentOS == WIN_2000 && RemoteSession)) - { - BroadcastDeviceChange (DBT_DEVICEREMOVECOMPLETE, 0, ~driveMap); - Sleep (100); - BroadcastDeviceChange (DBT_DEVICEARRIVAL, 0, driveMap); - } + + BroadcastDeviceChange (DBT_DEVICEREMOVECOMPLETE, 0, ~driveMap); + Sleep (100); + BroadcastDeviceChange (DBT_DEVICEARRIVAL, 0, driveMap); LoadDriveLetters (hwndDlg, GetDlgItem (hwndDlg, IDC_DRIVELIST), 0); @@ -9826,7 +9818,7 @@ BOOL TaskBarIconAdd (HWND hwnd) ScreenDPI >= 120 ? 0 : 16, (ScreenDPI >= 120 ? LR_DEFAULTSIZE : 0) | LR_SHARED - | (nCurrentOS != WIN_2000 ? LR_DEFAULTCOLOR : LR_VGACOLOR)); // Windows 2000 cannot display more than 16 fixed colors in notification tray + | LR_DEFAULTCOLOR); StringCbCopyW (tnid.szTip, sizeof(tnid.szTip), L"VeraCrypt"); @@ -9878,7 +9870,7 @@ BOOL TaskBarIconChange (HWND hwnd, int iconId) ScreenDPI >= 120 ? 0 : 16, (ScreenDPI >= 120 ? LR_DEFAULTSIZE : 0) | LR_SHARED - | (nCurrentOS != WIN_2000 ? LR_DEFAULTCOLOR : LR_VGACOLOR)); // Windows 2000 cannot display more than 16 fixed colors in notification tray + | LR_DEFAULTCOLOR : LR_VGACOLOR); return Shell_NotifyIcon (NIM_MODIFY, &tnid); } diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c index a497d4e0..1021e8bc 100644 --- a/src/Setup/Wizard.c +++ b/src/Setup/Wizard.c @@ -915,22 +915,6 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa } bLicenseAccepted = TRUE; EnableWindow (GetDlgItem (hwndDlg, IDHELP), TRUE); - - if (nCurrentOS == WIN_2000) - { - WarningDirect (L"Warning: Please note that this may be the last version of VeraCrypt that supports Windows 2000. If you want to be able to upgrade to future versions of VeraCrypt (which is highly recommended), you will need to upgrade to Windows XP or a later version of Windows.\n\nNote: Microsoft stopped issuing security updates for Windows 2000 to the general public on 7/13/2010 (the last non-security update for Windows 2000 was issued to the general public in 2005).", hwndDlg); - - - HKEY hkey; - - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Updates\\Windows 2000\\SP5\\Update Rollup 1", 0, KEY_READ, &hkey) != ERROR_SUCCESS) - { - ErrorDirect (L"VeraCrypt requires Update Rollup 1 for Windows 2000 SP4 to be installed.\n\nFor more information, see http://support.microsoft.com/kb/891861", hwndDlg); - AbortProcessSilent (); - } - - RegCloseKey (hkey); - } } #ifndef PORTABLE else if (nCurPageNo == WIZARD_MODE_PAGE) |