Skip to content

Commit

Permalink
TrueCrypt Source Version 7.1a
Browse files Browse the repository at this point in the history
  • Loading branch information
Truecrypt Foundation authored and FreeApophis committed May 29, 2014
1 parent df05a91 commit 253990a
Show file tree
Hide file tree
Showing 32 changed files with 419 additions and 415 deletions.
2 changes: 1 addition & 1 deletion Boot/Windows/BootCommon.h
Expand Up @@ -32,7 +32,7 @@
#define TC_MBR_SECTOR 0
#define TC_MAX_MBR_BOOT_CODE_SIZE 440

#define TC_MAX_EXTRA_BOOT_PARTITION_SIZE (256UL * 1024UL * 1024UL)
#define TC_MAX_EXTRA_BOOT_PARTITION_SIZE (512UL * 1024UL * 1024UL)


#pragma pack (1)
Expand Down
7 changes: 5 additions & 2 deletions Boot/Windows/BootConfig.cpp
@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Copyright (c) 2008-2012 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
Expand Down Expand Up @@ -56,8 +56,11 @@ void ReadBootSectorUserConfiguration ()
if (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE)
{
if (CustomUserMessage[0])
{
InitVideoMode();
Print (CustomUserMessage);

}

DisableScreenOutput();
}

Expand Down
4 changes: 2 additions & 2 deletions Boot/Windows/BootDiskIo.cpp
Expand Up @@ -401,7 +401,7 @@ BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t par
continue;

partition.Drive = drive;
partition.Number = partitionNumber;
partition.Number = partitionArrayPos;

if (partEntry.Type == 0x5 || partEntry.Type == 0xf) // Extended partition
{
Expand All @@ -422,7 +422,7 @@ BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t par
PartitionEntryMBRToPartition (extMbr->Partitions[0], logPart);
logPart.Drive = drive;

logPart.Number = partitionNumber++;
logPart.Number = partitionArrayPos;
logPart.Primary = false;

logPart.StartSector.LowPart += extStartLBA.LowPart;
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/IntFilter.cpp
Expand Up @@ -290,7 +290,7 @@ static bool CreateNewBiosMemoryMap ()
++overSize;
}

PrintErrorNoEndl ("MMAP: ");
PrintErrorNoEndl ("MMP:");
Print (overSize);
PrintEndl();

Expand Down
17 changes: 12 additions & 5 deletions Common/DLGCODE.C
Expand Up @@ -4,7 +4,7 @@
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
Agreement for Encryption for the Masses'. Modifications and additions to
the original source code (contained in this file) and all other portions
of this file are Copyright (c) 2003-2010 TrueCrypt Developers Association
of this file are Copyright (c) 2003-2012 TrueCrypt Developers Association
and are governed by the TrueCrypt License 3.0 the full text of which is
contained in the file License.txt included in TrueCrypt binary and source
code distribution packages. */
Expand Down Expand Up @@ -915,13 +915,13 @@ BOOL CALLBACK AboutDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
"Paulo Barreto, Brian Gladman, Wei Dai, Peter Gutmann, and many others.\r\n\r\n"

"Portions of this software:\r\n"
"Copyright \xA9 2003-2011 TrueCrypt Developers Association. All Rights Reserved.\r\n"
"Copyright \xA9 2003-2012 TrueCrypt Developers Association. All Rights Reserved.\r\n"
"Copyright \xA9 1998-2000 Paul Le Roux. All Rights Reserved.\r\n"
"Copyright \xA9 1998-2008 Brian Gladman. All Rights Reserved.\r\n"
"Copyright \xA9 2002-2004 Mark Adler. All Rights Reserved.\r\n\r\n"

"This software as a whole:\r\n"
"Copyright \xA9 2011 TrueCrypt Developers Association. All rights reserved.\r\n\r\n"
"Copyright \xA9 2012 TrueCrypt Developers Association. All rights reserved.\r\n\r\n"

"A TrueCrypt Foundation Release");

Expand Down Expand Up @@ -3183,7 +3183,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
BOOL DoDriverInstall (HWND hwndDlg)
{
#ifdef SETUP
if (SystemEncryptionUpgrade)
if (SystemEncryptionUpdate)
return TRUE;
#endif

Expand Down Expand Up @@ -6206,7 +6206,7 @@ retry:
wchar_t mountPoint[] = { L'A' + (wchar_t) driveNo, L':', 0 };
wsprintfW (msg, GetString ("MOUNTED_VOLUME_DIRTY"), mountPoint);

if (AskWarnYesNoString (msg) == IDYES)
if (AskWarnYesNoStringTopmost (msg) == IDYES)
CheckFilesystem (driveNo, TRUE);
}

Expand Down Expand Up @@ -7776,6 +7776,13 @@ int AskWarnYesNoTopmost (char *stringId)
}


int AskWarnYesNoStringTopmost (const wchar_t *string)
{
if (Silent) return IDNO;
return MessageBoxW (MainDlg, string, lpszTitle, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON1 | MB_SETFOREGROUND | MB_TOPMOST);
}


int AskWarnNoYes (char *stringId)
{
if (Silent) return IDNO;
Expand Down
1 change: 1 addition & 0 deletions Common/DLGCODE.H
Expand Up @@ -395,6 +395,7 @@ int AskOkCancel (char *stringId);
int AskWarnYesNo (char *stringId);
int AskWarnYesNoString (const wchar_t *string);
int AskWarnYesNoTopmost (char *stringId);
int AskWarnYesNoStringTopmost (const wchar_t *string);
int AskWarnNoYes (char *stringId);
int AskWarnNoYesString (const wchar_t *string);
int AskWarnNoYesTopmost (char *stringId);
Expand Down
26 changes: 10 additions & 16 deletions Common/Language.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Common/TCDEFS.H
Expand Up @@ -15,15 +15,15 @@
#define TC_APP_NAME "TrueCrypt"

// Version displayed to user
#define VERSION_STRING "7.1"
#define VERSION_STRING "7.1a"

// Version number to compare against driver
#define VERSION_NUM 0x0710
#define VERSION_NUM 0x071a

// Release date
#define TC_STR_RELEASE_DATE "September 1, 2011"
#define TC_RELEASE_DATE_YEAR 2011
#define TC_RELEASE_DATE_MONTH 9
#define TC_STR_RELEASE_DATE "February 7, 2012"
#define TC_RELEASE_DATE_YEAR 2012
#define TC_RELEASE_DATE_MONTH 2

#define BYTES_PER_KB 1024LL
#define BYTES_PER_MB 1048576LL
Expand Down
Binary file added Common/TrueCrypt_mounted.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions Driver/DriveFilter.c
@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
Copyright (c) 2008-2012 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
Expand Down Expand Up @@ -673,7 +673,7 @@ static NTSTATUS DispatchPower (PDEVICE_OBJECT DeviceObject, PIRP Irp, DriveFilte
&& irpSp->MinorFunction == IRP_MN_SET_POWER
&& irpSp->Parameters.Power.ShutdownType == PowerActionHibernate)
{
AbortBootEncryptionSetup();
while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_ABORT_BOOT_ENCRYPTION_SETUP, NULL, 0, NULL, 0) == STATUS_INSUFFICIENT_RESOURCES);
}

#if 0 // Dismount of the system drive is disabled until there is a way to do it without causing system errors (see the documentation for more info)
Expand Down
8 changes: 4 additions & 4 deletions Driver/Driver.rc
Expand Up @@ -27,8 +27,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 7,1,0,0
PRODUCTVERSION 7,1,0,0
FILEVERSION 7,1,1,0
PRODUCTVERSION 7,1,1,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -45,11 +45,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "TrueCrypt Foundation"
VALUE "FileDescription", "TrueCrypt Driver"
VALUE "FileVersion", "7.1"
VALUE "FileVersion", "7.1a"
VALUE "LegalTrademarks", "TrueCrypt"
VALUE "OriginalFilename", "truecrypt.sys"
VALUE "ProductName", "TrueCrypt"
VALUE "ProductVersion", "7.1"
VALUE "ProductVersion", "7.1a"
END
END
BLOCK "VarFileInfo"
Expand Down
55 changes: 49 additions & 6 deletions Driver/NTDRIVER.C
Expand Up @@ -4,7 +4,7 @@
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
Agreement for Encryption for the Masses'. Modifications and additions to
the original source code (contained in this file) and all other portions
of this file are Copyright (c) 2003-2011 TrueCrypt Developers Association
of this file are Copyright (c) 2003-2012 TrueCrypt Developers Association
and are governed by the TrueCrypt License 3.0 the full text of which is
contained in the file License.txt included in TrueCrypt binary and source
code distribution packages. */
Expand Down Expand Up @@ -257,10 +257,10 @@ NTSTATUS TCDispatchQueueIRP (PDEVICE_OBJECT DeviceObject, PIRP Irp)
DriverShuttingDown = TRUE;

if (EncryptionSetupThread)
AbortBootEncryptionSetup();
while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_ABORT_BOOT_ENCRYPTION_SETUP, NULL, 0, NULL, 0) == STATUS_INSUFFICIENT_RESOURCES);

if (DecoySystemWipeThread)
AbortDecoySystemWipe();
while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_ABORT_DECOY_SYSTEM_WIPE, NULL, 0, NULL, 0) == STATUS_INSUFFICIENT_RESOURCES);

OnShutdownPending();
}
Expand Down Expand Up @@ -2105,8 +2105,14 @@ VOID TCUnloadDriver (PDRIVER_OBJECT DriverObject)

void OnShutdownPending ()
{
UnmountAllDevices (NULL, TRUE);
WipeCache ();
UNMOUNT_STRUCT unmount;
memset (&unmount, 0, sizeof (unmount));
unmount.ignoreOpenFiles = TRUE;

while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_DISMOUNT_ALL_VOLUMES, &unmount, sizeof (unmount), &unmount, sizeof (unmount)) == STATUS_INSUFFICIENT_RESOURCES || unmount.HiddenVolumeProtectionTriggered)
unmount.HiddenVolumeProtectionTriggered = FALSE;

while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_WIPE_PASSWORD_CACHE, NULL, 0, NULL, 0) == STATUS_INSUFFICIENT_RESOURCES);
}


Expand Down Expand Up @@ -2158,14 +2164,51 @@ ret:
}


typedef struct
{
PDEVICE_OBJECT deviceObject; ULONG ioControlCode; void *inputBuffer; int inputBufferSize; void *outputBuffer; int outputBufferSize;
NTSTATUS Status;
KEVENT WorkItemCompletedEvent;
} SendDeviceIoControlRequestWorkItemArgs;


static VOID SendDeviceIoControlRequestWorkItemRoutine (PDEVICE_OBJECT rootDeviceObject, SendDeviceIoControlRequestWorkItemArgs *arg)
{
arg->Status = SendDeviceIoControlRequest (arg->deviceObject, arg->ioControlCode, arg->inputBuffer, arg->inputBufferSize, arg->outputBuffer, arg->outputBufferSize);
KeSetEvent (&arg->WorkItemCompletedEvent, IO_NO_INCREMENT, FALSE);
}


NTSTATUS SendDeviceIoControlRequest (PDEVICE_OBJECT deviceObject, ULONG ioControlCode, void *inputBuffer, int inputBufferSize, void *outputBuffer, int outputBufferSize)
{
IO_STATUS_BLOCK ioStatusBlock;
NTSTATUS status;
PIRP irp;
KEVENT event;

ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
if (KeGetCurrentIrql() > APC_LEVEL)
{
SendDeviceIoControlRequestWorkItemArgs args;

PIO_WORKITEM workItem = IoAllocateWorkItem (RootDeviceObject);
if (!workItem)
return STATUS_INSUFFICIENT_RESOURCES;

args.deviceObject = deviceObject;
args.ioControlCode = ioControlCode;
args.inputBuffer = inputBuffer;
args.inputBufferSize = inputBufferSize;
args.outputBuffer = outputBuffer;
args.outputBufferSize = outputBufferSize;

KeInitializeEvent (&args.WorkItemCompletedEvent, SynchronizationEvent, FALSE);
IoQueueWorkItem (workItem, SendDeviceIoControlRequestWorkItemRoutine, DelayedWorkQueue, &args);

KeWaitForSingleObject (&args.WorkItemCompletedEvent, Executive, KernelMode, FALSE, NULL);
IoFreeWorkItem (workItem);

return args.Status;
}

KeInitializeEvent (&event, NotificationEvent, FALSE);

Expand Down
1 change: 1 addition & 0 deletions Driver/NTDRIVER.H
Expand Up @@ -96,6 +96,7 @@ typedef enum


extern PDRIVER_OBJECT TCDriverObject;
extern PDEVICE_OBJECT RootDeviceObject;
extern BOOL DriverShuttingDown;
extern ULONG OsMajorVersion;
extern ULONG OsMinorVersion;
Expand Down
8 changes: 4 additions & 4 deletions Format/Format.rc
Expand Up @@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 7,1,0,0
PRODUCTVERSION 7,1,0,0
FILEVERSION 7,1,1,0
PRODUCTVERSION 7,1,1,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -46,11 +46,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "TrueCrypt Foundation"
VALUE "FileDescription", "TrueCrypt Format"
VALUE "FileVersion", "7.1"
VALUE "FileVersion", "7.1a"
VALUE "LegalTrademarks", "TrueCrypt"
VALUE "OriginalFilename", "TrueCrypt Format.exe"
VALUE "ProductName", "TrueCrypt"
VALUE "ProductVersion", "7.1"
VALUE "ProductVersion", "7.1a"
END
END
BLOCK "VarFileInfo"
Expand Down
22 changes: 22 additions & 0 deletions Format/TCFORMAT.C
Expand Up @@ -1629,6 +1629,9 @@ static void SysEncResume (void)

if (locBootEncStatus.SetupInProgress)
{
// Prevent the OS from entering Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS | ES_SYSTEM_REQUIRED);

bSystemEncryptionInProgress = TRUE;
UpdateSysEncControls ();
SetTimer (MainDlg, TIMER_ID_SYSENC_PROGRESS, TIMER_INTERVAL_SYSENC_PROGRESS, NULL);
Expand Down Expand Up @@ -1667,11 +1670,17 @@ static void SysEncResume (void)

if (!bSystemEncryptionInProgress)
{
// Allow the OS to enter Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS);

EnableWindow (GetDlgItem (hCurPage, IDC_PAUSE), TRUE);
Error ("FAILED_TO_RESUME_SYSTEM_ENCRYPTION");
return;
}

// Prevent the OS from entering Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS | ES_SYSTEM_REQUIRED);

bFirstSysEncResumeDone = TRUE;
InitSysEncProgressBar ();
UpdateSysEncProgressBar ();
Expand Down Expand Up @@ -2324,6 +2333,9 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
}
}

// Prevent the OS from entering Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS | ES_SYSTEM_REQUIRED);

bHidden = bHiddenVol && !bHiddenVolHost;

volParams->bDevice = bDevice;
Expand Down Expand Up @@ -2377,6 +2389,9 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
nStatus = TCFormatVolume (volParams);
}

// Allow the OS to enter Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS);

if (nStatus == ERR_OUTOFMEMORY)
{
AbortProcess ("OUTOFMEMORY");
Expand Down Expand Up @@ -2532,6 +2547,7 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
}

cancel:

LastDialogId = (bInPlaceEncNonSys ? "NONSYS_INPLACE_ENC_CANCELED" : "FORMAT_CANCELED");

if (!bInPlaceEncNonSys)
Expand All @@ -2548,6 +2564,9 @@ cancel:
bVolTransformThreadRunning = FALSE;
bVolTransformThreadCancel = FALSE;

// Allow the OS to enter Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS);

PostMessage (hwndDlg, TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED, 0, 0);

if (bHiddenVolHost && hiddenVolHostDriveNo < -1 && !bVolTransformThreadCancel) // If hidden volume host could not be mounted
Expand Down Expand Up @@ -5520,6 +5539,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
// The driver stopped encrypting/decrypting

// Allow the OS to enter Sleep mode when idle
SetThreadExecutionState (ES_CONTINUOUS);

KillTimer (hwndDlg, TIMER_ID_SYSENC_PROGRESS);

try
Expand Down

0 comments on commit 253990a

Please sign in to comment.