Guest User

TrueCrypt 7.1 vs 7.2

a guest
May 28th, 2014
2,531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 245.72 KB | None | 0 0
  1. diff -b -r tc-7.1/Boot/Windows/BootMain.cpp tc-7.2/Boot/Windows/BootMain.cpp
  2. 78c78,80
  3. <   PrintEndl (3);
  4. ---
  5. >   PrintEndl (2);
  6. >   Print ("WARNING: Using TrueCrypt is not secure");
  7. >   PrintEndl (2);
  8. 577,695d578
  9. < static bool CopySystemPartitionToHiddenVolume (byte drive, byte &exitKey)
  10. < {
  11. <   bool status = false;
  12. <
  13. <   uint64 sectorsRemaining;
  14. <   uint64 sectorOffset;
  15. <   sectorOffset.LowPart = 0;
  16. <   sectorOffset.HighPart = 0;
  17. <
  18. <   int fragmentSectorCount = 0x7f; // Maximum safe value supported by BIOS
  19. <   int statCount;
  20. <
  21. <   if (!CheckMemoryRequirements ())
  22. <       goto err;
  23. <
  24. <   if (!GetSystemPartitions (drive))
  25. <       goto err;
  26. <
  27. <   if (PartitionFollowingActive.Drive == TC_INVALID_BIOS_DRIVE)
  28. <       TC_THROW_FATAL_EXCEPTION;
  29. <
  30. <   // Check if BIOS can read the last sector of the hidden system
  31. <   AcquireSectorBuffer();
  32. <
  33. <   if (ReadSectors (SectorBuffer, PartitionFollowingActive.Drive, PartitionFollowingActive.EndSector - (TC_VOLUME_HEADER_GROUP_SIZE / TC_LB_SIZE - 2), 1) != BiosResultSuccess
  34. <       || GetCrc32 (SectorBuffer, sizeof (SectorBuffer)) != OuterVolumeBackupHeaderCrc)
  35. <   {
  36. <       PrintErrorNoEndl ("Your BIOS does not support large drives");
  37. <       Print (IsLbaSupported (PartitionFollowingActive.Drive) ? " due to a bug" : "\r\n- Enable LBA in BIOS");
  38. <       PrintEndl();
  39. <       Print (TC_BOOT_STR_UPGRADE_BIOS);
  40. <
  41. <       ReleaseSectorBuffer();
  42. <       goto err;
  43. <   }
  44. <
  45. <   ReleaseSectorBuffer();
  46. <
  47. <   if (!MountVolume (drive, exitKey, true, false))
  48. <       return false;
  49. <
  50. <   sectorsRemaining = EncryptedVirtualPartition.SectorCount;
  51. <
  52. <   if (!(sectorsRemaining == ActivePartition.SectorCount))
  53. <       TC_THROW_FATAL_EXCEPTION;
  54. <
  55. <   InitScreen();
  56. <   Print ("\r\nCopying system to hidden volume. To abort, press Esc.\r\n\r\n");
  57. <
  58. <   while (sectorsRemaining.HighPart != 0 || sectorsRemaining.LowPart != 0)
  59. <   {
  60. <       if (EscKeyPressed())
  61. <       {
  62. <           Print ("\rIf aborted, copying will have to start from the beginning (if attempted again).\r\n");
  63. <           if (AskYesNo ("Abort"))
  64. <               break;
  65. <       }
  66. <
  67. <       if (sectorsRemaining.HighPart == 0 && sectorsRemaining.LowPart < fragmentSectorCount)
  68. <           fragmentSectorCount = (int) sectorsRemaining.LowPart;
  69. <
  70. <       if (ReadWriteSectors (false, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, ActivePartition.StartSector + sectorOffset, fragmentSectorCount, false) != BiosResultSuccess)
  71. <       {
  72. <           Print ("To fix bad sectors: 1) Terminate 2) Encrypt and decrypt sys partition 3) Retry\r\n");
  73. <           crypto_close (BootCryptoInfo);
  74. <           goto err;
  75. <       }
  76. <
  77. <       AcquireSectorBuffer();
  78. <
  79. <       for (int i = 0; i < fragmentSectorCount; ++i)
  80. <       {
  81. <           CopyMemory (TC_BOOT_LOADER_BUFFER_SEGMENT, i * TC_LB_SIZE, SectorBuffer, TC_LB_SIZE);
  82. <
  83. <           uint64 s = HiddenVolumeStartUnitNo + sectorOffset + i;
  84. <           EncryptDataUnits (SectorBuffer, &s, 1, BootCryptoInfo);
  85. <
  86. <           CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT, i * TC_LB_SIZE, TC_LB_SIZE);
  87. <       }
  88. <
  89. <       ReleaseSectorBuffer();
  90. <
  91. <       if (ReadWriteSectors (true, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, HiddenVolumeStartSector + sectorOffset, fragmentSectorCount, false) != BiosResultSuccess)
  92. <       {
  93. <           crypto_close (BootCryptoInfo);
  94. <           goto err;
  95. <       }
  96. <
  97. <       sectorsRemaining = sectorsRemaining - fragmentSectorCount;
  98. <       sectorOffset = sectorOffset + fragmentSectorCount;
  99. <
  100. <       if (!(statCount++ & 0xf))
  101. <       {
  102. <           Print ("\rRemaining: ");
  103. <           PrintSectorCountInMB (sectorsRemaining);
  104. <       }
  105. <   }
  106. <
  107. <   crypto_close (BootCryptoInfo);
  108. <
  109. <   if (sectorsRemaining.HighPart == 0 && sectorsRemaining.LowPart == 0)
  110. <   {
  111. <       status = true;
  112. <       Print ("\rCopying completed.");
  113. <   }
  114. <
  115. <   PrintEndl (2);
  116. <   goto ret;
  117. <
  118. < err:
  119. <   exitKey = TC_BIOS_KEY_ESC;
  120. <   GetKeyboardChar();
  121. <
  122. < ret:
  123. <   EraseMemory ((void *) TC_BOOT_LOADER_ARGS_OFFSET, sizeof (BootArguments));
  124. <   return status;
  125. < }
  126. <
  127. <
  128. 1108,1129d990
  129. <       // Hidden system setup
  130. <       byte hiddenSystemCreationPhase = BootSectorFlags & TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE;
  131. <
  132. <       if (hiddenSystemCreationPhase != TC_HIDDEN_OS_CREATION_PHASE_NONE)
  133. <       {
  134. <           PreventNormalSystemBoot = true;
  135. <           PrintMainMenu();
  136. <
  137. <           if (hiddenSystemCreationPhase == TC_HIDDEN_OS_CREATION_PHASE_CLONING)
  138. <           {
  139. <               if (CopySystemPartitionToHiddenVolume (BootDrive, exitKey))
  140. <               {
  141. <                   BootSectorFlags = (BootSectorFlags & ~TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE) | TC_HIDDEN_OS_CREATION_PHASE_WIPING;
  142. <                   UpdateBootSectorConfiguration (BootLoaderDrive);
  143. <               }
  144. <               else if (exitKey == TC_BIOS_KEY_ESC)
  145. <                   goto bootMenu;
  146. <               else
  147. <                   continue;
  148. <           }
  149. <       }
  150. <       else
  151. diff -b -r tc-7.1/Common/BootEncryption.cpp tc-7.2/Common/BootEncryption.cpp
  152. 1863a1864,1865
  153. >       AbortProcess ("INSECURE_APP");
  154. >
  155. 2235,2242c2237
  156. <       BootEncryptionStatus encStatus = GetStatus();
  157. <       if (encStatus.DriveMounted)
  158. <           throw ParameterIncorrect (SRC_POS);
  159. <
  160. <       CheckRequirements();
  161. <       BackupSystemLoader();
  162. <
  163. <       SelectedEncryptionAlgorithmId = ea;
  164. ---
  165. >       AbortProcess ("INSECURE_APP");
  166. 2248,2300c2243
  167. <       BootEncryptionStatus encStatus = GetStatus();
  168. <       if (encStatus.DriveMounted)
  169. <           throw ParameterIncorrect (SRC_POS);
  170. <
  171. <       CheckRequirements ();
  172. <
  173. <       SystemDriveConfiguration config = GetSystemDriveConfiguration();
  174. <
  175. <       // Some chipset drivers may prevent access to the last sector of the drive
  176. <       if (!systemPartitionOnly)
  177. <       {
  178. <           DISK_GEOMETRY geometry = GetDriveGeometry (config.DriveNumber);
  179. <           Buffer sector (geometry.BytesPerSector);
  180. <
  181. <           Device device (config.DevicePath);
  182. <
  183. <           try
  184. <           {
  185. <               device.SeekAt (config.DrivePartition.Info.PartitionLength.QuadPart - geometry.BytesPerSector);
  186. <               device.Read (sector.Ptr(), sector.Size());
  187. <           }
  188. <           catch (SystemException &e)
  189. <           {
  190. <               if (e.ErrorCode != ERROR_CRC)
  191. <               {
  192. <                   e.Show (ParentWindow);
  193. <                   Error ("WHOLE_DRIVE_ENCRYPTION_PREVENTED_BY_DRIVERS");
  194. <                   throw UserAbort (SRC_POS);
  195. <               }
  196. <           }
  197. <       }
  198. <
  199. <       BackupSystemLoader ();
  200. <
  201. <       uint64 volumeSize;
  202. <       uint64 encryptedAreaStart;
  203. <
  204. <       if (systemPartitionOnly)
  205. <       {
  206. <           volumeSize = config.SystemPartition.Info.PartitionLength.QuadPart;
  207. <           encryptedAreaStart = config.SystemPartition.Info.StartingOffset.QuadPart;
  208. <       }
  209. <       else
  210. <       {
  211. <           volumeSize = config.DrivePartition.Info.PartitionLength.QuadPart - TC_BOOT_LOADER_AREA_SIZE;
  212. <           encryptedAreaStart = config.DrivePartition.Info.StartingOffset.QuadPart + TC_BOOT_LOADER_AREA_SIZE;
  213. <       }
  214. <
  215. <       SelectedEncryptionAlgorithmId = ea;
  216. <       CreateVolumeHeader (volumeSize, encryptedAreaStart, &password, ea, mode, pkcs5);
  217. <      
  218. <       if (!rescueIsoImagePath.empty())
  219. <           CreateRescueIsoImage (true, rescueIsoImagePath);
  220. ---
  221. >       AbortProcess ("INSECURE_APP");
  222. 2361,2373c2304
  223. <       BootEncryptionStatus encStatus = GetStatus();
  224. <
  225. <       if (!encStatus.DeviceFilterActive || !encStatus.DriveMounted || encStatus.SetupInProgress)
  226. <           throw ParameterIncorrect (SRC_POS);
  227. <
  228. <       BootEncryptionSetupRequest request;
  229. <       ZeroMemory (&request, sizeof (request));
  230. <      
  231. <       request.SetupMode = SetupEncryption;
  232. <       request.WipeAlgorithm = wipeAlgorithm;
  233. <       request.ZeroUnreadableSectors = zeroUnreadableSectors;
  234. <
  235. <       CallDriver (TC_IOCTL_BOOT_ENCRYPTION_SETUP, &request, sizeof (request), NULL, 0);
  236. ---
  237. >       AbortProcess ("INSECURE_APP");
  238. diff -b -r tc-7.1/Common/Cmdline.c tc-7.2/Common/Cmdline.c
  239. 56a57,58
  240. >       strcat (tmp, "\nExamples:\n\nMount a volume as X:\ttruecrypt.exe /q /v volume.tc /l X\nDismount a volume X:\ttruecrypt.exe /q /d X");
  241. >
  242. diff -b -r tc-7.1/Common/Common.rc tc-7.2/Common/Common.rc
  243. 16c16
  244. < // English (U.S.) resources
  245. ---
  246. > // English (United States) resources
  247. 19d18
  248. < #ifdef _WIN32
  249. 22d20
  250. < #endif //_WIN32
  251. 37d34
  252. <     LTEXT           "",IDC_HOMEPAGE,18,87,117,9,SS_NOTIFY
  253. 39c36
  254. <     CONTROL         517,IDC_ABOUT_BKG,"Static",SS_BITMAP,0,0,12,11,WS_EX_STATICEDGE
  255. ---
  256. >     CONTROL         IDB_TEXTUAL_LOGO_BKG,IDC_ABOUT_BKG,"Static",SS_BITMAP,0,0,12,11,WS_EX_STATICEDGE
  257. 45c42
  258. <     CONTROL         518,IDC_TEXTUAL_LOGO_IMG,"Static",SS_BITMAP,12,26,157,16
  259. ---
  260. >     CONTROL         IDB_TEXTUAL_LOGO_96DPI,IDC_TEXTUAL_LOGO_IMG,"Static",SS_BITMAP,12,26,157,16
  261. 48c45
  262. < IDD_COMMANDHELP_DLG DIALOGEX 0, 0, 249, 213
  263. ---
  264. > IDD_COMMANDHELP_DLG DIALOGEX 0, 0, 249, 234
  265. 54,55c51,52
  266. <     DEFPUSHBUTTON   "OK",IDOK,93,191,59,14
  267. <     LTEXT           "",IDC_COMMANDHELP_TEXT,20,11,208,174
  268. ---
  269. >     DEFPUSHBUTTON   "OK",IDOK,93,212,59,14
  270. >     LTEXT           "",IDC_COMMANDHELP_TEXT,20,11,208,195
  271. 68c65
  272. < IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 172
  273. ---
  274. > IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 159
  275. 84d80
  276. <     LTEXT           "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,151,247,10,SS_NOTIFY
  277. 88c84
  278. <     GROUPBOX        "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,95
  279. ---
  280. >     GROUPBOX        "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,81
  281. 112d107
  282. <     LTEXT           "More information on keyfiles",IDC_LINK_KEYFILES_INFO,96,220,108,10,SS_NOTIFY
  283. 122d116
  284. <     CTEXT           "Download language pack",IDC_GET_LANG_PACKS,2,146,205,10,SS_NOTIFY
  285. 214c208
  286. < STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
  287. ---
  288. > STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
  289. 310a305,308
  290. >     IDD_ABOUT_DLG, DIALOG
  291. >     BEGIN
  292. >     END
  293. >
  294. 313c311
  295. <         BOTTOMMARGIN, 205
  296. ---
  297. >         BOTTOMMARGIN, 226
  298. 328c326
  299. <         BOTTOMMARGIN, 166
  300. ---
  301. >         BOTTOMMARGIN, 153
  302. 527c525
  303. < #endif    // English (U.S.) resources
  304. ---
  305. > #endif    // English (United States) resources
  306. diff -b -r tc-7.1/Common/Dlgcode.c tc-7.2/Common/Dlgcode.c
  307. 53a54
  308. > #include "Mount/resource.h"
  309. 69,70d69
  310. < char szHelpFile[TC_MAX_PATH];
  311. < char szHelpFile2[TC_MAX_PATH];
  312. 408,409c407,408
  313. <   MessageBoxW (NULL, GetString (stringId), lpszTitle, ICON_HAND);
  314. <   exit (1);
  315. ---
  316. >   MessageBoxW (NULL, GetString (stringId), lpszTitle, ICON_HAND | MB_SETFOREGROUND | MB_TOPMOST);
  317. >   ExitProcess (1);
  318. 415c414
  319. <   exit (1);
  320. ---
  321. >   ExitProcess (1);
  322. 771a771,783
  323. > // Note that the user can still close the window by right-clicking its taskbar icon and selecting 'Close window', or by pressing Alt-F4, or using the Task Manager.
  324. > void DisableCloseButton (HWND hwndDlg)
  325. > {
  326. >   EnableMenuItem (GetSystemMenu (hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
  327. > }
  328. >
  329. >
  330. > void EnableCloseButton (HWND hwndDlg)
  331. > {
  332. >   EnableMenuItem (GetSystemMenu (hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_ENABLED);
  333. > }
  334. >
  335. >
  336. 872,875d883
  337. <           // Hyperlink
  338. <           SetWindowText (GetDlgItem (hwndDlg, IDC_HOMEPAGE), "www.truecrypt.org");
  339. <           ToHyperlink (hwndDlg, IDC_HOMEPAGE);
  340. <
  341. 918c926
  342. <           "Copyright \xA9 2003-2012 TrueCrypt Developers Association. All Rights Reserved.\r\n"
  343. ---
  344. >           "Copyright \xA9 2003-2014 TrueCrypt Developers Association. All Rights Reserved.\r\n"
  345. 924c932
  346. <           "Copyright \xA9 2012 TrueCrypt Developers Association. All rights reserved.\r\n\r\n"
  347. ---
  348. >           "Copyright \xA9 2014 TrueCrypt Developers Association. All rights reserved.\r\n\r\n"
  349. 937,942d944
  350. <       if (lw == IDC_HOMEPAGE)
  351. <       {
  352. <           Applink ("main", TRUE, "");
  353. <           return 1;
  354. <       }
  355. <
  356. 1628,1885d1629
  357. < static BOOL IsReturnAddress (DWORD64 address)
  358. < {
  359. <   static size_t codeEnd = 0;
  360. <   byte *sp = (byte *) address;
  361. <
  362. <   if (codeEnd == 0)
  363. <   {
  364. <       MEMORY_BASIC_INFORMATION mi;
  365. <       if (VirtualQuery ((LPCVOID) 0x401000, &mi, sizeof (mi)) >= sizeof (mi))
  366. <           codeEnd = (size_t) mi.BaseAddress + mi.RegionSize;
  367. <   }
  368. <
  369. <   if (address < 0x401000 + 8 || address > codeEnd)
  370. <       return FALSE;
  371. <
  372. <   return sp[-5] == 0xe8                                   // call ADDR
  373. <       || (sp[-6] == 0xff && sp[-5] == 0x15)               // call [ADDR]
  374. <       || (sp[-2] == 0xff && (sp[-1] & 0xf0) == 0xd0);     // call REG
  375. < }
  376. <
  377. <
  378. < typedef struct
  379. < {
  380. <   EXCEPTION_POINTERS *ExceptionPointers;
  381. <   HANDLE ExceptionThread;
  382. <
  383. < } ExceptionHandlerThreadArgs;
  384. <
  385. <
  386. < void ExceptionHandlerThread (void *threadArg)
  387. < {
  388. <   ExceptionHandlerThreadArgs *args = (ExceptionHandlerThreadArgs *) threadArg;
  389. <
  390. <   EXCEPTION_POINTERS *ep = args->ExceptionPointers;
  391. <   DWORD addr;
  392. <   DWORD exCode = ep->ExceptionRecord->ExceptionCode;
  393. <   SYSTEM_INFO si;
  394. <   wchar_t msg[8192];
  395. <   char modPath[MAX_PATH];
  396. <   int crc = 0;
  397. <   char url[MAX_URL_LENGTH];
  398. <   char lpack[128];
  399. <   stringstream callStack;
  400. <   addr = (DWORD) ep->ExceptionRecord->ExceptionAddress;
  401. <   PDWORD sp = (PDWORD) ep->ContextRecord->Esp;
  402. <   int frameNumber = 0;
  403. <
  404. <   switch (exCode)
  405. <   {
  406. <   case STATUS_IN_PAGE_ERROR:
  407. <   case 0xeedfade:
  408. <       // Exception not caused by TrueCrypt
  409. <       MessageBoxW (0, GetString ("EXCEPTION_REPORT_EXT"),
  410. <           GetString ("EXCEPTION_REPORT_TITLE"),
  411. <           MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
  412. <       return;
  413. <   }
  414. <
  415. <   // Call stack
  416. <   HMODULE dbgDll = LoadLibrary ("dbghelp.dll");
  417. <   if (dbgDll)
  418. <   {
  419. <       typedef DWORD (__stdcall *SymGetOptions_t) ();
  420. <       typedef DWORD (__stdcall *SymSetOptions_t) (DWORD SymOptions);
  421. <       typedef BOOL (__stdcall *SymInitialize_t) (HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess);
  422. <       typedef BOOL (__stdcall *StackWalk64_t) (DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME64 StackFrame, PVOID ContextRecord, PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress);
  423. <       typedef BOOL (__stdcall * SymFromAddr_t) (HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol);
  424. <
  425. <       SymGetOptions_t DbgHelpSymGetOptions = (SymGetOptions_t) GetProcAddress (dbgDll, "SymGetOptions");
  426. <       SymSetOptions_t DbgHelpSymSetOptions = (SymSetOptions_t) GetProcAddress (dbgDll, "SymSetOptions");
  427. <       SymInitialize_t DbgHelpSymInitialize = (SymInitialize_t) GetProcAddress (dbgDll, "SymInitialize");
  428. <       PFUNCTION_TABLE_ACCESS_ROUTINE64 DbgHelpSymFunctionTableAccess64 = (PFUNCTION_TABLE_ACCESS_ROUTINE64) GetProcAddress (dbgDll, "SymFunctionTableAccess64");
  429. <       PGET_MODULE_BASE_ROUTINE64 DbgHelpSymGetModuleBase64 = (PGET_MODULE_BASE_ROUTINE64) GetProcAddress (dbgDll, "SymGetModuleBase64");
  430. <       StackWalk64_t DbgHelpStackWalk64 = (StackWalk64_t) GetProcAddress (dbgDll, "StackWalk64");
  431. <       SymFromAddr_t DbgHelpSymFromAddr = (SymFromAddr_t) GetProcAddress (dbgDll, "SymFromAddr");
  432. <
  433. <       if (DbgHelpSymGetOptions && DbgHelpSymSetOptions && DbgHelpSymInitialize && DbgHelpSymFunctionTableAccess64 && DbgHelpSymGetModuleBase64 && DbgHelpStackWalk64 && DbgHelpSymFromAddr)
  434. <       {
  435. <           DbgHelpSymSetOptions (DbgHelpSymGetOptions() | SYMOPT_DEFERRED_LOADS | SYMOPT_ALLOW_ABSOLUTE_SYMBOLS | SYMOPT_NO_CPP);
  436. <
  437. <           if (DbgHelpSymInitialize (GetCurrentProcess(), NULL, TRUE))
  438. <           {
  439. <               STACKFRAME64 frame;
  440. <               memset (&frame, 0, sizeof (frame));
  441. <
  442. <               frame.AddrPC.Offset = ep->ContextRecord->Eip;
  443. <               frame.AddrPC.Mode = AddrModeFlat;
  444. <               frame.AddrStack.Offset = ep->ContextRecord->Esp;
  445. <               frame.AddrStack.Mode = AddrModeFlat;
  446. <               frame.AddrFrame.Offset = ep->ContextRecord->Ebp;
  447. <               frame.AddrFrame.Mode = AddrModeFlat;
  448. <
  449. <               string lastSymbol;
  450. <
  451. <               while (frameNumber < 32 && DbgHelpStackWalk64 (IMAGE_FILE_MACHINE_I386, GetCurrentProcess(), args->ExceptionThread, &frame, ep->ContextRecord, NULL, DbgHelpSymFunctionTableAccess64, DbgHelpSymGetModuleBase64, NULL))
  452. <               {
  453. <                   if (!frame.AddrPC.Offset)
  454. <                       continue;
  455. <
  456. <                   ULONG64 symbolBuffer[(sizeof (SYMBOL_INFO) + MAX_SYM_NAME * sizeof (TCHAR) + sizeof (ULONG64) - 1) / sizeof (ULONG64)];
  457. <                   memset (symbolBuffer, 0, sizeof (symbolBuffer));
  458. <
  459. <                   PSYMBOL_INFO symbol = (PSYMBOL_INFO) symbolBuffer;
  460. <                   symbol->SizeOfStruct = sizeof (SYMBOL_INFO);
  461. <                   symbol->MaxNameLen = MAX_SYM_NAME;
  462. <
  463. <                   if (DbgHelpSymFromAddr (GetCurrentProcess(), frame.AddrPC.Offset, NULL, symbol) && symbol->NameLen > 0)
  464. <                   {
  465. <                       for (size_t i = 0; i < symbol->NameLen; ++i)
  466. <                       {
  467. <                           if (!isalnum (symbol->Name[i]))
  468. <                               symbol->Name[i] = '_';
  469. <                       }
  470. <
  471. <                       if (symbol->Name != lastSymbol)
  472. <                           callStack << "&st" << frameNumber++ << "=" << symbol->Name;
  473. <
  474. <                       lastSymbol = symbol->Name;
  475. <                   }
  476. <                   else if (frameNumber == 0 || IsReturnAddress (frame.AddrPC.Offset))
  477. <                   {
  478. <                       callStack << "&st" << frameNumber++ << "=0x" << hex << frame.AddrPC.Offset << dec;
  479. <                   }
  480. <               }
  481. <           }
  482. <       }
  483. <   }
  484. <
  485. <   // StackWalk64() may fail due to missing frame pointers
  486. <   list <DWORD> retAddrs;
  487. <   if (frameNumber == 0)
  488. <       retAddrs.push_back (ep->ContextRecord->Eip);
  489. <
  490. <   retAddrs.push_back (0);
  491. <
  492. <   MEMORY_BASIC_INFORMATION mi;
  493. <   VirtualQuery (sp, &mi, sizeof (mi));
  494. <   PDWORD stackTop = (PDWORD)((byte *) mi.BaseAddress + mi.RegionSize);
  495. <   int i = 0;
  496. <
  497. <   while (retAddrs.size() < 16 && &sp[i] < stackTop)
  498. <   {
  499. <       if (IsReturnAddress (sp[i]))
  500. <       {
  501. <           bool duplicate = false;
  502. <           foreach (DWORD prevAddr, retAddrs)
  503. <           {
  504. <               if (sp[i] == prevAddr)
  505. <               {
  506. <                   duplicate = true;
  507. <                   break;
  508. <               }
  509. <           }
  510. <
  511. <           if (!duplicate)
  512. <               retAddrs.push_back (sp[i]);
  513. <       }
  514. <       i++;
  515. <   }
  516. <
  517. <   if (retAddrs.size() > 1)
  518. <   {
  519. <       foreach (DWORD addr, retAddrs)
  520. <       {
  521. <           callStack << "&st" << frameNumber++ << "=0x" << hex << addr << dec;
  522. <       }
  523. <   }
  524. <
  525. <   // Checksum of the module
  526. <   if (GetModuleFileName (NULL, modPath, sizeof (modPath)))
  527. <   {
  528. <       HANDLE h = CreateFile (modPath, FILE_READ_DATA | FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
  529. <       if (h != INVALID_HANDLE_VALUE)
  530. <       {
  531. <           BY_HANDLE_FILE_INFORMATION fi;
  532. <           if (GetFileInformationByHandle (h, &fi))
  533. <           {
  534. <               char *buf = (char *) malloc (fi.nFileSizeLow);
  535. <               if (buf)
  536. <               {
  537. <                   DWORD bytesRead;
  538. <                   if (ReadFile (h, buf, fi.nFileSizeLow, &bytesRead, NULL) && bytesRead == fi.nFileSizeLow)
  539. <                       crc = GetCrc32 ((unsigned char *) buf, fi.nFileSizeLow);
  540. <                   free (buf);
  541. <               }
  542. <           }
  543. <           CloseHandle (h);
  544. <       }
  545. <   }
  546. <
  547. <   GetSystemInfo (&si);
  548. <
  549. <   if (LocalizationActive)
  550. <       sprintf_s (lpack, sizeof (lpack), "&langpack=%s_%s", GetPreferredLangId (), GetActiveLangPackVersion ());
  551. <   else
  552. <       lpack[0] = 0;
  553. <
  554. <   sprintf (url, TC_APPLINK_SECURE "&dest=err-report%s&os=%s&osver=%d.%d.%d&arch=%s&cpus=%d&app=%s&cksum=%x&dlg=%s&err=%x&addr=%x"
  555. <       , lpack
  556. <       , GetWindowsEdition().c_str()
  557. <       , CurrentOSMajor
  558. <       , CurrentOSMinor
  559. <       , CurrentOSServicePack
  560. <       , Is64BitOs () ? "x64" : "x86"
  561. <       , si.dwNumberOfProcessors
  562. < #ifdef TCMOUNT
  563. <       ,"main"
  564. < #endif
  565. < #ifdef VOLFORMAT
  566. <       ,"format"
  567. < #endif
  568. < #ifdef SETUP
  569. <       ,"setup"
  570. < #endif
  571. <       , crc
  572. <       , LastDialogId ? LastDialogId : "-"
  573. <       , exCode
  574. <       , addr);
  575. <
  576. <   string urlStr = url + callStack.str();
  577. <
  578. <   _snwprintf (msg, array_capacity (msg), GetString ("EXCEPTION_REPORT"), urlStr.c_str());
  579. <
  580. <   if (IDYES == MessageBoxW (0, msg, GetString ("EXCEPTION_REPORT_TITLE"), MB_ICONERROR | MB_YESNO | MB_DEFBUTTON1))
  581. <       ShellExecute (NULL, "open", urlStr.c_str(), NULL, NULL, SW_SHOWNORMAL);
  582. <   else
  583. <       UnhandledExceptionFilter (ep);
  584. < }
  585. <
  586. <
  587. < LONG __stdcall ExceptionHandler (EXCEPTION_POINTERS *ep)
  588. < {
  589. <   SetUnhandledExceptionFilter (NULL);
  590. <
  591. <   if (SystemFileSelectorCallPending && SystemFileSelectorCallerThreadId == GetCurrentThreadId())
  592. <   {
  593. <       MessageBoxW (NULL, GetString ("EXCEPTION_REPORT_EXT_FILESEL"), GetString ("EXCEPTION_REPORT_TITLE"), MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
  594. <
  595. <       UnhandledExceptionFilter (ep);
  596. <       return EXCEPTION_EXECUTE_HANDLER;
  597. <   }
  598. <
  599. <   ExceptionHandlerThreadArgs args;
  600. <   args.ExceptionPointers = ep;
  601. <   args.ExceptionThread = GetCurrentThread();
  602. <
  603. <   WaitForSingleObject ((HANDLE) _beginthread (ExceptionHandlerThread, 0, &args), INFINITE);
  604. <
  605. <   return EXCEPTION_EXECUTE_HANDLER;
  606. < }
  607. <
  608. <
  609. < void InvalidParameterHandler (const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t reserved)
  610. < {
  611. <   TC_THROW_FATAL_EXCEPTION;
  612. < }
  613. <
  614. <
  615. 2108c1852
  616. < // Returns the number of partitions where non-system in-place encryption is progress or had been in progress
  617. ---
  618. > // Returns the number of partitions where non-system in-place encryption is or had been in progress
  619. 2156,2222d1899
  620. < void SavePostInstallTasksSettings (int command)
  621. < {
  622. <   FILE *f = NULL;
  623. <
  624. <   if (IsNonInstallMode() && command != TC_POST_INSTALL_CFG_REMOVE_ALL)
  625. <       return;
  626. <
  627. <   switch (command)
  628. <   {
  629. <   case TC_POST_INSTALL_CFG_REMOVE_ALL:
  630. <       remove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL));
  631. <       remove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES));
  632. <       break;
  633. <
  634. <   case TC_POST_INSTALL_CFG_TUTORIAL:
  635. <       f = fopen (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL), "w");
  636. <       break;
  637. <
  638. <   case TC_POST_INSTALL_CFG_RELEASE_NOTES:
  639. <       f = fopen (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES), "w");
  640. <       break;
  641. <
  642. <   default:
  643. <       return;
  644. <   }
  645. <
  646. <   if (f == NULL)
  647. <       return;
  648. <
  649. <   if (fputs ("1", f) < 0)
  650. <   {
  651. <       // Error
  652. <       fclose (f);
  653. <       return;
  654. <   }
  655. <
  656. <   TCFlushFile (f);
  657. <
  658. <   fclose (f);
  659. < }
  660. <
  661. <
  662. < void DoPostInstallTasks (void)
  663. < {
  664. <   BOOL bDone = FALSE;
  665. <
  666. <   if (FileExists (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL)))
  667. <   {
  668. <       if (AskYesNo ("AFTER_INSTALL_TUTORIAL") == IDYES)
  669. <           Applink ("beginnerstutorial", TRUE, "");
  670. <
  671. <       bDone = TRUE;
  672. <   }
  673. <
  674. <   if (FileExists (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES)))
  675. <   {
  676. <       if (AskYesNo ("AFTER_UPGRADE_RELEASE_NOTES") == IDYES)
  677. <           Applink ("releasenotes", TRUE, "");
  678. <
  679. <       bDone = TRUE;
  680. <   }
  681. <
  682. <   if (bDone)
  683. <       SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_REMOVE_ALL);
  684. < }
  685. <
  686. <
  687. 2358,2360d2034
  688. <   SetUnhandledExceptionFilter (ExceptionHandler);
  689. <   _set_invalid_parameter_handler (InvalidParameterHandler);
  690. <
  691. 2463,2464d2136
  692. <   InitHelpFileName ();
  693. <
  694. 2474,2504d2145
  695. < void InitHelpFileName (void)
  696. < {
  697. <   char *lpszTmp;
  698. <
  699. <   GetModuleFileName (NULL, szHelpFile, sizeof (szHelpFile));
  700. <   lpszTmp = strrchr (szHelpFile, '\\');
  701. <   if (lpszTmp)
  702. <   {
  703. <       char szTemp[TC_MAX_PATH];
  704. <
  705. <       // Primary file name
  706. <       if (strcmp (GetPreferredLangId(), "en") == 0
  707. <           || GetPreferredLangId() == NULL)
  708. <       {
  709. <           strcpy (++lpszTmp, "TrueCrypt User Guide.pdf");
  710. <       }
  711. <       else
  712. <       {
  713. <           sprintf (szTemp, "TrueCrypt User Guide.%s.pdf", GetPreferredLangId());
  714. <           strcpy (++lpszTmp, szTemp);
  715. <       }
  716. <
  717. <       // Secondary file name (used when localized documentation is not found).
  718. <       GetModuleFileName (NULL, szHelpFile2, sizeof (szHelpFile2));
  719. <       lpszTmp = strrchr (szHelpFile2, '\\');
  720. <       if (lpszTmp)
  721. <       {
  722. <           strcpy (++lpszTmp, "TrueCrypt User Guide.pdf");
  723. <       }
  724. <   }
  725. < }
  726. 2653a2295,2351
  727. >
  728. > /* Determines whether the path points to a non-system partition on the system drive.
  729. > IMPORTANT: As this may take a very long time if called for the first time, it should be called
  730. >            only before performing a dangerous operation, never at WM_INITDIALOG or any other GUI events.
  731. > Return codes:
  732. > 0  - it isn't a non-system partition on the system drive
  733. > 1  - it's a non-system partition on the system drive
  734. > -1 - the result can't be determined, isn't reliable, or there was an error. */
  735. > int IsNonSysPartitionOnSysDrive (const char *path)
  736. > {
  737. >   char tmpPath [TC_MAX_PATH + 1];
  738. >   int pos;
  739. >
  740. >   if (!GetSysDevicePaths (MainDlg))
  741. >       return -1;
  742. >
  743. >   if (strlen (SysPartitionDevicePath) <= 1 || strlen (SysDriveDevicePath) <= 1)
  744. >       return -1;
  745. >
  746. >   if (strncmp (path, SysPartitionDevicePath, max (strlen(path), strlen(SysPartitionDevicePath))) == 0
  747. >       || strncmp (path, SysDriveDevicePath, max (strlen(path), strlen(SysDriveDevicePath))) == 0)
  748. >   {
  749. >       // It is the system partition/drive path (it isn't a non-system partition)
  750. >       return 0;
  751. >   }
  752. >
  753. >   memset (tmpPath, 0, sizeof (tmpPath));
  754. >   strncpy (tmpPath, path, sizeof (tmpPath) - 1);
  755. >
  756. >
  757. >   pos = (int) FindString (tmpPath, "Partition", strlen (tmpPath), strlen ("Partition"), 0);
  758. >
  759. >   if (pos < 0)
  760. >       return -1;
  761. >
  762. >   pos += strlen ("Partition");
  763. >
  764. >   if (pos + 1 > sizeof (tmpPath) - 1)
  765. >       return -1;
  766. >
  767. >   tmpPath [pos] = '0';
  768. >   tmpPath [pos + 1] = 0;
  769. >
  770. >   if (strncmp (tmpPath, SysDriveDevicePath, max (strlen(tmpPath), strlen(SysDriveDevicePath))) == 0)
  771. >   {
  772. >       // It is a non-system partition on the system drive
  773. >       return 1;
  774. >   }
  775. >   else
  776. >   {
  777. >       // The partition is not on the system drive
  778. >       return 0;
  779. >   }
  780. > }
  781. >
  782. >
  783. >
  784. 3817c3515,3519
  785. <   if (TCBootLoaderOnInactiveSysEncDrive ())
  786. ---
  787. >
  788. >   char szDevicePath [TC_MAX_PATH+1] = {0};
  789. >   GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), szDevicePath, sizeof (szDevicePath));
  790. >
  791. >   if (TCBootLoaderOnInactiveSysEncDrive (szDevicePath))
  792. 4618,4619d4319
  793. <           ToHyperlink (hwndDlg, IDC_HW_AES_LABEL_LINK);
  794. <
  795. 4646,4647d4345
  796. <           ToHyperlink (hwndDlg, IDC_PARALLELIZATION_LABEL_LINK);
  797. <
  798. 4684,4693d4381
  799. <       case IDC_HW_AES_LABEL_LINK:
  800. <
  801. <           Applink ("hwacceleration", TRUE, "");
  802. <           return 1;
  803. <
  804. <       case IDC_PARALLELIZATION_LABEL_LINK:
  805. <
  806. <           Applink ("parallelization", TRUE, "");
  807. <           return 1;
  808. <
  809. 5688a5377,5378
  810. >           DisableCloseButton (hwndDlg);
  811. >
  812. 5711c5401,5402
  813. <       EndDialog (hwndDlg, 0);
  814. ---
  815. >       // This prevents the window from being closed by pressing Alt-F4 (the Close button is hidden).
  816. >       // Note that the OS handles modal MessageBox() dialog windows the same way.
  817. 6354a6046
  818. > // Returns -1 if no drive letter is resolved
  819. 7750a7443,7449
  820. > int AskNoYesString (const wchar_t *string)
  821. > {
  822. >   if (Silent) return IDNO;
  823. >   return MessageBoxW (MainDlg, string, lpszTitle, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2);
  824. > }
  825. >
  826. >
  827. 7840,7841c7539
  828. < // If the returned value is 0, the user closed the dialog window without making a choice.
  829. < // If the user made a choice, the returned value is the ordinal number of the choice (1..MAX_MULTI_CHOICES)
  830. ---
  831. > // The returned value is the ordinal number of the choice the user selected (1..MAX_MULTI_CHOICES)
  832. 7987,8016d7684
  833. < void OpenPageHelp (HWND hwndDlg, int nPage)
  834. < {
  835. <   int r = (int)ShellExecute (NULL, "open", szHelpFile, NULL, NULL, SW_SHOWNORMAL);
  836. <
  837. <   if (r == ERROR_FILE_NOT_FOUND)
  838. <   {
  839. <       // Try the secondary help file
  840. <       r = (int)ShellExecute (NULL, "open", szHelpFile2, NULL, NULL, SW_SHOWNORMAL);
  841. <
  842. <       if (r == ERROR_FILE_NOT_FOUND)
  843. <       {
  844. <           OpenOnlineHelp ();
  845. <           return;
  846. <       }
  847. <   }
  848. <
  849. <   if (r == SE_ERR_NOASSOC)
  850. <   {
  851. <       if (AskYesNo ("HELP_READER_ERROR") == IDYES)
  852. <           OpenOnlineHelp ();
  853. <   }
  854. < }
  855. <
  856. <
  857. < void OpenOnlineHelp ()
  858. < {
  859. <   Applink ("help", TRUE, "");
  860. < }
  861. <
  862. <
  863. 8324,8337d7991
  864. < void Applink (char *dest, BOOL bSendOS, char *extraOutput)
  865. < {
  866. <   char url [MAX_URL_LENGTH];
  867. <
  868. <   ArrowWaitCursor ();
  869. <
  870. <   sprintf_s (url, sizeof (url), TC_APPLINK "%s%s&dest=%s", bSendOS ? ("&os=" + GetWindowsEdition()).c_str() : "", extraOutput, dest);
  871. <   ShellExecute (NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
  872. <
  873. <   Sleep (200);
  874. <   NormalCursor ();
  875. < }
  876. <
  877. <
  878. 9543c9197
  879. < int AskNonSysInPlaceEncryptionResume ()
  880. ---
  881. > int AskNonSysInPlaceEncryptionResume (BOOL *decrypt)
  882. 9545a9200,9201
  883. >   {
  884. >       *decrypt = TRUE;
  885. 9546a9203
  886. >   }
  887. diff -b -r tc-7.1/Common/Dlgcode.h tc-7.2/Common/Dlgcode.h
  888. 34,35c34
  889. <   IDM_SHOW_HIDE,
  890. <   IDM_HOMEPAGE_SYSTRAY
  891. ---
  892. >   IDM_SHOW_HIDE
  893. 77,78d75
  894. < #define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL           "Post-Install Task - Tutorial"
  895. < #define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES  "Post-Install Task - Release Notes"
  896. 88,94d84
  897. < enum
  898. < {
  899. <   TC_POST_INSTALL_CFG_REMOVE_ALL = 0,
  900. <   TC_POST_INSTALL_CFG_TUTORIAL,
  901. <   TC_POST_INSTALL_CFG_RELEASE_NOTES
  902. < };
  903. <
  904. 97,98d86
  905. < extern char szHelpFile[TC_MAX_PATH];
  906. < extern char szHelpFile2[TC_MAX_PATH];
  907. 130a119,122
  908. > extern char SysPartitionDevicePath [TC_MAX_PATH];
  909. > extern char SysDriveDevicePath [TC_MAX_PATH];
  910. > extern char bCachedSysDevicePathsValid;
  911. >
  912. 287,288d278
  913. < void SavePostInstallTasksSettings (int command);
  914. < void DoPostInstallTasks (void);
  915. 291d280
  916. < void InitHelpFileName (void);
  917. 296a286
  918. > int IsNonSysPartitionOnSysDrive (const char *path);
  919. 375d364
  920. < void OpenPageHelp (HWND hwndDlg, int nPage);
  921. 393a383
  922. > int AskNoYesString (const wchar_t *string);
  923. 424d413
  924. < void Applink (char *dest, BOOL bSendOS, char *extraOutput);
  925. 434d422
  926. < void OpenOnlineHelp ();
  927. 445a434,435
  928. > void DisableCloseButton (HWND hwndDlg);
  929. > void EnableCloseButton (HWND hwndDlg);
  930. 448a439
  931. > BOOL GetSysDevicePaths (HWND hwndDlg);
  932. 463c454
  933. < int AskNonSysInPlaceEncryptionResume ();
  934. ---
  935. > int AskNonSysInPlaceEncryptionResume (BOOL *decrypt);
  936. diff -b -r tc-7.1/Common/Fat.c tc-7.2/Common/Fat.c
  937. 19a20
  938. > #include "Dlgcode.h"
  939. 258,437c259
  940. <   int write_buf_cnt = 0;
  941. <   char sector[TC_MAX_VOLUME_SECTOR_SIZE], *write_buf;
  942. <   unsigned __int64 nSecNo = startSector;
  943. <   int x, n;
  944. <   int retVal;
  945. <   char temporaryKey[MASTER_KEYDATA_SIZE];
  946. <
  947. <   LARGE_INTEGER startOffset;
  948. <   LARGE_INTEGER newOffset;
  949. <
  950. <   // Seek to start sector
  951. <   startOffset.QuadPart = startSector * ft->sector_size;
  952. <   if (!SetFilePointerEx ((HANDLE) dev, startOffset, &newOffset, FILE_BEGIN)
  953. <       || newOffset.QuadPart != startOffset.QuadPart)
  954. <   {
  955. <       return ERR_VOL_SEEKING;
  956. <   }
  957. <
  958. <   /* Write the data area */
  959. <
  960. <   write_buf = (char *)TCalloc (FormatWriteBufferSize);
  961. <   if (!write_buf)
  962. <       return ERR_OUTOFMEMORY;
  963. <
  964. <   memset (sector, 0, ft->sector_size);
  965. <
  966. <   RandgetBytes (ft->volume_id, sizeof (ft->volume_id), FALSE);
  967. <
  968. <   PutBoot (ft, (unsigned char *) sector);
  969. <   if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  970. <       cryptoInfo) == FALSE)
  971. <       goto fail;
  972. <
  973. <   /* fat32 boot area */
  974. <   if (ft->size_fat == 32)            
  975. <   {
  976. <       /* fsinfo */
  977. <       PutFSInfo((unsigned char *) sector, ft);
  978. <       if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  979. <           cryptoInfo) == FALSE)
  980. <           goto fail;
  981. <
  982. <       /* reserved */
  983. <       while (nSecNo - startSector < 6)
  984. <       {
  985. <           memset (sector, 0, ft->sector_size);
  986. <           sector[508+3]=0xaa; /* TrailSig */
  987. <           sector[508+2]=0x55;
  988. <           if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  989. <               cryptoInfo) == FALSE)
  990. <               goto fail;
  991. <       }
  992. <      
  993. <       /* bootsector backup */
  994. <       memset (sector, 0, ft->sector_size);
  995. <       PutBoot (ft, (unsigned char *) sector);
  996. <       if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  997. <                cryptoInfo) == FALSE)
  998. <           goto fail;
  999. <
  1000. <       PutFSInfo((unsigned char *) sector, ft);
  1001. <       if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  1002. <           cryptoInfo) == FALSE)
  1003. <           goto fail;
  1004. <   }
  1005. <
  1006. <   /* reserved */
  1007. <   while (nSecNo - startSector < (unsigned int)ft->reserved)
  1008. <   {
  1009. <       memset (sector, 0, ft->sector_size);
  1010. <       if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  1011. <           cryptoInfo) == FALSE)
  1012. <           goto fail;
  1013. <   }
  1014. <
  1015. <   /* write fat */
  1016. <   for (x = 1; x <= ft->fats; x++)
  1017. <   {
  1018. <       for (n = 0; n < ft->fat_length; n++)
  1019. <       {
  1020. <           memset (sector, 0, ft->sector_size);
  1021. <
  1022. <           if (n == 0)
  1023. <           {
  1024. <               unsigned char fat_sig[12];
  1025. <               if (ft->size_fat == 32)
  1026. <               {
  1027. <                   fat_sig[0] = (unsigned char) ft->media;
  1028. <                   fat_sig[1] = fat_sig[2] = 0xff;
  1029. <                   fat_sig[3] = 0x0f;
  1030. <                   fat_sig[4] = fat_sig[5] = fat_sig[6] = 0xff;
  1031. <                   fat_sig[7] = 0x0f;
  1032. <                   fat_sig[8] = fat_sig[9] = fat_sig[10] = 0xff;
  1033. <                   fat_sig[11] = 0x0f;
  1034. <                   memcpy (sector, fat_sig, 12);
  1035. <               }              
  1036. <               else if (ft->size_fat == 16)
  1037. <               {
  1038. <                   fat_sig[0] = (unsigned char) ft->media;
  1039. <                   fat_sig[1] = 0xff;
  1040. <                   fat_sig[2] = 0xff;
  1041. <                   fat_sig[3] = 0xff;
  1042. <                   memcpy (sector, fat_sig, 4);
  1043. <               }
  1044. <               else if (ft->size_fat == 12)
  1045. <               {
  1046. <                   fat_sig[0] = (unsigned char) ft->media;
  1047. <                   fat_sig[1] = 0xff;
  1048. <                   fat_sig[2] = 0xff;
  1049. <                   fat_sig[3] = 0x00;
  1050. <                   memcpy (sector, fat_sig, 4);
  1051. <               }
  1052. <           }
  1053. <
  1054. <           if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  1055. <                   cryptoInfo) == FALSE)
  1056. <               goto fail;
  1057. <       }
  1058. <   }
  1059. <
  1060. <
  1061. <   /* write rootdir */
  1062. <   for (x = 0; x < ft->size_root_dir / ft->sector_size; x++)
  1063. <   {
  1064. <       memset (sector, 0, ft->sector_size);
  1065. <       if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  1066. <                cryptoInfo) == FALSE)
  1067. <           goto fail;
  1068. <
  1069. <   }
  1070. <
  1071. <   /* Fill the rest of the data area with random data */
  1072. <
  1073. <   if(!quickFormat)
  1074. <   {
  1075. <       if (!FlushFormatWriteBuffer (dev, write_buf, &write_buf_cnt, &nSecNo, cryptoInfo))
  1076. <           goto fail;
  1077. <
  1078. <       /* Generate a random temporary key set to be used for "dummy" encryption that will fill
  1079. <       the free disk space (data area) with random data.  This is necessary for plausible
  1080. <       deniability of hidden volumes (and also reduces the amount of predictable plaintext
  1081. <       within the volume). */
  1082. <
  1083. <       // Temporary master key
  1084. <       if (!RandgetBytes (temporaryKey, EAGetKeySize (cryptoInfo->ea), FALSE))
  1085. <           goto fail;
  1086. <
  1087. <       // Temporary secondary key (XTS mode)
  1088. <       if (!RandgetBytes (cryptoInfo->k2, sizeof cryptoInfo->k2, FALSE))      
  1089. <           goto fail;
  1090. <
  1091. <       retVal = EAInit (cryptoInfo->ea, temporaryKey, cryptoInfo->ks);
  1092. <       if (retVal != ERR_SUCCESS)
  1093. <       {
  1094. <           burn (temporaryKey, sizeof(temporaryKey));
  1095. <           return retVal;
  1096. <       }
  1097. <       if (!EAInitMode (cryptoInfo))
  1098. <       {
  1099. <           burn (temporaryKey, sizeof(temporaryKey));
  1100. <           return ERR_MODE_INIT_FAILED;
  1101. <       }
  1102. <
  1103. <       x = ft->num_sectors - ft->reserved - ft->size_root_dir / ft->sector_size - ft->fat_length * 2;
  1104. <       while (x--)
  1105. <       {
  1106. <           if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  1107. <               cryptoInfo) == FALSE)
  1108. <               goto fail;
  1109. <       }
  1110. <       UpdateProgressBar (nSecNo * ft->sector_size);
  1111. <   }
  1112. <   else
  1113. <       UpdateProgressBar ((uint64) ft->num_sectors * ft->sector_size);
  1114. <
  1115. <   if (!FlushFormatWriteBuffer (dev, write_buf, &write_buf_cnt, &nSecNo, cryptoInfo))
  1116. <       goto fail;
  1117. <
  1118. <   TCfree (write_buf);
  1119. <   burn (temporaryKey, sizeof(temporaryKey));
  1120. ---
  1121. >   AbortProcess ("INSECURE_APP");
  1122. 439,444d260
  1123. <
  1124. < fail:
  1125. <
  1126. <   TCfree (write_buf);
  1127. <   burn (temporaryKey, sizeof(temporaryKey));
  1128. <   return ERR_OS_ERROR;
  1129. diff -b -r tc-7.1/Common/Format.c tc-7.2/Common/Format.c
  1130. 75,674c75,76
  1131. <   int nStatus;
  1132. <   PCRYPTO_INFO cryptoInfo = NULL;
  1133. <   HANDLE dev = INVALID_HANDLE_VALUE;
  1134. <   DWORD dwError;
  1135. <   char header[TC_VOLUME_HEADER_EFFECTIVE_SIZE];
  1136. <   unsigned __int64 num_sectors, startSector;
  1137. <   fatparams ft;
  1138. <   FILETIME ftCreationTime;
  1139. <   FILETIME ftLastWriteTime;
  1140. <   FILETIME ftLastAccessTime;
  1141. <   BOOL bTimeStampValid = FALSE;
  1142. <   BOOL bInstantRetryOtherFilesys = FALSE;
  1143. <   char dosDev[TC_MAX_PATH] = { 0 };
  1144. <   char devName[MAX_PATH] = { 0 };
  1145. <   int driveLetter = -1;
  1146. <   WCHAR deviceName[MAX_PATH];
  1147. <   uint64 dataOffset, dataAreaSize;
  1148. <   LARGE_INTEGER offset;
  1149. <   BOOL bFailedRequiredDASD = FALSE;
  1150. <
  1151. <   FormatSectorSize = volParams->sectorSize;
  1152. <
  1153. <   if (FormatSectorSize < TC_MIN_VOLUME_SECTOR_SIZE
  1154. <       || FormatSectorSize > TC_MAX_VOLUME_SECTOR_SIZE
  1155. <       || FormatSectorSize % ENCRYPTION_DATA_UNIT_SIZE != 0)
  1156. <   {
  1157. <       Error ("SECTOR_SIZE_UNSUPPORTED");
  1158. <       return ERR_DONT_REPORT;
  1159. <   }
  1160. <
  1161. <   /* WARNING: Note that if Windows fails to format the volume as NTFS and the volume size is
  1162. <   less than the maximum FAT size, the user is asked within this function whether he wants to instantly
  1163. <   retry FAT format instead (to avoid having to re-create the whole container again). If the user
  1164. <   answers yes, some of the input parameters are modified, the code below 'begin_format' is re-executed
  1165. <   and some destructive operations that were performed during the first attempt must be (and are) skipped.
  1166. <   Therefore, whenever adding or modifying any potentially destructive operations below 'begin_format',
  1167. <   determine whether they (or their portions) need to be skipped during such a second attempt; if so,
  1168. <   use the 'bInstantRetryOtherFilesys' flag to skip them. */
  1169. <
  1170. <   if (volParams->hiddenVol)
  1171. <   {
  1172. <       dataOffset = volParams->hiddenVolHostSize - TC_VOLUME_HEADER_GROUP_SIZE - volParams->size;
  1173. <   }
  1174. <   else
  1175. <   {
  1176. <       if (volParams->size <= TC_TOTAL_VOLUME_HEADERS_SIZE)
  1177. <           return ERR_VOL_SIZE_WRONG;
  1178. <
  1179. <       dataOffset = TC_VOLUME_DATA_OFFSET;
  1180. <   }
  1181. <
  1182. <   dataAreaSize = GetVolumeDataAreaSize (volParams->hiddenVol, volParams->size);
  1183. <
  1184. <   num_sectors = dataAreaSize / FormatSectorSize;
  1185. <
  1186. <   if (volParams->bDevice)
  1187. <   {
  1188. <       strcpy ((char *)deviceName, volParams->volumePath);
  1189. <       ToUNICODE ((char *)deviceName);
  1190. <
  1191. <       driveLetter = GetDiskDeviceDriveLetter (deviceName);
  1192. <   }
  1193. <
  1194. <   VirtualLock (header, sizeof (header));
  1195. <
  1196. <   nStatus = CreateVolumeHeaderInMemory (FALSE,
  1197. <                    header,
  1198. <                    volParams->ea,
  1199. <                    FIRST_MODE_OF_OPERATION_ID,
  1200. <                    volParams->password,
  1201. <                    volParams->pkcs5,
  1202. <                    NULL,
  1203. <                    &cryptoInfo,
  1204. <                    dataAreaSize,
  1205. <                    volParams->hiddenVol ? dataAreaSize : 0,
  1206. <                    dataOffset,
  1207. <                    dataAreaSize,
  1208. <                    0,
  1209. <                    volParams->headerFlags,
  1210. <                    FormatSectorSize,
  1211. <                    FALSE);
  1212. <
  1213. <   if (nStatus != 0)
  1214. <   {
  1215. <       burn (header, sizeof (header));
  1216. <       VirtualUnlock (header, sizeof (header));
  1217. <       return nStatus;
  1218. <   }
  1219. <
  1220. < begin_format:
  1221. <
  1222. <   if (volParams->bDevice)
  1223. <   {
  1224. <       /* Device-hosted volume */
  1225. <
  1226. <       DWORD dwResult;
  1227. <       int nPass;
  1228. <
  1229. <       if (FakeDosNameForDevice (volParams->volumePath, dosDev, devName, FALSE) != 0)
  1230. <           return ERR_OS_ERROR;
  1231. <
  1232. <       if (IsDeviceMounted (devName))
  1233. <       {
  1234. <           if ((dev = DismountDrive (devName, volParams->volumePath)) == INVALID_HANDLE_VALUE)
  1235. <           {
  1236. <               Error ("FORMAT_CANT_DISMOUNT_FILESYS");
  1237. <               nStatus = ERR_DONT_REPORT;
  1238. <               goto error;
  1239. <           }
  1240. <
  1241. <           /* Gain "raw" access to the partition (it contains a live filesystem and the filesystem driver
  1242. <           would otherwise prevent us from writing to hidden sectors). */
  1243. <
  1244. <           if (!DeviceIoControl (dev,
  1245. <               FSCTL_ALLOW_EXTENDED_DASD_IO,
  1246. <               NULL,
  1247. <               0,  
  1248. <               NULL,
  1249. <               0,
  1250. <               &dwResult,
  1251. <               NULL))
  1252. <           {
  1253. <               bFailedRequiredDASD = TRUE;
  1254. <           }
  1255. <       }
  1256. <       else if (IsOSAtLeast (WIN_VISTA) && driveLetter == -1)
  1257. <       {
  1258. <           // Windows Vista doesn't allow overwriting sectors belonging to an unformatted partition
  1259. <           // to which no drive letter has been assigned under the system. This problem can be worked
  1260. <           // around by assigning a drive letter to the partition temporarily.
  1261. <
  1262. <           char szDriveLetter[] = { 'A', ':', 0 };
  1263. <           char rootPath[] = { 'A', ':', '\\', 0 };
  1264. <           char uniqVolName[MAX_PATH+1] = { 0 };
  1265. <           int tmpDriveLetter = -1;
  1266. <           BOOL bResult = FALSE;
  1267. <
  1268. <           tmpDriveLetter = GetFirstAvailableDrive ();
  1269. <  
  1270. <           if (tmpDriveLetter != -1)
  1271. <           {
  1272. <               rootPath[0] += (char) tmpDriveLetter;
  1273. <               szDriveLetter[0] += (char) tmpDriveLetter;
  1274. <
  1275. <               if (DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, volParams->volumePath))
  1276. <               {
  1277. <                   bResult = GetVolumeNameForVolumeMountPoint (rootPath, uniqVolName, MAX_PATH);
  1278. <
  1279. <                   DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE,
  1280. <                       szDriveLetter,
  1281. <                       volParams->volumePath);
  1282. <
  1283. <                   if (bResult
  1284. <                       && SetVolumeMountPoint (rootPath, uniqVolName))
  1285. <                   {
  1286. <                       // The drive letter can be removed now
  1287. <                       DeleteVolumeMountPoint (rootPath);
  1288. <                   }
  1289. <               }
  1290. <           }
  1291. <       }
  1292. <
  1293. <       // For extra safety, we will try to gain "raw" access to the partition. Note that this should actually be
  1294. <       // redundant because if the filesystem was mounted, we already tried to obtain DASD above. If we failed,
  1295. <       // bFailedRequiredDASD was set to TRUE and therefore we will perform pseudo "quick format" below. However,
  1296. <       // for extra safety, in case IsDeviceMounted() failed to detect a live filesystem, we will blindly
  1297. <       // send FSCTL_ALLOW_EXTENDED_DASD_IO (possibly for a second time) without checking the result.
  1298. <
  1299. <       DeviceIoControl (dev,
  1300. <           FSCTL_ALLOW_EXTENDED_DASD_IO,
  1301. <           NULL,
  1302. <           0,  
  1303. <           NULL,
  1304. <           0,
  1305. <           &dwResult,
  1306. <           NULL);
  1307. <
  1308. <
  1309. <       // If DASD is needed but we failed to obtain it, perform open - 'quick format' - close - open
  1310. <       // so that the filesystem driver does not prevent us from formatting hidden sectors.
  1311. <       for (nPass = (bFailedRequiredDASD ? 0 : 1); nPass < 2; nPass++)
  1312. <       {
  1313. <           int retryCount;
  1314. <
  1315. <           retryCount = 0;
  1316. <
  1317. <           // Try exclusive access mode first
  1318. <           // Note that when exclusive access is denied, it is worth retrying (usually succeeds after a few tries).
  1319. <           while (dev == INVALID_HANDLE_VALUE && retryCount++ < EXCL_ACCESS_MAX_AUTO_RETRIES)
  1320. <           {
  1321. <               dev = CreateFile (devName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
  1322. <
  1323. <               if (retryCount > 1)
  1324. <                   Sleep (EXCL_ACCESS_AUTO_RETRY_DELAY);
  1325. <           }
  1326. <
  1327. <           if (dev == INVALID_HANDLE_VALUE)
  1328. <           {
  1329. <               // Exclusive access denied -- retry in shared mode
  1330. <               dev = CreateFile (devName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
  1331. <               if (dev != INVALID_HANDLE_VALUE)
  1332. <               {
  1333. <                   if (IDNO == MessageBoxW (volParams->hwndDlg, GetString ("DEVICE_IN_USE_FORMAT"), lpszTitle, MB_YESNO|MB_ICONWARNING|MB_DEFBUTTON2))
  1334. <                   {
  1335. <                       nStatus = ERR_DONT_REPORT;
  1336. <                       goto error;
  1337. <                   }
  1338. <               }
  1339. <               else
  1340. <               {
  1341. <                   handleWin32Error (volParams->hwndDlg);
  1342. <                   Error ("CANT_ACCESS_VOL");
  1343. <                   nStatus = ERR_DONT_REPORT;
  1344. <                   goto error;
  1345. <               }
  1346. <           }
  1347. <
  1348. <           if (volParams->hiddenVol || bInstantRetryOtherFilesys)
  1349. <               break;  // The following "quick format" operation would damage the outer volume
  1350. <
  1351. <           if (nPass == 0)
  1352. <           {
  1353. <               char buf [2 * TC_MAX_VOLUME_SECTOR_SIZE];
  1354. <               DWORD bw;
  1355. <
  1356. <               // Perform pseudo "quick format" so that the filesystem driver does not prevent us from
  1357. <               // formatting hidden sectors
  1358. <               memset (buf, 0, sizeof (buf));
  1359. <
  1360. <               if (!WriteFile (dev, buf, sizeof (buf), &bw, NULL))
  1361. <               {
  1362. <                   nStatus = ERR_OS_ERROR;
  1363. <                   goto error;
  1364. <               }
  1365. <
  1366. <               FlushFileBuffers (dev);
  1367. <               CloseHandle (dev);
  1368. <               dev = INVALID_HANDLE_VALUE;
  1369. <           }
  1370. <       }
  1371. <
  1372. <       if (DeviceIoControl (dev, FSCTL_IS_VOLUME_MOUNTED, NULL, 0, NULL, 0, &dwResult, NULL))
  1373. <       {
  1374. <           Error ("FORMAT_CANT_DISMOUNT_FILESYS");
  1375. <           nStatus = ERR_DONT_REPORT;
  1376. <           goto error;
  1377. <       }
  1378. <   }
  1379. <   else
  1380. <   {
  1381. <       /* File-hosted volume */
  1382. <
  1383. <       dev = CreateFile (volParams->volumePath, GENERIC_READ | GENERIC_WRITE,
  1384. <           (volParams->hiddenVol || bInstantRetryOtherFilesys) ? (FILE_SHARE_READ | FILE_SHARE_WRITE) : 0,
  1385. <           NULL, (volParams->hiddenVol || bInstantRetryOtherFilesys) ? OPEN_EXISTING : CREATE_ALWAYS, 0, NULL);
  1386. <
  1387. <       if (dev == INVALID_HANDLE_VALUE)
  1388. <       {
  1389. <           nStatus = ERR_OS_ERROR;
  1390. <           goto error;
  1391. <       }
  1392. <
  1393. <       DisableFileCompression (dev);
  1394. <
  1395. <       if (!volParams->hiddenVol && !bInstantRetryOtherFilesys)
  1396. <       {
  1397. <           LARGE_INTEGER volumeSize;
  1398. <           volumeSize.QuadPart = dataAreaSize + TC_VOLUME_HEADER_GROUP_SIZE;
  1399. <
  1400. <           if (volParams->sparseFileSwitch && volParams->quickFormat)
  1401. <           {
  1402. <               // Create as sparse file container
  1403. <               DWORD tmp;
  1404. <               if (!DeviceIoControl (dev, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &tmp, NULL))
  1405. <               {
  1406. <                   nStatus = ERR_OS_ERROR;
  1407. <                   goto error;
  1408. <               }
  1409. <           }
  1410. <
  1411. <           // Preallocate the file
  1412. <           if (!SetFilePointerEx (dev, volumeSize, NULL, FILE_BEGIN)
  1413. <               || !SetEndOfFile (dev)
  1414. <               || SetFilePointer (dev, 0, NULL, FILE_BEGIN) != 0)
  1415. <           {
  1416. <               nStatus = ERR_OS_ERROR;
  1417. <               goto error;
  1418. <           }
  1419. <       }
  1420. <   }
  1421. <
  1422. <   if (volParams->hiddenVol && !volParams->bDevice && bPreserveTimestamp)
  1423. <   {
  1424. <       if (GetFileTime ((HANDLE) dev, &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime) == 0)
  1425. <           bTimeStampValid = FALSE;
  1426. <       else
  1427. <           bTimeStampValid = TRUE;
  1428. <   }
  1429. <
  1430. <   KillTimer (volParams->hwndDlg, TIMER_ID_RANDVIEW);
  1431. <
  1432. <   /* Volume header */
  1433. <
  1434. <   // Hidden volume setup
  1435. <   if (volParams->hiddenVol)
  1436. <   {
  1437. <       LARGE_INTEGER headerOffset;
  1438. <
  1439. <       // Check hidden volume size
  1440. <       if (volParams->hiddenVolHostSize < TC_MIN_HIDDEN_VOLUME_HOST_SIZE || volParams->hiddenVolHostSize > TC_MAX_HIDDEN_VOLUME_HOST_SIZE)
  1441. <       {      
  1442. <           nStatus = ERR_VOL_SIZE_WRONG;
  1443. <           goto error;
  1444. <       }
  1445. <
  1446. <       // Seek to hidden volume header location
  1447. <      
  1448. <       headerOffset.QuadPart = TC_HIDDEN_VOLUME_HEADER_OFFSET;
  1449. <
  1450. <       if (!SetFilePointerEx ((HANDLE) dev, headerOffset, NULL, FILE_BEGIN))
  1451. <       {
  1452. <           nStatus = ERR_OS_ERROR;
  1453. <           goto error;
  1454. <       }
  1455. <   }
  1456. <   else if (bInstantRetryOtherFilesys)
  1457. <   {
  1458. <       // The previous file system format failed and the user wants to try again with a different file system.
  1459. <       // The volume header had been written successfully so we need to seek to the byte after the header.
  1460. <
  1461. <       LARGE_INTEGER offset;
  1462. <       offset.QuadPart = TC_VOLUME_DATA_OFFSET;
  1463. <       if (!SetFilePointerEx ((HANDLE) dev, offset, NULL, FILE_BEGIN))
  1464. <       {
  1465. <           nStatus = ERR_OS_ERROR;
  1466. <           goto error;
  1467. <       }
  1468. <   }
  1469. <
  1470. <   if (!bInstantRetryOtherFilesys)
  1471. <   {
  1472. <       // Write the volume header
  1473. <       if (!WriteEffectiveVolumeHeader (volParams->bDevice, dev, header))
  1474. <       {
  1475. <           nStatus = ERR_OS_ERROR;
  1476. <           goto error;
  1477. <       }
  1478. <
  1479. <       // To prevent fragmentation, write zeroes to reserved header sectors which are going to be filled with random data
  1480. <       if (!volParams->bDevice && !volParams->hiddenVol)
  1481. <       {
  1482. <           byte buf[TC_VOLUME_HEADER_GROUP_SIZE - TC_VOLUME_HEADER_EFFECTIVE_SIZE];
  1483. <           DWORD bytesWritten;
  1484. <           ZeroMemory (buf, sizeof (buf));
  1485. <
  1486. <           if (!WriteFile (dev, buf, sizeof (buf), &bytesWritten, NULL))
  1487. <           {
  1488. <               nStatus = ERR_OS_ERROR;
  1489. <               goto error;
  1490. <           }
  1491. <
  1492. <           if (bytesWritten != sizeof (buf))
  1493. <           {
  1494. <               nStatus = ERR_PARAMETER_INCORRECT;
  1495. <               goto error;
  1496. <           }
  1497. <       }
  1498. <   }
  1499. <
  1500. <   if (volParams->hiddenVol)
  1501. <   {
  1502. <       // Calculate data area position of hidden volume
  1503. <       cryptoInfo->hiddenVolumeOffset = dataOffset;
  1504. <
  1505. <       // Validate the offset
  1506. <       if (dataOffset % FormatSectorSize != 0)
  1507. <       {
  1508. <           nStatus = ERR_VOL_SIZE_WRONG;
  1509. <           goto error;
  1510. <       }
  1511. <
  1512. <       volParams->quickFormat = TRUE;      // To entirely format a hidden volume would be redundant
  1513. <   }
  1514. <
  1515. <   /* Data area */
  1516. <   startSector = dataOffset / FormatSectorSize;
  1517. <
  1518. <   // Format filesystem
  1519. <
  1520. <   switch (volParams->fileSystem)
  1521. <   {
  1522. <   case FILESYS_NONE:
  1523. <   case FILESYS_NTFS:
  1524. <
  1525. <       if (volParams->bDevice && !StartFormatWriteThread())
  1526. <       {
  1527. <           nStatus = ERR_OS_ERROR;
  1528. <           goto error;
  1529. <       }
  1530. <
  1531. <       nStatus = FormatNoFs (startSector, num_sectors, dev, cryptoInfo, volParams->quickFormat);
  1532. <
  1533. <       if (volParams->bDevice)
  1534. <           StopFormatWriteThread();
  1535. <
  1536. <       break;
  1537. <      
  1538. <   case FILESYS_FAT:
  1539. <       if (num_sectors > 0xFFFFffff)
  1540. <       {
  1541. <           nStatus = ERR_VOL_SIZE_WRONG;
  1542. <           goto error;
  1543. <       }
  1544. <
  1545. <       // Calculate the fats, root dir etc
  1546. <       ft.num_sectors = (unsigned int) (num_sectors);
  1547. <
  1548. < #if TC_MAX_VOLUME_SECTOR_SIZE > 0xFFFF
  1549. < #error TC_MAX_VOLUME_SECTOR_SIZE > 0xFFFF
  1550. < #endif
  1551. <
  1552. <       ft.sector_size = (uint16) FormatSectorSize;
  1553. <       ft.cluster_size = volParams->clusterSize;
  1554. <       memcpy (ft.volume_name, "NO NAME    ", 11);
  1555. <       GetFatParams (&ft);
  1556. <       *(volParams->realClusterSize) = ft.cluster_size * FormatSectorSize;
  1557. <
  1558. <       if (volParams->bDevice && !StartFormatWriteThread())
  1559. <       {
  1560. <           nStatus = ERR_OS_ERROR;
  1561. <           goto error;
  1562. <       }
  1563. <
  1564. <       nStatus = FormatFat (startSector, &ft, (void *) dev, cryptoInfo, volParams->quickFormat);
  1565. <
  1566. <       if (volParams->bDevice)
  1567. <           StopFormatWriteThread();
  1568. <
  1569. <       break;
  1570. <
  1571. <   default:
  1572. <       nStatus = ERR_PARAMETER_INCORRECT;
  1573. <       goto error;
  1574. <   }
  1575. <
  1576. <   if (nStatus != ERR_SUCCESS)
  1577. <       goto error;
  1578. <
  1579. <   // Write header backup
  1580. <   offset.QuadPart = volParams->hiddenVol ? volParams->hiddenVolHostSize - TC_HIDDEN_VOLUME_HEADER_OFFSET : dataAreaSize + TC_VOLUME_HEADER_GROUP_SIZE;
  1581. <
  1582. <   if (!SetFilePointerEx ((HANDLE) dev, offset, NULL, FILE_BEGIN))
  1583. <   {
  1584. <       nStatus = ERR_OS_ERROR;
  1585. <       goto error;
  1586. <   }
  1587. <
  1588. <   nStatus = CreateVolumeHeaderInMemory (FALSE,
  1589. <       header,
  1590. <       volParams->ea,
  1591. <       FIRST_MODE_OF_OPERATION_ID,
  1592. <       volParams->password,
  1593. <       volParams->pkcs5,
  1594. <       cryptoInfo->master_keydata,
  1595. <       &cryptoInfo,
  1596. <       dataAreaSize,
  1597. <       volParams->hiddenVol ? dataAreaSize : 0,
  1598. <       dataOffset,
  1599. <       dataAreaSize,
  1600. <       0,
  1601. <       volParams->headerFlags,
  1602. <       FormatSectorSize,
  1603. <       FALSE);
  1604. <
  1605. <   if (!WriteEffectiveVolumeHeader (volParams->bDevice, dev, header))
  1606. <   {
  1607. <       nStatus = ERR_OS_ERROR;
  1608. <       goto error;
  1609. <   }
  1610. <
  1611. <   // Fill reserved header sectors (including the backup header area) with random data
  1612. <   if (!volParams->hiddenVol)
  1613. <   {
  1614. <       nStatus = WriteRandomDataToReservedHeaderAreas (dev, cryptoInfo, dataAreaSize, FALSE, FALSE);
  1615. <
  1616. <       if (nStatus != ERR_SUCCESS)
  1617. <           goto error;
  1618. <   }
  1619. <
  1620. < #ifndef DEBUG
  1621. <   if (volParams->quickFormat && volParams->fileSystem != FILESYS_NTFS)
  1622. <       Sleep (500);    // User-friendly GUI
  1623. < #endif
  1624. <
  1625. < error:
  1626. <   dwError = GetLastError();
  1627. <
  1628. <   burn (header, sizeof (header));
  1629. <   VirtualUnlock (header, sizeof (header));
  1630. <
  1631. <   if (dev != INVALID_HANDLE_VALUE)
  1632. <   {
  1633. <       if (!volParams->bDevice && !volParams->hiddenVol && nStatus != 0)
  1634. <       {
  1635. <           // Remove preallocated part before closing file handle if format failed
  1636. <           if (SetFilePointer (dev, 0, NULL, FILE_BEGIN) == 0)
  1637. <               SetEndOfFile (dev);
  1638. <       }
  1639. <
  1640. <       FlushFileBuffers (dev);
  1641. <
  1642. <       if (bTimeStampValid)
  1643. <           SetFileTime (dev, &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime);
  1644. <
  1645. <       CloseHandle (dev);
  1646. <       dev = INVALID_HANDLE_VALUE;
  1647. <   }
  1648. <
  1649. <   if (nStatus != 0)
  1650. <   {
  1651. <       SetLastError(dwError);
  1652. <       goto fv_end;
  1653. <   }
  1654. <
  1655. <   if (volParams->fileSystem == FILESYS_NTFS)
  1656. <   {
  1657. <       // Quick-format volume as NTFS
  1658. <       int driveNo = GetLastAvailableDrive ();
  1659. <       MountOptions mountOptions;
  1660. <       int retCode;
  1661. <
  1662. <       ZeroMemory (&mountOptions, sizeof (mountOptions));
  1663. <
  1664. <       if (driveNo == -1)
  1665. <       {
  1666. <           MessageBoxW (volParams->hwndDlg, GetString ("NO_FREE_DRIVES"), lpszTitle, ICON_HAND);
  1667. <           MessageBoxW (volParams->hwndDlg, GetString ("FORMAT_NTFS_STOP"), lpszTitle, ICON_HAND);
  1668. <
  1669. <           nStatus = ERR_NO_FREE_DRIVES;
  1670. <           goto fv_end;
  1671. <       }
  1672. <
  1673. <       mountOptions.ReadOnly = FALSE;
  1674. <       mountOptions.Removable = FALSE;
  1675. <       mountOptions.ProtectHiddenVolume = FALSE;
  1676. <       mountOptions.PreserveTimestamp = bPreserveTimestamp;
  1677. <       mountOptions.PartitionInInactiveSysEncScope = FALSE;
  1678. <       mountOptions.UseBackupHeader = FALSE;
  1679. <
  1680. <       if (MountVolume (volParams->hwndDlg, driveNo, volParams->volumePath, volParams->password, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
  1681. <       {
  1682. <           MessageBoxW (volParams->hwndDlg, GetString ("CANT_MOUNT_VOLUME"), lpszTitle, ICON_HAND);
  1683. <           MessageBoxW (volParams->hwndDlg, GetString ("FORMAT_NTFS_STOP"), lpszTitle, ICON_HAND);
  1684. <           nStatus = ERR_VOL_MOUNT_FAILED;
  1685. <           goto fv_end;
  1686. <       }
  1687. <
  1688. <       if (!IsAdmin () && IsUacSupported ())
  1689. <           retCode = UacFormatNtfs (volParams->hwndDlg, driveNo, volParams->clusterSize);
  1690. <       else
  1691. <           retCode = FormatNtfs (driveNo, volParams->clusterSize);
  1692. <
  1693. <       if (retCode != TRUE)
  1694. <       {
  1695. <           if (!UnmountVolume (volParams->hwndDlg, driveNo, FALSE))
  1696. <               MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND);
  1697. <
  1698. <           if (dataAreaSize <= TC_MAX_FAT_SECTOR_COUNT * FormatSectorSize)
  1699. <           {
  1700. <               if (AskErrYesNo ("FORMAT_NTFS_FAILED_ASK_FAT") == IDYES)
  1701. <               {
  1702. <                   // NTFS format failed and the user wants to try FAT format immediately
  1703. <                   volParams->fileSystem = FILESYS_FAT;
  1704. <                   bInstantRetryOtherFilesys = TRUE;
  1705. <                   volParams->quickFormat = TRUE;      // Volume has already been successfully TC-formatted
  1706. <                   volParams->clusterSize = 0;     // Default cluster size
  1707. <                   goto begin_format;
  1708. <               }
  1709. <           }
  1710. <           else
  1711. <               Error ("FORMAT_NTFS_FAILED");
  1712. <
  1713. <           nStatus = ERR_DONT_REPORT;
  1714. <           goto fv_end;
  1715. <       }
  1716. <
  1717. <       if (!UnmountVolume (volParams->hwndDlg, driveNo, FALSE))
  1718. <           MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND);
  1719. <   }
  1720. <
  1721. < fv_end:
  1722. <   dwError = GetLastError();
  1723. <
  1724. <   if (dosDev[0])
  1725. <       RemoveFakeDosName (volParams->volumePath, dosDev);
  1726. <
  1727. <   crypto_close (cryptoInfo);
  1728. <
  1729. <   SetLastError (dwError);
  1730. <   return nStatus;
  1731. ---
  1732. >   AbortProcess ("INSECURE_APP");
  1733. >   return 0;
  1734. 678c80
  1735. < int FormatNoFs (unsigned __int64 startSector, __int64 num_sectors, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat)
  1736. ---
  1737. > int FormatNoFs(unsigned __int64 startSector, __int64 num_sectors, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat)
  1738. 680,770c82
  1739. <   int write_buf_cnt = 0;
  1740. <   char sector[TC_MAX_VOLUME_SECTOR_SIZE], *write_buf;
  1741. <   unsigned __int64 nSecNo = startSector;
  1742. <   int retVal = 0;
  1743. <   DWORD err;
  1744. <   char temporaryKey[MASTER_KEYDATA_SIZE];
  1745. <   char originalK2[MASTER_KEYDATA_SIZE];
  1746. <
  1747. <   LARGE_INTEGER startOffset;
  1748. <   LARGE_INTEGER newOffset;
  1749. <
  1750. <   // Seek to start sector
  1751. <   startOffset.QuadPart = startSector * FormatSectorSize;
  1752. <   if (!SetFilePointerEx ((HANDLE) dev, startOffset, &newOffset, FILE_BEGIN)
  1753. <       || newOffset.QuadPart != startOffset.QuadPart)
  1754. <   {
  1755. <       return ERR_OS_ERROR;
  1756. <   }
  1757. <
  1758. <   write_buf = (char *)TCalloc (FormatWriteBufferSize);
  1759. <   if (!write_buf)
  1760. <       return ERR_OUTOFMEMORY;
  1761. <
  1762. <   VirtualLock (temporaryKey, sizeof (temporaryKey));
  1763. <   VirtualLock (originalK2, sizeof (originalK2));
  1764. <
  1765. <   memset (sector, 0, sizeof (sector));
  1766. <
  1767. <   // Remember the original secondary key (XTS mode) before generating a temporary one
  1768. <   memcpy (originalK2, cryptoInfo->k2, sizeof (cryptoInfo->k2));
  1769. <
  1770. <   /* Fill the rest of the data area with random data */
  1771. <
  1772. <   if(!quickFormat)
  1773. <   {
  1774. <       /* Generate a random temporary key set to be used for "dummy" encryption that will fill
  1775. <       the free disk space (data area) with random data.  This is necessary for plausible
  1776. <       deniability of hidden volumes. */
  1777. <
  1778. <       // Temporary master key
  1779. <       if (!RandgetBytes (temporaryKey, EAGetKeySize (cryptoInfo->ea), FALSE))
  1780. <           goto fail;
  1781. <
  1782. <       // Temporary secondary key (XTS mode)
  1783. <       if (!RandgetBytes (cryptoInfo->k2, sizeof cryptoInfo->k2, FALSE))
  1784. <           goto fail;
  1785. <
  1786. <       retVal = EAInit (cryptoInfo->ea, temporaryKey, cryptoInfo->ks);
  1787. <       if (retVal != ERR_SUCCESS)
  1788. <           goto fail;
  1789. <
  1790. <       if (!EAInitMode (cryptoInfo))
  1791. <       {
  1792. <           retVal = ERR_MODE_INIT_FAILED;
  1793. <           goto fail;
  1794. <       }
  1795. <
  1796. <       while (num_sectors--)
  1797. <       {
  1798. <           if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
  1799. <               cryptoInfo) == FALSE)
  1800. <               goto fail;
  1801. <       }
  1802. <
  1803. <       if (!FlushFormatWriteBuffer (dev, write_buf, &write_buf_cnt, &nSecNo, cryptoInfo))
  1804. <           goto fail;
  1805. <   }
  1806. <   else
  1807. <       nSecNo = num_sectors;
  1808. <
  1809. <   UpdateProgressBar (nSecNo * FormatSectorSize);
  1810. <
  1811. <   // Restore the original secondary key (XTS mode) in case NTFS format fails and the user wants to try FAT immediately
  1812. <   memcpy (cryptoInfo->k2, originalK2, sizeof (cryptoInfo->k2));
  1813. <
  1814. <   // Reinitialize the encryption algorithm and mode in case NTFS format fails and the user wants to try FAT immediately
  1815. <   retVal = EAInit (cryptoInfo->ea, cryptoInfo->master_keydata, cryptoInfo->ks);
  1816. <   if (retVal != ERR_SUCCESS)
  1817. <       goto fail;
  1818. <   if (!EAInitMode (cryptoInfo))
  1819. <   {
  1820. <       retVal = ERR_MODE_INIT_FAILED;
  1821. <       goto fail;
  1822. <   }
  1823. <
  1824. <   burn (temporaryKey, sizeof(temporaryKey));
  1825. <   burn (originalK2, sizeof(originalK2));
  1826. <   VirtualUnlock (temporaryKey, sizeof (temporaryKey));
  1827. <   VirtualUnlock (originalK2, sizeof (originalK2));
  1828. <   TCfree (write_buf);
  1829. <
  1830. ---
  1831. >   AbortProcess ("INSECURE_APP");
  1832. 772,783d83
  1833. <
  1834. < fail:
  1835. <   err = GetLastError();
  1836. <
  1837. <   burn (temporaryKey, sizeof(temporaryKey));
  1838. <   burn (originalK2, sizeof(originalK2));
  1839. <   VirtualUnlock (temporaryKey, sizeof (temporaryKey));
  1840. <   VirtualUnlock (originalK2, sizeof (originalK2));
  1841. <   TCfree (write_buf);
  1842. <
  1843. <   SetLastError (err);
  1844. <   return (retVal ? retVal : ERR_OS_ERROR);
  1845. 798,827c98,99
  1846. <   WCHAR dir[8] = { (WCHAR) driveNo + 'A', 0 };
  1847. <   PFORMATEX FormatEx;
  1848. <   HMODULE hModule = LoadLibrary ("fmifs.dll");
  1849. <   int i;
  1850. <
  1851. <   if (hModule == NULL)
  1852. <       return FALSE;
  1853. <
  1854. <   if (!(FormatEx = (PFORMATEX) GetProcAddress (GetModuleHandle ("fmifs.dll"), "FormatEx")))
  1855. <   {
  1856. <       FreeLibrary (hModule);
  1857. <       return FALSE;
  1858. <   }
  1859. <
  1860. <   wcscat (dir, L":\\");
  1861. <
  1862. <   FormatExResult = FALSE;
  1863. <
  1864. <   // Windows sometimes fails to format a volume (hosted on a removable medium) as NTFS.
  1865. <   // It often helps to retry several times.
  1866. <   for (i = 0; i < 50 && FormatExResult != TRUE; i++)
  1867. <   {
  1868. <       FormatEx (dir, FMIFS_HARDDISK, L"NTFS", L"", TRUE, clusterSize * FormatSectorSize, FormatExCallback);
  1869. <   }
  1870. <
  1871. <   // The device may be referenced for some time after FormatEx() returns
  1872. <   Sleep (2000);
  1873. <
  1874. <   FreeLibrary (hModule);
  1875. <   return FormatExResult;
  1876. ---
  1877. >   AbortProcess ("INSECURE_APP");
  1878. >   return 0;
  1879. diff -b -r tc-7.1/Common/Keyfiles.c tc-7.2/Common/Keyfiles.c
  1880. 455,456d454
  1881. <
  1882. <           ToHyperlink (hwndDlg, IDC_LINK_KEYFILES_INFO);
  1883. 545,549d542
  1884. <       }
  1885. <
  1886. <       if (lw == IDC_LINK_KEYFILES_INFO)
  1887. <       {
  1888. <           Applink ("keyfiles", TRUE, "");
  1889. diff -b -r tc-7.1/Common/Language.c tc-7.2/Common/Language.c
  1890. 147c147
  1891. <       if (defaultLangParsed && strcmp (attr, VERSION_STRING) && strcmp (attr, "DEBUG"))
  1892. ---
  1893. >       if (defaultLangParsed && strcmp (attr, VERSION_STRING) && strcmp (attr, "DEBUG") && strcmp (attr, "7.1a"))
  1894. 150c150
  1895. <           swprintf (m, L"The installed language pack is incompatible with this version of TrueCrypt (the language pack is for TrueCrypt %hs). A newer version may be available at www.truecrypt.org.\n\nTo prevent this message from being displayed, do any of the following:\n\n- Select 'Settings' > 'Language'; then select 'English' and click 'OK'.\n\n- Remove or replace the language pack with a compatible version (the language pack may reside e.g. in 'C:\\Program Files\\TrueCrypt' or '%%LOCALAPPDATA%%\\VirtualStore\\Program Files\\TrueCrypt', etc.)", attr);
  1896. ---
  1897. >           swprintf (m, L"The installed language pack is incompatible with this version of TrueCrypt (the language pack is for TrueCrypt %hs).\n\nTo prevent this message from being displayed, do any of the following:\n\n- Select 'Settings' > 'Language'; then select 'English' and click 'OK'.\n\n- Remove or replace the language pack with a compatible version (the language pack may reside e.g. in 'C:\\Program Files\\TrueCrypt' or '%%LOCALAPPDATA%%\\VirtualStore\\Program Files\\TrueCrypt', etc.)", attr);
  1898. 334d333
  1899. <           ToHyperlink (hwndDlg, IDC_GET_LANG_PACKS);
  1900. 462,476d460
  1901. <
  1902. <       if (lw == IDC_GET_LANG_PACKS)
  1903. <       {
  1904. <           char tmpstr [256];
  1905. <
  1906. <           if (strlen (ActiveLangPackVersion) > 0 && strlen (GetPreferredLangId()) > 0)
  1907. <               sprintf (tmpstr, "&langpackversion=%s&lang=%s", ActiveLangPackVersion, GetPreferredLangId());
  1908. <           else
  1909. <               tmpstr[0] = 0;
  1910. <
  1911. <           Applink ("localizations", TRUE, tmpstr);
  1912. <
  1913. <           return 1;
  1914. <       }
  1915. <       return 0;
  1916. diff -b -r tc-7.1/Common/Language.xml tc-7.2/Common/Language.xml
  1917. 3c3
  1918. <   <localization prog-version="7.1a">
  1919. ---
  1920. >   <localization prog-version="7.2">
  1921. 16d15
  1922. <     <control lang="en" key="IDC_DONATE">Donate now...</control>
  1923. 40d38
  1924. <     <control lang="en" key="IDC_HIDDEN_SYSENC_INFO_LINK">More information</control>
  1925. 42d39
  1926. <     <control lang="en" key="IDC_HIDDEN_VOL_HELP">More information about hidden volumes</control>
  1927. 48,49d44
  1928. <     <control lang="en" key="IDC_LINK_HASH_INFO">Information on hash algorithms</control>
  1929. <     <control lang="en" key="IDC_LINK_MORE_INFO_ABOUT_CIPHER">More information</control>
  1930. 51,53d45
  1931. <     <control lang="en" key="IDC_MORE_INFO_ON_CONTAINERS">More information</control>
  1932. <     <control lang="en" key="IDC_MORE_INFO_ON_SYS_ENCRYPTION">More information about system encryption</control>
  1933. <     <control lang="en" key="IDC_MORE_INFO_SYS_ENCRYPTION">More information</control>
  1934. 73a66
  1935. >     <control lang="en" key="IDT_DRIVE_LETTER">Drive letter:</control>
  1936. 110d102
  1937. <     <control lang="en" key="IDC_CREATE_VOLUME">&amp;Create Volume</control>
  1938. 116d107
  1939. <     <control lang="en" key="IDC_FAVORITES_HELP_LINK">Help on favorite volumes</control>
  1940. 137,138d127
  1941. <     <control lang="en" key="IDC_MORE_INFO_ON_HW_ACCELERATION">More information</control>
  1942. <     <control lang="en" key="IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION">More information</control>
  1943. 169d157
  1944. <     <control lang="en" key="IDC_VOLUME_PROPERTIES">&amp;Volume Properties...</control>
  1945. 187d174
  1946. <     <control lang="en" key="IDM_ANALYZE_SYSTEM_CRASH">Analyze a System Crash...</control>
  1947. 196,197d182
  1948. <     <control lang="en" key="IDM_CONTACT">Contact</control>
  1949. <     <control lang="en" key="IDM_CREATE_HIDDEN_OS">Create Hidden Operating System...</control>
  1950. 199a185
  1951. >     <control lang="en" key="IDM_DECRYPT_NONSYS_VOL">Permanently Decrypt...</control>
  1952. 202,204d187
  1953. <     <control lang="en" key="IDM_FAQ">Frequently Asked Questions</control>
  1954. <     <control lang="en" key="IDM_HELP">User's Guide</control>
  1955. <     <control lang="en" key="IDM_HOMEPAGE">&amp;Homepage </control>
  1956. 215,217d197
  1957. <     <control lang="en" key="IDM_NEWS">News</control>
  1958. <     <control lang="en" key="IDM_ONLINE_HELP">Online Help</control>
  1959. <     <control lang="en" key="IDM_ONLINE_TUTORIAL">Beginner's Tutorial</control>
  1960. 226c206
  1961. <     <control lang="en" key="IDM_RESUME_INTERRUPTED_PROC">Resume Interrupted Process</control>
  1962. ---
  1963. >     <control lang="en" key="IDM_RESUME_INTERRUPTED_PROC">Resume Interrupted Decryption...</control>
  1964. 234d213
  1965. <     <control lang="en" key="IDM_TC_DOWNLOADS">Downloads</control>
  1966. 241d219
  1967. <     <control lang="en" key="IDM_VERSION_HISTORY">Version History</control>
  1968. 244d221
  1969. <     <control lang="en" key="IDM_WEBSITE">TrueCrypt Website</control>
  1970. 261a239
  1971. >     <control lang="en" key="IDT_INSECURE_APP">WARNING: Using TrueCrypt is not secure</control>
  1972. 288d265
  1973. <     <control lang="en" key="IDC_GET_LANG_PACKS">Download language pack</control>
  1974. 296,297d272
  1975. <     <control lang="en" key="IDC_LINK_HIDVOL_PROTECTION_INFO">What is hidden volume protection?</control>
  1976. <     <control lang="en" key="IDC_LINK_KEYFILES_INFO">More information on keyfiles</control>
  1977. 356d330
  1978. <     <control lang="en" key="MENU_WEBSITE">   Home&amp;page   </control>
  1979. 357a332
  1980. >     <string lang="en" key="INSECURE_APP">WARNING: Using TrueCrypt is not secure as it may contain unfixed security issues. Use it only to migrate existing data encrypted by TrueCrypt.\n\nThe development of TrueCrypt was ended in 5/2014 after Microsoft terminated support of Windows XP. Windows 8/7/Vista and later offer integrated support for encrypted disks and virtual disk images.\n\nUse BitLocker to encrypt data:\n\n- To encrypt a drive, click icon of the drive in Explorer using the right mouse button and select 'Turn on BitLocker'.\n\n- To create an encrypted file container:\n1) Create a virtual disk in Disk Management (right-click Computer/PC icon > select 'Manage' > select 'Storage' > select 'Disk Management' > select 'Action' menu > select 'Create VHD').\n2) Initialize the disk (right-click it and select 'Initialize Disk') and create a partition on it (right-click unallocated space on the drive and select 'New Simple Volume').\n3) Encrypt the new virtual drive by BitLocker (right-click it in Explorer and select 'Turn on BitLocker').</string>
  1981. 363c338
  1982. <     <string lang="en" key="ADMIN_PRIVILEGES_WARN_DEVICES">Please note that in order to encrypt/format a partition/device you need to be logged into an account with administrator privileges.\n\nThis does not apply to file-hosted volumes.</string>
  1983. ---
  1984. >     <string lang="en" key="ADMIN_PRIVILEGES_WARN_DEVICES">Please note that in order to encrypt, decrypt, or format a partition/device you need to be logged into an account with administrator privileges. (This does not apply to file-hosted volumes.)</string>
  1985. 423,437d397
  1986. <     <string lang="en" key="EXCEPTION_REPORT">A critical error has occurred and TrueCrypt must be terminated. If this is caused by a bug in TrueCrypt, we would like to fix it. To help us, you can send us an automatically generated error report containing the following items:\n\n- Program version\n- Operating system version\n- Type of CPU\n- TrueCrypt component name\n- Checksum of TrueCrypt executable\n- Symbolic name of dialog window\n- Error category\n- Error address\n- TrueCrypt call stack\n\nIf you select 'Yes', the following URL (which contains the entire error report) will be opened in your default Internet browser.\n\n%hs\n\nDo you want to send us the above error report?</string>
  1987. <     <string lang="en" key="EXCEPTION_REPORT_EXT">A critical error has occurred in your system, which requires TrueCrypt to be terminated.\n\nNote that this error has not been caused by TrueCrypt (so the TrueCrypt developers cannot fix it). Please, check your system for possible problems (e.g., system configuration, network connection, failing hardware components).</string>
  1988. <     <string lang="en" key="EXCEPTION_REPORT_EXT_FILESEL">A critical error has occurred in your system, which requires TrueCrypt to be terminated.\n\nIf this problem persists, you may want to try disabling or uninstalling applications that could potentially be causing this issue, such as antivirus or Internet security software, system "enhancers", "optimizers" or "tweakers", etc. If it does not help, you may want to try reinstalling your operating system (this problem may also be caused by malware).</string>
  1989. <     <string lang="en" key="EXCEPTION_REPORT_TITLE">TrueCrypt Critical Error</string>
  1990. <     <string lang="en" key="SYSTEM_CRASHED_ASK_REPORT">TrueCrypt detected that the operating system recently crashed. There are many potential reasons why the system could have crashed (for example, a failing hardware component, a bug in a device driver, etc.)\n\nDo you want TrueCrypt to check whether a bug in TrueCrypt could have caused the system crash?</string>
  1991. <     <string lang="en" key="ASK_KEEP_DETECTING_SYSTEM_CRASH">Do you want TrueCrypt to continue detecting system crashes?</string>
  1992. <     <string lang="en" key="NO_MINIDUMP_FOUND">TrueCrypt found no system crash minidump file.</string>
  1993. <     <string lang="en" key="ASK_DELETE_KERNEL_CRASH_DUMP">Do you want to delete the Windows crash dump file to free up disk space?</string>
  1994. <     <string lang="en" key="ASK_DEBUGGER_INSTALL">In order to analyze the system crash, TrueCrypt needs to install Microsoft Debugging Tools for Windows first.\n\nAfter you click OK, the Windows installer will download the Microsoft Debugging Tools installation package (16 MB) from a Microsoft server and install it (the Windows installer will be forwarded to the Microsoft server URL from the truecrypt.org server, which ensures that this feature works even if Microsoft changes the location of the installation package).</string>
  1995. <     <string lang="en" key="SYSTEM_CRASH_ANALYSIS_INFO">After you click OK, TrueCrypt will analyze the system crash. This may take up to several minutes.</string>
  1996. <     <string lang="en" key="DEBUGGER_NOT_FOUND">Please make sure the environment variable 'PATH' includes the path to 'kd.exe' (Kernel Debugger).</string>
  1997. <     <string lang="en" key="SYSTEM_CRASH_NO_TRUECRYPT">It appears that TrueCrypt most likely did not cause the system crash. There are many potential reasons why the system could have crashed (for example, a failing hardware component, a bug in a device driver, etc.)</string>
  1998. <     <string lang="en" key="SYSTEM_CRASH_UPDATE_DRIVER">Results of the analysis indicate that updating the following driver might solve this issue: </string>
  1999. <     <string lang="en" key="SYSTEM_CRASH_REPORT">To help us determine whether there is a bug in TrueCrypt, you can send us an automatically generated error report containing the following items:\n- Program version\n- Operating system version\n- Type of CPU\n- Error category\n- Driver name and version\n- System call stack\n\nIf you select 'Yes', the following URL (which contains the entire error report) will be opened in your default Internet browser.</string>
  2000. <     <string lang="en" key="ASK_SEND_ERROR_REPORT">Do you want to send us the above error report?</string>
  2001. 478a439
  2002. >     <string lang="en" key="NONSYS_INPLACE_DEC_FINISHED_TITLE">Volume Fully Decrypted</string>
  2003. 479a441,443
  2004. >     <string lang="en" key="NONSYS_INPLACE_DEC_FINISHED_INFO">The TrueCrypt volume has been successfully decrypted.</string>
  2005. >     <string lang="en" key="NONSYS_INPLACE_DEC_FINISHED_DRIVE_LETTER_SEL_INFO">The TrueCrypt volume has been successfully decrypted.\n\nPlease select a drive letter that you wish to assign to the decrypted volume and then click Finish.\n\nIMPORTANT: Until a drive letter is assigned to the decrypted volume, you will not be able to access data stored on the volume.</string>
  2006. >     <string lang="en" key="NONSYS_INPLACE_DEC_FINISHED_NO_DRIVE_LETTER_AVAILABLE">Warning: To be able to access the decrypted data, a drive letter needs to be assigned to the decrypted volume. However, no drive letter is currently available.\n\nPlease vacate a drive letter (for example, by disconnecting a USB flash drive or external hard drive, etc.) and then click OK.</string>
  2007. 535a500
  2008. >     <string lang="en" key="ERR_CANNOT_ASSIGN_DRIVE_LETTER_NONSYS_DEC">Error: Cannot assign drive letter.\n\nUntil a drive letter is assigned to the decrypted volume, you will not be able to access data stored on the volume.\n\nRetry?</string>
  2009. 555c520,521
  2010. <     <string lang="en" key="NONSYS_INPLACE_ENC_CONFIRM_BACKUP">WARNING: Please note that if power supply is suddenly interrupted while encrypting existing data in place, or when the operating system crashes due to a software error or hardware malfunction while TrueCrypt is encrypting existing data in place, portions of the data will be corrupted or lost. Therefore, before you start encrypting, please make sure that you have backup copies of the files you want to encrypt.\n\nDo you have such a backup?</string>
  2011. ---
  2012. >     <string lang="en" key="NONSYS_INPLACE_DEC_CONFIRM">WARNING: You will not be able to mount the volume or access any files stored on it until it has been fully decrypted.\n\nAre you sure you want to start decrypting the selected %s '%hs'%s?</string>
  2013. >     <string lang="en" key="NONSYS_INPLACE_ENC_CONFIRM_BACKUP">WARNING: Please note that when TrueCrypt is encrypting/decrypting partitions in place, the following problem may occur: If power supply is suddenly interrupted or the operating system crashes due to a software error or hardware malfunction, portions of the data being encrypted/decrypted may get corrupted or lost. Therefore, before you continue, make sure you have a backup of the data you are about to encrypt/decrypt now.\n\nDo you have such a backup?</string>
  2014. 570,571c536,538
  2015. <     <string lang="en" key="NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP">Please enter the password and/or keyfile(s) for the non-system volume where you want to resume the process of in-place encryption.\n\n\nRemark: After you click Next, TrueCrypt will attempt to find all non-system volumes where the process of encryption has been interrupted and where the TrueCrypt volume header can be decrypted using the supplied password and/or keyfile(s). If more than one such volume is found, you will need to select one of them in the next step.</string>
  2016. <     <string lang="en" key="NONSYS_INPLACE_ENC_RESUME_VOL_SELECT_HELP">Please select one of the listed volumes. The list contains every accessible non-system volume where the process of encryption has been interrupted and whose header could be decrypted using the supplied password and/or keyfile(s).</string>
  2017. ---
  2018. >     <string lang="en" key="NONSYS_INPLACE_DEC_PASSWORD_PAGE_HELP">Please enter the password and/or keyfile(s) for the non-system TrueCrypt volume that you want to decrypt.</string>
  2019. >     <string lang="en" key="NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP">Please enter the password and/or keyfile(s) for the non-system volume where you want to resume the process of in-place encryption/decryption.\n\nRemark: After you click Next, TrueCrypt will attempt to find all non-system volumes where the process of encryption/decryption has been interrupted and where the TrueCrypt volume header can be deciphered using the supplied password and/or keyfile(s). If more than one such volume is found, you will need to select one of them in the next step.</string>
  2020. >     <string lang="en" key="NONSYS_INPLACE_ENC_RESUME_VOL_SELECT_HELP">Please select one of the listed volumes. The list contains each accessible non-system volume where the process of encryption/decryption has been interrupted and where the volume header was successfully deciphered using the supplied password and/or keyfile(s).</string>
  2021. 593c560
  2022. <     <string lang="en" key="FOUND_NO_PARTITION_W_DEFERRED_INPLACE_ENC">TrueCrypt has not found any volume where non-system encryption has been interrupted and where the volume header can be decrypted using the supplied password and/or keyfile(s).\n\nPlease make sure the password and/or keyfile(s) are correct and that the partition/volume is not being used by the system or applications (including antivirus software).</string>
  2023. ---
  2024. >     <string lang="en" key="FOUND_NO_PARTITION_W_DEFERRED_INPLACE_ENC">TrueCrypt has not found any volume where the process of encryption/decryption of a non-system volume has been interrupted and where the volume header can be deciphered using the supplied password and/or keyfile(s).\n\nPlease make sure the password and/or keyfile(s) are correct and that the partition/volume is not being used by the system or applications (including antivirus software).</string>
  2025. 595a563,564
  2026. >     <string lang="en" key="CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE">TrueCrypt cannot decrypt an individual partition on an entirely encrypted system drive (you can decrypt only the entire system drive).</string>
  2027. >     <string lang="en" key="CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE_UNSURE">Warning: As the drive contains the TrueCrypt Boot Loader, it may be an entirely encrypted system drive. If it is, please note that TrueCrypt cannot decrypt an individual partition on an entirely encrypted system drive (you can decrypt only the entire system drive). If that is the case, you will be able to continue now but you will receive the 'Incorrect password' error message later.</string>
  2028. 646c615
  2029. <     <string lang="en" key="AMBIGUOUS_VOL_SELECTION">Two different mounted volumes are currently selected (one in the drive letter list and the other in the input field below the list).\n\nPlease choose the volume you wanted to select:</string>
  2030. ---
  2031. >     <string lang="en" key="AMBIGUOUS_VOL_SELECTION">Warning: Two different volumes/devices are currently selected (the first is selected in the drive letter list and the second is selected in the input field below the drive letter list).\n\nPlease confirm your choice:</string>
  2032. 693a663,667
  2033. >     <string lang="en" key="NONSYS_INPLACE_DECRYPTION_BAD_VOL_FORMAT">Error: TrueCrypt does not support in-place decryption of legacy non-system volumes created by TrueCrypt 5.1a or earlier.\n\nNote: You can still decrypt files stored on the volume by copying/moving them to any unencrypted volume.</string>
  2034. >     <string lang="en" key="NONSYS_INPLACE_DECRYPTION_CANT_DECRYPT_HID_VOL">Error: TrueCrypt cannot in-place decrypt a hidden TrueCrypt volume.\n\nNote: You can still decrypt files stored on the volume by copying/moving them to any unencrypted volume.</string>
  2035. >     <string lang="en" key="CONFIRM_VOL_CONTAINS_NO_HIDDEN_VOL">Warning: Note that TrueCrypt cannot in-place decrypt a volume that contains a hidden TrueCrypt volume (the hidden volume would be overwritten with pseudorandom data).\n\nPlease confirm that the volume you are about to decrypt contains no hidden volume.\n\nNote: If the volume contains a hidden volume but you do not mind losing the hidden volume, you can select Proceed (the outer volume will be safely decrypted).</string>
  2036. >     <string lang="en" key="VOL_CONTAINS_NO_HIDDEN_VOL">The volume does not contain any hidden volume. Proceed.</string>
  2037. >     <string lang="en" key="VOL_CONTAINS_A_HIDDEN_VOL">The volume contains a hidden volume. Cancel.</string>
  2038. 694a669
  2039. >     <string lang="en" key="CANT_GET_VOL_INFO">Error: Cannot obtain volume properties.</string>
  2040. 698c673,674
  2041. <     <string lang="en" key="INPLACE_ENC_GENERIC_ERR_RESUME">An error prevented TrueCrypt from resuming the process of encryption of the partition.\n\nPlease try fixing any previously reported problems and then try resuming the process again. Note that the volume cannot be mounted until it has been fully encrypted.</string>
  2042. ---
  2043. >     <string lang="en" key="INPLACE_DEC_GENERIC_ERR">An error prevented TrueCrypt from decrypting the volume. Please try fixing any previously reported problems and then try again if possible.</string>
  2044. >     <string lang="en" key="INPLACE_ENC_GENERIC_ERR_RESUME">An error prevented TrueCrypt from resuming the process of encryption/decryption of the partition/volume.\n\nPlease try fixing any previously reported problems and then try resuming the process again if possible. Note that the volume cannot be mounted until it has been fully encrypted or fully decrypted.</string>
  2045. 762,764d737
  2046. <     <string lang="en" key="SETUP_FINISHED_TITLE_DON">TrueCrypt has been successfully installed</string>
  2047. <     <string lang="en" key="SETUP_FINISHED_UPGRADE_TITLE_DON">TrueCrypt has been successfully upgraded</string>
  2048. <     <string lang="en" key="SETUP_FINISHED_INFO_DON">Please consider making a donation. You can click Finish anytime to close the installer.</string>
  2049. 768d740
  2050. <     <string lang="en" key="EXTRACTION_FINISHED_TITLE_DON">Files successfully extracted</string>
  2051. 772,773d743
  2052. <     <string lang="en" key="AFTER_UPGRADE_RELEASE_NOTES">Do you want to view release notes for the current (latest stable) version of TrueCrypt?</string>
  2053. <     <string lang="en" key="AFTER_INSTALL_TUTORIAL">If you have never used TrueCrypt before, we recommend that you read the chapter Beginner's Tutorial in the TrueCrypt User Guide. Do you want to view the tutorial?</string>
  2054. 782c752
  2055. <     <string lang="en" key="DIST_PACKAGE_CORRUPTED">This distribution package is damaged. Please try downloading it again (preferably from the official TrueCrypt website at www.truecrypt.org).</string>
  2056. ---
  2057. >     <string lang="en" key="DIST_PACKAGE_CORRUPTED">This distribution package is damaged. Please try downloading it again.</string>
  2058. 893d862
  2059. <     <string lang="en" key="SYS_FAVORITES_HELP_LINK">What are system favorite volumes?</string>
  2060. 918d886
  2061. <     <string lang="en" key="HOMEPAGE">Homepage</string>
  2062. 953c921
  2063. <     <string lang="en" key="NONSYS_INPLACE_ENC_RESUME_PROMPT">You have scheduled the process of encryption of a partition/volume. The process has not been completed yet.\n\nDo you want to resume the process now?</string>
  2064. ---
  2065. >     <string lang="en" key="NONSYS_INPLACE_ENC_RESUME_PROMPT">You have scheduled the process of encryption/decryption of a partition/volume. The process has not been completed yet.\n\nDo you want to resume the process now?</string>
  2066. 955c923
  2067. <     <string lang="en" key="ASK_NONSYS_INPLACE_ENC_NOTIFICATION_REMOVAL">Do you want to be prompted about whether you want to resume the currently scheduled processes of encryption of non-system partitions/volumes?</string>
  2068. ---
  2069. >     <string lang="en" key="ASK_NONSYS_INPLACE_ENC_NOTIFICATION_REMOVAL">Do you want to be prompted about whether you want to resume the currently scheduled processes of encryption/decryption of non-system partitions/volumes?</string>
  2070. 958c926
  2071. <     <string lang="en" key="NONSYS_INPLACE_ENC_NOTIFICATION_REMOVAL_NOTE">IMPORTANT: Keep in mind that you can resume the process of encryption of any non-system partition/volume by selecting 'Volumes' &gt; 'Resume Interrupted Process' from the menu bar of the main TrueCrypt window.</string>
  2072. ---
  2073. >     <string lang="en" key="NONSYS_INPLACE_ENC_NOTIFICATION_REMOVAL_NOTE">IMPORTANT: Keep in mind that you can resume the process of encryption or decryption of any non-system partition/volume by selecting 'Volumes' &gt; 'Resume Interrupted Decryption' from the menu bar of the main TrueCrypt window.</string>
  2074. 964,966c932,935
  2075. <     <string lang="en" key="NONSYS_INPLACE_ENC_DEFER_CONFIRM">Do you want to interrupt and postpone the process of encryption of the partition/volume?\n\nNote: Keep in mind that the volume cannot be mounted until it has been fully encrypted. You will be able to resume the process of encryption and it will continue from the point it was stopped. You can do so, for example, by selecting 'Volumes' &gt; 'Resume Interrupted Process' from the menu bar of the main TrueCrypt window.</string>
  2076. <     <string lang="en" key="SYSTEM_ENCRYPTION_DEFER_CONFIRM">Do you want to interrupt and postpone the process of encryption of the system partition/drive?\n\nNote: You will be able to resume the process and it will continue from the point it was stopped. You can do so, for example, by selecting 'System' &gt; 'Resume Interrupted Process' from the menu bar of the main TrueCrypt window. If you want to permanently terminate or reverse the encryption process, select 'System' &gt; 'Permanently Decrypt System Partition/Drive'.</string>
  2077. <     <string lang="en" key="SYSTEM_DECRYPTION_DEFER_CONFIRM">Do you want to interrupt and postpone the process of decryption of the system partition/drive?\n\nNote: You will be able to resume the process and it will continue from the point it was stopped. You can do so, for example, by selecting 'System' &gt; 'Resume Interrupted Process' from the menu bar of the main TrueCrypt window. If you want to reverse the decryption process (and start encrypting), select 'System' &gt; 'Encrypt System Partition/Drive'.</string>
  2078. ---
  2079. >     <string lang="en" key="NONSYS_INPLACE_ENC_REVERSE_INFO">Note: When you are encrypting a non-system partition/volume in place and an error persistently prevents you from finishing the process, you will not be able to mount the volume (and access data stored on it) until you entirely DECRYPT the volume (i.e. reverse the process).\n\nIf you need to do so, follow these steps:\n1) Exit this wizard.\n2) In the main TrueCrypt window, select 'Volumes' &gt; 'Resume Interrupted Decryption'.\n3) Select 'Decrypt'.</string>
  2080. >     <string lang="en" key="NONSYS_INPLACE_ENC_DEFER_CONFIRM">Do you want to interrupt and postpone the process of encryption/decryption of the partition/volume?\n\nNote: Keep in mind that the volume cannot be mounted until it has been fully encrypted or decrypted. You will be able to resume the process of encryption/decryption and it will continue from the point where it was stopped. You can do so, for example, by selecting 'Volumes' &gt; 'Resume Interrupted Decryption' from the menu bar of the main TrueCrypt window.</string>
  2081. >     <string lang="en" key="SYSTEM_ENCRYPTION_DEFER_CONFIRM">Do you want to interrupt and postpone the process of encryption of the system partition/drive?\n\nNote: You will be able to resume the process and it will continue from the point it was stopped. You can do so, for example, by selecting 'System' &gt; 'Resume Interrupted Decryption' from the menu bar of the main TrueCrypt window. If you want to permanently terminate or reverse the encryption process, select 'System' &gt; 'Permanently Decrypt System Partition/Drive'.</string>
  2082. >     <string lang="en" key="SYSTEM_DECRYPTION_DEFER_CONFIRM">Do you want to interrupt and postpone the process of decryption of the system partition/drive?\n\nNote: You will be able to resume the process and it will continue from the point it was stopped. You can do so, for example, by selecting 'System' &gt; 'Resume Interrupted Decryption' from the menu bar of the main TrueCrypt window. If you want to reverse the decryption process (and start encrypting), select 'System' &gt; 'Encrypt System Partition/Drive'.</string>
  2083. 973c942
  2084. <     <string lang="en" key="NOTHING_TO_RESUME">There is no process/task to resume.</string>
  2085. ---
  2086. >     <string lang="en" key="NO_SYS_ENC_PROCESS_TO_RESUME">There is no interrupted process of encryption/decryption of the system partition/drive to resume.\n\nNote: If you want to resume an interrupted process of encryption/decryption of a non-system partition/volume, select 'Volumes' &gt; 'Resume Interrupted Decryption'.</string>
  2087. 1101c1070
  2088. <     <string lang="en" key="SYS_ENCRYPTION_PRETEST_RESULT_INFO">The pretest has been successfully completed.\n\nWARNING: Please note that if power supply is suddenly interrupted while encrypting existing data in place, or when the operating system crashes due to a software error or hardware malfunction while TrueCrypt is encrypting existing data in place, portions of the data will be corrupted or lost. Therefore, before you start encrypting, please make sure that you have backup copies of the files you want to encrypt. If you do not, please back up the files now (you can click Defer, back up the files, then run TrueCrypt again anytime, and select 'System' &gt; 'Resume Interrupted Process' to start encrypting).\n\nWhen ready, click Encrypt to start encrypting.</string>
  2089. ---
  2090. >     <string lang="en" key="SYS_ENCRYPTION_PRETEST_RESULT_INFO">The pretest has been successfully completed.\n\nWARNING: Please note that if power supply is suddenly interrupted while encrypting existing data in place, or when the operating system crashes due to a software error or hardware malfunction while TrueCrypt is encrypting existing data in place, portions of the data will be corrupted or lost. Therefore, before you start encrypting, please make sure that you have backup copies of the files you want to encrypt. If you do not, please back up the files now (you can click Defer, back up the files, then run TrueCrypt again anytime, and select 'System' &gt; 'Resume Interrupted Decryption' to start encrypting).\n\nWhen ready, click Encrypt to start encrypting.</string>
  2091. 1103a1073
  2092. >     <string lang="en" key="NONSYS_INPLACE_DEC_DECRYPTION_PAGE_INFO">\n\nYou can click Pause or Defer anytime to interrupt the process of decryption, exit this wizard, restart or shut down the computer, and then resume the process, which will continue from the point where it was stopped. Note that the volume cannot be mounted until it has been fully decrypted.</string>
  2093. 1143c1113
  2094. <     <string lang="en" key="BOOT_PRETEST_FAILED_RETRY">The TrueCrypt system encryption pretest failed. Do you want to try again?\n\nIf you select 'No', the pre-boot authentication component will be uninstalled.\n\nNotes:\n\n- If the TrueCrypt Boot Loader did not ask you to enter the password before Windows started, it is possible that your operating system does not boot from the drive on which it is installed. This is not supported.\n\n- If you used an encryption algorithm other than AES and the pretest failed (and you entered the password), it may have been caused by an inappropriately designed driver. Select 'No', and try encrypting the system partition/drive again, but use the AES encryption algorithm (which has the lowest memory requirements).\n\n- For more possible causes and solutions, see: http://www.truecrypt.org/docs/?s=troubleshooting</string>
  2095. ---
  2096. >     <string lang="en" key="BOOT_PRETEST_FAILED_RETRY">The TrueCrypt system encryption pretest failed. Do you want to try again?\n\nIf you select 'No', the pre-boot authentication component will be uninstalled.\n\nNotes:\n\n- If the TrueCrypt Boot Loader did not ask you to enter the password before Windows started, it is possible that your operating system does not boot from the drive on which it is installed. This is not supported.\n\n- If you used an encryption algorithm other than AES and the pretest failed (and you entered the password), it may have been caused by an inappropriately designed driver. Select 'No', and try encrypting the system partition/drive again, but use the AES encryption algorithm (which has the lowest memory requirements).</string>
  2097. 1151c1121
  2098. <     <string lang="en" key="ERR_NONSYS_INPLACE_ENC_INCOMPLETE">Error: The process of encryption of the partition/volume has not been completed. It must be completed first.\n\nNote: To resume the process, select 'Volumes' &gt; 'Resume Interrupted Process' from the menu bar of the main TrueCrypt window.</string>
  2099. ---
  2100. >     <string lang="en" key="ERR_NONSYS_INPLACE_ENC_INCOMPLETE">Error: The process of encryption or decryption of the partition/volume has not been completed. It must be completed first.\n\nNote: To resume the process, select 'Volumes' &gt; 'Resume Interrupted Decryption' from the menu bar of the main TrueCrypt window.</string>
  2101. 1159c1129,1130
  2102. <     <string lang="en" key="CONFIRM_DECRYPT_SYS_DEVICE_CAUTION">CAUTION: If you permanently decrypt the system partition/drive, unencrypted data will be written to it.\n\nAre you really sure you want to permanently decrypt the system partition/drive?</string>
  2103. ---
  2104. >     <string lang="en" key="CONFIRM_DECRYPT_NON_SYS_DEVICE">Are you sure you want to permanently decrypt the following volume?</string>
  2105. >     <string lang="en" key="CONFIRM_DECRYPT_NON_SYS_DEVICE_CAUTION">CAUTION: If you permanently decrypt the TrueCrypt volume, unencrypted data will be written to the disk.\n\nAre you really sure you want to permanently decrypt the selected volume?</string>
  2106. 1174a1146
  2107. >     <string lang="en" key="SKIPPED_BAD_SECTOR_COUNT">Note: TrueCrypt has replaced the content of %I64d unreadable sectors (%s) with pseudorandom data.</string>
  2108. diff -b -r tc-7.1/Common/Resource.h tc-7.2/Common/Resource.h
  2109. 15,45c15,44
  2110. < #define IDC_HOMEPAGE                    511
  2111. < #define IDR_COMMON_RSRC_HEADER          512
  2112. < #define IDD_LANGUAGE                    513
  2113. < #define IDD_CIPHER_TEST_DLG             514
  2114. < #define IDR_LICENSE                     515
  2115. < #define IDD_AUXILIARY_DLG               516
  2116. < #define IDB_TEXTUAL_LOGO_BKG            517
  2117. < #define IDB_TEXTUAL_LOGO_96DPI          518
  2118. < #define IDB_TEXTUAL_LOGO_288DPI         519
  2119. < #define IDR_BOOT_SECTOR                 520
  2120. < #define IDR_BOOT_SECTOR_AES             521
  2121. < #define IDR_BOOT_SECTOR_SERPENT         522
  2122. < #define IDR_BOOT_SECTOR_TWOFISH         523
  2123. < #define IDR_BOOT_LOADER_DECOMPRESSOR    524
  2124. < #define IDR_BOOT_LOADER                 525
  2125. < #define IDR_BOOT_LOADER_AES             526
  2126. < #define IDR_BOOT_LOADER_SERPENT         527
  2127. < #define IDR_BOOT_LOADER_TWOFISH         528
  2128. < #define IDR_RESCUE_BOOT_SECTOR          529
  2129. < #define IDR_RESCUE_BOOT_SECTOR_AES      530
  2130. < #define IDR_RESCUE_BOOT_SECTOR_SERPENT  531
  2131. < #define IDR_RESCUE_BOOT_SECTOR_TWOFISH  532
  2132. < #define IDR_RESCUE_LOADER               533
  2133. < #define IDR_RESCUE_LOADER_AES           534
  2134. < #define IDR_RESCUE_LOADER_SERPENT       535
  2135. < #define IDR_RESCUE_LOADER_TWOFISH       536
  2136. < #define IDD_TOKEN_PASSWORD              537
  2137. < #define IDD_TOKEN_KEYFILES              538
  2138. < #define IDD_NEW_TOKEN_KEYFILE           539
  2139. < #define IDD_RANDOM_POOL_ENRICHMENT      540
  2140. < #define IDI_TRUECRYPT_MOUNTED_ICON      541
  2141. ---
  2142. > #define IDR_COMMON_RSRC_HEADER          511
  2143. > #define IDD_LANGUAGE                    512
  2144. > #define IDD_CIPHER_TEST_DLG             513
  2145. > #define IDR_LICENSE                     514
  2146. > #define IDD_AUXILIARY_DLG               515
  2147. > #define IDB_TEXTUAL_LOGO_BKG            516
  2148. > #define IDB_TEXTUAL_LOGO_96DPI          517
  2149. > #define IDB_TEXTUAL_LOGO_288DPI         518
  2150. > #define IDR_BOOT_SECTOR                 519
  2151. > #define IDR_BOOT_SECTOR_AES             520
  2152. > #define IDR_BOOT_SECTOR_SERPENT         521
  2153. > #define IDR_BOOT_SECTOR_TWOFISH         522
  2154. > #define IDR_BOOT_LOADER_DECOMPRESSOR    523
  2155. > #define IDR_BOOT_LOADER                 524
  2156. > #define IDR_BOOT_LOADER_AES             525
  2157. > #define IDR_BOOT_LOADER_SERPENT         526
  2158. > #define IDR_BOOT_LOADER_TWOFISH         527
  2159. > #define IDR_RESCUE_BOOT_SECTOR          528
  2160. > #define IDR_RESCUE_BOOT_SECTOR_AES      529
  2161. > #define IDR_RESCUE_BOOT_SECTOR_SERPENT  530
  2162. > #define IDR_RESCUE_BOOT_SECTOR_TWOFISH  531
  2163. > #define IDR_RESCUE_LOADER               532
  2164. > #define IDR_RESCUE_LOADER_AES           533
  2165. > #define IDR_RESCUE_LOADER_SERPENT       534
  2166. > #define IDR_RESCUE_LOADER_TWOFISH       535
  2167. > #define IDD_TOKEN_PASSWORD              536
  2168. > #define IDD_TOKEN_KEYFILES              537
  2169. > #define IDD_NEW_TOKEN_KEYFILE           538
  2170. > #define IDD_RANDOM_POOL_ENRICHMENT      539
  2171. > #define IDI_TRUECRYPT_MOUNTED_ICON      540
  2172. 123,162c122,158
  2173. < #define IDC_GET_LANG_PACKS              5077
  2174. < #define IDT_LANGPACK_AUTHORS            5078
  2175. < #define IDC_LANGPACK_CREDITS            5079
  2176. < #define IDC_LANGPACK_VERSION            5080
  2177. < #define IDT_ACTIVE_LANG_PACK            5081
  2178. < #define IDC_DISPLAY_POOL_CONTENTS       5082
  2179. < #define IDC_XTS_MODE_ENABLED            5083
  2180. < #define IDC_MULTI_CHOICE_MSG            5084
  2181. < #define IDC_CHOICE1                     5085
  2182. < #define IDC_CHOICE5                     5086
  2183. < #define IDC_CHOICE2                     5087
  2184. < #define IDC_CHOICE3                     5088
  2185. < #define IDC_CHOICE4                     5089
  2186. < #define IDC_CHOICE6                     5090
  2187. < #define IDC_CHOICE7                     5091
  2188. < #define IDC_CHOICE8                     5092
  2189. < #define IDC_CHOICE9                     5093
  2190. < #define IDC_CHOICE10                    5094
  2191. < #define IDC_MC_DLG_HR1                  5095
  2192. < #define IDC_MC_DLG_HR2                  5096
  2193. < #define IDC_LINK_HIDVOL_PROTECTION_INFO 5097
  2194. < #define IDC_LINK_KEYFILES_INFO          5098
  2195. < #define IDC_TEXTUAL_LOGO_IMG            5099
  2196. < #define IDC_ASPECT_RATIO_CALIBRATION_BOX 5100
  2197. < #define IDC_ABOUT_LOGO_AREA             5101
  2198. < #define IDC_TOKEN_PASSWORD              5102
  2199. < #define IDC_TOKEN_FILE_LIST             5103
  2200. < #define IDC_TOKEN_FILES_ADD             5104
  2201. < #define IDC_EXPORT                      5105
  2202. < #define IDC_DELETE                      5106
  2203. < #define IDC_IMPORT_KEYFILE              5107
  2204. < #define IDC_SELECTED_TOKEN              5108
  2205. < #define IDT_SECURITY_TOKEN              5109
  2206. < #define IDT_TOKEN_KEYFILE_NAME          5110
  2207. < #define IDC_TOKEN_KEYFILE_NAME          5111
  2208. < #define IDT_TOKEN_PASSWORD_INFO         5112
  2209. < #define IDT_RANDOM_POOL_ENRICHMENT_NOTE 5113
  2210. < #define IDC_CONTINUE                    5114
  2211. < #define IDT_ABOUT_RELEASE               5115
  2212. < #define IDT_STATIC_MODELESS_WAIT_DLG_INFO 5116
  2213. ---
  2214. > #define IDT_LANGPACK_AUTHORS            5077
  2215. > #define IDC_LANGPACK_CREDITS            5078
  2216. > #define IDC_LANGPACK_VERSION            5079
  2217. > #define IDT_ACTIVE_LANG_PACK            5080
  2218. > #define IDC_DISPLAY_POOL_CONTENTS       5081
  2219. > #define IDC_XTS_MODE_ENABLED            5082
  2220. > #define IDC_MULTI_CHOICE_MSG            5083
  2221. > #define IDC_CHOICE1                     5084
  2222. > #define IDC_CHOICE5                     5085
  2223. > #define IDC_CHOICE2                     5086
  2224. > #define IDC_CHOICE3                     5087
  2225. > #define IDC_CHOICE4                     5088
  2226. > #define IDC_CHOICE6                     5089
  2227. > #define IDC_CHOICE7                     5090
  2228. > #define IDC_CHOICE8                     5091
  2229. > #define IDC_CHOICE9                     5092
  2230. > #define IDC_CHOICE10                    5093
  2231. > #define IDC_MC_DLG_HR1                  5094
  2232. > #define IDC_MC_DLG_HR2                  5095
  2233. > #define IDC_TEXTUAL_LOGO_IMG            5096
  2234. > #define IDC_ASPECT_RATIO_CALIBRATION_BOX 5097
  2235. > #define IDC_ABOUT_LOGO_AREA             5098
  2236. > #define IDC_TOKEN_PASSWORD              5099
  2237. > #define IDC_TOKEN_FILE_LIST             5100
  2238. > #define IDC_TOKEN_FILES_ADD             5101
  2239. > #define IDC_EXPORT                      5102
  2240. > #define IDC_DELETE                      5103
  2241. > #define IDC_IMPORT_KEYFILE              5104
  2242. > #define IDC_SELECTED_TOKEN              5105
  2243. > #define IDT_SECURITY_TOKEN              5106
  2244. > #define IDT_TOKEN_KEYFILE_NAME          5107
  2245. > #define IDC_TOKEN_KEYFILE_NAME          5108
  2246. > #define IDT_TOKEN_PASSWORD_INFO         5109
  2247. > #define IDT_RANDOM_POOL_ENRICHMENT_NOTE 5110
  2248. > #define IDC_CONTINUE                    5111
  2249. > #define IDT_ABOUT_RELEASE               5112
  2250. > #define IDT_STATIC_MODELESS_WAIT_DLG_INFO 5113
  2251. 169c165
  2252. < #define _APS_NEXT_RESOURCE_VALUE        542
  2253. ---
  2254. > #define _APS_NEXT_RESOURCE_VALUE        541
  2255. 171c167
  2256. < #define _APS_NEXT_CONTROL_VALUE         5117
  2257. ---
  2258. > #define _APS_NEXT_CONTROL_VALUE         5114
  2259. diff -b -r tc-7.1/Common/Tcdefs.h tc-7.2/Common/Tcdefs.h
  2260. 18c18
  2261. < #define VERSION_STRING                    "7.1a"
  2262. ---
  2263. > #define VERSION_STRING                    "7.2"
  2264. 21c21
  2265. < #define VERSION_NUM                       0x071a
  2266. ---
  2267. > #define VERSION_NUM                       0x0720
  2268. 24,26c24
  2269. < #define TC_STR_RELEASE_DATE               "February 7, 2012"
  2270. < #define TC_RELEASE_DATE_YEAR          2012
  2271. < #define TC_RELEASE_DATE_MONTH         2
  2272. ---
  2273. > #define TC_STR_RELEASE_DATE               "5/2014"
  2274. 250c248
  2275. < #define TC_STR_RELEASED_BY "Released by TrueCrypt Foundation on " TC_STR_RELEASE_DATE
  2276. ---
  2277. > #define TC_STR_RELEASED_BY "Released by TrueCrypt Foundation in " TC_STR_RELEASE_DATE
  2278. 253,256d250
  2279. <
  2280. < #define TC_HOMEPAGE "http://www.truecrypt.org/"
  2281. < #define TC_APPLINK "http://www.truecrypt.org/applink?version=" VERSION_STRING
  2282. < #define TC_APPLINK_SECURE "https://www.truecrypt.org/applink?version=" VERSION_STRING
  2283. diff -b -r tc-7.1/Common/Volumes.h tc-7.2/Common/Volumes.h
  2284. 117c117
  2285. < #define TC_HEADER_FLAG_NONSYS_INPLACE_ENC     0x2     // The volume has been created using non-system in-place encryption
  2286. ---
  2287. > #define TC_HEADER_FLAG_NONSYS_INPLACE_ENC     0x2     // The volume has been created (or is being encrypted/decrypted) using non-system in-place encryption
  2288. diff -b -r tc-7.1/Driver/DriveFilter.c tc-7.2/Driver/DriveFilter.c
  2289. 1161,1163d1160
  2290. <   byte *wipeBuffer = NULL;
  2291. <   byte wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
  2292. <   byte wipeRandCharsUpdate[TC_WIPE_RAND_CHAR_COUNT];
  2293. 1170,1171c1167
  2294. <   // Make sure volume header can be updated
  2295. <   if (Extension->HeaderCryptoInfo == NULL)
  2296. ---
  2297. >   if (SetupRequest.SetupMode == SetupEncryption)
  2298. 1177,1178c1173,1174
  2299. <   buffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
  2300. <   if (!buffer)
  2301. ---
  2302. >   // Make sure volume header can be updated
  2303. >   if (Extension->HeaderCryptoInfo == NULL)
  2304. 1180c1176
  2305. <       SetupResult = STATUS_INSUFFICIENT_RESOURCES;
  2306. ---
  2307. >       SetupResult = STATUS_INVALID_PARAMETER;
  2308. 1184,1187c1180,1181
  2309. <   if (SetupRequest.SetupMode == SetupEncryption && SetupRequest.WipeAlgorithm != TC_WIPE_NONE)
  2310. <   {
  2311. <       wipeBuffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
  2312. <       if (!wipeBuffer)
  2313. ---
  2314. >   buffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
  2315. >   if (!buffer)
  2316. 1192d1185
  2317. <   }
  2318. 1324,1349d1316
  2319. <
  2320. <       if (SetupRequest.SetupMode == SetupEncryption)
  2321. <       {
  2322. <           EncryptDataUnits (buffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
  2323. <
  2324. <           if (SetupRequest.WipeAlgorithm != TC_WIPE_NONE)
  2325. <           {
  2326. <               byte wipePass;
  2327. <               for (wipePass = 1; wipePass <= GetWipePassCount (SetupRequest.WipeAlgorithm); ++wipePass)
  2328. <               {
  2329. <                   if (!WipeBuffer (SetupRequest.WipeAlgorithm, wipeRandChars, wipePass, wipeBuffer, setupBlockSize))
  2330. <                   {
  2331. <                       ULONG i;
  2332. <                       for (i = 0; i < setupBlockSize; ++i)
  2333. <                       {
  2334. <                           wipeBuffer[i] = buffer[i] + wipePass;
  2335. <                       }
  2336. <
  2337. <                       EncryptDataUnits (wipeBuffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
  2338. <                       memcpy (wipeRandCharsUpdate, wipeBuffer, sizeof (wipeRandCharsUpdate));
  2339. <                   }
  2340. <
  2341. <                   status = TCWriteDevice (BootDriveFilterExtension->LowerDeviceObject, wipeBuffer, offset, setupBlockSize);
  2342. <                   if (!NT_SUCCESS (status))
  2343. <                   {
  2344. <                       // Undo failed write operation
  2345. 1351,1364d1317
  2346. <                       TCWriteDevice (BootDriveFilterExtension->LowerDeviceObject, buffer, offset, setupBlockSize);
  2347. <
  2348. <                       SetupResult = status;
  2349. <                       goto err;
  2350. <                   }
  2351. <               }
  2352. <
  2353. <               memcpy (wipeRandChars, wipeRandCharsUpdate, sizeof (wipeRandCharsUpdate));
  2354. <           }
  2355. <       }
  2356. <       else
  2357. <       {
  2358. <           DecryptDataUnits (buffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
  2359. <       }
  2360. 1461,1462d1413
  2361. <   if (wipeBuffer)
  2362. <       TCfree (wipeBuffer);
  2363. diff -b -r tc-7.1/Driver/Driver.rc tc-7.2/Driver/Driver.rc
  2364. 16c16
  2365. < // English (U.S.) resources
  2366. ---
  2367. > // English (United States) resources
  2368. 19d18
  2369. < #ifdef _WIN32
  2370. 22d20
  2371. < #endif //_WIN32
  2372. 30,31c28,29
  2373. <  FILEVERSION 7,1,1,0
  2374. <  PRODUCTVERSION 7,1,1,0
  2375. ---
  2376. >  FILEVERSION 7,2,0,0
  2377. >  PRODUCTVERSION 7,2,0,0
  2378. 48c46
  2379. <             VALUE "FileVersion", "7.1a"
  2380. ---
  2381. >             VALUE "FileVersion", "7.2"
  2382. 52c50
  2383. <             VALUE "ProductVersion", "7.1a"
  2384. ---
  2385. >             VALUE "ProductVersion", "7.2"
  2386. 87c85
  2387. < #endif    // English (U.S.) resources
  2388. ---
  2389. > #endif    // English (United States) resources
  2390. diff -b -r tc-7.1/Format/Format.rc tc-7.2/Format/Format.rc
  2391. 17c17
  2392. < // English (U.S.) resources
  2393. ---
  2394. > // English (United States) resources
  2395. 20d19
  2396. < #ifdef _WIN32
  2397. 23d21
  2398. < #endif //_WIN32
  2399. 31,32c29,30
  2400. <  FILEVERSION 7,1,1,0
  2401. <  PRODUCTVERSION 7,1,1,0
  2402. ---
  2403. >  FILEVERSION 7,2,0,0
  2404. >  PRODUCTVERSION 7,2,0,0
  2405. 49c47
  2406. <             VALUE "FileVersion", "7.1a"
  2407. ---
  2408. >             VALUE "FileVersion", "7.2"
  2409. 53c51
  2410. <             VALUE "ProductVersion", "7.1a"
  2411. ---
  2412. >             VALUE "ProductVersion", "7.2"
  2413. 94c92
  2414. <     CONTROL         116,IDC_BITMAP_WIZARD,"Static",SS_BITMAP | SS_SUNKEN,10,9,137,169
  2415. ---
  2416. >     CONTROL         IDB_WIZARD,IDC_BITMAP_WIZARD,"Static",SS_BITMAP | SS_SUNKEN,10,9,137,169
  2417. 109,110d106
  2418. <     LTEXT           "More information",IDC_LINK_MORE_INFO_ABOUT_CIPHER,7,82,135,10,SS_NOTIFY
  2419. <     LTEXT           "Information on hash algorithms",IDC_LINK_HASH_INFO,97,124,115,8,SS_NOTIFY
  2420. 185d180
  2421. <     LTEXT           "More information",IDC_MORE_INFO_ON_CONTAINERS,16,39,165,10,SS_NOTIFY
  2422. 190d184
  2423. <     LTEXT           "More information about system encryption",IDC_MORE_INFO_ON_SYS_ENCRYPTION,16,136,190,10,SS_NOTIFY
  2424. 239d232
  2425. <     LTEXT           "More information about hidden volumes",IDC_HIDDEN_VOL_HELP,16,125,205,10,SS_NOTIFY
  2426. 307d299
  2427. <     LTEXT           "More information",IDC_MORE_INFO_SYS_ENCRYPTION,1,141,202,10,SS_NOTIFY
  2428. 359d350
  2429. <     LTEXT           "More information",IDC_HIDDEN_SYSENC_INFO_LINK,16,138,205,10,SS_NOTIFY
  2430. 368d358
  2431. <     LTEXT           "More information",IDC_HIDDEN_SYSENC_INFO_LINK,0,141,217,10,SS_NOTIFY
  2432. 419a410,418
  2433. > IDD_DRIVE_LETTER_SELECTION_PAGE DIALOGEX 0, 0, 226, 152
  2434. > STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
  2435. > FONT 8, "MS Shell Dlg", 400, 0, 0x1
  2436. > BEGIN
  2437. >     LTEXT           "",IDC_BOX_HELP,0,40,225,95
  2438. >     COMBOBOX        IDC_DRIVE_LETTER_LIST,94,15,38,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
  2439. >     RTEXT           "Drive letter:",IDT_DRIVE_LETTER,5,17,86,8
  2440. > END
  2441. >
  2442. 662a662,669
  2443. >
  2444. >     IDD_DRIVE_LETTER_SELECTION_PAGE, DIALOG
  2445. >     BEGIN
  2446. >         LEFTMARGIN, 7
  2447. >         RIGHTMARGIN, 219
  2448. >         TOPMARGIN, 7
  2449. >         BOTTOMMARGIN, 145
  2450. >     END
  2451. 684c691
  2452. < #endif    // English (U.S.) resources
  2453. ---
  2454. > #endif    // English (United States) resources
  2455. diff -b -r tc-7.1/Format/InPlace.c tc-7.2/Format/InPlace.c
  2456. 12c12
  2457. < because it breaks the main font app when the app is running on XP (likely an MS bug).
  2458. ---
  2459. > because it breaks the main font app when the app is running on XP.
  2460. 39a40,51
  2461. > #if TC_VOLUME_DATA_OFFSET != 131072
  2462. > # error TC_VOLUME_DATA_OFFSET != 131072
  2463. > #endif
  2464. >
  2465. > #if TC_VOLUME_HEADER_EFFECTIVE_SIZE != 512
  2466. > # error TC_VOLUME_HEADER_EFFECTIVE_SIZE != 512
  2467. > #endif
  2468. >
  2469. > #if TC_TOTAL_VOLUME_HEADERS_SIZE != 262144
  2470. > # error TC_TOTAL_VOLUME_HEADERS_SIZE != 262144
  2471. > #endif
  2472. >
  2473. 41,42c53,54
  2474. < #define TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE      (2 * TC_MAX_VOLUME_SECTOR_SIZE)
  2475. < #define TC_NTFS_CONCEAL_CONSTANT  0xFF
  2476. ---
  2477. > #define TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE      (2 * TC_MAX_VOLUME_SECTOR_SIZE)
  2478. > #define TC_TRANSFORM_FS_CONCEAL_CONSTANT  0xFF
  2479. 302c314
  2480. < int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, volatile HANDLE *outHandle, WipeAlgorithmId wipeAlgorithm)
  2481. ---
  2482. > BOOL CheckRequirementsForNonSysInPlaceDec (const char *devicePath, BOOL silent)
  2483. 304,493c316
  2484. <   SHRINK_VOLUME_INFORMATION shrinkVolInfo;
  2485. <   signed __int64 sizeToShrinkTo;
  2486. <   int nStatus = ERR_SUCCESS;
  2487. <   PCRYPTO_INFO cryptoInfo = NULL;
  2488. <   PCRYPTO_INFO cryptoInfo2 = NULL;
  2489. <   HANDLE dev = INVALID_HANDLE_VALUE;
  2490. <   DWORD dwError;
  2491. <   char *header;
  2492. <   char dosDev[TC_MAX_PATH] = {0};
  2493. <   char devName[MAX_PATH] = {0};
  2494. <   int driveLetter = -1;
  2495. <   WCHAR deviceName[MAX_PATH];
  2496. <   uint64 dataAreaSize;
  2497. <   __int64 deviceSize;
  2498. <   LARGE_INTEGER offset;
  2499. <   DWORD dwResult;
  2500. <
  2501. <   SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_PREPARING);
  2502. <
  2503. <
  2504. <   if (!CheckRequirementsForNonSysInPlaceEnc (volParams->volumePath, FALSE))
  2505. <       return ERR_DONT_REPORT;
  2506. <
  2507. <
  2508. <   header = (char *) TCalloc (TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  2509. <   if (!header)
  2510. <       return ERR_OUTOFMEMORY;
  2511. <
  2512. <   VirtualLock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  2513. <
  2514. <   deviceSize = GetDeviceSize (volParams->volumePath);
  2515. <   if (deviceSize < 0)
  2516. <   {
  2517. <       // Cannot determine the size of the partition
  2518. <       nStatus = ERR_PARAMETER_INCORRECT;
  2519. <       goto closing_seq;
  2520. <   }
  2521. <
  2522. <   if (deviceSize < TC_NONSYS_INPLACE_ENC_MIN_VOL_SIZE)
  2523. <   {
  2524. <       ShowInPlaceEncErrMsgWAltSteps ("PARTITION_TOO_SMALL_FOR_NONSYS_INPLACE_ENC", TRUE);
  2525. <       nStatus = ERR_DONT_REPORT;
  2526. <       goto closing_seq;
  2527. <   }
  2528. <
  2529. <   dataAreaSize = GetVolumeDataAreaSize (volParams->hiddenVol, deviceSize);
  2530. <
  2531. <   strcpy ((char *)deviceName, volParams->volumePath);
  2532. <   ToUNICODE ((char *)deviceName);
  2533. <
  2534. <   driveLetter = GetDiskDeviceDriveLetter (deviceName);
  2535. <
  2536. <
  2537. <   if (FakeDosNameForDevice (volParams->volumePath, dosDev, devName, FALSE) != 0)
  2538. <   {
  2539. <       nStatus = ERR_OS_ERROR;
  2540. <       goto closing_seq;
  2541. <   }
  2542. <
  2543. <   if (IsDeviceMounted (devName))
  2544. <   {
  2545. <       dev = OpenPartitionVolume (devName,
  2546. <           FALSE,  // Do not require exclusive access (must be FALSE; otherwise, it will not be possible to dismount the volume or obtain its properties and FSCTL_ALLOW_EXTENDED_DASD_IO will fail too)
  2547. <           TRUE,   // Require shared access (must be TRUE; otherwise, it will not be possible to dismount the volume or obtain its properties and FSCTL_ALLOW_EXTENDED_DASD_IO will fail too)
  2548. <           FALSE,  // Do not ask the user to confirm shared access (if exclusive fails)
  2549. <           FALSE,  // Do not append alternative instructions how to encrypt the data (to applicable error messages)
  2550. <           FALSE); // Non-silent mode
  2551. <
  2552. <       if (dev == INVALID_HANDLE_VALUE)
  2553. <       {
  2554. <           nStatus = ERR_DONT_REPORT;
  2555. <           goto closing_seq;
  2556. <       }
  2557. <   }
  2558. <   else
  2559. <   {
  2560. <       // The volume is not mounted so we can't work with the filesystem.
  2561. <       Error ("ONLY_MOUNTED_VOL_SUPPORTED_FOR_NONSYS_INPLACE_ENC");
  2562. <       nStatus = ERR_DONT_REPORT;
  2563. <       goto closing_seq;
  2564. <   }
  2565. <
  2566. <
  2567. <   /* Gain "raw" access to the partition (the NTFS driver guards hidden sectors). */
  2568. <
  2569. <   if (!DeviceIoControl (dev,
  2570. <       FSCTL_ALLOW_EXTENDED_DASD_IO,
  2571. <       NULL,
  2572. <       0,  
  2573. <       NULL,
  2574. <       0,
  2575. <       &dwResult,
  2576. <       NULL))
  2577. <   {
  2578. <       handleWin32Error (MainDlg);
  2579. <       ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
  2580. <       nStatus = ERR_DONT_REPORT;
  2581. <       goto closing_seq;
  2582. <   }
  2583. <
  2584. <
  2585. <
  2586. <   /* Shrink the filesystem */
  2587. <
  2588. <   int64 totalClusterCount;
  2589. <   DWORD bytesPerCluster;
  2590. <
  2591. <   sizeToShrinkTo = NewFileSysSizeAfterShrink (dev, volParams->volumePath, &totalClusterCount, &bytesPerCluster, FALSE);
  2592. <
  2593. <   if (sizeToShrinkTo == -1)
  2594. <   {
  2595. <       ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
  2596. <       nStatus = ERR_DONT_REPORT;
  2597. <       goto closing_seq;
  2598. <   }
  2599. <
  2600. <   SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_RESIZING);
  2601. <
  2602. <   memset (&shrinkVolInfo, 0, sizeof (shrinkVolInfo));
  2603. <
  2604. <   shrinkVolInfo.ShrinkRequestType = ShrinkPrepare;
  2605. <   shrinkVolInfo.NewNumberOfSectors = sizeToShrinkTo;
  2606. <
  2607. <   if (!DeviceIoControl (dev,
  2608. <       FSCTL_SHRINK_VOLUME,
  2609. <       (LPVOID) &shrinkVolInfo,
  2610. <       sizeof (shrinkVolInfo),  
  2611. <       NULL,
  2612. <       0,
  2613. <       &dwResult,
  2614. <       NULL))
  2615. <   {
  2616. <       handleWin32Error (MainDlg);
  2617. <       ShowInPlaceEncErrMsgWAltSteps ("CANNOT_RESIZE_FILESYS", TRUE);
  2618. <       nStatus = ERR_DONT_REPORT;
  2619. <       goto closing_seq;
  2620. <   }
  2621. <
  2622. <   BOOL clustersMovedBeforeVolumeEnd = FALSE;
  2623. <
  2624. <   while (true)
  2625. <   {
  2626. <       shrinkVolInfo.ShrinkRequestType = ShrinkCommit;
  2627. <       shrinkVolInfo.NewNumberOfSectors = 0;
  2628. <
  2629. <       if (!DeviceIoControl (dev, FSCTL_SHRINK_VOLUME, &shrinkVolInfo, sizeof (shrinkVolInfo), NULL, 0, &dwResult, NULL))
  2630. <       {
  2631. <           // If there are any occupied clusters beyond the new desired end of the volume, the call fails with
  2632. <           // ERROR_ACCESS_DENIED (STATUS_ALREADY_COMMITTED).
  2633. <           if (GetLastError () == ERROR_ACCESS_DENIED)
  2634. <           {
  2635. <               if (!clustersMovedBeforeVolumeEnd)
  2636. <               {
  2637. <                   if (MoveClustersBeforeThreshold (dev, deviceName, totalClusterCount - (bytesPerCluster > TC_TOTAL_VOLUME_HEADERS_SIZE ? 1 : TC_TOTAL_VOLUME_HEADERS_SIZE / bytesPerCluster)))
  2638. <                   {
  2639. <                       clustersMovedBeforeVolumeEnd = TRUE;
  2640. <                       continue;
  2641. <                   }
  2642. <
  2643. <                   handleWin32Error (MainDlg);
  2644. <               }
  2645. <           }
  2646. <           else
  2647. <               handleWin32Error (MainDlg);
  2648. <
  2649. <           ShowInPlaceEncErrMsgWAltSteps ("CANNOT_RESIZE_FILESYS", TRUE);
  2650. <           nStatus = ERR_DONT_REPORT;
  2651. <           goto closing_seq;
  2652. <       }
  2653. <
  2654. <       break;
  2655. <   }
  2656. <
  2657. <   SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_PREPARING);
  2658. <
  2659. <
  2660. <   /* Gain exclusive access to the volume */
  2661. <
  2662. <   nStatus = DismountFileSystem (dev,
  2663. <       driveLetter,
  2664. <       TRUE,
  2665. <       TRUE,
  2666. <       FALSE);
  2667. <
  2668. <   if (nStatus != ERR_SUCCESS)
  2669. <   {
  2670. <       nStatus = ERR_DONT_REPORT;
  2671. <       goto closing_seq;
  2672. <   }
  2673. <
  2674. ---
  2675. >   int partitionNumber = -1, driveNumber = -1;
  2676. 496,522c319
  2677. <   /* Create header backup on the partition. Until the volume is fully encrypted, the backup header will provide
  2678. <   us with the master key, encrypted range, and other data for pause/resume operations. We cannot create the
  2679. <   primary header until the entire partition is encrypted (because we encrypt backwards and the primary header
  2680. <   area is occuppied by data until the very end of the process). */
  2681. <
  2682. <   // Prepare the backup header
  2683. <   for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_DISK_WIPE_PASSES); wipePass++)
  2684. <   {
  2685. <       nStatus = CreateVolumeHeaderInMemory (FALSE,
  2686. <           header,
  2687. <           volParams->ea,
  2688. <           FIRST_MODE_OF_OPERATION_ID,
  2689. <           volParams->password,
  2690. <           volParams->pkcs5,
  2691. <           wipePass == 0 ? NULL : (char *) cryptoInfo->master_keydata,
  2692. <           &cryptoInfo,
  2693. <           dataAreaSize,
  2694. <           0,
  2695. <           TC_VOLUME_DATA_OFFSET + dataAreaSize,   // Start of the encrypted area = the first byte of the backup heeader (encrypting from the end)
  2696. <           0,  // No data is encrypted yet
  2697. <           0,
  2698. <           volParams->headerFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC,
  2699. <           volParams->sectorSize,
  2700. <           wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_DISK_WIPE_PASSES - 1));
  2701. <
  2702. <       if (nStatus != 0)
  2703. <           goto closing_seq;
  2704. ---
  2705. >   /* ---------- Checks that do not require admin rights ----------- */
  2706. 524d320
  2707. <       offset.QuadPart = TC_VOLUME_DATA_OFFSET + dataAreaSize;
  2708. 526,530c322
  2709. <       if (!SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
  2710. <       {
  2711. <           nStatus = ERR_OS_ERROR;
  2712. <           goto closing_seq;
  2713. <       }
  2714. ---
  2715. >   /* Volume type (must be a partition or a dynamic volume) */
  2716. 532,533c324,326
  2717. <       // Write the backup header to the partition
  2718. <       if (!WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header))
  2719. ---
  2720. >   if ((sscanf (devicePath, "\\Device\\HarddiskVolume%d", &partitionNumber) != 1
  2721. >       && sscanf (devicePath, "\\Device\\Harddisk%d\\Partition%d", &driveNumber, &partitionNumber) != 2)
  2722. >       || partitionNumber == 0)
  2723. 535,540c328,329
  2724. <           nStatus = ERR_OS_ERROR;
  2725. <           goto closing_seq;
  2726. <       }
  2727. <
  2728. <       // Fill the reserved sectors of the backup header area with random data
  2729. <       nStatus = WriteRandomDataToReservedHeaderAreas (dev, cryptoInfo, dataAreaSize, FALSE, TRUE);
  2730. ---
  2731. >       if (!silent)
  2732. >           Error ("INPLACE_ENC_INVALID_PATH");
  2733. 542,543c331
  2734. <       if (nStatus != ERR_SUCCESS)
  2735. <           goto closing_seq;
  2736. ---
  2737. >       return FALSE;
  2738. 547,549c335
  2739. <   /* Now we will try to decrypt the backup header to verify it has been correctly written. */
  2740. <
  2741. <   nStatus = OpenBackupHeader (dev, volParams->volumePath, volParams->password, &cryptoInfo2, NULL, deviceSize);
  2742. ---
  2743. >   /* Admin rights */
  2744. 551,553c337
  2745. <   if (nStatus != ERR_SUCCESS
  2746. <       || cryptoInfo->EncryptedAreaStart.Value != cryptoInfo2->EncryptedAreaStart.Value
  2747. <       || cryptoInfo2->EncryptedAreaStart.Value == 0)
  2748. ---
  2749. >   if (!IsAdmin())
  2750. 555,556c339,340
  2751. <       if (nStatus == ERR_SUCCESS)
  2752. <           nStatus = ERR_PARAMETER_INCORRECT;
  2753. ---
  2754. >       // We rely on the wizard process to call us only when the whole wizard process has been elevated (so UAC
  2755. >       // status can be ignored). In case the IsAdmin() detection somehow fails, we allow the user to continue.
  2756. 558c342,343
  2757. <       goto closing_seq;
  2758. ---
  2759. >       if (!silent)
  2760. >           Warning ("ADMIN_PRIVILEGES_WARN_DEVICES");
  2761. 561,573d345
  2762. <   // The backup header is valid so we know we should be able to safely resume in-place encryption
  2763. <   // of this partition even if the system/app crashes.
  2764. <
  2765. <
  2766. <
  2767. <   /* Conceal the NTFS filesystem (by performing an easy-to-undo modification). This will prevent Windows
  2768. <   and apps from interfering with the volume until it has been fully encrypted. */
  2769. <
  2770. <   nStatus = ConcealNTFS (dev);
  2771. <
  2772. <   if (nStatus != ERR_SUCCESS)
  2773. <       goto closing_seq;
  2774. <
  2775. 574a347
  2776. >   /* ---------- Checks that may require admin rights ----------- */
  2777. 576,624c349
  2778. <   // /* If a drive letter is assigned to the device, remove it (so that users do not try to open it, which
  2779. <   //would cause Windows to ask them if they want to format the volume and other dangerous things). */
  2780. <
  2781. <   //if (driveLetter >= 0)
  2782. <   //{
  2783. <   //  char rootPath[] = { driveLetter + 'A', ':', '\\', 0 };
  2784. <
  2785. <   //  // Try to remove the assigned drive letter
  2786. <   //  if (DeleteVolumeMountPoint (rootPath))
  2787. <   //      driveLetter = -1;
  2788. <   //}
  2789. <
  2790. <
  2791. <
  2792. <   /* Update config files and app data */
  2793. <
  2794. <   // In the config file, increase the number of partitions where in-place encryption is in progress
  2795. <
  2796. <   SaveNonSysInPlaceEncSettings (1, wipeAlgorithm);
  2797. <
  2798. <
  2799. <   // Add the wizard to the system startup sequence if appropriate
  2800. <
  2801. <   if (!IsNonInstallMode ())
  2802. <       ManageStartupSeqWiz (FALSE, "/prinplace");
  2803. <
  2804. <
  2805. <   nStatus = ERR_SUCCESS;
  2806. <
  2807. <
  2808. < closing_seq:
  2809. <
  2810. <   dwError = GetLastError();
  2811. <
  2812. <   if (cryptoInfo != NULL)
  2813. <   {
  2814. <       crypto_close (cryptoInfo);
  2815. <       cryptoInfo = NULL;
  2816. <   }
  2817. <
  2818. <   if (cryptoInfo2 != NULL)
  2819. <   {
  2820. <       crypto_close (cryptoInfo2);
  2821. <       cryptoInfo2 = NULL;
  2822. <   }
  2823. <
  2824. <   burn (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  2825. <   VirtualUnlock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  2826. <   TCfree (header);
  2827. ---
  2828. >   // [Currently none]
  2829. 626,627d350
  2830. <   if (dosDev[0])
  2831. <       RemoveFakeDosName (volParams->volumePath, dosDev);
  2832. 629c352,353
  2833. <   *outHandle = dev;
  2834. ---
  2835. >   return TRUE;
  2836. > }
  2837. 631,632d354
  2838. <   if (nStatus != ERR_SUCCESS)
  2839. <       SetLastError (dwError);
  2840. 634c356,359
  2841. <   return nStatus;
  2842. ---
  2843. > int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, volatile HANDLE *outHandle, WipeAlgorithmId wipeAlgorithm)
  2844. > {
  2845. >   AbortProcess ("INSECURE_APP");
  2846. >   return 0;
  2847. 643c368,376
  2848. <   PCRYPTO_INFO masterCryptoInfo = NULL, headerCryptoInfo = NULL, tmpCryptoInfo = NULL;
  2849. ---
  2850. >   AbortProcess ("INSECURE_APP");
  2851. >   return 0;
  2852. > }
  2853. >
  2854. >
  2855. > int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile BOOL *DiscardUnreadableEncryptedSectors)
  2856. > {
  2857. >   HANDLE dev = INVALID_HANDLE_VALUE;
  2858. >   PCRYPTO_INFO masterCryptoInfo = NULL, headerCryptoInfo = NULL;
  2859. 645,648c378,379
  2860. <   char *buf = NULL, *header = NULL;
  2861. <   byte *wipeBuffer = NULL;
  2862. <   byte wipeRandChars [TC_WIPE_RAND_CHAR_COUNT];
  2863. <   byte wipeRandCharsUpdate [TC_WIPE_RAND_CHAR_COUNT];
  2864. ---
  2865. >   char *buf = NULL;
  2866. >   byte *tmpSectorBuf = NULL;
  2867. 654c385
  2868. <   uint64 remainingBytes, lastHeaderUpdateDistance = 0, zeroedSectorCount = 0;
  2869. ---
  2870. >   uint64 remainingBytes, workChunkStartByteOffset, lastHeaderUpdateDistance = 0, skippedBadSectorCount = 0;
  2871. 667,668d397
  2872. <   bInPlaceEncNonSysResumed = TRUE;
  2873. <
  2874. 676,694d404
  2875. <   header = (char *) TCalloc (TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  2876. <   if (!header)
  2877. <   {
  2878. <       nStatus = ERR_OUTOFMEMORY;
  2879. <       goto closing_seq;
  2880. <   }
  2881. <
  2882. <   VirtualLock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  2883. <
  2884. <   if (wipeAlgorithm != TC_WIPE_NONE)
  2885. <   {
  2886. <       wipeBuffer = (byte *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE);
  2887. <       if (!wipeBuffer)
  2888. <       {
  2889. <           nStatus = ERR_OUTOFMEMORY;
  2890. <           goto closing_seq;
  2891. <       }
  2892. <   }
  2893. <
  2894. 711c421,428
  2895. <   if (dev == INVALID_HANDLE_VALUE)
  2896. ---
  2897. >
  2898. >   // The wizard should have dismounted the TC volume if it was mounted, but for extra safety we will check this again.
  2899. >   if (IsMountedVolume (devicePath))
  2900. >   {
  2901. >       int driveLetter = GetMountedVolumeDriveNo (devicePath);
  2902. >
  2903. >       if (driveLetter == -1
  2904. >           || !UnmountVolume (MainDlg, driveLetter, TRUE))
  2905. 712a430,435
  2906. >           handleWin32Error (MainDlg);
  2907. >           AbortProcess ("CANT_DISMOUNT_VOLUME");
  2908. >       }
  2909. >   }
  2910. >
  2911. >
  2912. 723c446
  2913. <           FALSE,  // Do not require exclusive access
  2914. ---
  2915. >       TRUE,   // Require exclusive access
  2916. 734c457,458
  2917. <   }
  2918. ---
  2919. >
  2920. >
  2921. 755a480,487
  2922. >   tmpSectorBuf = (byte *) TCalloc (sectorSize);
  2923. >   if (!tmpSectorBuf)
  2924. >   {
  2925. >       nStatus = ERR_OUTOFMEMORY;
  2926. >       goto closing_seq;
  2927. >   }
  2928. >
  2929. >
  2930. 761a494,550
  2931. >   if (masterCryptoInfo->LegacyVolume)
  2932. >   {
  2933. >       Error ("NONSYS_INPLACE_DECRYPTION_BAD_VOL_FORMAT");
  2934. >       nStatus = ERR_DONT_REPORT;
  2935. >       goto closing_seq;
  2936. >   }
  2937. >
  2938. >   if (masterCryptoInfo->hiddenVolume)
  2939. >   {
  2940. >       Error ("NONSYS_INPLACE_DECRYPTION_CANT_DECRYPT_HID_VOL");
  2941. >       nStatus = ERR_DONT_REPORT;
  2942. >       goto closing_seq;
  2943. >   }
  2944. >
  2945. >   if (!bInPlaceEncNonSysResumed
  2946. >       && masterCryptoInfo->VolumeSize.Value == masterCryptoInfo->EncryptedAreaLength.Value)
  2947. >   {
  2948. >       /* Decryption started (not resumed) */
  2949. >
  2950. >       if ((masterCryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC) == 0)
  2951. >       {
  2952. >           // The volume has not been encrypted in-place so it may contain a hidden volume.
  2953. >           // Ask the user to confirm it does not.
  2954. >
  2955. >           char *tmpStr[] = {0,
  2956. >               "CONFIRM_VOL_CONTAINS_NO_HIDDEN_VOL",
  2957. >               "VOL_CONTAINS_NO_HIDDEN_VOL",
  2958. >               "VOL_CONTAINS_A_HIDDEN_VOL",
  2959. >               0};
  2960. >
  2961. >           switch (AskMultiChoice ((void **) tmpStr, FALSE))
  2962. >           {
  2963. >           case 1:
  2964. >               // NOP
  2965. >               break;
  2966. >           case 2:
  2967. >           default:
  2968. >               // Cancel
  2969. >               nStatus = ERR_DONT_REPORT;
  2970. >               goto closing_seq;
  2971. >           }
  2972. >       }
  2973. >
  2974. >       // Update config files and app data
  2975. >
  2976. >       // In the config file, increase the number of partitions where in-place decryption is in progress
  2977. >       SaveNonSysInPlaceEncSettings (1, TC_WIPE_NONE, TRUE);
  2978. >
  2979. >       // Add the wizard to the system startup sequence if appropriate
  2980. >       if (!IsNonInstallMode ())
  2981. >           ManageStartupSeqWiz (FALSE, "/prinplace");
  2982. >   }
  2983. >
  2984. >
  2985. >
  2986. >   bInPlaceEncNonSysResumed = TRUE;
  2987. >   bFirstNonSysInPlaceEncResumeDone = TRUE;
  2988. 763c552,553
  2989. <     remainingBytes = masterCryptoInfo->VolumeSize.Value - masterCryptoInfo->EncryptedAreaLength.Value;
  2990. ---
  2991. >
  2992. >   remainingBytes = masterCryptoInfo->EncryptedAreaLength.Value;
  2993. 770c560
  2994. <   SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_ENCRYPTING);
  2995. ---
  2996. >   SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_DECRYPTING);
  2997. 772d561
  2998. <   bFirstNonSysInPlaceEncResumeDone = TRUE;
  2999. 775c564
  3000. <   /* The in-place encryption core */
  3001. ---
  3002. >   /* The in-place decryption core */
  3003. 787c576
  3004. <       unitNo.Value = (remainingBytes - workChunkSize + TC_VOLUME_DATA_OFFSET) / ENCRYPTION_DATA_UNIT_SIZE;
  3005. ---
  3006. >       workChunkStartByteOffset = masterCryptoInfo->EncryptedAreaStart.Value;
  3007. 788a578
  3008. >       unitNo.Value = workChunkStartByteOffset / ENCRYPTION_DATA_UNIT_SIZE;
  3009. 790d579
  3010. <       // Read the plaintext into RAM
  3011. 792c581
  3012. < inplace_enc_read:
  3013. ---
  3014. >       // Read the ciphertext into RAM
  3015. 794c583
  3016. <       offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize - TC_VOLUME_DATA_OFFSET;
  3017. ---
  3018. >       offset.QuadPart = workChunkStartByteOffset;
  3019. 812c601
  3020. <               if (!*bTryToCorrectReadErrors)
  3021. ---
  3022. >               if (!*DiscardUnreadableEncryptedSectors)
  3023. 814c603
  3024. <                   *bTryToCorrectReadErrors = (AskWarnYesNo ("ENABLE_BAD_SECTOR_ZEROING") == IDYES);
  3025. ---
  3026. >                   *DiscardUnreadableEncryptedSectors = (AskWarnYesNo ("DISCARD_UNREADABLE_ENCRYPTED_SECTORS") == IDYES);
  3027. 817c606
  3028. <               if (*bTryToCorrectReadErrors)
  3029. ---
  3030. >               if (*DiscardUnreadableEncryptedSectors)
  3031. 819c608
  3032. <                   // Try to correct the read errors physically
  3033. ---
  3034. >                   // Read the work chunk again, but this time each sector individually and skiping each bad sector
  3035. 821c610,613
  3036. <                   offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize - TC_VOLUME_DATA_OFFSET;
  3037. ---
  3038. >                   LARGE_INTEGER tmpSectorOffset;
  3039. >                   uint64 tmpSectorCount;
  3040. >                   uint64 tmpBufOffset = 0;
  3041. >                   DWORD tmpNbrReadBytes = 0;
  3042. 823c615
  3043. <                   nStatus = ZeroUnreadableSectors (dev, offset, workChunkSize, sectorSize, &zeroedSectorCount);
  3044. ---
  3045. >                   tmpSectorOffset.QuadPart = offset.QuadPart;
  3046. 825c617,619
  3047. <                   if (nStatus != ERR_SUCCESS)
  3048. ---
  3049. >                   for (tmpSectorCount = workChunkSize / sectorSize; tmpSectorCount > 0; --tmpSectorCount)
  3050. >                   {
  3051. >                       if (SetFilePointerEx (dev, tmpSectorOffset, NULL, FILE_BEGIN) == 0)
  3052. 827d620
  3053. <                       // Due to write errors, we can't correct the read errors
  3054. 832,833c625,633
  3055. <                   goto inplace_enc_read;
  3056. <               }
  3057. ---
  3058. >                       if (ReadFile (dev, tmpSectorBuf, sectorSize, &tmpNbrReadBytes, NULL) == 0
  3059. >                           || tmpNbrReadBytes != (DWORD) sectorSize)
  3060. >                       {
  3061. >                           // Read error
  3062. >
  3063. >                           // Clear the buffer so the content of each unreadable sector is replaced with decrypted all-zero blocks (producing pseudorandom data)
  3064. >                           memset (tmpSectorBuf, 0, sectorSize);
  3065. >
  3066. >                           skippedBadSectorCount++;
  3067. 835a636,643
  3068. >                       memcpy (buf + tmpBufOffset, tmpSectorBuf, sectorSize);
  3069. >
  3070. >                       tmpSectorOffset.QuadPart += sectorSize;
  3071. >                       tmpBufOffset += sectorSize;
  3072. >                   }
  3073. >               }
  3074. >               else
  3075. >               {
  3076. 841,842c649,650
  3077. <
  3078. <       if (remainingBytes - workChunkSize < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE)
  3079. ---
  3080. >           }
  3081. >           else
  3082. 844,845c652
  3083. <           // We reached the inital portion of the filesystem, which we had concealed (in order to prevent
  3084. <           // Windows from interfering with the volume). Now we need to undo that modification.
  3085. ---
  3086. >               SetLastError (dwTmpErr);        // Preserve the original error code
  3087. 847,848c654,656
  3088. <           for (i = 0; i < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE - (remainingBytes - workChunkSize); i++)
  3089. <               buf[i] ^= TC_NTFS_CONCEAL_CONSTANT;
  3090. ---
  3091. >               nStatus = ERR_OS_ERROR;
  3092. >               goto closing_seq;
  3093. >           }
  3094. 850a659
  3095. >       // Decrypt the ciphertext in RAM
  3096. 852,861c661
  3097. <       // Encrypt the plaintext in RAM
  3098. <
  3099. <       EncryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
  3100. <
  3101. <
  3102. <       // If enabled, wipe the area to which we will write the ciphertext
  3103. <
  3104. <       if (wipeAlgorithm != TC_WIPE_NONE)
  3105. <       {
  3106. <           byte wipePass;
  3107. ---
  3108. >       DecryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
  3109. 863d662
  3110. <           offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize;
  3111. 865,873d663
  3112. <           for (wipePass = 1; wipePass <= GetWipePassCount (wipeAlgorithm); ++wipePass)
  3113. <           {
  3114. <               if (!WipeBuffer (wipeAlgorithm, wipeRandChars, wipePass, wipeBuffer, workChunkSize))
  3115. <               {
  3116. <                   ULONG i;
  3117. <                   for (i = 0; i < workChunkSize; ++i)
  3118. <                   {
  3119. <                       wipeBuffer[i] = buf[i] + wipePass;
  3120. <                   }
  3121. 875,883c665
  3122. <                   EncryptDataUnits (wipeBuffer, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
  3123. <                   memcpy (wipeRandCharsUpdate, wipeBuffer, sizeof (wipeRandCharsUpdate));
  3124. <               }
  3125. <
  3126. <               if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0
  3127. <                   || WriteFile (dev, wipeBuffer, workChunkSize, &n, NULL) == 0)
  3128. <               {
  3129. <                   // Write error
  3130. <                   dwError = GetLastError();
  3131. ---
  3132. >       // Conceal initial portion of the filesystem
  3133. 885,886c667
  3134. <                   // Undo failed write operation
  3135. <                   if (workChunkSize > TC_VOLUME_DATA_OFFSET && SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
  3136. ---
  3137. >       if (workChunkStartByteOffset - TC_VOLUME_DATA_OFFSET < TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE)
  3138. 888,896c669,670
  3139. <                       DecryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
  3140. <                       WriteFile (dev, buf + TC_VOLUME_DATA_OFFSET, workChunkSize - TC_VOLUME_DATA_OFFSET, &n, NULL);
  3141. <                   }
  3142. <
  3143. <                   SetLastError (dwError);
  3144. <                   nStatus = ERR_OS_ERROR;
  3145. <                   goto closing_seq;
  3146. <               }
  3147. <           }
  3148. ---
  3149. >           // We are decrypting the initial TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE bytes of the filesystem. We will
  3150. >           // conceal this portion to prevent Windows and applications from interfering with the volume.
  3151. 898c672,673
  3152. <           memcpy (wipeRandChars, wipeRandCharsUpdate, sizeof (wipeRandCharsUpdate));
  3153. ---
  3154. >           for (i = 0; i < min (TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, workChunkStartByteOffset - TC_VOLUME_DATA_OFFSET + workChunkSize); i++)
  3155. >               buf[i] ^= TC_TRANSFORM_FS_CONCEAL_CONSTANT;
  3156. 902c677
  3157. <       // Write the ciphertext
  3158. ---
  3159. >       // Write the plaintext
  3160. 904c679
  3161. <       offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize;
  3162. ---
  3163. >       offset.QuadPart = workChunkStartByteOffset - TC_VOLUME_DATA_OFFSET;
  3164. 915,924d689
  3165. <           dwError = GetLastError();
  3166. <
  3167. <           // Undo failed write operation
  3168. <           if (workChunkSize > TC_VOLUME_DATA_OFFSET && SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
  3169. <           {
  3170. <               DecryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
  3171. <               WriteFile (dev, buf + TC_VOLUME_DATA_OFFSET, workChunkSize - TC_VOLUME_DATA_OFFSET, &n, NULL);
  3172. <           }
  3173. <
  3174. <           SetLastError (dwError);
  3175. 930,931c695,696
  3176. <       masterCryptoInfo->EncryptedAreaStart.Value -= workChunkSize;
  3177. <       masterCryptoInfo->EncryptedAreaLength.Value += workChunkSize;
  3178. ---
  3179. >       masterCryptoInfo->EncryptedAreaStart.Value += workChunkSize;
  3180. >       masterCryptoInfo->EncryptedAreaLength.Value -= workChunkSize;
  3181. 942a708,709
  3182. >           {
  3183. >               // Possible write error
  3184. 943a711
  3185. >           }
  3186. 960a729,730
  3187. >   {
  3188. >       // Possible write error
  3189. 961a732
  3190. >   }
  3191. 966c737,742
  3192. <       /* The data area has been fully encrypted; create and write the primary volume header */
  3193. ---
  3194. >       /* Volume has been fully decrypted. */
  3195. >
  3196. >
  3197. >       // Prevent attempts to update volume header during the closing sequence
  3198. >       bEncryptedAreaSizeChanged = FALSE;
  3199. >
  3200. 970,987c746,750
  3201. <       for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_DISK_WIPE_PASSES); wipePass++)
  3202. <       {
  3203. <           nStatus = CreateVolumeHeaderInMemory (FALSE,
  3204. <               header,
  3205. <               headerCryptoInfo->ea,
  3206. <               headerCryptoInfo->mode,
  3207. <               password,
  3208. <               masterCryptoInfo->pkcs5,
  3209. <               (char *) masterCryptoInfo->master_keydata,
  3210. <               &tmpCryptoInfo,
  3211. <               masterCryptoInfo->VolumeSize.Value,
  3212. <               0,
  3213. <               masterCryptoInfo->EncryptedAreaStart.Value,
  3214. <               masterCryptoInfo->EncryptedAreaLength.Value,
  3215. <               masterCryptoInfo->RequiredProgramVersion,
  3216. <               masterCryptoInfo->HeaderFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC,
  3217. <               masterCryptoInfo->SectorSize,
  3218. <               wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_DISK_WIPE_PASSES - 1));
  3219. ---
  3220. >
  3221. >
  3222. >       /* Undo concealing of the filesystem */
  3223. >
  3224. >       nStatus = ConcealNTFS (dev);
  3225. 993d755
  3226. <           offset.QuadPart = TC_VOLUME_HEADER_OFFSET;
  3227. 995,996c757,765
  3228. <           if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0
  3229. <               || !WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header))
  3230. ---
  3231. >       /* Ovewrite the backup header and the remaining ciphertext with all-zero blocks (the primary header was overwritten with the decrypted data). */
  3232. >
  3233. >       memset (tmpSectorBuf, 0, sectorSize);
  3234. >
  3235. >       for (offset.QuadPart = masterCryptoInfo->VolumeSize.Value;
  3236. >           offset.QuadPart <= deviceSize - sectorSize;
  3237. >           offset.QuadPart += sectorSize)
  3238. >       {
  3239. >           if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0)
  3240. 1002,1003c771,774
  3241. <           // Fill the reserved sectors of the header area with random data
  3242. <           nStatus = WriteRandomDataToReservedHeaderAreas (dev, headerCryptoInfo, masterCryptoInfo->VolumeSize.Value, TRUE, FALSE);
  3243. ---
  3244. >           if (WriteFile (dev, tmpSectorBuf, sectorSize, &n, NULL) == 0)
  3245. >           {
  3246. >               // Write error
  3247. >               dwError = GetLastError();
  3248. 1005c776,777
  3249. <           if (nStatus != ERR_SUCCESS)
  3250. ---
  3251. >               SetLastError (dwError);
  3252. >               nStatus = ERR_OS_ERROR;
  3253. 1007a780,782
  3254. >       }
  3255. >
  3256. >
  3257. 1009c784
  3258. <       // Update the configuration files
  3259. ---
  3260. >       /* Update the configuration files */
  3261. 1011c786
  3262. <       SaveNonSysInPlaceEncSettings (-1, wipeAlgorithm);
  3263. ---
  3264. >       SaveNonSysInPlaceEncSettings (-1, TC_WIPE_NONE, TRUE);
  3265. 1017a793
  3266. >
  3267. 1027a804,809
  3268. >   if (dev != INVALID_HANDLE_VALUE)
  3269. >   {
  3270. >       CloseHandle (dev);
  3271. >       dev = INVALID_HANDLE_VALUE;
  3272. >   }
  3273. >
  3274. 1042a825,830
  3275. >   if (dev != INVALID_HANDLE_VALUE)
  3276. >   {
  3277. >       CloseHandle (dev);
  3278. >       dev = INVALID_HANDLE_VALUE;
  3279. >   }
  3280. >
  3281. 1055,1060d842
  3282. <   if (tmpCryptoInfo != NULL)
  3283. <   {
  3284. <       crypto_close (tmpCryptoInfo);
  3285. <       tmpCryptoInfo = NULL;
  3286. <   }
  3287. <
  3288. 1064,1069d845
  3289. <   if (dev != INVALID_HANDLE_VALUE)
  3290. <   {
  3291. <       CloseHandle (dev);
  3292. <       dev = INVALID_HANDLE_VALUE;
  3293. <   }
  3294. <
  3295. 1070a847
  3296. >   {
  3297. 1071a849,850
  3298. >       buf = NULL;
  3299. >   }
  3300. 1073c852
  3301. <   if (header != NULL)
  3302. ---
  3303. >   if (tmpSectorBuf != NULL)
  3304. 1075,1077c854,855
  3305. <       burn (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  3306. <       VirtualUnlock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
  3307. <       TCfree (header);
  3308. ---
  3309. >       TCfree (tmpSectorBuf);
  3310. >       tmpSectorBuf = NULL;
  3311. 1080,1083c858
  3312. <   if (wipeBuffer != NULL)
  3313. <       TCfree (wipeBuffer);
  3314. <
  3315. <   if (zeroedSectorCount > 0)
  3316. ---
  3317. >   if (skippedBadSectorCount > 0)
  3318. 1088c863
  3319. <       GetSizeString (zeroedSectorCount * sectorSize, sizeStr);
  3320. ---
  3321. >       GetSizeString (skippedBadSectorCount * sectorSize, sizeStr);
  3322. 1091,1092c866,867
  3323. <           GetString ("ZEROED_BAD_SECTOR_COUNT"),
  3324. <           zeroedSectorCount,
  3325. ---
  3326. >           GetString ("SKIPPED_BAD_SECTOR_COUNT"),
  3327. >           skippedBadSectorCount,
  3328. 1146a922,929
  3329. >   // We need to ensure the TC_HEADER_FLAG_NONSYS_INPLACE_ENC flag bit is set, because if volumes created by TC-format
  3330. >   // were decrypted in place, it would be possible to mount them partially encrypted and it wouldn't be possible
  3331. >   // to resume interrupted decryption after the wizard exits.
  3332. >   masterCryptoInfo->HeaderFlags |= TC_HEADER_FLAG_NONSYS_INPLACE_ENC;
  3333. >   fieldPos = (byte *) header + TC_HEADER_OFFSET_FLAGS;
  3334. >   mputLong (fieldPos, (masterCryptoInfo->HeaderFlags));
  3335. >
  3336. >
  3337. 1150a934
  3338. >
  3339. 1250,1311d1033
  3340. < static int DismountFileSystem (HANDLE dev,
  3341. <                   int driveLetter,
  3342. <                   BOOL bForcedAllowed,
  3343. <                   BOOL bForcedRequiresConfirmation,
  3344. <                   BOOL bSilent)
  3345. < {
  3346. <   int attempt;
  3347. <   BOOL bResult;
  3348. <   DWORD dwResult;
  3349. <
  3350. <   CloseVolumeExplorerWindows (MainDlg, driveLetter);
  3351. <
  3352. <   attempt = UNMOUNT_MAX_AUTO_RETRIES * 10;
  3353. <
  3354. <   while (!(bResult = DeviceIoControl (dev, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &dwResult, NULL))
  3355. <       && attempt > 0)
  3356. <   {
  3357. <       Sleep (UNMOUNT_AUTO_RETRY_DELAY);
  3358. <       attempt--;
  3359. <   }
  3360. <
  3361. <   if (!bResult)
  3362. <   {
  3363. <       if (!bForcedAllowed)
  3364. <       {
  3365. <           if (!bSilent)
  3366. <               ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS", TRUE);
  3367. <
  3368. <           return ERR_DONT_REPORT;
  3369. <       }
  3370. <
  3371. <       if (bForcedRequiresConfirmation
  3372. <           && !bSilent
  3373. <           && AskWarnYesNo ("VOL_LOCK_FAILED_OFFER_FORCED_DISMOUNT") == IDNO)
  3374. <       {
  3375. <           return ERR_DONT_REPORT;
  3376. <       }
  3377. <   }
  3378. <
  3379. <   // Dismount the volume
  3380. <
  3381. <   attempt = UNMOUNT_MAX_AUTO_RETRIES * 10;
  3382. <
  3383. <   while (!(bResult = DeviceIoControl (dev, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dwResult, NULL))
  3384. <       && attempt > 0)
  3385. <   {
  3386. <       Sleep (UNMOUNT_AUTO_RETRY_DELAY);
  3387. <       attempt--;
  3388. <   }
  3389. <
  3390. <   if (!bResult)
  3391. <   {
  3392. <       if (!bSilent)
  3393. <           ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS", TRUE);
  3394. <
  3395. <       return ERR_DONT_REPORT;
  3396. <   }
  3397. <
  3398. <   return ERR_SUCCESS;
  3399. < }
  3400. <
  3401. <
  3402. 1318c1040
  3403. <   char buf [TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE];
  3404. ---
  3405. >   char buf [TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE];
  3406. 1329c1051
  3407. <   if (ReadFile (dev, buf, TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
  3408. ---
  3409. >   if (ReadFile (dev, buf, TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
  3410. 1332,1333c1054,1055
  3411. <   for (i = 0; i < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE; i++)
  3412. <       buf[i] ^= TC_NTFS_CONCEAL_CONSTANT;
  3413. ---
  3414. >   for (i = 0; i < TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE; i++)
  3415. >       buf[i] ^= TC_TRANSFORM_FS_CONCEAL_CONSTANT;
  3416. 1340c1062
  3417. <   if (WriteFile (dev, buf, TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
  3418. ---
  3419. >   if (WriteFile (dev, buf, TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
  3420. 1347,1348c1069,1070
  3421. <       for (i = 0; i < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE; i++)
  3422. <           buf[i] ^= TC_NTFS_CONCEAL_CONSTANT;
  3423. ---
  3424. >       for (i = 0; i < TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE; i++)
  3425. >           buf[i] ^= TC_TRANSFORM_FS_CONCEAL_CONSTANT;
  3426. 1357c1079
  3427. <           || WriteFile (dev, buf, TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed2, NULL) == 0);
  3428. ---
  3429. >           || WriteFile (dev, buf, TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed2, NULL) == 0);
  3430. 1397c1119
  3431. < BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm)
  3432. ---
  3433. > BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm, BOOL decrypting)
  3434. 1413c1135,1136
  3435. <   else
  3436. ---
  3437. >
  3438. >   if (!decrypting)
  3439. 1424a1148
  3440. >   }
  3441. 1429d1152
  3442. <   }
  3443. diff -b -r tc-7.1/Format/InPlace.h tc-7.2/Format/InPlace.h
  3444. 20a21
  3445. >   NONSYS_INPLACE_ENC_STATUS_DECRYPTING,
  3446. 27a29
  3447. > BOOL CheckRequirementsForNonSysInPlaceDec (const char *devicePath, BOOL silent);
  3448. 29a32
  3449. > int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile BOOL *DiscardUnreadableEncryptedSectors);
  3450. 35d37
  3451. < static int DismountFileSystem (HANDLE dev, int driveLetter, BOOL bForcedAllowed, BOOL bForcedRequiresConfirmation, BOOL bSilent);
  3452. 37c39
  3453. < BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId wipeAlgorithm);
  3454. ---
  3455. > BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId wipeAlgorithm, BOOL decrypting);
  3456. diff -b -r tc-7.1/Format/Resource.h tc-7.2/Format/Resource.h
  3457. 36a37
  3458. > #define IDD_DRIVE_LETTER_SELECTION_PAGE 132
  3459. 45,139c46,134
  3460. < #define IDC_COMBO_BOX_HASH_ALGO         1008
  3461. < #define IDC_SPACE_LEFT                  1009
  3462. < #define IDC_VERIFY                      1010
  3463. < #define IDC_KB                          1011
  3464. < #define IDC_NO_HISTORY                  1012
  3465. < #define IDC_MB                          1013
  3466. < #define IDC_PROGRESS_BAR                1014
  3467. < #define IDC_GB                          1015
  3468. < #define IDC_ABORT_BUTTON                1016
  3469. < #define IDC_HEADER_KEY                  1017
  3470. < #define IDC_LIST_BOX                    1018
  3471. < #define IDC_DISK_KEY                    1019
  3472. < #define IDC_RANDOM_BYTES                1020
  3473. < #define IDC_CIPHER_TEST                 1021
  3474. < #define IDC_BENCHMARK                   1022
  3475. < #define IDC_QUICKFORMAT                 1023
  3476. < #define IDC_BYTESWRITTEN                1024
  3477. < #define IDC_WRITESPEED                  1025
  3478. < #define IDC_KEY_FILES                   1026
  3479. < #define IDC_TIMEREMAIN                  1027
  3480. < #define IDC_CLUSTERSIZE                 1028
  3481. < #define IDC_FILESYS                     1029
  3482. < #define IDC_SHOW_KEYS                   1030
  3483. < #define IDC_STD_VOL                     1031
  3484. < #define IDC_HIDDEN_VOL                  1032
  3485. < #define IDC_HIDDEN_VOL_HELP             1033
  3486. < #define IDC_OPEN_OUTER_VOLUME           1034
  3487. < #define IDC_HIDVOL_WIZ_MODE_FULL        1035
  3488. < #define IDC_HIDVOL_WIZ_MODE_DIRECT      1036
  3489. < #define IDC_PASSWORD_DIRECT             1037
  3490. < #define IDC_SIZEBOX                     1038
  3491. < #define IDC_SELECT_VOLUME_LOCATION      1039
  3492. < #define IDC_NEXT                        1040
  3493. < #define IDC_PREV                        1041
  3494. < #define IDT_ENCRYPTION_ALGO             1042
  3495. < #define IDT_HASH_ALGO                   1043
  3496. < #define IDT_FORMAT_OPTIONS              1044
  3497. < #define IDT_FILESYSTEM                  1045
  3498. < #define IDT_CLUSTER                     1046
  3499. < #define IDT_RANDOM_POOL                 1047
  3500. < #define IDT_HEADER_KEY                  1048
  3501. < #define IDT_MASTER_KEY                  1049
  3502. < #define IDT_DONE                        1050
  3503. < #define IDT_SPEED                       1051
  3504. < #define IDT_LEFT                        1052
  3505. < #define IDT_CONFIRM                     1053
  3506. < #define IDT_PASSWORD                    1054
  3507. < #define IDC_SHOW_PASSWORD_SINGLE        1055
  3508. < #define IDC_SHOW_PASSWORD               1056
  3509. < #define IDC_LINK_MORE_INFO_ABOUT_CIPHER 1057
  3510. < #define IDC_LINK_HASH_INFO              1058
  3511. < #define IDC_POS_BOX                     1059
  3512. < #define IDC_BITMAP_WIZARD               1060
  3513. < #define IDC_FILE_CONTAINER              1061
  3514. < #define IDC_NONSYS_DEVICE               1062
  3515. < #define IDC_SYS_DEVICE                  1063
  3516. < #define IDT_FILE_CONTAINER              1064
  3517. < #define IDT_NON_SYS_DEVICE              1065
  3518. < #define IDT_SYS_DEVICE                  1066
  3519. < #define IDC_WHOLE_SYS_DRIVE             1067
  3520. < #define IDC_SYS_PARTITION               1068
  3521. < #define IDT_WHOLE_SYS_DRIVE             1069
  3522. < #define IDT_SYS_PARTITION               1070
  3523. < #define IDT_RESCUE_DISK_INFO            1071
  3524. < #define IDC_MORE_INFO                   1072
  3525. < #define IDC_MORE_INFO_ON_SYS_ENCRYPTION 1073
  3526. < #define IDT_COLLECTING_RANDOM_DATA_NOTE 1074
  3527. < #define IDC_MORE_INFO_ON_CONTAINERS     1075
  3528. < #define IDC_SINGLE_BOOT                 1076
  3529. < #define IDC_MULTI_BOOT                  1077
  3530. < #define IDT_MULTI_BOOT                  1078
  3531. < #define IDT_SINGLE_BOOT                 1079
  3532. < #define IDC_SYS_POOL_CONTENTS           1080
  3533. < #define IDT_PARTIAL_POOL_CONTENTS       1081
  3534. < #define IDC_DOWNLOAD_CD_BURN_SOFTWARE   1082
  3535. < #define IDT_RESCUE_DISK_BURN_INFO       1083
  3536. < #define IDT_WIPE_MODE_INFO              1084
  3537. < #define IDC_WIPE_MODE                   1085
  3538. < #define IDC_SELECT                      1086
  3539. < #define IDT_SYSENC_KEYS_GEN_INFO        1087
  3540. < #define IDC_DISPLAY_KEYS                1088
  3541. < #define IDC_PAUSE                       1089
  3542. < #define IDT_WIPE_MODE                   1090
  3543. < #define IDC_MORE_INFO_SYS_ENCRYPTION    1091
  3544. < #define IDC_BOX_HELP_NORMAL_VOL         1092
  3545. < #define IDT_STATUS                      1093
  3546. < #define IDT_PROGRESS                    1094
  3547. < #define IDT_SYSENC_DRIVE_ANALYSIS_INFO  1095
  3548. < #define IDC_SYSENC_NORMAL               1096
  3549. < #define IDC_SYSENC_HIDDEN               1097
  3550. < #define IDC_BOX_HELP_SYSENC_NORMAL      1098
  3551. < #define IDC_HIDDEN_SYSENC_INFO_LINK     1099
  3552. < #define IDT_PASS                        1100
  3553. < #define IDC_DEVICE_TRANSFORM_MODE_FORMAT 1101
  3554. < #define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1102
  3555. ---
  3556. > #define IDC_DRIVE_LETTER_LIST           1008
  3557. > #define IDC_COMBO_BOX_HASH_ALGO         1009
  3558. > #define IDC_SPACE_LEFT                  1010
  3559. > #define IDC_VERIFY                      1011
  3560. > #define IDC_KB                          1012
  3561. > #define IDC_NO_HISTORY                  1013
  3562. > #define IDC_MB                          1014
  3563. > #define IDC_PROGRESS_BAR                1015
  3564. > #define IDC_GB                          1016
  3565. > #define IDC_ABORT_BUTTON                1017
  3566. > #define IDC_HEADER_KEY                  1018
  3567. > #define IDC_LIST_BOX                    1019
  3568. > #define IDC_DISK_KEY                    1020
  3569. > #define IDC_RANDOM_BYTES                1021
  3570. > #define IDC_CIPHER_TEST                 1022
  3571. > #define IDC_BENCHMARK                   1023
  3572. > #define IDC_QUICKFORMAT                 1024
  3573. > #define IDC_BYTESWRITTEN                1025
  3574. > #define IDC_WRITESPEED                  1026
  3575. > #define IDC_KEY_FILES                   1027
  3576. > #define IDC_TIMEREMAIN                  1028
  3577. > #define IDC_CLUSTERSIZE                 1029
  3578. > #define IDC_FILESYS                     1030
  3579. > #define IDT_DRIVE_LETTER                1031
  3580. > #define IDC_SHOW_KEYS                   1032
  3581. > #define IDC_STD_VOL                     1033
  3582. > #define IDC_HIDDEN_VOL                  1034
  3583. > #define IDC_OPEN_OUTER_VOLUME           1035
  3584. > #define IDC_HIDVOL_WIZ_MODE_FULL        1036
  3585. > #define IDC_HIDVOL_WIZ_MODE_DIRECT      1037
  3586. > #define IDC_PASSWORD_DIRECT             1038
  3587. > #define IDC_SIZEBOX                     1039
  3588. > #define IDC_SELECT_VOLUME_LOCATION      1040
  3589. > #define IDC_NEXT                        1041
  3590. > #define IDC_PREV                        1042
  3591. > #define IDT_ENCRYPTION_ALGO             1043
  3592. > #define IDT_HASH_ALGO                   1044
  3593. > #define IDT_FORMAT_OPTIONS              1045
  3594. > #define IDT_FILESYSTEM                  1046
  3595. > #define IDT_CLUSTER                     1047
  3596. > #define IDT_RANDOM_POOL                 1048
  3597. > #define IDT_HEADER_KEY                  1049
  3598. > #define IDT_MASTER_KEY                  1050
  3599. > #define IDT_DONE                        1051
  3600. > #define IDT_SPEED                       1052
  3601. > #define IDT_LEFT                        1053
  3602. > #define IDT_CONFIRM                     1054
  3603. > #define IDT_PASSWORD                    1055
  3604. > #define IDC_SHOW_PASSWORD_SINGLE        1056
  3605. > #define IDC_SHOW_PASSWORD               1057
  3606. > #define IDC_POS_BOX                     1058
  3607. > #define IDC_BITMAP_WIZARD               1059
  3608. > #define IDC_FILE_CONTAINER              1060
  3609. > #define IDC_NONSYS_DEVICE               1061
  3610. > #define IDC_SYS_DEVICE                  1062
  3611. > #define IDT_FILE_CONTAINER              1063
  3612. > #define IDT_NON_SYS_DEVICE              1064
  3613. > #define IDT_SYS_DEVICE                  1065
  3614. > #define IDC_WHOLE_SYS_DRIVE             1066
  3615. > #define IDC_SYS_PARTITION               1067
  3616. > #define IDT_WHOLE_SYS_DRIVE             1068
  3617. > #define IDT_SYS_PARTITION               1069
  3618. > #define IDT_RESCUE_DISK_INFO            1070
  3619. > #define IDT_COLLECTING_RANDOM_DATA_NOTE 1071
  3620. > #define IDC_SINGLE_BOOT                 1072
  3621. > #define IDC_MULTI_BOOT                  1073
  3622. > #define IDT_MULTI_BOOT                  1074
  3623. > #define IDT_SINGLE_BOOT                 1075
  3624. > #define IDC_SYS_POOL_CONTENTS           1076
  3625. > #define IDT_PARTIAL_POOL_CONTENTS       1077
  3626. > #define IDC_DOWNLOAD_CD_BURN_SOFTWARE   1078
  3627. > #define IDT_RESCUE_DISK_BURN_INFO       1079
  3628. > #define IDT_WIPE_MODE_INFO              1080
  3629. > #define IDC_WIPE_MODE                   1081
  3630. > #define IDC_SELECT                      1082
  3631. > #define IDT_SYSENC_KEYS_GEN_INFO        1083
  3632. > #define IDC_DISPLAY_KEYS                1084
  3633. > #define IDC_PAUSE                       1085
  3634. > #define IDT_WIPE_MODE                   1086
  3635. > #define IDC_BOX_HELP_NORMAL_VOL         1087
  3636. > #define IDT_STATUS                      1088
  3637. > #define IDT_PROGRESS                    1089
  3638. > #define IDT_SYSENC_DRIVE_ANALYSIS_INFO  1090
  3639. > #define IDC_SYSENC_NORMAL               1091
  3640. > #define IDC_SYSENC_HIDDEN               1092
  3641. > #define IDC_BOX_HELP_SYSENC_NORMAL      1093
  3642. > #define IDT_PASS                        1094
  3643. > #define IDC_DEVICE_TRANSFORM_MODE_FORMAT 1095
  3644. > #define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1096
  3645. 146c141
  3646. < #define _APS_NEXT_RESOURCE_VALUE        132
  3647. ---
  3648. > #define _APS_NEXT_RESOURCE_VALUE        133
  3649. 148c143
  3650. < #define _APS_NEXT_CONTROL_VALUE         1103
  3651. ---
  3652. > #define _APS_NEXT_CONTROL_VALUE         1097
  3653. diff -b -r tc-7.1/Format/Tcformat.c tc-7.2/Format/Tcformat.c
  3654. 90c90
  3655. <       NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE,
  3656. ---
  3657. >       NONSYS_INPLACE_ENC_PASSWORD_PAGE,
  3658. 94,95c94,96
  3659. <       NONSYS_INPLACE_ENC_ENCRYPTION_PAGE,
  3660. <       NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE,
  3661. ---
  3662. >       NONSYS_INPLACE_ENC_TRANSFORM_PAGE,
  3663. >       NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE,
  3664. >       NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE,
  3665. 147a149
  3666. > BOOL DirectNonSysInplaceDecStartMode = FALSE;
  3667. 148a151
  3668. > BOOL DirectNonSysInplaceDecResumeMode = FALSE;
  3669. 150,151c153,155
  3670. < volatile BOOL bInPlaceEncNonSys = FALSE;      /* If TRUE, existing data on a non-system partition/volume are to be encrypted (for system encryption, this flag is ignored) */
  3671. < volatile BOOL bInPlaceEncNonSysResumed = FALSE;   /* If TRUE, the wizard is supposed to resume (or has resumed) process of non-system in-place encryption. */
  3672. ---
  3673. > volatile BOOL bInPlaceEncNonSys = FALSE;      /* If TRUE, existing data on a non-system partition/volume are to be encrypted (or decrypted if bInPlaceDecNonSys is TRUE) in place (for system encryption, this flag is ignored) */
  3674. > volatile BOOL bInPlaceDecNonSys = FALSE;      /* If TRUE, existing data on a non-system partition/volume are to be decrypted in place (for system encryption, this flag is ignored) */
  3675. > volatile BOOL bInPlaceEncNonSysResumed = FALSE;   /* If TRUE, the wizard is supposed to resume (or has resumed) process of non-system in-place encryption/decryption. */
  3676. 568a573
  3677. >       {
  3678. 569a575,576
  3679. >           bInPlaceDecNonSys = FALSE;
  3680. >       }
  3681. 576a584
  3682. >       {
  3683. 577a586,587
  3684. >
  3685. >           if (! (bInPlaceDecNonSys && !bInPlaceEncNonSysResumed)) // If we are starting (but not resuming) decryption of non-system volume, we actually need szFileName as it contains the command line param.
  3686. 578a589
  3687. >
  3688. 581a593
  3689. >       }
  3690. 978a991
  3691. >           bInPlaceDecNonSys = FALSE;
  3692. 1014c1027
  3693. < void SwitchWizardToNonSysInplaceEncResumeMode (void)
  3694. ---
  3695. > void SwitchWizardToNonSysInplaceEncResumeMode (BOOL decrypt)
  3696. 1018c1031
  3697. <       if (!ElevateWholeWizardProcess ("/zinplace"))
  3698. ---
  3699. >       if (!ElevateWholeWizardProcess (decrypt ? "/resumeinplacedec" : "/zinplace"))
  3700. 1027a1041
  3701. >   bInPlaceDecNonSys = decrypt;
  3702. 1032c1046,1071
  3703. <   LoadPage (MainDlg, NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE);
  3704. ---
  3705. >   LoadPage (MainDlg, NONSYS_INPLACE_ENC_PASSWORD_PAGE);
  3706. > }
  3707. >
  3708. > void SwitchWizardToNonSysInplaceDecStartMode (char *volPath)
  3709. > {
  3710. >   if (!IsAdmin() && IsUacSupported())
  3711. >   {
  3712. >       if (!ElevateWholeWizardProcess ((string ("/inplacedec \"") + volPath + "\"").c_str()))
  3713. >           AbortProcessSilent ();
  3714. >   }
  3715. >
  3716. >   if (!IsAdmin())
  3717. >       AbortProcess("ADMIN_PRIVILEGES_WARN_DEVICES");
  3718. >
  3719. >   if (!CheckRequirementsForNonSysInPlaceDec (volPath, FALSE))
  3720. >       AbortProcessSilent ();
  3721. >
  3722. >   CreateNonSysInplaceEncMutex ();
  3723. >
  3724. >   bInPlaceEncNonSys = TRUE;
  3725. >   bInPlaceDecNonSys = TRUE;
  3726. >   bInPlaceEncNonSysResumed = FALSE;
  3727. >
  3728. >   ChangeWizardMode (WIZARD_MODE_NONSYS_DEVICE);
  3729. >
  3730. >   LoadPage (MainDlg, NONSYS_INPLACE_ENC_PASSWORD_PAGE);
  3731. 1238,1239d1276
  3732. <           wcscpy_s (hyperLink, sizeof(hyperLink) / 2, GetString ("IDC_LINK_MORE_INFO_ABOUT_CIPHER"));
  3733. <
  3734. 1247,1251d1283
  3735. <
  3736. <
  3737. <       // Update hyperlink
  3738. <       SetWindowTextW (GetDlgItem (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER), hyperLink);
  3739. <       AccommodateTextField (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER, FALSE, hUserUnderlineFont);
  3740. 1641a1674
  3741. >       bVolTransformThreadCancel = FALSE;
  3742. 1817a1851,1853
  3743. >   case NONSYS_INPLACE_ENC_STATUS_DECRYPTING:
  3744. >       wcscpy (nonSysInplaceEncUIStatus, GetString ("PROGRESS_STATUS_DECRYPTING"));
  3745. >       break;
  3746. 1837c1873,1878
  3747. <   EnableWindow (GetDlgItem (hCurPage, IDC_WIPE_MODE), !(bVolTransformThreadRunning || bVolTransformThreadToRun));
  3748. ---
  3749. >   // Reduce flickering by updating a GUI element only when a relevant change affects it
  3750. >   static BOOL lastbVolTransformThreadRunning = !bVolTransformThreadRunning;
  3751. >   static BOOL lastbVolTransformThreadToRun = !bVolTransformThreadToRun;
  3752. >   static BOOL lastbInPlaceEncNonSysResumed = !bInPlaceEncNonSysResumed;
  3753. >
  3754. >   EnableWindow (GetDlgItem (hCurPage, IDC_WIPE_MODE), !(bVolTransformThreadRunning || bVolTransformThreadToRun) && !bInPlaceDecNonSys);
  3755. 1838a1880,1882
  3756. >   if (lastbVolTransformThreadRunning != bVolTransformThreadRunning
  3757. >       || lastbVolTransformThreadToRun != bVolTransformThreadToRun)
  3758. >   {
  3759. 1841a1886,1891
  3760. >       lastbVolTransformThreadRunning = bVolTransformThreadRunning;
  3761. >       lastbVolTransformThreadToRun = bVolTransformThreadToRun;
  3762. >   }
  3763. >
  3764. >   if (lastbInPlaceEncNonSysResumed != bInPlaceEncNonSysResumed)
  3765. >   {
  3766. 1842a1893,1894
  3767. >       lastbInPlaceEncNonSysResumed = bInPlaceEncNonSysResumed;
  3768. >   }
  3769. 1906a1959
  3770. >       || nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_DECRYPTING
  3771. 1911c1964
  3772. <           && nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_ENCRYPTING)
  3773. ---
  3774. >           && (nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_ENCRYPTING || nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_DECRYPTING))
  3775. 1945c1998
  3776. <       FALSE,
  3777. ---
  3778. >       bInPlaceDecNonSys,
  3779. 2348c2401
  3780. <   volParams->headerFlags = CreatingHiddenSysVol() ? TC_HEADER_FLAG_ENCRYPTED_SYSTEM : 0;
  3781. ---
  3782. >   volParams->headerFlags = (CreatingHiddenSysVol() ? TC_HEADER_FLAG_ENCRYPTED_SYSTEM : 0);
  3783. 2358c2411,2420
  3784. <   if (bInPlaceEncNonSys)
  3785. ---
  3786. >   if (bInPlaceDecNonSys)
  3787. >   {
  3788. >       // In-place decryption of non-system volume
  3789. >
  3790. >       if (!bInPlaceEncNonSysResumed)
  3791. >           DiscardUnreadableEncryptedSectors = FALSE;
  3792. >
  3793. >       nStatus = DecryptPartitionInPlace (volParams, &DiscardUnreadableEncryptedSectors);
  3794. >   }
  3795. >   else if (bInPlaceEncNonSys)
  3796. 2359a2422,2423
  3797. >       // In-place encryption of non-system volume
  3798. >
  3799. 2386a2451,2452
  3800. >       // Format-encryption
  3801. >
  3802. 2404c2470
  3803. <       // Ignore user abort if non-system in-place encryption successfully finished
  3804. ---
  3805. >       // Ignore user abort if non-system in-place encryption/decryption successfully finished
  3806. 2431c2497
  3807. <       && !(bInPlaceEncNonSys && NonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINISHED))    // Ignore user abort if non-system in-place encryption successfully finished.
  3808. ---
  3809. >       && !(bInPlaceEncNonSys && NonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINISHED))    // Ignore user abort if non-system in-place encryption/decryption successfully finished.
  3810. 2460a2527,2530
  3811. >
  3812. >                   if (bInPlaceDecNonSys)
  3813. >                       Error ("INPLACE_DEC_GENERIC_ERR");
  3814. >                   else
  3815. 2500a2571,2572
  3816. >                   if (!bInPlaceDecNonSys)
  3817. >                   {
  3818. 2502d2573
  3819. <
  3820. 2506a2578,2582
  3821. >                       // NOP - Final steps for in-place decryption are handled with the TC_APPMSG_NONSYS_INPLACE_ENC_FINISHED message.
  3822. >                   }
  3823. >               }
  3824. >               else
  3825. >               {
  3826. 2632,2633c2708
  3827. <       hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_INTRO_PAGE_DLG), hwndDlg,
  3828. <                    (DLGPROC) PageDialogProc);
  3829. ---
  3830. >       AbortProcess ("INSECURE_APP");
  3831. 2771c2846
  3832. <   case NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE:
  3833. ---
  3834. >   case NONSYS_INPLACE_ENC_PASSWORD_PAGE:
  3835. 2781c2856
  3836. <   case NONSYS_INPLACE_ENC_ENCRYPTION_PAGE:
  3837. ---
  3838. >   case NONSYS_INPLACE_ENC_TRANSFORM_PAGE:
  3839. 2786c2861
  3840. <   case NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE:
  3841. ---
  3842. >   case NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE:
  3843. 2790a2866,2870
  3844. >   case NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE:
  3845. >       hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_DRIVE_LETTER_SELECTION_PAGE), hwndDlg,
  3846. >           (DLGPROC) PageDialogProc);
  3847. >       break;
  3848. >
  3849. 3185c3265
  3850. <           swprintf (szTmp, GetString (bInPlaceEncNonSys ? "NONSYS_INPLACE_ENC_CONFIRM" : "OVERWRITEPROMPT_DEVICE"), type, szFileName, drive);
  3851. ---
  3852. >           swprintf (szTmp, GetString (bInPlaceEncNonSys ? (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_CONFIRM" : "NONSYS_INPLACE_ENC_CONFIRM") : "OVERWRITEPROMPT_DEVICE"), type, szFileName, drive);
  3853. 3251a3332,3341
  3854. >
  3855. > void UpdateLastDialogId (void)
  3856. > {
  3857. >   static char PageDebugId[128];
  3858. >
  3859. >   sprintf (PageDebugId, "FORMAT_PAGE_%d", nCurPageNo);
  3860. >   LastDialogId = PageDebugId;
  3861. > }
  3862. >
  3863. >
  3864. 3294d3383
  3865. <   static char PageDebugId[128];
  3866. 3305,3306c3394
  3867. <       sprintf (PageDebugId, "FORMAT_PAGE_%d", nCurPageNo);
  3868. <       LastDialogId = PageDebugId;
  3869. ---
  3870. >       UpdateLastDialogId ();
  3871. 3318,3320d3405
  3872. <           ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_CONTAINERS);
  3873. <           ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_SYS_ENCRYPTION);
  3874. <
  3875. 3347,3348d3431
  3876. <           ToHyperlink (hwndDlg, IDC_HIDDEN_SYSENC_INFO_LINK);
  3877. <
  3878. 3368d3450
  3879. <           ToHyperlink (hwndDlg, IDC_HIDDEN_SYSENC_INFO_LINK);
  3880. 3537,3538d3618
  3881. <           ToHyperlink (hwndDlg, IDC_HIDDEN_VOL_HELP);
  3882. <
  3883. 3728,3729d3807
  3884. <               ToHyperlink (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER);
  3885. <
  3886. 3747,3748d3824
  3887. <               ToHyperlink (hwndDlg, IDC_LINK_HASH_INFO);
  3888. <
  3889. 3851c3927
  3890. <       case NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE:
  3891. ---
  3892. >       case NONSYS_INPLACE_ENC_PASSWORD_PAGE:
  3893. 3861c3937
  3894. <           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceEncNonSys ? "NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP" : "PASSWORD_HIDDENVOL_HOST_DIRECT_HELP"));
  3895. ---
  3896. >           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceEncNonSys ? (bInPlaceEncNonSysResumed ? "NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP" : "NONSYS_INPLACE_DEC_PASSWORD_PAGE_HELP") : "PASSWORD_HIDDENVOL_HOST_DIRECT_HELP"));
  3897. 4206,4207d4281
  3898. <               ToHyperlink (hwndDlg, IDC_MORE_INFO_SYS_ENCRYPTION);
  3899. <
  3900. 4253c4327
  3901. <       case NONSYS_INPLACE_ENC_ENCRYPTION_PAGE:
  3902. ---
  3903. >       case NONSYS_INPLACE_ENC_TRANSFORM_PAGE:
  3904. 4263c4337
  3905. <           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("ENCRYPTION"));
  3906. ---
  3907. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bInPlaceDecNonSys ? "DECRYPTION" : "ENCRYPTION"));
  3908. 4265c4339
  3909. <           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("NONSYS_INPLACE_ENC_ENCRYPTION_PAGE_INFO"));
  3910. ---
  3911. >           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_DECRYPTION_PAGE_INFO" : "NONSYS_INPLACE_ENC_ENCRYPTION_PAGE_INFO"));
  3912. 4271c4345
  3913. <           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString (bInPlaceEncNonSysResumed ? "RESUME" : "ENCRYPT"));
  3914. ---
  3915. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString (bInPlaceEncNonSysResumed ? "RESUME" : (bInPlaceDecNonSys ? "DECRYPT" : "ENCRYPT")));
  3916. 4275c4349
  3917. <           EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), !bInPlaceEncNonSysResumed);
  3918. ---
  3919. >           EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), !bInPlaceEncNonSysResumed && !bInPlaceDecNonSys);
  3920. 4281,4282c4355,4362
  3921. <           ShowWindow (GetDlgItem (hwndDlg, IDC_MORE_INFO_SYS_ENCRYPTION), SW_HIDE);
  3922. <
  3923. ---
  3924. >           if (bInPlaceDecNonSys)
  3925. >           {
  3926. >               ShowWindow(GetDlgItem(hwndDlg, IDT_FORMAT_OPTIONS), SW_HIDE);
  3927. >               ShowWindow(GetDlgItem(hwndDlg, IDT_WIPE_MODE), SW_HIDE);
  3928. >               ShowWindow(GetDlgItem(hwndDlg, IDC_WIPE_MODE), SW_HIDE);
  3929. >           }
  3930. >           else
  3931. >           {
  3932. 4285a4366
  3933. >           }
  3934. 4289c4370
  3935. <       case NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE:
  3936. ---
  3937. >       case NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE:
  3938. 4293c4374
  3939. <           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("NONSYS_INPLACE_ENC_FINISHED_TITLE"));
  3940. ---
  3941. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_FINISHED_TITLE" : "NONSYS_INPLACE_ENC_FINISHED_TITLE"));
  3942. 4295c4376
  3943. <           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("NONSYS_INPLACE_ENC_FINISHED_INFO"));
  3944. ---
  3945. >           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_FINISHED_INFO" : "NONSYS_INPLACE_ENC_FINISHED_INFO"));
  3946. 4306a4388,4435
  3947. >       case NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE:
  3948. >
  3949. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("NONSYS_INPLACE_DEC_FINISHED_TITLE"));
  3950. >
  3951. >           SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("NONSYS_INPLACE_DEC_FINISHED_DRIVE_LETTER_SEL_INFO"));
  3952. >
  3953. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
  3954. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("FINALIZE"));
  3955. >           EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), FALSE);
  3956. >           EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
  3957. >
  3958. >           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("CANCEL"));
  3959. >
  3960. >           // The Cancel button and the X button must be disabled to prevent the user from forgetting to assign a drive letter to the partition by closing
  3961. >           // the window accidentally or clicking Cancel. The user is forced to click Finish to assign at least the pre-selected free drive letter.
  3962. >           // This is critical because inexperienced users would not know how to access data on the decrypted volume without a drive letter.
  3963. >           EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), FALSE);
  3964. >           DisableCloseButton (MainDlg);
  3965. >           bConfirmQuit = TRUE;    // Alt-F4 will still work but the user will be prompted to confirm the action.
  3966. >
  3967. >           // Decryption of non-system volume finished, no drive letter is assigned to the decrypted volume, and free drive letters are available.
  3968. >           // This is critical because inexperienced users would not know how to access data on the decrypted volume. We cannot allow exit
  3969. >           // until a drive letter is freed up and assigned to the decrypted volume.
  3970. >
  3971. >           while (GetFirstAvailableDrive () == -1)
  3972. >           {
  3973. >               Error ("NONSYS_INPLACE_DEC_FINISHED_NO_DRIVE_LETTER_AVAILABLE");
  3974. >           }
  3975. >
  3976. >           // Populate the combobox with free drive letters
  3977. >           {
  3978. >               DWORD dwUsedDrives = GetLogicalDrives();
  3979. >               char szDriveLetter[] = {' ', ':', 0 };
  3980. >               int i;
  3981. >
  3982. >               for (i = 3; i < 26; i++)
  3983. >               {
  3984. >                   if (!(dwUsedDrives & 1 << i))
  3985. >                   {
  3986. >                       // Add
  3987. >                       szDriveLetter [0] = (char) (i + 'A');
  3988. >                       AddComboPair (GetDlgItem (hCurPage, IDC_DRIVE_LETTER_LIST), szDriveLetter, i);
  3989. >                   }
  3990. >               }
  3991. >           }
  3992. >           SendMessage (GetDlgItem (hwndDlg, IDC_DRIVE_LETTER_LIST), CB_SETCURSEL, 0, 0);
  3993. >           break;
  3994. >
  3995. 4623,4626d4751
  3996. <   case WM_HELP:
  3997. <       OpenPageHelp (GetParent (hwndDlg), nCurPageNo);
  3998. <       return 1;
  3999. <
  4000. 4648,4655d4772
  4001. <
  4002. <           case IDC_MORE_INFO_ON_CONTAINERS:
  4003. <               Applink ("introcontainer", TRUE, "");
  4004. <               return 1;
  4005. <
  4006. <           case IDC_MORE_INFO_ON_SYS_ENCRYPTION:
  4007. <               Applink ("introsysenc", TRUE, "");
  4008. <               return 1;
  4009. 4674,4677d4790
  4010. <
  4011. <           case IDC_HIDDEN_SYSENC_INFO_LINK:
  4012. <               Applink ("hiddensysenc", TRUE, "");
  4013. <               return 1;
  4014. 4681,4686d4793
  4015. <       if (nCurPageNo == SYSENC_HIDDEN_OS_REQ_CHECK_PAGE && lw == IDC_HIDDEN_SYSENC_INFO_LINK)
  4016. <       {
  4017. <           Applink ("hiddensysenc", TRUE, "");
  4018. <           return 1;
  4019. <       }
  4020. <
  4021. 4804,4807d4910
  4022. <
  4023. <           case IDC_MORE_INFO_SYS_ENCRYPTION:
  4024. <               Applink ("sysencprogressinfo", TRUE, "");
  4025. <               return 1;
  4026. 4853c4956
  4027. <           case  NONSYS_INPLACE_ENC_ENCRYPTION_PAGE:
  4028. ---
  4029. >           case  NONSYS_INPLACE_ENC_TRANSFORM_PAGE:
  4030. 4895,4900d4997
  4031. <       if (lw == IDC_HIDDEN_VOL_HELP && nCurPageNo == VOLUME_TYPE_PAGE)
  4032. <       {
  4033. <           Applink ("hiddenvolume", TRUE, "");
  4034. <           return 1;
  4035. <       }
  4036. <
  4037. 4940,4965d5036
  4038. <       if (lw == IDC_LINK_MORE_INFO_ABOUT_CIPHER && nCurPageNo == CIPHER_PAGE)
  4039. <       {
  4040. <           char name[100];
  4041. <
  4042. <           int nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
  4043. <           nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
  4044. <           EAGetName (name, nIndex);
  4045. <
  4046. <           if (strcmp (name, "AES") == 0)
  4047. <               Applink ("aes", FALSE, "");
  4048. <           else if (strcmp (name, "Serpent") == 0)
  4049. <               Applink ("serpent", FALSE, "");
  4050. <           else if (strcmp (name, "Twofish") == 0)
  4051. <               Applink ("twofish", FALSE, "");
  4052. <           else if (EAGetCipherCount (nIndex) > 1)
  4053. <               Applink ("cascades", TRUE, "");
  4054. <
  4055. <           return 1;
  4056. <       }
  4057. <
  4058. <       if (lw == IDC_LINK_HASH_INFO && nCurPageNo == CIPHER_PAGE)
  4059. <       {
  4060. <           Applink ("hashalgorithms", TRUE, "");
  4061. <           return 1;
  4062. <       }
  4063. <
  4064. 5031c5102
  4065. <           || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4066. ---
  4067. >           || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4068. 5054c5125
  4069. <                   if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4070. ---
  4071. >                   if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4072. 5057c5128
  4073. <                   if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4074. ---
  4075. >                   if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4076. 5073c5144
  4077. <               if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4078. ---
  4079. >               if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4080. 5088c5159
  4081. <           || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4082. ---
  4083. >           || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4084. 5320,5321d5390
  4085. <           else
  4086. <               Applink ("isoburning", TRUE, "");
  4087. 5546a5616,5617
  4088. >                       UpdateLastDialogId ();
  4089. >
  4090. 5670a5742,5743
  4091. >
  4092. >                   UpdateLastDialogId ();
  4093. 5747a5821
  4094. >
  4095. 5809a5884
  4096. >                       UpdateLastDialogId ();
  4097. 5893c5968,5988
  4098. <       LoadPage (hwndDlg, NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE);
  4099. ---
  4100. >       if (bInPlaceDecNonSys)
  4101. >       {
  4102. >           // Decryption of non-system volume finished and free drive letters are available. Check if a drive letter is assigned to the decrypted volume.
  4103. >
  4104. >           WCHAR deviceName[MAX_PATH];
  4105. >
  4106. >           strcpy ((char *)deviceName, szDiskFile);
  4107. >           ToUNICODE ((char *)deviceName);
  4108. >
  4109. >           if (GetDiskDeviceDriveLetter (deviceName) < 0)     
  4110. >           {
  4111. >               // No drive letter is assigned to the device
  4112. >               MessageBeep (MB_OK);
  4113. >               LoadPage (hwndDlg, NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE);
  4114. >               return 1;
  4115. >           }
  4116. >           else
  4117. >           {
  4118. >               Info ("NONSYS_INPLACE_DEC_FINISHED_INFO");
  4119. >           }
  4120. >       }
  4121. 5894a5990
  4122. >       LoadPage (hwndDlg, NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE);
  4123. 5926,5930d6021
  4124. <   case WM_HELP:
  4125. <
  4126. <       OpenPageHelp (hwndDlg, nCurPageNo);
  4127. <       return 1;
  4128. <
  4129. 5933c6024
  4130. <       if (nCurPageNo == NONSYS_INPLACE_ENC_ENCRYPTION_PAGE
  4131. ---
  4132. >       if (nCurPageNo == NONSYS_INPLACE_ENC_TRANSFORM_PAGE
  4133. 6026,6031c6117
  4134. <       if (lw == IDHELP)
  4135. <       {
  4136. <           OpenPageHelp (hwndDlg, nCurPageNo);
  4137. <           return 1;
  4138. <       }
  4139. <       else if (lw == IDCANCEL)
  4140. ---
  4141. >       if (lw == IDCANCEL)
  4142. 6713c6799
  4143. <               || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4144. ---
  4145. >               || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4146. 6852c6938
  4147. <               else
  4148. ---
  4149. >               else if (bInPlaceEncNonSysResumed)
  4150. 6855c6941
  4151. <                   encryption has been interrupted. */
  4152. ---
  4153. >                   encryption/decryption has been interrupted. */
  4154. 6898c6984
  4155. <                       nNewPageNo = NONSYS_INPLACE_ENC_ENCRYPTION_PAGE - 1;    // Skip irrelevant pages
  4156. ---
  4157. >                       nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
  4158. 6902a6989,7001
  4159. >               else
  4160. >               {
  4161. >                   /* Try to mount the non-system volume to decrypt in place (the process has not started yet, we are NOT trying to resume it).
  4162. >                      We will try to mount it using the backup header, which we require to work (i.e. be non-damaged) before we start writing
  4163. >                      to the volume (the primary header will be overwritten by decrypted data soon after the decryption process begins, so the
  4164. >                      backup header will contain the only copy of the master key). */
  4165. >
  4166. >                   int driveNo = -1;
  4167. >
  4168. >                   // The volume may already be mounted. We need to dismount it first in order to verify the supplied password/keyfile(s) is/are correct.
  4169. >                   if (IsMountedVolume (szFileName))
  4170. >                   {
  4171. >                       driveNo = GetMountedVolumeDriveNo (szFileName);
  4172. 6903a7003,7092
  4173. >                       if (driveNo == -1
  4174. >                           || !UnmountVolume (hwndDlg, driveNo, TRUE))
  4175. >                       {
  4176. >                           handleWin32Error (MainDlg);
  4177. >                           AbortProcess ("CANT_DISMOUNT_VOLUME");
  4178. >                       }
  4179. >                   }
  4180. >
  4181. >                   driveNo = GetLastAvailableDrive ();
  4182. >
  4183. >                   if (driveNo < 0)
  4184. >                       AbortProcess ("NO_FREE_DRIVES");
  4185. >
  4186. >                   MountOptions mountOptions;
  4187. >                   ZeroMemory (&mountOptions, sizeof (mountOptions));
  4188. >
  4189. >                   mountOptions.UseBackupHeader = FALSE;   // This must be FALSE at this point because otherwise we wouldn't be able to detect a legacy volume
  4190. >                   mountOptions.ReadOnly = TRUE;
  4191. >                   mountOptions.Removable = ConfigReadInt ("MountVolumesRemovable", FALSE);
  4192. >
  4193. >                   // Check that it is not a hidden or legacy volume
  4194. >
  4195. >                   if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
  4196. >                   {
  4197. >                       NormalCursor();
  4198. >                       return 1;
  4199. >                   }
  4200. >
  4201. >                   {
  4202. >                       DWORD dwResult;
  4203. >                       VOLUME_PROPERTIES_STRUCT volProp;
  4204. >
  4205. >                       memset (&volProp, 0, sizeof(volProp));
  4206. >                       volProp.driveNo = driveNo;
  4207. >                       if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &volProp, sizeof (volProp), &volProp, sizeof (volProp), &dwResult, NULL) || dwResult == 0)
  4208. >                       {
  4209. >                           handleWin32Error (hwndDlg);
  4210. >                           UnmountVolume (hwndDlg, driveNo, TRUE);
  4211. >                           AbortProcess ("CANT_GET_VOL_INFO");
  4212. >                       }
  4213. >
  4214. >                       if (volProp.volFormatVersion == TC_VOLUME_FORMAT_VERSION_PRE_6_0)
  4215. >                       {
  4216. >                           UnmountVolume (hwndDlg, driveNo, TRUE);
  4217. >                           AbortProcess ("NONSYS_INPLACE_DECRYPTION_BAD_VOL_FORMAT");
  4218. >                       }
  4219. >
  4220. >                       if (volProp.hiddenVolume)
  4221. >                       {
  4222. >                           UnmountVolume (hwndDlg, driveNo, TRUE);
  4223. >                           AbortProcess ("NONSYS_INPLACE_DECRYPTION_CANT_DECRYPT_HID_VOL");
  4224. >                       }
  4225. >                   }
  4226. >
  4227. >                   // Remount the volume using the backup header to verify it is working
  4228. >
  4229. >                   if (!UnmountVolume (hwndDlg, driveNo, TRUE))
  4230. >                   {
  4231. >                       handleWin32Error (MainDlg);
  4232. >                       AbortProcess ("CANT_DISMOUNT_VOLUME");
  4233. >                   }
  4234. >
  4235. >                   mountOptions.UseBackupHeader = TRUE;    // This must be TRUE at this point (we won't be using the regular header, which will be lost soon after the decryption process starts)
  4236. >
  4237. >                   if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
  4238. >                   {
  4239. >                       NormalCursor();
  4240. >                       return 1;
  4241. >                   }
  4242. >
  4243. >                   if (!UnmountVolume (hwndDlg, driveNo, TRUE))
  4244. >                   {
  4245. >                       handleWin32Error (MainDlg);
  4246. >                       AbortProcess ("CANT_DISMOUNT_VOLUME");
  4247. >                   }
  4248. >
  4249. >                   BOOL tmpbDevice;
  4250. >
  4251. >                   CreateFullVolumePath (szDiskFile, szFileName, &tmpbDevice);
  4252. >
  4253. >                   nVolumeSize = GetDeviceSize (szDiskFile);
  4254. >                   if (nVolumeSize == -1)
  4255. >                   {
  4256. >                       handleWin32Error (MainDlg);
  4257. >                       AbortProcessSilent ();
  4258. >                   }
  4259. >
  4260. >                   nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
  4261. >                   NormalCursor();
  4262. >               }
  4263. 7208c7397
  4264. <               nNewPageNo = NONSYS_INPLACE_ENC_ENCRYPTION_PAGE - 1;    // Skip irrelevant pages
  4265. ---
  4266. >               nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
  4267. 7210c7399
  4268. <           else if (nCurPageNo == NONSYS_INPLACE_ENC_ENCRYPTION_PAGE)
  4269. ---
  4270. >           else if (nCurPageNo == NONSYS_INPLACE_ENC_TRANSFORM_PAGE)
  4271. 7213a7403,7410
  4272. >               if (bInPlaceDecNonSys
  4273. >                   && !bInPlaceEncNonSysResumed
  4274. >                   && AskWarnYesNo ("NONSYS_INPLACE_ENC_CONFIRM_BACKUP") == IDNO)
  4275. >               {
  4276. >                   // Cancel
  4277. >                   return 1;
  4278. >               }
  4279. >
  4280. 7217c7414,7419
  4281. <           else if (nCurPageNo == NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE)
  4282. ---
  4283. >           else if (nCurPageNo == NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE)
  4284. >           {
  4285. >               PostMessage (hwndDlg, TC_APPMSG_FORMAT_USER_QUIT, 0, 0);
  4286. >               return 1;
  4287. >           }
  4288. >           else if (nCurPageNo == NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE)
  4289. 7218a7421,7464
  4290. >               BOOL bDrvLetterAssignResult = FALSE;
  4291. >
  4292. >               int tmpDriveLetter = (int) SendMessage (GetDlgItem (hCurPage, IDC_DRIVE_LETTER_LIST),
  4293. >                       CB_GETITEMDATA,
  4294. >                       SendMessage (GetDlgItem (hCurPage, IDC_DRIVE_LETTER_LIST), CB_GETCURSEL, 0, 0),
  4295. >                       0);
  4296. >
  4297. >               if (tmpDriveLetter < 0)
  4298. >                   tmpDriveLetter = GetFirstAvailableDrive ();
  4299. >
  4300. >               do
  4301. >               {
  4302. >                   char szDriveLetter[] = {'A', ':', 0 };
  4303. >                   char rootPath[] = {'A', ':', '\\', 0 };
  4304. >                   char uniqVolName[MAX_PATH+1] = { 0 };
  4305. >
  4306. >                   rootPath[0] += (char) tmpDriveLetter;
  4307. >                   szDriveLetter[0] += (char) tmpDriveLetter;
  4308. >
  4309. >                   if (DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, szDiskFile))
  4310. >                   {
  4311. >                       bDrvLetterAssignResult = GetVolumeNameForVolumeMountPoint (rootPath, uniqVolName, MAX_PATH);
  4312. >
  4313. >                       DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE,
  4314. >                           szDriveLetter,
  4315. >                           szDiskFile);
  4316. >
  4317. >                       if (bDrvLetterAssignResult)
  4318. >                       {
  4319. >                           if (SetVolumeMountPoint (rootPath, uniqVolName) == 0)
  4320. >                               bDrvLetterAssignResult = FALSE;
  4321. >                       }
  4322. >                   }
  4323. >
  4324. >                   if (!bDrvLetterAssignResult)
  4325. >                   {
  4326. >                       if (AskErrYesNo ("ERR_CANNOT_ASSIGN_DRIVE_LETTER_NONSYS_DEC") == IDNO)
  4327. >                           break;
  4328. >                   }
  4329. >
  4330. >               } while (bDrvLetterAssignResult == FALSE);
  4331. >
  4332. >               bConfirmQuit = FALSE;
  4333. >
  4334. 7680c7926
  4335. <               || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
  4336. ---
  4337. >               || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
  4338. 7802c8048
  4339. <               CommandResumeInplaceLogOn,
  4340. ---
  4341. >               CommandResumeNonSysInplaceLogOn,
  4342. 7804a8051,8052
  4343. >               CommandInplaceDec,
  4344. >               CommandResumeInplaceDec,
  4345. 7809a8058
  4346. >               // Public
  4347. 7814a8064
  4348. >               // Internal
  4349. 7820c8070
  4350. <               { CommandResumeInplaceLogOn,    "/prinplace",       "/p", TRUE },
  4351. ---
  4352. >               { CommandResumeNonSysInplaceLogOn,  "/prinplace",       "/p", TRUE },
  4353. 7822a8073,8074
  4354. >               { CommandInplaceDec,                "/inplacedec",      NULL, TRUE },
  4355. >               { CommandResumeInplaceDec,          "/resumeinplacedec",NULL, TRUE },
  4356. 7842,7856c8094
  4357. <               // Encrypt system partition/drive (passed by Mount if system encryption hasn't started or to reverse decryption)
  4358. <
  4359. <               // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption
  4360. <               if (CreateSysEncMutex ())
  4361. <               {
  4362. <                   bDirectSysEncMode = TRUE;
  4363. <                   bDirectSysEncModeCommand = SYSENC_COMMAND_ENCRYPT;
  4364. <                   ChangeWizardMode (WIZARD_MODE_SYS_DEVICE);
  4365. <               }
  4366. <               else
  4367. <               {
  4368. <                   Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
  4369. <                   exit(0);
  4370. <               }
  4371. <
  4372. ---
  4373. >               AbortProcess ("INSECURE_APP");
  4374. 7877,7891c8115
  4375. <               // Create a hidden operating system (passed by Mount when the user selects System -> Create Hidden Operating System)
  4376. <
  4377. <               // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption
  4378. <               if (CreateSysEncMutex ())
  4379. <               {
  4380. <                   bDirectSysEncMode = TRUE;
  4381. <                   bDirectSysEncModeCommand = SYSENC_COMMAND_CREATE_HIDDEN_OS;
  4382. <                   ChangeWizardMode (WIZARD_MODE_SYS_DEVICE);
  4383. <               }
  4384. <               else
  4385. <               {
  4386. <                   Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
  4387. <                   exit(0);
  4388. <               }
  4389. <
  4390. ---
  4391. >               AbortProcess ("INSECURE_APP");
  4392. 7895,7909c8119
  4393. <               // Resume process of creation of a hidden operating system (passed by Wizard when the user needs to UAC-elevate the whole wizard process)
  4394. <
  4395. <               // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption
  4396. <               if (CreateSysEncMutex ())
  4397. <               {
  4398. <                   bDirectSysEncMode = TRUE;
  4399. <                   bDirectSysEncModeCommand = SYSENC_COMMAND_CREATE_HIDDEN_OS_ELEV;
  4400. <                   ChangeWizardMode (WIZARD_MODE_SYS_DEVICE);
  4401. <               }
  4402. <               else
  4403. <               {
  4404. <                   Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
  4405. <                   exit(0);
  4406. <               }
  4407. <
  4408. ---
  4409. >               AbortProcess ("INSECURE_APP");
  4410. 7947,7948c8157,8176
  4411. <               // Resume process of creation of a non-sys-device-hosted volume (passed by Wizard when the user needs to UAC-elevate)
  4412. <               DirectDeviceEncMode = TRUE;
  4413. ---
  4414. >               AbortProcess ("INSECURE_APP");
  4415. >               break;
  4416. >
  4417. >           case CommandInplaceDec:
  4418. >               // Start (not resume) decrypting the specified non-system volume in place
  4419. >               {
  4420. >                   char szTmp [TC_MAX_PATH + 8000] = {0};
  4421. >
  4422. >                   GetArgumentValue (lpszCommandLineArgs, nArgPos, &i, nNoCommandLineArgs, szTmp, sizeof (szTmp));
  4423. >
  4424. >                   if (strlen (szTmp) < 1)
  4425. >                   {
  4426. >                       // No valid volume path specified as command-line parameter
  4427. >                       AbortProcess ("ERR_PARAMETER_INCORRECT");
  4428. >                   }
  4429. >
  4430. >                   memset (szFileName, 0, sizeof (szFileName));
  4431. >                   strncpy (szFileName, szTmp, sizeof (szFileName));
  4432. >                   DirectNonSysInplaceDecStartMode = TRUE;
  4433. >               }
  4434. 7952,7953c8180,8185
  4435. <               // Resume interrupted process of non-system in-place encryption of a partition
  4436. <               DirectNonSysInplaceEncResumeMode = TRUE;
  4437. ---
  4438. >               AbortProcess ("INSECURE_APP");
  4439. >               break;
  4440. >
  4441. >           case CommandResumeInplaceDec:
  4442. >               // Resume interrupted process of non-system in-place decryption of a partition
  4443. >               DirectNonSysInplaceDecResumeMode = TRUE;
  4444. 7956,7957c8188,8189
  4445. <           case CommandResumeInplaceLogOn:
  4446. <               // Ask the user whether to resume interrupted process of non-system in-place encryption of a partition
  4447. ---
  4448. >           case CommandResumeNonSysInplaceLogOn:
  4449. >               // Ask the user whether to resume interrupted process of non-system in-place encryption/decryption of a partition
  4450. 8089c8321
  4451. <   if (volProp.volFormatVersion < TC_VOLUME_FORMAT_VERSION)
  4452. ---
  4453. >   if (volProp.volFormatVersion == TC_VOLUME_FORMAT_VERSION_PRE_6_0)
  4454. 8142c8374
  4455. <   // The Windows API sometimes fails to indentify the file system correctly so we're using "raw" analysis too.
  4456. ---
  4457. >   // The Windows API sometimes fails to indentify the file system correctly (observed under Windows XP) so we're using "raw" analysis below too.
  4458. 8532c8764
  4459. <               Warning ("NOTHING_TO_RESUME");
  4460. ---
  4461. >               Warning ("NO_SYS_ENC_PROCESS_TO_RESUME");
  4462. 8876c9108
  4463. <           // a non-system in-place encryption process. However, no config file indicates that any such process
  4464. ---
  4465. >           // a non-system in-place encryption/decryption process. However, no config file indicates that any such process
  4466. 8887c9119,9126
  4467. <       if (DirectNonSysInplaceEncResumeMode)
  4468. ---
  4469. >       BOOL decrypt = FALSE;
  4470. >
  4471. >       if (DirectNonSysInplaceDecStartMode)
  4472. >       {
  4473. >           SwitchWizardToNonSysInplaceDecStartMode (szFileName);
  4474. >           return;
  4475. >       }
  4476. >       else if (DirectNonSysInplaceEncResumeMode || DirectNonSysInplaceDecResumeMode)
  4477. 8889c9128
  4478. <           SwitchWizardToNonSysInplaceEncResumeMode();
  4479. ---
  4480. >           SwitchWizardToNonSysInplaceEncResumeMode (DirectNonSysInplaceDecResumeMode);
  4481. 8897,8898c9136,9137
  4482. <           if (AskNonSysInPlaceEncryptionResume() == IDYES)
  4483. <               SwitchWizardToNonSysInplaceEncResumeMode();
  4484. ---
  4485. >           if (AskNonSysInPlaceEncryptionResume (&decrypt) == IDYES)
  4486. >               SwitchWizardToNonSysInplaceEncResumeMode (decrypt);
  4487. 8906c9145
  4488. <           && AskNonSysInPlaceEncryptionResume() == IDYES)
  4489. ---
  4490. >           && AskNonSysInPlaceEncryptionResume (&decrypt) == IDYES)
  4491. 8908c9147
  4492. <           SwitchWizardToNonSysInplaceEncResumeMode();
  4493. ---
  4494. >           SwitchWizardToNonSysInplaceEncResumeMode (decrypt);
  4495. diff -b -r tc-7.1/Format/Tcformat.h tc-7.2/Format/Tcformat.h
  4496. 44a45
  4497. > void UpdateLastDialogId (void);
  4498. 92a94
  4499. > extern volatile BOOL bInPlaceDecNonSys;
  4500. diff -b -r tc-7.1/License.html tc-7.2/License.html
  4501. 13c13
  4502. < <b>TrueCrypt License Version 3.0</b><br>
  4503. ---
  4504. > <b>TrueCrypt License Version 3.1</b><br>
  4505. 43,45c43
  4506. <   <li>Phrase &quot;<i>Based on TrueCrypt, freely available at http://www.truecrypt.org/</i>&quot; must be displayed by Your Product (if technically feasible) and contained in its documentation. Alternatively, if This Product or its portion You included in Your Product constitutes only a minor portion of Your Product, phrase &quot;<i>Portions of this product are based in part on TrueCrypt, freely available at http://www.truecrypt.org/</i>&quot; may be displayed instead. In each of the cases mentioned above in this paragraph, &quot;<i>http://www.truecrypt.org/</i>&quot; must be a hyperlink (if technically feasible) pointing to http://www.truecrypt.org/ and You may freely choose the location within the user interface (if there is any) of Your Product (e.g., an &quot;About&quot; window, etc.) and the way in which Your Product will display the respective phrase.<br>
  4507. <     <br>
  4508. <   Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt.org (or any domain name that forwards to the domain name truecrypt.org) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or otherwise attempt to indicate that the domain name truecrypt.org is associated with Your Product.<br>
  4509. ---
  4510. >   <li>Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt (or any domain name that forwards to the domain name truecrypt) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or otherwise attempt to indicate that the domain name truecrypt is associated with Your Product.<br>
  4511. diff -b -r tc-7.1/License.txt tc-7.2/License.txt
  4512. 1c1
  4513. < TrueCrypt License Version 3.0
  4514. ---
  4515. > TrueCrypt License Version 3.1
  4516. 115,131c115
  4517. <     c. Phrase "Based on TrueCrypt, freely available at
  4518. <     http://www.truecrypt.org/" must be displayed by Your Product
  4519. <     (if technically feasible) and contained in its
  4520. <     documentation. Alternatively, if This Product or its portion
  4521. <     You included in Your Product constitutes only a minor
  4522. <     portion of Your Product, phrase "Portions of this product
  4523. <     are based in part on TrueCrypt, freely available at
  4524. <     http://www.truecrypt.org/" may be displayed instead. In each
  4525. <     of the cases mentioned above in this paragraph,
  4526. <     "http://www.truecrypt.org/" must be a hyperlink (if
  4527. <     technically feasible) pointing to http://www.truecrypt.org/
  4528. <     and You may freely choose the location within the user
  4529. <     interface (if there is any) of Your Product (e.g., an
  4530. <     "About" window, etc.) and the way in which Your Product will
  4531. <     display the respective phrase.
  4532. <
  4533. <     Your Product (and any associated materials, e.g., the
  4534. ---
  4535. >     c. Your Product (and any associated materials, e.g., the
  4536. 134,135c118,119
  4537. <     containing the domain name truecrypt.org (or any domain name
  4538. <     that forwards to the domain name truecrypt.org) in a manner
  4539. ---
  4540. >     containing the domain name truecrypt (or any domain name
  4541. >     that forwards to the domain name truecrypt) in a manner
  4542. 140c124
  4543. <     name truecrypt.org is associated with Your Product.
  4544. ---
  4545. >     name truecrypt is associated with Your Product.
  4546. diff -b -r tc-7.1/Mount/Favorites.cpp tc-7.2/Mount/Favorites.cpp
  4547. 210,214d209
  4548. <
  4549. <                   if (SystemFavoritesMode)
  4550. <                       SetDlgItemTextW (hwndDlg, IDC_FAVORITES_HELP_LINK, GetString ("SYS_FAVORITES_HELP_LINK"));
  4551. <
  4552. <                   ToHyperlink (hwndDlg, IDC_FAVORITES_HELP_LINK);
  4553. 365,368d359
  4554. <               return 1;
  4555. <
  4556. <           case IDC_FAVORITES_HELP_LINK:
  4557. <               Applink (SystemFavoritesMode ? "sysfavorites" : "favorites", TRUE, "");
  4558. diff -b -r tc-7.1/Mount/MainCom.cpp tc-7.2/Mount/MainCom.cpp
  4559. 70,75d69
  4560. <   virtual void STDMETHODCALLTYPE AnalyzeKernelMiniDump (LONG_PTR hwndDlg)
  4561. <   {
  4562. <       MainDlg = (HWND) hwndDlg;
  4563. <       ::AnalyzeKernelMiniDump ((HWND) hwndDlg);
  4564. <   }
  4565. <
  4566. 196,212d189
  4567. < }
  4568. <
  4569. <
  4570. < extern "C" void UacAnalyzeKernelMiniDump (HWND hwndDlg)
  4571. < {
  4572. <   CComPtr<ITrueCryptMainCom> tc;
  4573. <
  4574. <   CoInitialize (NULL);
  4575. <
  4576. <   if (ComGetInstance (hwndDlg, &tc))
  4577. <   {
  4578. <       WaitCursor();
  4579. <       tc->AnalyzeKernelMiniDump ((LONG_PTR) hwndDlg);
  4580. <       NormalCursor();
  4581. <   }
  4582. <
  4583. <   CoUninitialize ();
  4584. diff -b -r tc-7.1/Mount/MainCom.h tc-7.2/Mount/MainCom.h
  4585. 23d22
  4586. < void UacAnalyzeKernelMiniDump (HWND hwndDlg);
  4587. diff -b -r tc-7.1/Mount/MainCom.idl tc-7.2/Mount/MainCom.idl
  4588. 15c15
  4589. <   version(2.4)    // Update ComSetup.cpp when changing version number
  4590. ---
  4591. >   version(2.5)    // Update ComSetup.cpp when changing version number
  4592. 27d26
  4593. <       void AnalyzeKernelMiniDump (LONG_PTR hwndDlg);
  4594. diff -b -r tc-7.1/Mount/Mount.c tc-7.2/Mount/Mount.c
  4595. 102d101
  4596. < BOOL SystemCrashDetected = FALSE;
  4597. 223c222
  4598. <   char *popupTexts[] = {"MENU_VOLUMES", "MENU_SYSTEM_ENCRYPTION", "MENU_FAVORITES", "MENU_TOOLS", "MENU_SETTINGS", "MENU_HELP", "MENU_WEBSITE", 0};
  4599. ---
  4600. >   char *popupTexts[] = {"MENU_VOLUMES", "MENU_SYSTEM_ENCRYPTION", "MENU_FAVORITES", "MENU_TOOLS", "MENU_SETTINGS", "MENU_HELP", 0};
  4601. 238,240d236
  4602. <   // Help file name
  4603. <   InitHelpFileName();
  4604. <
  4605. 259,262d254
  4606. <
  4607. <       if (strcmp (popupTexts[i], "MENU_WEBSITE") == 0)
  4608. <           info.fType = MFT_STRING | MFT_RIGHTJUSTIFY;
  4609. <       else
  4610. 303a296,297
  4611. >
  4612. >   ToHyperlink (hwndDlg, IDT_INSECURE_APP);
  4613. 391a386,563
  4614. >
  4615. > // When a function does not require the affected volume to be dismounted, there may be cases where we have two valid
  4616. > // paths selected in the main window and we cannot be sure which of them the user really intends to apply the function to.
  4617. > // This function asks the user to explicitly select either the volume path specified in the input field below the main
  4618. > // drive list (whether mounted or not), or the path to the volume selected in the main drive list. If, however, both
  4619. > // of the GUI elements contain the same volume (or one of them does not contain any path), this function does not
  4620. > // ask the user and returns the volume path directly (no selection ambiguity).
  4621. > // If driveNoPtr is not NULL, and the volume is mounted, its drive letter is returned in *driveNoPtr (if no valid drive
  4622. > // letter is resolved, -1 is stored instead).
  4623. > static string ResolveAmbiguousSelection (int *driveNoPtr)
  4624. > {
  4625. >   LPARAM selectedDrive = GetSelectedLong (GetDlgItem (MainDlg, IDC_DRIVELIST));
  4626. >
  4627. >   char volPathInputField [TC_MAX_PATH];
  4628. >   wchar_t volPathInputFieldW [TC_MAX_PATH];
  4629. >
  4630. >   wchar_t volPathDriveListW [TC_MAX_PATH];
  4631. >   string volPathDriveListStr;
  4632. >   wstring volPathDriveListWStr;
  4633. >
  4634. >   string retPath;
  4635. >
  4636. >   VOLUME_PROPERTIES_STRUCT prop;
  4637. >   DWORD dwResult;
  4638. >
  4639. >   BOOL useInputField = TRUE;
  4640. >
  4641. >   memset (&prop, 0, sizeof(prop));
  4642. >
  4643. >   BOOL ambig = (LOWORD (selectedDrive) != TC_MLIST_ITEM_FREE && LOWORD (selectedDrive) != 0xffff && HIWORD (selectedDrive) != 0xffff
  4644. >       && VolumeSelected (MainDlg));
  4645. >
  4646. >   if (VolumeSelected (MainDlg))
  4647. >   {
  4648. >       // volPathInputField will contain the volume path (if any) from the input field below the drive list
  4649. >       GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), volPathInputField, sizeof (volPathInputField));
  4650. >
  4651. >       if (!ambig)
  4652. >           retPath = (string) volPathInputField;
  4653. >   }
  4654. >
  4655. >   if (LOWORD (selectedDrive) != TC_MLIST_ITEM_FREE && LOWORD (selectedDrive) != 0xffff && HIWORD (selectedDrive) != 0xffff)
  4656. >   {
  4657. >       // A volume is selected in the main drive list.
  4658. >
  4659. >       switch (LOWORD (selectedDrive))
  4660. >       {
  4661. >       case TC_MLIST_ITEM_NONSYS_VOL:
  4662. >           prop.driveNo = HIWORD (selectedDrive) - 'A';
  4663. >
  4664. >           if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &prop, sizeof (prop), &prop, sizeof (prop), &dwResult, NULL) || dwResult == 0)
  4665. >           {
  4666. >               // The driver did not return any path for this drive letter (the volume may have been dismounted).
  4667. >
  4668. >               // Return whatever is in the input field below the drive list (even if empty)
  4669. >               return ((string) volPathInputField);
  4670. >           }
  4671. >
  4672. >           // volPathDriveListWStr will contain the volume path selected in the main drive list
  4673. >           volPathDriveListWStr = (wstring) prop.wszVolume;
  4674. >           volPathDriveListStr = WideToSingleString (volPathDriveListWStr);
  4675. >           break;
  4676. >
  4677. >       case TC_MLIST_ITEM_SYS_PARTITION:
  4678. >
  4679. >           GetSysDevicePaths (MainDlg);
  4680. >          
  4681. >           if (bCachedSysDevicePathsValid)
  4682. >           {
  4683. >               volPathDriveListStr = (string) SysPartitionDevicePath;
  4684. >               volPathDriveListWStr = SingleStringToWide (volPathDriveListStr);
  4685. >           }
  4686. >
  4687. >           break;
  4688. >
  4689. >       case TC_MLIST_ITEM_SYS_DRIVE:
  4690. >
  4691. >           GetSysDevicePaths (MainDlg);
  4692. >
  4693. >           if (bCachedSysDevicePathsValid)
  4694. >           {
  4695. >               volPathDriveListStr = (string) SysDriveDevicePath;
  4696. >               volPathDriveListWStr = SingleStringToWide (volPathDriveListStr);
  4697. >           }
  4698. >
  4699. >           break;
  4700. >       }
  4701. >
  4702. >       if (!ambig)
  4703. >       {
  4704. >           useInputField = FALSE;
  4705. >           retPath = volPathDriveListStr;
  4706. >       }
  4707. >   }
  4708. >
  4709. >   if (ambig)
  4710. >   {
  4711. >       /* We have two paths. Compare them and if they don't match, ask the user to select one of them. Otherwise, return the path without asking. */
  4712. >
  4713. >       if (memcmp (volPathDriveListStr.c_str (), "\\??\\", 4) == 0)
  4714. >       {
  4715. >           // The volume path starts with "\\??\\" which is used for file-hosted containers. We're going to strip this prefix.
  4716. >
  4717. >           volPathDriveListStr = (string) (volPathDriveListStr.c_str () + 4);
  4718. >           volPathDriveListWStr = SingleStringToWide (volPathDriveListStr);
  4719. >       }
  4720. >
  4721. >       wcscpy (volPathDriveListW, SingleStringToWide (volPathDriveListStr).c_str ());
  4722. >
  4723. >       ToSBCS (volPathDriveListW);
  4724. >       strcpy ((char *) volPathInputFieldW, volPathInputField);
  4725. >       ToUNICODE ((char *) volPathInputFieldW);
  4726. >
  4727. >       if (strcmp (((memcmp ((char *) volPathDriveListW, "\\??\\", 4) == 0) ? (char *) volPathDriveListW + 4 : (char *) volPathDriveListW), volPathInputField) != 0)
  4728. >       {
  4729. >           // The path selected in the input field is different from the path to the volume selected
  4730. >           // in the drive lettter list. We have to resolve possible ambiguity.
  4731. >
  4732. >           wchar_t *tmp[] = {L"", L"", L"", L"", L"", 0};
  4733. >           const int maxVolPathLen = 80;
  4734. >
  4735. >           if (volPathDriveListWStr.length () > maxVolPathLen)
  4736. >           {
  4737. >               // Ellipsis (path too long)
  4738. >               volPathDriveListWStr = wstring (L"...") + volPathDriveListWStr.substr (volPathDriveListWStr.length () - maxVolPathLen, maxVolPathLen);
  4739. >           }
  4740. >
  4741. >           wstring volPathInputFieldWStr (volPathInputFieldW);
  4742. >
  4743. >           if (volPathInputFieldWStr.length () > maxVolPathLen)
  4744. >           {
  4745. >               // Ellipsis (path too long)
  4746. >               volPathInputFieldWStr = wstring (L"...") + volPathInputFieldWStr.substr (volPathInputFieldWStr.length () - maxVolPathLen, maxVolPathLen);
  4747. >           }
  4748. >
  4749. >           tmp[1] = GetString ("AMBIGUOUS_VOL_SELECTION");
  4750. >           tmp[2] = (wchar_t *) volPathDriveListWStr.c_str();
  4751. >           tmp[3] = (wchar_t *) volPathInputFieldWStr.c_str();
  4752. >           tmp[4] = GetString ("IDCANCEL");
  4753. >
  4754. >           switch (AskMultiChoice ((void **) tmp, FALSE))
  4755. >           {
  4756. >           case 1:
  4757. >               retPath = volPathDriveListStr;
  4758. >               break;
  4759. >
  4760. >           case 2:
  4761. >               retPath = (string) volPathInputField;
  4762. >               break;
  4763. >
  4764. >           default:
  4765. >               if (driveNoPtr != NULL)
  4766. >                   *driveNoPtr = -1;
  4767. >
  4768. >               return string ("");
  4769. >           }
  4770. >       }
  4771. >       else
  4772. >       {
  4773. >           // Both selected paths are the same
  4774. >           retPath = (string) volPathInputField;
  4775. >       }
  4776. >   }
  4777. >
  4778. >   if (driveNoPtr != NULL)
  4779. >       *driveNoPtr = GetMountedVolumeDriveNo ((char *) retPath.c_str ());
  4780. >
  4781. >
  4782. >   if (memcmp (retPath.c_str (), "\\??\\", 4) == 0)
  4783. >   {
  4784. >       // The selected volume path starts with "\\??\\" which is used for file-hosted containers. We're going to strip this prefix.
  4785. >
  4786. >       retPath = (string) (retPath.c_str () + 4);
  4787. >   }
  4788. >
  4789. >   return retPath;
  4790. > }
  4791. >
  4792. 650c822
  4793. < // Returns TRUE if the entire system drive (as opposed to the system partition only) is (or is to be) encrypted
  4794. ---
  4795. > // Returns TRUE if the entire system drive (as opposed to the system partition only) of the currently running OS is (or is to be) encrypted
  4796. 859c1031
  4797. < BOOL TCBootLoaderOnInactiveSysEncDrive (void)
  4798. ---
  4799. > BOOL TCBootLoaderOnInactiveSysEncDrive (char *szDevicePath)
  4800. 864d1035
  4801. <       char szDevicePath [TC_MAX_PATH+1];
  4802. 870,871d1040
  4803. <       GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), szDevicePath, sizeof (szDevicePath));
  4804. <
  4805. 940c1109
  4806. <   char t[TC_MAX_PATH] = {'"',0};
  4807. ---
  4808. >   char t[TC_MAX_PATH + 1024] = {'"',0};
  4809. 1945a2115,2116
  4810. >
  4811. >           ToHyperlink (hwndDlg, IDT_INSECURE_APP);
  4812. 2029a2201,2206
  4813. >       if (lw == IDT_INSECURE_APP)
  4814. >       {
  4815. >           Warning ("INSECURE_APP");
  4816. >           return 1;
  4817. >       }
  4818. >
  4819. 2438,2440d2614
  4820. <          
  4821. <           ToHyperlink (hwndDlg, IDC_LINK_HIDVOL_PROTECTION_INFO);
  4822. <
  4823. 2494,2498d2667
  4824. <       if (lw == IDC_LINK_HIDVOL_PROTECTION_INFO)
  4825. <       {
  4826. <           Applink ("hiddenvolprotection", TRUE, "");
  4827. <       }
  4828. <
  4829. 3322c3491,3493
  4830. <   if (ListView_GetItem (hTree, &item) == FALSE)
  4831. ---
  4832. >   if (ListView_GetItemCount (hTree) < 1
  4833. >       || ListView_GetItem (hTree, &item) == FALSE)
  4834. >   {
  4835. 3323a3495
  4836. >   }
  4837. 4130,4132d4301
  4838. <   if (AskWarnNoYes ("CONFIRM_DECRYPT_SYS_DEVICE_CAUTION") == IDNO)
  4839. <       return;
  4840. <
  4841. 4172,4173c4341
  4842. < // Initiates the process of creation of a hidden operating system
  4843. < static void CreateHiddenOS (void)
  4844. ---
  4845. > static void DecryptNonSysDevice (BOOL bResolveAmbiguousSelection, BOOL bUseDriveListSel)
  4846. 4174a4343,4438
  4847. >   string scPath;
  4848. >
  4849. >   if (bResolveAmbiguousSelection)
  4850. >   {
  4851. >       scPath = ResolveAmbiguousSelection (NULL);
  4852. >
  4853. >       if (scPath.empty ())
  4854. >       {
  4855. >           // The user selected Cancel
  4856. >           return;
  4857. >       }
  4858. >   }
  4859. >   else if (bUseDriveListSel)
  4860. >   {
  4861. >       // Decrypt mounted volume selected in the main drive list
  4862. >
  4863. >       LPARAM lLetter = GetSelectedLong (GetDlgItem (MainDlg, IDC_DRIVELIST));
  4864. >
  4865. >       if (LOWORD (lLetter) != 0xffff)
  4866. >       {
  4867. >           VOLUME_PROPERTIES_STRUCT prop;
  4868. >           DWORD bytesReturned;
  4869. >
  4870. >           memset (&prop, 0, sizeof (prop));
  4871. >           prop.driveNo = (char) HIWORD (lLetter) - 'A';
  4872. >
  4873. >           if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &prop, sizeof (prop), &prop, sizeof (prop), &bytesReturned, NULL))
  4874. >           {
  4875. >               handleWin32Error (MainDlg);
  4876. >               return;
  4877. >           }
  4878. >
  4879. >           scPath = WideToSingleString ((wchar_t *) prop.wszVolume);
  4880. >       }
  4881. >       else
  4882. >           return;
  4883. >   }
  4884. >   else
  4885. >   {
  4886. >       // Decrypt volume specified in the input field below the main drive list
  4887. >
  4888. >       char volPath [TC_MAX_PATH];
  4889. >
  4890. >       GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), volPath, sizeof (volPath));
  4891. >
  4892. >       scPath = volPath;
  4893. >   }
  4894. >
  4895. >   if (scPath.empty ())
  4896. >   {
  4897. >       Warning ("NO_VOLUME_SELECTED");
  4898. >       return;
  4899. >   }
  4900. >
  4901. >   WaitCursor();
  4902. >
  4903. >   switch (IsSystemDevicePath ((char *) scPath.c_str (), MainDlg, TRUE))
  4904. >   {
  4905. >   case 1:
  4906. >   case 2:
  4907. >       // The user wants to decrypt the system partition/drive. Divert to the appropriate function.
  4908. >
  4909. >       NormalCursor ();
  4910. >
  4911. >       DecryptSystemDevice ();
  4912. >       return;
  4913. >   }
  4914. >
  4915. >   WaitCursor();
  4916. >
  4917. >   // Make sure the user is not attempting to decrypt a partition on an entirely encrypted system drive.
  4918. >   if (IsNonSysPartitionOnSysDrive (scPath.c_str ()) == 1)
  4919. >   {
  4920. >       if (WholeSysDriveEncryption (TRUE))
  4921. >       {
  4922. >           // The system drive is entirely encrypted and the encrypted OS is running
  4923. >
  4924. >           NormalCursor ();
  4925. >
  4926. >           Warning ("CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE");
  4927. >           return;
  4928. >       }
  4929. >   }
  4930. >   else if (TCBootLoaderOnInactiveSysEncDrive ((char *) scPath.c_str ()))
  4931. >   {
  4932. >       // The system drive MAY be entirely encrypted (external access without PBA) and the potentially encrypted OS is not running
  4933. >
  4934. >       NormalCursor ();
  4935. >
  4936. >       Warning ("CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE_UNSURE");
  4937. >
  4938. >       // We allow the user to continue as we don't know if the drive is really an encrypted system drive.
  4939. >       // If it is, the user has been warned and he will not be able to start decrypting, because the
  4940. >       // format wizard will not enable (nor will it allow the user to enable) the mount option for
  4941. >       // external without-PBA access (the user will receive the 'Incorrect password' error message).
  4942. >   }
  4943. 4176,4179c4440,4444
  4944. <   // Display brief information as to what a hidden operating system is and what it's good for. This needs to be
  4945. <   // done, because if the system partition/drive is currently encrypted, the wizard will not display any
  4946. <   // such information, but will exit (displaying only an error meessage).
  4947. <   Info("HIDDEN_OS_PREINFO");
  4948. ---
  4949. >   NormalCursor ();
  4950. >
  4951. >  
  4952. >   if (AskNoYesString ((wstring (GetString ("CONFIRM_DECRYPT_NON_SYS_DEVICE")) + L"\n\n" + SingleStringToWide (scPath)).c_str()) == IDNO)
  4953. >       return;
  4954. 4181c4446,4449
  4955. <   LaunchVolCreationWizard (MainDlg, "/isysenc");
  4956. ---
  4957. >   if (AskWarnNoYes ("CONFIRM_DECRYPT_NON_SYS_DEVICE_CAUTION") == IDNO)
  4958. >       return;
  4959. >
  4960. >   LaunchVolCreationWizard (MainDlg, (string ("/inplacedec \"") + scPath + "\"").c_str ());
  4961. 4384c4652
  4962. < static void ResumeInterruptedNonSysInplaceEncProcess (void)
  4963. ---
  4964. > static void ResumeInterruptedNonSysInplaceEncProcess (BOOL decrypt)
  4965. 4389c4657
  4966. <   LaunchVolCreationWizard (MainDlg, "/zinplace");
  4967. ---
  4968. >   LaunchVolCreationWizard (MainDlg, decrypt ? "/resumeinplacedec" : "/zinplace");
  4969. 4991,4999c5259
  4970. <                   if (AskNonSysInPlaceEncryptionResume() == IDYES)
  4971. <                       ResumeInterruptedNonSysInplaceEncProcess ();
  4972. <               }
  4973. <           }
  4974. <
  4975. <           if (!DisableSystemCrashDetection
  4976. <               && IsOSAtLeast (WIN_7))
  4977. <           {
  4978. <               // Auto-detect a system crash
  4979. ---
  4980. >                   BOOL decrypt = FALSE;
  4981. 5001,5042c5261,5262
  4982. <               const int detectionPeriodInMonthsSinceReleaseDate = 2;
  4983. <               int maxYear = TC_RELEASE_DATE_YEAR;
  4984. <               int maxMonth = TC_RELEASE_DATE_MONTH + detectionPeriodInMonthsSinceReleaseDate;
  4985. <               if (maxMonth > 12)
  4986. <               {
  4987. <                   ++maxYear;
  4988. <                   maxMonth -= 12;
  4989. <               }
  4990. <
  4991. <               SYSTEMTIME systemTime;
  4992. <               GetSystemTime (&systemTime);
  4993. <
  4994. <               if (systemTime.wYear >= TC_RELEASE_DATE_YEAR
  4995. <                   && !(systemTime.wYear == TC_RELEASE_DATE_YEAR && systemTime.wMonth < TC_RELEASE_DATE_MONTH)
  4996. <                   && systemTime.wYear <= maxYear
  4997. <                   && !(systemTime.wYear == maxYear && systemTime.wMonth > maxMonth))
  4998. <               {
  4999. <                   char winDir[MAX_PATH] = { 0 };
  5000. <                   GetWindowsDirectory (winDir, sizeof (winDir));
  5001. <
  5002. <                   WIN32_FIND_DATA findData;
  5003. <                   HANDLE find = FindFirstFile ((string (winDir) + "\\MEMORY.DMP").c_str(), &findData);
  5004. <
  5005. <                   if (find != INVALID_HANDLE_VALUE)
  5006. <                   {
  5007. <                       SYSTEMTIME systemTime;
  5008. <                       FILETIME ft;
  5009. <                       GetSystemTime (&systemTime);
  5010. <                       SystemTimeToFileTime (&systemTime, &ft);
  5011. <
  5012. <                       ULARGE_INTEGER sysTime, fileTime;
  5013. <                       sysTime.HighPart = ft.dwHighDateTime;
  5014. <                       sysTime.LowPart = ft.dwLowDateTime;
  5015. <                       fileTime.HighPart = findData.ftLastWriteTime.dwHighDateTime;
  5016. <                       fileTime.LowPart = findData.ftLastWriteTime.dwLowDateTime;
  5017. <
  5018. <                       // Memory dump must not be older than 10 minutes
  5019. <                       if (sysTime.QuadPart - fileTime.QuadPart < 10I64 * 1000 * 1000 * 60 * 10)
  5020. <                           SystemCrashDetected = TRUE;
  5021. <
  5022. <                       FindClose (find);
  5023. <                   }
  5024. ---
  5025. >                   if (AskNonSysInPlaceEncryptionResume (&decrypt) == IDYES)
  5026. >                       ResumeInterruptedNonSysInplaceEncProcess (decrypt);
  5027. 5046d5265
  5028. <           DoPostInstallTasks ();
  5029. 5072,5075d5290
  5030. <   case WM_HELP:
  5031. <       OpenPageHelp (hwndDlg, 0);
  5032. <       return 1;
  5033. <
  5034. 5136,5160d5350
  5035. <               // Handle system crash
  5036. <               static BOOL systemCrashHandlerLocked = FALSE;
  5037. <               if (SystemCrashDetected && !systemCrashHandlerLocked)
  5038. <               {
  5039. <                   systemCrashHandlerLocked = TRUE;
  5040. <
  5041. <                   SetForegroundWindow (hwndDlg);
  5042. <                   MainWindowHidden = FALSE;
  5043. <                   ShowWindow (hwndDlg, SW_SHOW);
  5044. <                   ShowWindow (hwndDlg, SW_RESTORE);
  5045. <
  5046. <                   if (AskYesNoTopmost ("SYSTEM_CRASHED_ASK_REPORT") == IDYES)
  5047. <                   {
  5048. <                       if (!IsAdmin() && IsUacSupported())
  5049. <                           UacAnalyzeKernelMiniDump (hwndDlg);
  5050. <                       else
  5051. <                           AnalyzeKernelMiniDump (hwndDlg);
  5052. <                   }
  5053. <                   else if (AskYesNoTopmost ("ASK_KEEP_DETECTING_SYSTEM_CRASH") == IDNO)
  5054. <                   {
  5055. <                       DisableSystemCrashDetection = TRUE;
  5056. <                       SaveSettings (hwndDlg);
  5057. <                   }
  5058. <               }
  5059. <
  5060. 5366,5367d5555
  5061. <                   AppendMenuW (popup, MF_STRING, IDM_HELP, GetString ("MENU_HELP"));
  5062. <                   AppendMenuW (popup, MF_STRING, IDM_HOMEPAGE_SYSTRAY, GetString ("HOMEPAGE"));
  5063. 5406,5409d5593
  5064. <                   else if (sel == IDM_HOMEPAGE_SYSTRAY)
  5065. <                   {
  5066. <                       Applink ("home", TRUE, "");
  5067. <                   }
  5068. 5623a5808,5809
  5069. >                       AppendMenuW (popup, MF_STRING, IDM_DECRYPT_NONSYS_VOL, GetString ("IDM_DECRYPT_NONSYS_VOL"));
  5070. >                       AppendMenu (popup, MF_SEPARATOR, 0, NULL);
  5071. 5674a5861,5865
  5072. >                   case IDM_DECRYPT_NONSYS_VOL:
  5073. >                       if (CheckMountList ())
  5074. >                           DecryptNonSysDevice (FALSE, TRUE);
  5075. >                       break;
  5076. >
  5077. 5738,5743d5928
  5078. <       if (lw == IDHELP || lw == IDM_HELP)
  5079. <       {
  5080. <           OpenPageHelp (hwndDlg, 0);
  5081. <           return 1;
  5082. <       }
  5083. <
  5084. 5816,5818d6000
  5085. <       case IDM_CREATE_HIDDEN_OS:
  5086. <           CreateHiddenOS ();
  5087. <           break;
  5088. 5873a6056,6057
  5089. >               AppendMenuW (popup, MF_STRING, IDM_DECRYPT_NONSYS_VOL, GetString ("IDM_DECRYPT_NONSYS_VOL"));
  5090. >               AppendMenu (popup, MF_SEPARATOR, 0, NULL);
  5091. 5891a6076,6086
  5092. >           case IDM_DECRYPT_NONSYS_VOL:
  5093. >               if (!VolumeSelected(hwndDlg))
  5094. >               {
  5095. >                   Warning ("NO_VOLUME_SELECTED");
  5096. >               }
  5097. >               else
  5098. >               {
  5099. >                   DecryptNonSysDevice (TRUE, FALSE);
  5100. >               }
  5101. >               break;
  5102. >
  5103. 5986a6182,6197
  5104. >       if (lw == IDM_DECRYPT_NONSYS_VOL)
  5105. >       {
  5106. >           LPARAM selectedDrive = GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST));
  5107. >
  5108. >           if (LOWORD (selectedDrive) == TC_MLIST_ITEM_FREE && !VolumeSelected (MainDlg))
  5109. >           {
  5110. >               Warning ("NO_VOLUME_SELECTED");
  5111. >           }
  5112. >           else
  5113. >           {
  5114. >               DecryptNonSysDevice (TRUE, FALSE);
  5115. >           }
  5116. >
  5117. >           return 1;
  5118. >       }
  5119. >
  5120. 6028a6240,6245
  5121. >       if (lw == IDT_INSECURE_APP)
  5122. >       {
  5123. >           Warning ("INSECURE_APP");
  5124. >           return 1;
  5125. >       }
  5126. >
  5127. 6042c6259
  5128. <       if (lw == IDC_CREATE_VOLUME || lw == IDM_CREATE_VOLUME || lw == IDM_VOLUME_WIZARD)
  5129. ---
  5130. >       if (lw == IDM_CREATE_VOLUME || lw == IDM_VOLUME_WIZARD)
  5131. 6111,6165d6327
  5132. <       if (lw == IDM_WEBSITE)
  5133. <       {
  5134. <           Applink ("website", TRUE, "");
  5135. <           return 1;
  5136. <       }
  5137. <       else if (lw == IDM_HOMEPAGE)
  5138. <       {
  5139. <           Applink ("homepage", TRUE, "");
  5140. <           return 1;
  5141. <       }
  5142. <       else if (lw == IDM_ONLINE_TUTORIAL)
  5143. <       {
  5144. <           Applink ("tutorial", TRUE, "");
  5145. <           return 1;
  5146. <       }
  5147. <       else if (lw == IDM_ONLINE_HELP)
  5148. <       {
  5149. <           OpenOnlineHelp ();
  5150. <           return 1;
  5151. <       }
  5152. <       else if (lw == IDM_FAQ)
  5153. <       {
  5154. <           Applink ("faq", TRUE, "");
  5155. <           return 1;
  5156. <       }
  5157. <       else if (lw == IDM_TC_DOWNLOADS)
  5158. <       {
  5159. <           Applink ("downloads", TRUE, "");
  5160. <           return 1;
  5161. <       }
  5162. <       else if (lw == IDM_NEWS)
  5163. <       {
  5164. <           Applink ("news", TRUE, "");
  5165. <           return 1;
  5166. <       }
  5167. <       else if (lw == IDM_VERSION_HISTORY)
  5168. <       {
  5169. <           Applink ("history", TRUE, "");
  5170. <           return 1;
  5171. <       }
  5172. <       else if (lw == IDM_ANALYZE_SYSTEM_CRASH)
  5173. <       {
  5174. <           if (!IsAdmin() && IsUacSupported())
  5175. <               UacAnalyzeKernelMiniDump (hwndDlg);
  5176. <           else
  5177. <               AnalyzeKernelMiniDump (hwndDlg);
  5178. <
  5179. <           return 1;
  5180. <       }
  5181. <       else if (lw == IDM_CONTACT)
  5182. <       {
  5183. <           Applink ("contact", FALSE, "");
  5184. <           return 1;
  5185. <       }
  5186. <
  5187. 6456c6618
  5188. <           ResumeInterruptedNonSysInplaceEncProcess ();
  5189. ---
  5190. >           ResumeInterruptedNonSysInplaceEncProcess (TRUE);
  5191. 8127,8129d8288
  5192. <
  5193. <           ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_HW_ACCELERATION);
  5194. <           ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION);
  5195. 8240,8247d8398
  5196. <
  5197. <       case IDC_MORE_INFO_ON_HW_ACCELERATION:
  5198. <           Applink ("hwacceleration", TRUE, "");
  5199. <           return 1;
  5200. <
  5201. <       case IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION:
  5202. <           Applink ("parallelization", TRUE, "");
  5203. <           return 1;
  5204. 8606,8939d8756
  5205. < }
  5206. <
  5207. <
  5208. < void AnalyzeKernelMiniDump (HWND hwndDlg)
  5209. < {
  5210. <   char winDir[MAX_PATH] = { 0 };
  5211. <   GetWindowsDirectory (winDir, sizeof (winDir));
  5212. <   string memDumpPath = string (winDir) + "\\MEMORY.DMP";
  5213. <   string tmpDumpPath;
  5214. <
  5215. <   string dumpPath = FindLatestFileOrDirectory (string (winDir) + "\\Minidump", "*.dmp", false, true);
  5216. <   if (dumpPath.empty())
  5217. <   {
  5218. <       Error ("NO_MINIDUMP_FOUND");
  5219. <       return;
  5220. <   }
  5221. <
  5222. <   WIN32_FIND_DATA findData;
  5223. <   HANDLE find = FindFirstFile (memDumpPath.c_str(), &findData);
  5224. <
  5225. <   if (find != INVALID_HANDLE_VALUE)
  5226. <   {
  5227. <       ULARGE_INTEGER memDumpTime, miniDumpTime;
  5228. <       memDumpTime.HighPart = findData.ftLastWriteTime.dwHighDateTime;
  5229. <       memDumpTime.LowPart = findData.ftLastWriteTime.dwLowDateTime;
  5230. <
  5231. <       FindClose (find);
  5232. <
  5233. <       find = FindFirstFile (dumpPath.c_str(), &findData);
  5234. <       if (find != INVALID_HANDLE_VALUE)
  5235. <       {
  5236. <           miniDumpTime.HighPart = findData.ftLastWriteTime.dwHighDateTime;
  5237. <           miniDumpTime.LowPart = findData.ftLastWriteTime.dwLowDateTime;
  5238. <
  5239. <           if (_abs64 (miniDumpTime.QuadPart - memDumpTime.QuadPart) < 10I64 * 1000 * 1000 * 60 * 5)
  5240. <           {
  5241. <               // Rename MEMORY.DMP file first as it can be deleted by Windows when system crash dialog is closed
  5242. <               tmpDumpPath = memDumpPath + ".true_crypt.dmp"; // Application name must be mangled to avoid interfering with crash analysis
  5243. <
  5244. <               if (MoveFile (memDumpPath.c_str(), tmpDumpPath.c_str()))
  5245. <                   dumpPath = tmpDumpPath;
  5246. <               else
  5247. <                   tmpDumpPath.clear();
  5248. <           }
  5249. <
  5250. <           FindClose (find);
  5251. <       }
  5252. <   }
  5253. <
  5254. <   finally_do_arg2 (string, tmpDumpPath, string, memDumpPath,
  5255. <   {
  5256. <       if (!finally_arg.empty())
  5257. <       {
  5258. <           if (AskYesNo ("ASK_DELETE_KERNEL_CRASH_DUMP") == IDYES)
  5259. <               DeleteFile (finally_arg.c_str());
  5260. <           else
  5261. <               MoveFile (finally_arg.c_str(), finally_arg2.c_str());
  5262. <       }
  5263. <   });
  5264. <
  5265. <   STARTUPINFO startupInfo;
  5266. <   PROCESS_INFORMATION procInfo;
  5267. <
  5268. <   ZeroMemory (&startupInfo, sizeof (startupInfo));
  5269. <   ZeroMemory (&procInfo, sizeof (procInfo));
  5270. <
  5271. <   if (!IsApplicationInstalled (Is64BitOs() ? "Debugging Tools for Windows (x64)" : "Debugging Tools for Windows (x86)"))
  5272. <   {
  5273. <       if (AskOkCancel ("ASK_DEBUGGER_INSTALL") != IDOK)
  5274. <           return;
  5275. <
  5276. <       if (!CreateProcess (NULL, (LPSTR) (string ("msiexec.exe /qb /i " TC_APPLINK "&dest=ms-debug-tools-x") + (Is64BitOs() ? "64" : "86")).c_str(),
  5277. <           NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &procInfo))
  5278. <       {
  5279. <           handleWin32Error (hwndDlg);
  5280. <           return;
  5281. <       }
  5282. <
  5283. <       WaitCursor();
  5284. <       WaitForSingleObject (procInfo.hProcess, INFINITE);
  5285. <       NormalCursor();
  5286. <
  5287. <       DWORD exitCode;
  5288. <       if (!GetExitCodeProcess (procInfo.hProcess, &exitCode) || exitCode != 0)
  5289. <           return;
  5290. <   }
  5291. <
  5292. <   if (AskOkCancel ("SYSTEM_CRASH_ANALYSIS_INFO") == IDCANCEL)
  5293. <       return;
  5294. <
  5295. <   ZeroMemory (&startupInfo, sizeof (startupInfo));
  5296. <   ZeroMemory (&procInfo, sizeof (procInfo));
  5297. <
  5298. <   SECURITY_ATTRIBUTES securityAttrib;
  5299. <   securityAttrib.bInheritHandle = TRUE;
  5300. <   securityAttrib.nLength = sizeof (securityAttrib);
  5301. <   securityAttrib.lpSecurityDescriptor = NULL;
  5302. <
  5303. <   HANDLE hChildStdoutWrite = INVALID_HANDLE_VALUE;
  5304. <   HANDLE hChildStdoutRead = INVALID_HANDLE_VALUE;
  5305. <   if (!CreatePipe (&hChildStdoutRead, &hChildStdoutWrite, &securityAttrib, 0))
  5306. <   {
  5307. <       handleWin32Error (hwndDlg);
  5308. <       return;
  5309. <   }
  5310. <   SetHandleInformation (hChildStdoutRead, HANDLE_FLAG_INHERIT, 0);
  5311. <
  5312. <   startupInfo.hStdInput = INVALID_HANDLE_VALUE;
  5313. <   startupInfo.hStdOutput = hChildStdoutWrite;
  5314. <   startupInfo.cb = sizeof (startupInfo);
  5315. <   startupInfo.hStdError = hChildStdoutWrite;
  5316. <   startupInfo.dwFlags |= STARTF_USESTDHANDLES;
  5317. <
  5318. <   list <string> kdPaths;
  5319. <   string kdPath;
  5320. <   char progPath[MAX_PATH];
  5321. <   if (SHGetSpecialFolderPath (hwndDlg, progPath, CSIDL_PROGRAM_FILES, FALSE))
  5322. <   {
  5323. <       if (Is64BitOs())
  5324. <       {
  5325. <           string s = progPath;
  5326. <           size_t p = s.find (" (x86)");
  5327. <           if (p != string::npos)
  5328. <           {
  5329. <               s = s.substr (0, p);
  5330. <               if (_access (s.c_str(), 0) != -1)
  5331. <                   strcpy_s (progPath, sizeof (progPath), s.c_str());
  5332. <           }
  5333. <       }
  5334. <
  5335. <       kdPath = string (progPath) + "\\Debugging Tools for Windows (" + (Is64BitOs() ? "x64" : "x86") + ")\\kd.exe";
  5336. <       kdPaths.push_back (kdPath);
  5337. <   }
  5338. <
  5339. <   kdPath = FindLatestFileOrDirectory (string (winDir).substr (0, 1) + ":\\WinDDK", "*", true, false);
  5340. <   kdPath += "\\Debuggers\\kd.exe";
  5341. <   kdPaths.push_back (kdPath);
  5342. <
  5343. <   kdPaths.push_back ("kd.exe");
  5344. <
  5345. <   bool kdRunning = false;
  5346. <   foreach (const string &kdPath, kdPaths)
  5347. <   {
  5348. <       if (CreateProcess (NULL, (LPSTR) ("\"" + kdPath + "\" -z \"" + dumpPath + "\" -y http://msdl.microsoft.com/download/symbols -c \".bugcheck; !analyze -v; q\"").c_str(),
  5349. <           NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &procInfo))
  5350. <       {
  5351. <           kdRunning = true;
  5352. <           break;
  5353. <       }
  5354. <   }
  5355. <
  5356. <   if (!kdRunning)
  5357. <   {
  5358. <       handleWin32Error (hwndDlg);
  5359. <       Error ("DEBUGGER_NOT_FOUND");
  5360. <       return;
  5361. <   }
  5362. <
  5363. <   EnableElevatedCursorChange (hwndDlg);
  5364. <   WaitCursor();
  5365. <
  5366. <   CloseHandle (procInfo.hProcess);
  5367. <   CloseHandle (procInfo.hThread);
  5368. <   CloseHandle (hChildStdoutWrite);
  5369. <
  5370. <   string output;
  5371. <
  5372. <   while (TRUE)
  5373. <   {
  5374. <       DWORD bytesReceived;
  5375. <       char pipeBuffer [4096];
  5376. <
  5377. <       if (!ReadFile (hChildStdoutRead, pipeBuffer, sizeof (pipeBuffer), &bytesReceived, NULL))
  5378. <           break;
  5379. <
  5380. <       output.insert (output.size(), pipeBuffer, bytesReceived);
  5381. <   }
  5382. <
  5383. <   NormalCursor();
  5384. <
  5385. <   bool otherDriver = (StringToUpperCase (output).find (StringToUpperCase (TC_APP_NAME)) == string::npos);
  5386. <
  5387. <   size_t p, p2;
  5388. <   while ((p = output.find ('`')) != string::npos)
  5389. <       output.erase (output.begin() + p);
  5390. <
  5391. <   p = output.find ("Bugcheck code ");
  5392. <   if (p == string::npos)
  5393. <   {
  5394. <       Error ("ERR_PARAMETER_INCORRECT");
  5395. <       return;
  5396. <   }
  5397. <
  5398. <   uint64 bugcheckCode;
  5399. <   int n = sscanf (output.substr (p + 14, 8).c_str(), "%I64X", &bugcheckCode);
  5400. <   if (n != 1)
  5401. <   {
  5402. <       Error ("ERR_PARAMETER_INCORRECT");
  5403. <       return;
  5404. <   }
  5405. <
  5406. <   p = output.find ("Arguments ", p);
  5407. <  
  5408. <   uint64 bugcheckArgs[4];
  5409. <   n = sscanf (output.substr (p + 10, (Is64BitOs() ? 17 : 9) * 4).c_str(), "%I64X %I64X %I64X %I64X", &bugcheckArgs[0], &bugcheckArgs[1], &bugcheckArgs[2], &bugcheckArgs[3]);
  5410. <   if (n != 4)
  5411. <   {
  5412. <       Error ("ERR_PARAMETER_INCORRECT");
  5413. <       return;
  5414. <   }
  5415. <
  5416. <   // Image name
  5417. <   string imageName, imageVersion;
  5418. <   p = output.find ("IMAGE_NAME:");
  5419. <   if (p != string::npos)
  5420. <   {
  5421. <       p += 13;
  5422. <       p2 = output.find ('\n', p);
  5423. <       if (p2 != string::npos)
  5424. <           imageName = output.substr (p, p2 - p);
  5425. <   }
  5426. <
  5427. <   // Stack trace
  5428. <   p = output.find ("STACK_TEXT:");
  5429. <   if (p == string::npos)
  5430. <   {
  5431. <       Error ("ERR_PARAMETER_INCORRECT");
  5432. <       return;
  5433. <   }
  5434. <
  5435. <   p2 = output.find ("FOLLOWUP_IP:", p);
  5436. <   if (p2 == string::npos)
  5437. <       p2 = output.find ("STACK_COMMAND:", p);
  5438. <   if (p2 == string::npos)
  5439. <       p2 = output.size();
  5440. <
  5441. <   output = output.substr (p, p2 - p);
  5442. <
  5443. <   list <string> retAddrs;
  5444. <   p = 0;
  5445. <   while ((p = output.find ("+", p)) != string::npos)
  5446. <   {
  5447. <       size_t p1 = output.rfind (" ", p);
  5448. <       if (p1 == string::npos)
  5449. <           break;
  5450. <
  5451. <       p = output.find ('\n', p);
  5452. <       if (p == string::npos)
  5453. <           p = output.size() - 1;
  5454. <
  5455. <       string s = output.substr (p1 + 1, p - p1 - 1);
  5456. <
  5457. <       if (s.find ('(') == 0)
  5458. <           s = s.substr (1);
  5459. <       if (s.rfind (')') == s.size() - 1)
  5460. <           s = s.substr (0, s.size() - 1);
  5461. <
  5462. <       retAddrs.push_back (s);
  5463. <   }
  5464. <
  5465. <   char url[MAX_URL_LENGTH];
  5466. <   sprintf (url, TC_APPLINK_SECURE "&dest=syserr-report&os=%s&osver=%d.%d.%d&arch=%s&err=%I64x&arg1=%I64x&arg2=%I64x&arg3=%I64x&arg4=%I64x&flag=%s&drv=%s",
  5467. <       GetWindowsEdition().c_str(),
  5468. <       CurrentOSMajor,
  5469. <       CurrentOSMinor,
  5470. <       CurrentOSServicePack,
  5471. <       Is64BitOs() ? "x64" : "x86",
  5472. <       bugcheckCode,
  5473. <       bugcheckArgs[0],
  5474. <       bugcheckArgs[1],
  5475. <       bugcheckArgs[2],
  5476. <       bugcheckArgs[3],
  5477. <       otherDriver ? "0" : "1",
  5478. <       imageName.empty() ? "-" : imageName.c_str()
  5479. <       );
  5480. <
  5481. <   stringstream stackTraceArgs;
  5482. <   int i = 0;
  5483. <   foreach (const string &retAddr, retAddrs)
  5484. <   {
  5485. <       stackTraceArgs << "&st" << i++ << "=" << retAddr;
  5486. <   }
  5487. <
  5488. <   wstring msg;
  5489. <
  5490. <   if (!imageName.empty() && StringToUpperCase (imageName) != StringToUpperCase (TC_APP_NAME) + ".SYS")
  5491. <   {
  5492. <       msg += wstring (GetString ("SYSTEM_CRASH_UPDATE_DRIVER")) + L"\n\n" + SingleStringToWide (imageName);
  5493. <
  5494. <       string description, company, product;
  5495. <       if (GetExecutableImageInformation (string (winDir) + "\\System32\\drivers\\" + imageName, imageVersion, description, company, product))
  5496. <       {
  5497. <           string s;
  5498. <           if (!description.empty())
  5499. <               s += description;
  5500. <           if (!company.empty())
  5501. <               s += ";  " + company;
  5502. <           if (!product.empty())
  5503. <               s += ";  " + product;
  5504. <
  5505. <           if (s.find (";  ") == 0)
  5506. <               s = s.substr (3);
  5507. <
  5508. <           if (!s.empty())
  5509. <               msg += SingleStringToWide ("  (" + s + ")");
  5510. <       }
  5511. <
  5512. <       msg += L"\n\n";
  5513. <   }
  5514. <
  5515. <   if (otherDriver)
  5516. <   {
  5517. <       msg += GetString ("SYSTEM_CRASH_NO_TRUECRYPT");
  5518. <       msg += L"\n\n";
  5519. <   }
  5520. <
  5521. <   string urlStr = string (url) + "&drvver=" + (imageVersion.empty() ? "-" : imageVersion) + stackTraceArgs.str();
  5522. <
  5523. <   for (size_t i = 0; i < urlStr.size(); ++i)
  5524. <   {
  5525. <       if (urlStr[i] == '+')
  5526. <           urlStr[i] = '.';
  5527. <   }
  5528. <
  5529. <   msg += GetString ("SYSTEM_CRASH_REPORT");
  5530. <   msg += L"\n\n";
  5531. <
  5532. <   msg += SingleStringToWide (urlStr);
  5533. <
  5534. <   msg += L"\n\n";
  5535. <   msg += GetString ("ASK_SEND_ERROR_REPORT");
  5536. <
  5537. <   if (AskYesNoString (msg.c_str()) == IDYES)
  5538. <       ShellExecute (NULL, "open", urlStr.c_str(), NULL, NULL, SW_SHOWNORMAL);
  5539. diff -b -r tc-7.1/Mount/Mount.h tc-7.2/Mount/Mount.h
  5540. 92d91
  5541. < void LaunchVolCreationWizard (HWND hwndDlg);
  5542. 95c94
  5543. < BOOL TCBootLoaderOnInactiveSysEncDrive (void);
  5544. ---
  5545. > BOOL TCBootLoaderOnInactiveSysEncDrive (char *szDevicePath);
  5546. 104d102
  5547. < void AnalyzeKernelMiniDump (HWND hwndDlg);
  5548. diff -b -r tc-7.1/Mount/Mount.rc tc-7.2/Mount/Mount.rc
  5549. 17c17
  5550. < // English (U.S.) resources
  5551. ---
  5552. > // English (United States) resources
  5553. 20d19
  5554. < #ifdef _WIN32
  5555. 23d21
  5556. < #endif //_WIN32
  5557. 138,139d135
  5558. <     PUSHBUTTON      "&Create Volume",IDC_CREATE_VOLUME,16,159,84,14
  5559. <     PUSHBUTTON      "&Volume Properties...",IDC_VOLUME_PROPERTIES,146,159,84,14
  5560. 150c146
  5561. <     CONTROL         112,IDC_LOGO,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,16,192,27,31
  5562. ---
  5563. >     CONTROL         IDB_LOGO_96DPI,IDC_LOGO,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,16,192,27,31
  5564. 157a154
  5565. >     LTEXT           "WARNING: Using TrueCrypt is not secure",IDT_INSECURE_APP,83,161,141,10,SS_NOTIFY
  5566. 160c157
  5567. < IDD_PASSWORD_DLG DIALOGEX 0, 0, 280, 68
  5568. ---
  5569. > IDD_PASSWORD_DLG DIALOGEX 0, 0, 281, 85
  5570. 165c162
  5571. <     EDITTEXT        IDC_PASSWORD,48,8,153,14,ES_PASSWORD | ES_AUTOHSCROLL
  5572. ---
  5573. >     EDITTEXT        IDC_PASSWORD,48,7,153,14,ES_PASSWORD | ES_AUTOHSCROLL
  5574. 167,174c164,172
  5575. <                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,27,153,10
  5576. <     CONTROL         "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,40,83,10
  5577. <     CONTROL         "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,52,83,11
  5578. <     PUSHBUTTON      "&Keyfiles...",IDC_KEY_FILES,137,49,64,14
  5579. <     PUSHBUTTON      "Mount Opti&ons...",IDC_MOUNT_OPTIONS,208,49,64,14
  5580. <     DEFPUSHBUTTON   "OK",IDOK,208,8,64,14
  5581. <     PUSHBUTTON      "Cancel",IDCANCEL,208,25,64,14
  5582. <     RTEXT           "Password:",IDT_PASSWORD,0,10,46,19
  5583. ---
  5584. >                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,43,153,10
  5585. >     CONTROL         "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,56,83,10
  5586. >     CONTROL         "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,68,83,11
  5587. >     PUSHBUTTON      "&Keyfiles...",IDC_KEY_FILES,137,65,64,14
  5588. >     PUSHBUTTON      "Mount Opti&ons...",IDC_MOUNT_OPTIONS,208,65,64,14
  5589. >     DEFPUSHBUTTON   "OK",IDOK,208,7,64,14
  5590. >     PUSHBUTTON      "Cancel",IDCANCEL,208,24,64,14
  5591. >     RTEXT           "Password:",IDT_PASSWORD,0,9,46,19
  5592. >     LTEXT           "WARNING: Using TrueCrypt is not secure",IDT_INSECURE_APP,51,27,146,10,SS_NOTIFY
  5593. 280d277
  5594. <     LTEXT           "More information",IDC_MORE_INFO_ON_HW_ACCELERATION,18,61,165,10,SS_NOTIFY
  5595. 284d280
  5596. <     LTEXT           "More information",IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION,18,159,165,10,SS_NOTIFY
  5597. 316d311
  5598. <     LTEXT           "Help on favorite volumes",IDC_FAVORITES_HELP_LINK,17,259,237,10,SS_NOTIFY
  5599. 365c360
  5600. <         BOTTOMMARGIN, 63
  5601. ---
  5602. >         BOTTOMMARGIN, 80
  5603. 424,425c419,420
  5604. <  FILEVERSION 7,1,1,0
  5605. <  PRODUCTVERSION 7,1,1,0
  5606. ---
  5607. >  FILEVERSION 7,2,0,0
  5608. >  PRODUCTVERSION 7,2,0,0
  5609. 442c437
  5610. <             VALUE "FileVersion", "7.1a"
  5611. ---
  5612. >             VALUE "FileVersion", "7.2"
  5613. 446c441
  5614. <             VALUE "ProductVersion", "7.1a"
  5615. ---
  5616. >             VALUE "ProductVersion", "7.2"
  5617. 506a502,503
  5618. >         MENUITEM "Permanently Decrypt...",      IDM_DECRYPT_NONSYS_VOL
  5619. >         MENUITEM "Resume Interrupted Decryption...", IDM_RESUME_INTERRUPTED_PROC
  5620. 508d504
  5621. <         MENUITEM "Resume Interrupted Process",  IDM_RESUME_INTERRUPTED_PROC
  5622. 526d521
  5623. <         MENUITEM "Encrypt System Partition/Drive...", IDM_ENCRYPT_SYSTEM_DEVICE
  5624. 529,530c524
  5625. <         MENUITEM SEPARATOR
  5626. <         MENUITEM "Create Hidden Operating System...", IDM_CREATE_HIDDEN_OS
  5627. ---
  5628. >         MENUITEM "Encrypt System Partition/Drive...", IDM_ENCRYPT_SYSTEM_DEVICE
  5629. 591,603d584
  5630. <         MENUITEM "User's Guide",                IDM_HELP
  5631. <         MENUITEM "Online Help",                 IDM_ONLINE_HELP
  5632. <         MENUITEM "Beginner's Tutorial",         IDM_ONLINE_TUTORIAL
  5633. <         MENUITEM "Frequently Asked Questions",  IDM_FAQ
  5634. <         MENUITEM SEPARATOR
  5635. <         MENUITEM "TrueCrypt Website",           IDM_WEBSITE
  5636. <         MENUITEM "Downloads",                   IDM_TC_DOWNLOADS
  5637. <         MENUITEM "News",                        IDM_NEWS
  5638. <         MENUITEM "Version History",             IDM_VERSION_HISTORY
  5639. <         MENUITEM SEPARATOR
  5640. <         MENUITEM "Analyze a System Crash...",   IDM_ANALYZE_SYSTEM_CRASH
  5641. <         MENUITEM SEPARATOR
  5642. <         MENUITEM "Contact",                     IDM_CONTACT
  5643. 607d587
  5644. <     MENUITEM "&Homepage ",                  IDM_HOMEPAGE
  5645. 621c601
  5646. < #endif    // English (U.S.) resources
  5647. ---
  5648. > #endif    // English (United States) resources
  5649. diff -b -r tc-7.1/Mount/Resource.h tc-7.2/Mount/Resource.h
  5650. 61,222c61,208
  5651. < #define IDC_CREATE_VOLUME               1038
  5652. < #define IDC_VOLUME_TOOLS                1039
  5653. < #define IDC_WIPE_CACHE                  1040
  5654. < #define IDC_MOUNTALL                    1041
  5655. < #define IDD_TRAVELER_DLG                1042
  5656. < #define IDC_SELECT_FILE                 1043
  5657. < #define IDD_HOTKEYS_DLG                 1044
  5658. < #define IDC_VOLUME_PROPERTIES           1045
  5659. < #define IDT_FILE_SETTINGS               1046
  5660. < #define IDD_PERFORMANCE_SETTINGS        1047
  5661. < #define IDT_AUTORUN                     1048
  5662. < #define IDT_TRAVEL_INSERTION            1049
  5663. < #define IDT_TRAVEL_ROOT                 1050
  5664. < #define IDT_VOLUME                      1051
  5665. < #define IDT_PASSWORD                    1052
  5666. < #define IDT_CURRENT                     1053
  5667. < #define IDT_NEW                         1054
  5668. < #define IDT_NEW_PASSWORD                1055
  5669. < #define IDT_CONFIRM_PASSWORD            1056
  5670. < #define IDT_PKCS5_PRF                   1057
  5671. < #define IDT_PW_CACHE_OPTIONS            1058
  5672. < #define IDT_DEFAULT_MOUNT_OPTIONS       1059
  5673. < #define IDT_WINDOWS_RELATED_SETTING     1060
  5674. < #define IDC_CREATE                      1061
  5675. < #define IDC_EXIT                        1062
  5676. < #define IDC_TRAVEL_OPEN_EXPLORER        1063
  5677. < #define IDC_TRAV_CACHE_PASSWORDS        1064
  5678. < #define IDC_UNMOUNTALL                  1065
  5679. < #define IDT_TASKBAR_ICON                1066
  5680. < #define IDT_AUTO_DISMOUNT               1067
  5681. < #define IDC_PREF_FORCE_AUTO_DISMOUNT    1068
  5682. < #define IDC_PREF_DISMOUNT_INACTIVE_TIME 1069
  5683. < #define IDT_MINUTES                     1070
  5684. < #define IDC_PREF_DISMOUNT_SCREENSAVER   1071
  5685. < #define IDC_PREF_DISMOUNT_POWERSAVING   1072
  5686. < #define IDT_AUTO_DISMOUNT_ON            1073
  5687. < #define IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT 1074
  5688. < #define IDC_CLOSE_BKG_TASK_WHEN_NOVOL   1075
  5689. < #define IDC_MORE_INFO_ON_HW_ACCELERATION 1076
  5690. < #define IDT_LOGON                       1077
  5691. < #define IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION 1078
  5692. < #define IDC_PREF_LOGON_START            1079
  5693. < #define IDC_PREF_LOGON_MOUNT_DEVICES    1080
  5694. < #define IDC_SHOW_PASSWORD_CHPWD_NEW     1081
  5695. < #define IDC_HK_DISMOUNT_BALLOON_TOOLTIP 1082
  5696. < #define IDC_SHOW_PASSWORD_CHPWD_ORI     1083
  5697. < #define IDC_HK_DISMOUNT_PLAY_SOUND      1084
  5698. < #define IDC_HOTKEY_ASSIGN               1085
  5699. < #define IDC_HOTKEY_REMOVE               1086
  5700. < #define IDC_HOTKEY_KEY                  1087
  5701. < #define IDT_HOTKEY_KEY                  1088
  5702. < #define IDC_HOTKEY_LIST                 1089
  5703. < #define IDC_RESET_HOTKEYS               1090
  5704. < #define IDT_DISMOUNT_ACTION             1091
  5705. < #define IDT_ASSIGN_HOTKEY               1092
  5706. < #define IDC_HK_MOD_SHIFT                1093
  5707. < #define IDC_HK_MOD_CTRL                 1094
  5708. < #define IDC_HK_MOD_ALT                  1095
  5709. < #define IDC_HK_MOD_WIN                  1096
  5710. < #define IDC_SHOW_PASSWORD               1097
  5711. < #define IDC_LOGO                        1098
  5712. < #define IDT_PKCS11_LIB_PATH             1099
  5713. < #define IDC_PKCS11_MODULE               1100
  5714. < #define IDC_SELECT_PKCS11_MODULE        1101
  5715. < #define IDC_AUTO_DETECT_PKCS11_MODULE   1102
  5716. < #define IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT 1103
  5717. < #define IDT_SECURITY_OPTIONS            1104
  5718. < #define IDC_DISABLE_BOOT_LOADER_OUTPUT  1105
  5719. < #define IDC_ALLOW_ESC_PBA_BYPASS        1106
  5720. < #define IDC_CUSTOM_BOOT_LOADER_MESSAGE  1107
  5721. < #define IDC_BOOT_LOADER_CACHE_PASSWORD  1108
  5722. < #define IDC_MORE_SETTINGS               1109
  5723. < #define IDT_CUSTOM_BOOT_LOADER_MESSAGE  1110
  5724. < #define IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP 1111
  5725. < #define IDT_BOOT_LOADER_SCREEN_OPTIONS  1112
  5726. < #define IDT_PKCS11_LIB_HELP             1113
  5727. < #define IDT_ACCELERATION_OPTIONS        1114
  5728. < #define IDC_ENABLE_HARDWARE_ENCRYPTION  1115
  5729. < #define IDC_FAVORITE_VOLUMES_LIST       1116
  5730. < #define IDC_FAVORITE_MOUNT_READONLY     1117
  5731. < #define IDC_FAVORITE_MOUNT_REMOVABLE    1118
  5732. < #define IDC_FAVORITE_MOUNT_ON_ARRIVAL   1119
  5733. < #define IDC_FAVORITE_LABEL              1120
  5734. < #define IDT_FAVORITE_LABEL              1121
  5735. < #define IDC_FAVORITE_MOUNT_ON_LOGON     1122
  5736. < #define IDC_FAVORITE_DISABLE_HOTKEY     1123
  5737. < #define IDC_FAVORITE_MOVE_UP            1124
  5738. < #define IDC_FAVORITE_MOVE_DOWN          1125
  5739. < #define IDC_FAVORITE_REMOVE             1126
  5740. < #define IDT_HW_AES_SUPPORTED_BY_CPU     1127
  5741. < #define IDC_FAVORITE_OPEN_EXPLORER_WIN_ON_MOUNT 1128
  5742. < #define IDC_HW_AES_SUPPORTED_BY_CPU     1129
  5743. < #define IDC_LIMIT_ENC_THREAD_POOL       1130
  5744. < #define IDC_ENCRYPTION_FREE_CPU_COUNT   1131
  5745. < #define IDT_PARALLELIZATION_OPTIONS     1132
  5746. < #define IDT_LIMIT_ENC_THREAD_POOL_NOTE  1133
  5747. < #define IDC_FAV_VOL_OPTIONS_GROUP_BOX   1134
  5748. < #define IDC_FAVORITES_HELP_LINK         1135
  5749. < #define IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX 1136
  5750. < #define IDM_HELP                        40001
  5751. < #define IDM_ABOUT                       40002
  5752. < #define IDM_UNMOUNT_VOLUME              40003
  5753. < #define IDM_CLEAR_HISTORY               40004
  5754. < #define IDM_BENCHMARK                   40005
  5755. < #define IDM_TRAVELER                    40006
  5756. < #define IDM_MOUNT_VOLUME_OPTIONS        40007
  5757. < #define IDM_FAQ                         40008
  5758. < #define IDM_REFRESH_DRIVE_LETTERS       40009
  5759. < #define IDM_DEFAULT_KEYFILES            40010
  5760. < #define IDM_WEBSITE                     40011
  5761. < #define IDM_MOUNTALL                    40012
  5762. < #define IDM_UNMOUNTALL                  40013
  5763. < #define IDM_MOUNT_VOLUME                40014
  5764. < #define IDM_CHANGE_PASSWORD             40015
  5765. < #define IDM_VOLUME_WIZARD               40016
  5766. < #define IDM_CREATE_VOLUME               40017
  5767. < #define IDM_WIPE_CACHE                  40018
  5768. < #define IDM_PREFERENCES                 40019
  5769. < #define IDM_LICENSE                     40020
  5770. < #define IDM_SELECT_FILE                 40021
  5771. < #define IDM_SELECT_DEVICE               40022
  5772. < #define IDM_VOLUME_PROPERTIES           40023
  5773. < #define IDM_LANGUAGE                    40024
  5774. < #define IDM_MOUNT_FAVORITE_VOLUMES      40025
  5775. < #define IDM_BACKUP_VOL_HEADER           40026
  5776. < #define IDM_RESTORE_VOL_HEADER          40027
  5777. < #define IDM_HOTKEY_SETTINGS             40028
  5778. < #define IDM_TC_DOWNLOADS                40029
  5779. < #define IDM_NEWS                        40030
  5780. < #define IDM_CONTACT                     40031
  5781. < #define IDM_VERSION_HISTORY             40032
  5782. < #define IDM_HOMEPAGE                    40033
  5783. < #define IDM_TEST_VECTORS                40034
  5784. < #define IDM_ADD_REMOVE_VOL_KEYFILES     40035
  5785. < #define IDM_REMOVE_ALL_KEYFILES_FROM_VOL 40036
  5786. < #define IDM_CHANGE_HEADER_KEY_DERIV_ALGO 40037
  5787. < #define IDM_KEYFILE_GENERATOR           40038
  5788. < #define IDM_ONLINE_TUTORIAL             40039
  5789. < #define IDM_ONLINE_HELP                 40040
  5790. < #define IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO 40041
  5791. < #define IDM_CHANGE_SYS_PASSWORD         40042
  5792. < #define IDM_CREATE_RESCUE_DISK          40043
  5793. < #define IDM_PERMANENTLY_DECRYPT_SYS     40044
  5794. < #define IDM_VERIFY_RESCUE_DISK          40045
  5795. < #define IDM_SYSTEM_ENCRYPTION_STATUS    40046
  5796. < #define IDM_ENCRYPT_SYSTEM_DEVICE       40047
  5797. < #define IDM_SYSENC_RESUME               40048
  5798. < #define IDM_MOUNT_SYSENC_PART_WITHOUT_PBA 40049
  5799. < #define IDM_CREATE_HIDDEN_OS            40050
  5800. < #define IDM_TOKEN_PREFERENCES           40051
  5801. < #define IDM_CLOSE_ALL_TOKEN_SESSIONS    40052
  5802. < #define IDM_SYS_ENC_SETTINGS            40053
  5803. < #define IDM_SYSENC_SETTINGS             40054
  5804. < #define IDM_RESUME_INTERRUPTED_PROC     40055
  5805. < #define IDM_MANAGE_TOKEN_KEYFILES       40056
  5806. < #define IDM_SYS_FAVORITES_SETTINGS      40057
  5807. < #define IDM_ORGANIZE_FAVORITES          40058
  5808. < #define IDM_ORGANIZE_SYSTEM_FAVORITES   40059
  5809. < #define IDM_ADD_VOLUME_TO_FAVORITES     40060
  5810. < #define IDM_ADD_VOLUME_TO_SYSTEM_FAVORITES 40061
  5811. < #define IDM_PERFORMANCE_SETTINGS        40062
  5812. < #define IDM_ANALYZE_SYSTEM_CRASH        40063
  5813. ---
  5814. > #define IDC_VOLUME_TOOLS                1038
  5815. > #define IDC_WIPE_CACHE                  1039
  5816. > #define IDC_MOUNTALL                    1040
  5817. > #define IDD_TRAVELER_DLG                1041
  5818. > #define IDC_SELECT_FILE                 1042
  5819. > #define IDD_HOTKEYS_DLG                 1043
  5820. > #define IDC_VOLUME_PROPERTIES           1044
  5821. > #define IDT_FILE_SETTINGS               1045
  5822. > #define IDD_PERFORMANCE_SETTINGS        1046
  5823. > #define IDT_AUTORUN                     1047
  5824. > #define IDT_TRAVEL_INSERTION            1048
  5825. > #define IDT_TRAVEL_ROOT                 1049
  5826. > #define IDT_VOLUME                      1050
  5827. > #define IDT_PASSWORD                    1051
  5828. > #define IDT_CURRENT                     1052
  5829. > #define IDT_NEW                         1053
  5830. > #define IDT_NEW_PASSWORD                1054
  5831. > #define IDT_CONFIRM_PASSWORD            1055
  5832. > #define IDT_PKCS5_PRF                   1056
  5833. > #define IDT_PW_CACHE_OPTIONS            1057
  5834. > #define IDT_DEFAULT_MOUNT_OPTIONS       1058
  5835. > #define IDT_WINDOWS_RELATED_SETTING     1059
  5836. > #define IDC_CREATE                      1060
  5837. > #define IDC_EXIT                        1061
  5838. > #define IDC_TRAVEL_OPEN_EXPLORER        1062
  5839. > #define IDC_TRAV_CACHE_PASSWORDS        1063
  5840. > #define IDC_UNMOUNTALL                  1064
  5841. > #define IDT_TASKBAR_ICON                1065
  5842. > #define IDT_AUTO_DISMOUNT               1066
  5843. > #define IDC_PREF_FORCE_AUTO_DISMOUNT    1067
  5844. > #define IDC_PREF_DISMOUNT_INACTIVE_TIME 1068
  5845. > #define IDT_MINUTES                     1069
  5846. > #define IDC_PREF_DISMOUNT_SCREENSAVER   1070
  5847. > #define IDC_PREF_DISMOUNT_POWERSAVING   1071
  5848. > #define IDT_AUTO_DISMOUNT_ON            1072
  5849. > #define IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT 1073
  5850. > #define IDC_CLOSE_BKG_TASK_WHEN_NOVOL   1074
  5851. > #define IDT_LOGON                       1075
  5852. > #define IDC_PREF_LOGON_START            1076
  5853. > #define IDC_PREF_LOGON_MOUNT_DEVICES    1077
  5854. > #define IDC_SHOW_PASSWORD_CHPWD_NEW     1078
  5855. > #define IDC_HK_DISMOUNT_BALLOON_TOOLTIP 1079
  5856. > #define IDC_SHOW_PASSWORD_CHPWD_ORI     1080
  5857. > #define IDC_HK_DISMOUNT_PLAY_SOUND      1081
  5858. > #define IDC_HOTKEY_ASSIGN               1082
  5859. > #define IDC_HOTKEY_REMOVE               1083
  5860. > #define IDC_HOTKEY_KEY                  1084
  5861. > #define IDT_HOTKEY_KEY                  1085
  5862. > #define IDC_HOTKEY_LIST                 1086
  5863. > #define IDC_RESET_HOTKEYS               1087
  5864. > #define IDT_DISMOUNT_ACTION             1088
  5865. > #define IDT_ASSIGN_HOTKEY               1089
  5866. > #define IDC_HK_MOD_SHIFT                1090
  5867. > #define IDC_HK_MOD_CTRL                 1091
  5868. > #define IDC_HK_MOD_ALT                  1092
  5869. > #define IDC_HK_MOD_WIN                  1093
  5870. > #define IDC_SHOW_PASSWORD               1094
  5871. > #define IDC_LOGO                        1095
  5872. > #define IDT_PKCS11_LIB_PATH             1096
  5873. > #define IDC_PKCS11_MODULE               1097
  5874. > #define IDC_SELECT_PKCS11_MODULE        1098
  5875. > #define IDC_AUTO_DETECT_PKCS11_MODULE   1099
  5876. > #define IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT 1100
  5877. > #define IDT_SECURITY_OPTIONS            1101
  5878. > #define IDC_DISABLE_BOOT_LOADER_OUTPUT  1102
  5879. > #define IDC_ALLOW_ESC_PBA_BYPASS        1103
  5880. > #define IDC_CUSTOM_BOOT_LOADER_MESSAGE  1104
  5881. > #define IDC_BOOT_LOADER_CACHE_PASSWORD  1105
  5882. > #define IDC_MORE_SETTINGS               1106
  5883. > #define IDT_CUSTOM_BOOT_LOADER_MESSAGE  1107
  5884. > #define IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP 1108
  5885. > #define IDT_BOOT_LOADER_SCREEN_OPTIONS  1109
  5886. > #define IDT_PKCS11_LIB_HELP             1110
  5887. > #define IDT_ACCELERATION_OPTIONS        1111
  5888. > #define IDC_ENABLE_HARDWARE_ENCRYPTION  1112
  5889. > #define IDC_FAVORITE_VOLUMES_LIST       1113
  5890. > #define IDC_FAVORITE_MOUNT_READONLY     1114
  5891. > #define IDC_FAVORITE_MOUNT_REMOVABLE    1115
  5892. > #define IDC_FAVORITE_MOUNT_ON_ARRIVAL   1116
  5893. > #define IDC_FAVORITE_LABEL              1117
  5894. > #define IDT_FAVORITE_LABEL              1118
  5895. > #define IDC_FAVORITE_MOUNT_ON_LOGON     1119
  5896. > #define IDC_FAVORITE_DISABLE_HOTKEY     1120
  5897. > #define IDC_FAVORITE_MOVE_UP            1121
  5898. > #define IDC_FAVORITE_MOVE_DOWN          1122
  5899. > #define IDC_FAVORITE_REMOVE             1123
  5900. > #define IDT_HW_AES_SUPPORTED_BY_CPU     1124
  5901. > #define IDC_FAVORITE_OPEN_EXPLORER_WIN_ON_MOUNT 1125
  5902. > #define IDC_HW_AES_SUPPORTED_BY_CPU     1126
  5903. > #define IDC_LIMIT_ENC_THREAD_POOL       1127
  5904. > #define IDC_ENCRYPTION_FREE_CPU_COUNT   1128
  5905. > #define IDT_PARALLELIZATION_OPTIONS     1129
  5906. > #define IDT_LIMIT_ENC_THREAD_POOL_NOTE  1130
  5907. > #define IDC_FAV_VOL_OPTIONS_GROUP_BOX   1131
  5908. > #define IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX 1132
  5909. > #define IDT_INSECURE_APP                1133
  5910. > #define IDM_ABOUT                       40001
  5911. > #define IDM_UNMOUNT_VOLUME              40002
  5912. > #define IDM_CLEAR_HISTORY               40003
  5913. > #define IDM_BENCHMARK                   40004
  5914. > #define IDM_TRAVELER                    40005
  5915. > #define IDM_MOUNT_VOLUME_OPTIONS        40006
  5916. > #define IDM_REFRESH_DRIVE_LETTERS       40007
  5917. > #define IDM_DEFAULT_KEYFILES            40008
  5918. > #define IDM_MOUNTALL                    40009
  5919. > #define IDM_UNMOUNTALL                  40010
  5920. > #define IDM_MOUNT_VOLUME                40011
  5921. > #define IDM_CHANGE_PASSWORD             40012
  5922. > #define IDM_VOLUME_WIZARD               40013
  5923. > #define IDM_CREATE_VOLUME               40014
  5924. > #define IDM_WIPE_CACHE                  40015
  5925. > #define IDM_PREFERENCES                 40016
  5926. > #define IDM_LICENSE                     40017
  5927. > #define IDM_SELECT_FILE                 40018
  5928. > #define IDM_SELECT_DEVICE               40019
  5929. > #define IDM_VOLUME_PROPERTIES           40020
  5930. > #define IDM_LANGUAGE                    40021
  5931. > #define IDM_MOUNT_FAVORITE_VOLUMES      40022
  5932. > #define IDM_BACKUP_VOL_HEADER           40023
  5933. > #define IDM_RESTORE_VOL_HEADER          40024
  5934. > #define IDM_HOTKEY_SETTINGS             40025
  5935. > #define IDM_TEST_VECTORS                40026
  5936. > #define IDM_ADD_REMOVE_VOL_KEYFILES     40027
  5937. > #define IDM_REMOVE_ALL_KEYFILES_FROM_VOL 40028
  5938. > #define IDM_CHANGE_HEADER_KEY_DERIV_ALGO 40029
  5939. > #define IDM_KEYFILE_GENERATOR           40030
  5940. > #define IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO 40031
  5941. > #define IDM_CHANGE_SYS_PASSWORD         40032
  5942. > #define IDM_CREATE_RESCUE_DISK          40033
  5943. > #define IDM_PERMANENTLY_DECRYPT_SYS     40034
  5944. > #define IDM_VERIFY_RESCUE_DISK          40035
  5945. > #define IDM_SYSTEM_ENCRYPTION_STATUS    40036
  5946. > #define IDM_ENCRYPT_SYSTEM_DEVICE       40037
  5947. > #define IDM_SYSENC_RESUME               40038
  5948. > #define IDM_MOUNT_SYSENC_PART_WITHOUT_PBA 40039
  5949. > #define IDM_TOKEN_PREFERENCES           40040
  5950. > #define IDM_CLOSE_ALL_TOKEN_SESSIONS    40041
  5951. > #define IDM_SYS_ENC_SETTINGS            40042
  5952. > #define IDM_SYSENC_SETTINGS             40043
  5953. > #define IDM_RESUME_INTERRUPTED_PROC     40044
  5954. > #define IDM_MANAGE_TOKEN_KEYFILES       40045
  5955. > #define IDM_SYS_FAVORITES_SETTINGS      40046
  5956. > #define IDM_ORGANIZE_FAVORITES          40047
  5957. > #define IDM_ORGANIZE_SYSTEM_FAVORITES   40048
  5958. > #define IDM_ADD_VOLUME_TO_FAVORITES     40049
  5959. > #define IDM_ADD_VOLUME_TO_SYSTEM_FAVORITES 40050
  5960. > #define IDM_PERFORMANCE_SETTINGS        40051
  5961. > #define IDM_DECRYPT_NONSYS_VOL          40052
  5962. 230,231c216,217
  5963. < #define _APS_NEXT_COMMAND_VALUE         40064
  5964. < #define _APS_NEXT_CONTROL_VALUE         1137
  5965. ---
  5966. > #define _APS_NEXT_COMMAND_VALUE         40053
  5967. > #define _APS_NEXT_CONTROL_VALUE         1134
  5968. diff -b -r tc-7.1/Readme.txt tc-7.2/Readme.txt
  5969. 1c1,9
  5970. < This archive contains the source code of TrueCrypt 7.1a.
  5971. ---
  5972. >
  5973. > WARNING: Using TrueCrypt is not secure as it may contain unfixed security issues
  5974. >
  5975. > The development of TrueCrypt was ended in 5/2014 after Microsoft terminated
  5976. > support of Windows XP. Windows 8/7/Vista and later offer integrated support for
  5977. > encrypted disks and virtual disk images. Such integrated support is also
  5978. > available on other platforms. You should migrate any data encrypted by TrueCrypt
  5979. > to encrypted disks or virtual disk images supported on your platform.
  5980. >
  5981. 27,34d34
  5982. < III. FreeBSD and OpenSolaris
  5983. <
  5984. < IV. Third-Party Developers (Contributors)
  5985. <
  5986. < V. Legal Information
  5987. <
  5988. < VI. Further Information
  5989. <
  5990. 44c44
  5991. < - Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)
  5992. ---
  5993. > - Microsoft Visual C++ 1.52
  5994. 48c48
  5995. <   header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)
  5996. ---
  5997. >   header files
  5998. 52,70d51
  5999. < IMPORTANT:
  6000. <
  6001. < The 64-bit editions of Windows Vista and later versions of Windows, and in
  6002. < some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not
  6003. < allow the TrueCrypt driver to run without an appropriate digital signature.
  6004. < Therefore, all .sys files in official TrueCrypt binary packages are digitally
  6005. < signed with the digital certificate of the TrueCrypt Foundation, which was
  6006. < issued by a certification authority. At the end of each official .exe and
  6007. < .sys file, there are embedded digital signatures and all related certificates
  6008. < (i.e. all certificates in the relevant certification chain, such as the
  6009. < certification authority certificates, CA-MS cross-certificate, and the
  6010. < TrueCrypt Foundation certificate). Keep this in mind if you compile TrueCrypt
  6011. < and compare your binaries with the official binaries. If your binaries are
  6012. < unsigned, the sizes of the official binaries will usually be approximately
  6013. < 10 KB greater than sizes of your binaries (there may be further differences
  6014. < if you use a different version of the compiler, or if you install a different
  6015. < or no service pack for Visual Studio, or different hotfixes for it, or if you
  6016. < use different versions of the required SDKs).
  6017. <
  6018. 114,116c95,96
  6019. <   wxWidgets 2.8 library source code (available at http://www.wxwidgets.org)
  6020. < - FUSE library and header files (available at http://fuse.sourceforge.net
  6021. <   and http://code.google.com/p/macfuse)
  6022. ---
  6023. >   wxWidgets 2.8 library source code
  6024. > - FUSE library and header files
  6025. 118,120c98,99
  6026. <   header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)
  6027. <   located in a standard include path or in a directory defined by the
  6028. <   environment variable 'PKCS11_INC'.
  6029. ---
  6030. >   header files located in a standard include path or in a directory
  6031. >   defined by the environment variable 'PKCS11_INC'
  6032. 155,209d133
  6033. <
  6034. <
  6035. <
  6036. < III. FreeBSD and OpenSolaris
  6037. < ============================
  6038. <
  6039. < Support status for FreeBSD: http://www.truecrypt.org/misc/freebsd
  6040. < Support status for OpenSolaris: http://www.truecrypt.org/misc/opensolaris
  6041. <
  6042. <
  6043. <
  6044. < IV. Third-Party Developers (Contributors)
  6045. < =========================================
  6046. <
  6047. < If you intend to implement a feature, please contact us first to make sure:
  6048. <
  6049. < 1) That the feature has not been implemented (we may have already implemented
  6050. <    it, but haven't released the code yet).
  6051. < 2) That the feature is acceptable.
  6052. < 3) Whether we need help of third-party developers with implementing the feature.
  6053. <
  6054. < Information on how to contact us can be found at:
  6055. < http://www.truecrypt.org/contact
  6056. <
  6057. <
  6058. <
  6059. < V. Legal Information
  6060. < ====================
  6061. <
  6062. < Copyright Information
  6063. < ---------------------
  6064. <
  6065. < This software as a whole:
  6066. < Copyright (c) 2012 TrueCrypt Developers Association. All rights reserved.
  6067. <
  6068. < Portions of this software:
  6069. < Copyright (c) 2003-2012 TrueCrypt Developers Association. All rights reserved.
  6070. < Copyright (c) 1998-2000 Paul Le Roux. All rights reserved.
  6071. < Copyright (c) 1998-2008 Brian Gladman, Worcester, UK. All rights reserved.
  6072. < Copyright (c) 2002-2004 Mark Adler. All rights reserved.
  6073. < For more information, please see the legal notices attached to parts of the
  6074. < source code.
  6075. <
  6076. < Trademark Information
  6077. < ---------------------
  6078. <
  6079. < Any trademarks contained in the source code, binaries, and/or in the
  6080. < documentation, are the sole property of their respective owners.
  6081. <
  6082. <
  6083. <
  6084. < VI. Further Information
  6085. < =======================
  6086. <
  6087. < http://www.truecrypt.org
  6088. diff -b -r tc-7.1/Release/Setup Files/License.txt tc-7.2/Release/Setup Files/License.txt
  6089. 1c1
  6090. < TrueCrypt License Version 3.0
  6091. ---
  6092. > TrueCrypt License Version 3.1
  6093. 115,131c115
  6094. <     c. Phrase "Based on TrueCrypt, freely available at
  6095. <     http://www.truecrypt.org/" must be displayed by Your Product
  6096. <     (if technically feasible) and contained in its
  6097. <     documentation. Alternatively, if This Product or its portion
  6098. <     You included in Your Product constitutes only a minor
  6099. <     portion of Your Product, phrase "Portions of this product
  6100. <     are based in part on TrueCrypt, freely available at
  6101. <     http://www.truecrypt.org/" may be displayed instead. In each
  6102. <     of the cases mentioned above in this paragraph,
  6103. <     "http://www.truecrypt.org/" must be a hyperlink (if
  6104. <     technically feasible) pointing to http://www.truecrypt.org/
  6105. <     and You may freely choose the location within the user
  6106. <     interface (if there is any) of Your Product (e.g., an
  6107. <     "About" window, etc.) and the way in which Your Product will
  6108. <     display the respective phrase.
  6109. <
  6110. <     Your Product (and any associated materials, e.g., the
  6111. ---
  6112. >     c. Your Product (and any associated materials, e.g., the
  6113. 134,135c118,119
  6114. <     containing the domain name truecrypt.org (or any domain name
  6115. <     that forwards to the domain name truecrypt.org) in a manner
  6116. ---
  6117. >     containing the domain name truecrypt (or any domain name
  6118. >     that forwards to the domain name truecrypt) in a manner
  6119. 140c124
  6120. <     name truecrypt.org is associated with Your Product.
  6121. ---
  6122. >     name truecrypt is associated with Your Product.
  6123. Only in tc-7.1/Release/Setup Files: TrueCrypt User Guide.pdf
  6124. diff -b -r tc-7.1/Resources/Texts/License.rtf tc-7.2/Resources/Texts/License.rtf
  6125. 61c61
  6126. < \pard\plain \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0{\ltrch\hich\b\loch\b TrueCrypt License Version 3.0}}{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 \line \line Software distributed under this license is distributed on an "AS IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO USES, COPIES, MODIFIES, OR (RE)DISTRIB
  6127. ---
  6128. > \pard\plain \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0{\ltrch\hich\b\loch\b TrueCrypt License Version 3.1}}{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 \line \line Software distributed under this license is distributed on an "AS IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO USES, COPIES, MODIFIES, OR (RE)DISTRIB
  6129. 82,87c82,84
  6130. < \par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\sa283\f2\fs16\f2\fs16\f2\fs16 c.\tab}\ilvl0 \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\li707\ri0\lin707\rin0\fi-283\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033 {\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 Phrase "{\ltrch\hich\i\loch\i Based on TrueCrypt, freely available at http://www.truecrypt.org/}" must be displayed by Your Product (if technically feasible) and contained in its documentation. Alternatively, if This Product or its portion You included in Your Product constitute
  6131. < s only a minor portion of Your Product, phrase "{\ltrch\hich\i\loch\i Portions of this product are based in part on TrueCrypt, freely available at http://www.truecrypt.org/}" may be displayed instead. In each of the cases mentioned above in this paragraph, "{\ltrch\hich\i\loch\i http://www.truecrypt.
  6132. < org/}" must be a hyperlink (if technically feasible) pointing to http://www.truecrypt.org/ and You may freely choose the location within the user interface (if there is any) of Your Product (e.g., an "About" window, etc.) and the way in which Your Product w
  6133. < ill display the respective phrase.\line \line Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt.org (or any doma
  6134. < in name that forwards to the domain name truecrypt.org) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or
  6135. <  otherwise attempt to indicate that the domain name truecrypt.org is associated with Your Product.}
  6136. ---
  6137. > \par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\sa283\f2\fs16\f2\fs16\f2\fs16 c.\tab}\ilvl0 \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\li707\ri0\lin707\rin0\fi-283\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033 {\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt (or any doma
  6138. > in name that forwards to the domain name truecrypt) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or
  6139. >  otherwise attempt to indicate that the domain name truecrypt is associated with Your Product.}
  6140. diff -b -r tc-7.1/Setup/ComSetup.cpp tc-7.2/Setup/ComSetup.cpp
  6141. 10c10
  6142. < #define TC_MAIN_COM_VERSION_MINOR 4
  6143. ---
  6144. > #define TC_MAIN_COM_VERSION_MINOR 5
  6145. diff -b -r tc-7.1/Setup/Resource.h tc-7.2/Setup/Resource.h
  6146. 19d18
  6147. < #define IDD_DONATIONS_PAGE_DLG          114
  6148. 52d50
  6149. < #define IDC_DONATE                      1032
  6150. 59c57
  6151. < #define _APS_NEXT_RESOURCE_VALUE        115
  6152. ---
  6153. > #define _APS_NEXT_RESOURCE_VALUE        114
  6154. 61c59
  6155. < #define _APS_NEXT_CONTROL_VALUE         1033
  6156. ---
  6157. > #define _APS_NEXT_CONTROL_VALUE         1032
  6158. diff -b -r tc-7.1/Setup/Setup.c tc-7.2/Setup/Setup.c
  6159. 483a484,485
  6160. >   DeleteFile ((string(szDestDir) + "\\TrueCrypt User Guide.pdf").c_str());
  6161. >
  6162. 536,537c538
  6163. <           strcpy (szTmp, TC_HOMEPAGE);
  6164. <           RegSetValueEx (hkey, "URLInfoAbout", 0, REG_SZ, (BYTE *) szTmp, strlen (szTmp) + 1);
  6165. ---
  6166. >           RegDeleteValue (hkey, "URLInfoAbout");
  6167. 661,663c662
  6168. <   strcpy (szTmp, TC_HOMEPAGE);
  6169. <   if (RegSetValueEx (hkey, "URLInfoAbout", 0, REG_SZ, (BYTE *) szTmp, strlen (szTmp) + 1) != ERROR_SUCCESS)
  6170. <       goto error;
  6171. ---
  6172. >   RegDeleteValue(hkey, "URLInfoAbout");
  6173. 1232,1233d1230
  6174. <       FILE *f;
  6175. <
  6176. 1255,1265c1252
  6177. <       IconMessage (hwndDlg, szTmp2);
  6178. <       f = fopen (szTmp2, "w");
  6179. <       if (f)
  6180. <       {
  6181. <           fprintf (f, "[InternetShortcut]\nURL=%s\n", TC_HOMEPAGE);
  6182. <
  6183. <           CheckFileStreamWriteErrors (f, szTmp2);
  6184. <           fclose (f);
  6185. <       }
  6186. <       else
  6187. <           goto error;
  6188. ---
  6189. >       DeleteFile (szTmp2);
  6190. 1742,1775d1728
  6191. <
  6192. <   if (bOK && !bUninstall && !bDowngrade && !bRepairMode && !bDevm)
  6193. <   {
  6194. <       if (!IsHiddenOSRunning())   // A hidden OS user should not see the post-install notes twice (on decoy OS and then on hidden OS).
  6195. <       {
  6196. <           if (bRestartRequired || SystemEncryptionUpdate)
  6197. <           {
  6198. <               // Restart required
  6199. <
  6200. <               if (bUpgrade)
  6201. <               {
  6202. <                   SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_RELEASE_NOTES);
  6203. <               }
  6204. <               else if (bPossiblyFirstTimeInstall)
  6205. <               {
  6206. <                   SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_TUTORIAL);
  6207. <               }
  6208. <           }
  6209. <           else
  6210. <           {
  6211. <               // No restart will be required
  6212. <
  6213. <               if (bUpgrade)
  6214. <               {
  6215. <                   bPromptReleaseNotes = TRUE;
  6216. <               }
  6217. <               else if (bPossiblyFirstTimeInstall)
  6218. <               {
  6219. <                   bPromptTutorial = TRUE;
  6220. <               }
  6221. <           }
  6222. <       }
  6223. <   }
  6224. <
  6225. 2072a2026,2027
  6226. >   else
  6227. >       WarningTopMost ("INSECURE_APP");
  6228. diff -b -r tc-7.1/Setup/Setup.h tc-7.2/Setup/Setup.h
  6229. 22d21
  6230. <   "ATrueCrypt User Guide.pdf",
  6231. 35d33
  6232. <   "TrueCrypt User Guide.pdf",
  6233. diff -b -r tc-7.1/Setup/Setup.rc tc-7.2/Setup/Setup.rc
  6234. 17c17
  6235. < // English (U.S.) resources
  6236. ---
  6237. > // English (United States) resources
  6238. 20d19
  6239. < #ifdef _WIN32
  6240. 23d21
  6241. < #endif //_WIN32
  6242. 31,32c29,30
  6243. <  FILEVERSION 7,1,1,0
  6244. <  PRODUCTVERSION 7,1,1,0
  6245. ---
  6246. >  FILEVERSION 7,2,0,0
  6247. >  PRODUCTVERSION 7,2,0,0
  6248. 49c47
  6249. <             VALUE "FileVersion", "7.1a"
  6250. ---
  6251. >             VALUE "FileVersion", "7.2"
  6252. 53c51
  6253. <             VALUE "ProductVersion", "7.1a"
  6254. ---
  6255. >             VALUE "ProductVersion", "7.2"
  6256. 139,140c137,138
  6257. <     CONTROL         107,IDC_BITMAP_SETUP_WIZARD,"Static",SS_BITMAP | SS_NOTIFY,139,3,228,30
  6258. <     CONTROL         109,IDC_SETUP_WIZARD_BKG,"Static",SS_BITMAP,0,0,11,10
  6259. ---
  6260. >     CONTROL         IDB_SETUP_WIZARD,IDC_BITMAP_SETUP_WIZARD,"Static",SS_BITMAP | SS_NOTIFY,139,3,228,30
  6261. >     CONTROL         IDB_SETUP_WIZARD_BKG,IDC_SETUP_WIZARD_BKG,"Static",SS_BITMAP,0,0,11,10
  6262. 180,187d177
  6263. < IDD_DONATIONS_PAGE_DLG DIALOGEX 0, 0, 346, 152
  6264. < STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
  6265. < EXSTYLE WS_EX_TRANSPARENT
  6266. < FONT 8, "MS Shell Dlg", 0, 0, 0x0
  6267. < BEGIN
  6268. <     PUSHBUTTON      "Donate now...",IDC_DONATE,124,94,96,14
  6269. < END
  6270. <
  6271. 294,301d283
  6272. <
  6273. <     IDD_DONATIONS_PAGE_DLG, DIALOG
  6274. <     BEGIN
  6275. <         LEFTMARGIN, 7
  6276. <         RIGHTMARGIN, 339
  6277. <         TOPMARGIN, 7
  6278. <         BOTTOMMARGIN, 147
  6279. <     END
  6280. 313c295
  6281. < #endif    // English (U.S.) resources
  6282. ---
  6283. > #endif    // English (United States) resources
  6284. diff -b -r tc-7.1/Setup/Setup.vcproj tc-7.2/Setup/Setup.vcproj
  6285. 258,261d257
  6286. <           <File
  6287. <               RelativePath="..\Common\Xml.c"
  6288. <               >
  6289. <           </File>
  6290. 326a323,326
  6291. >                   >
  6292. >               </File>
  6293. >               <File
  6294. >                   RelativePath="..\Common\Xml.c"
  6295. diff -b -r tc-7.1/Setup/Wizard.c tc-7.2/Setup/Wizard.c
  6296. 34,35c34
  6297. <   EXTRACTION_PROGRESS_PAGE,
  6298. <   DONATIONS_PAGE
  6299. ---
  6300. >   EXTRACTION_PROGRESS_PAGE
  6301. 53,54d51
  6302. < BOOL bPromptTutorial = FALSE;
  6303. < BOOL bPromptReleaseNotes = FALSE;
  6304. 58,66d54
  6305. < static HFONT hDonTextFont;
  6306. < static BOOL OsPrngAvailable;
  6307. < static HCRYPTPROV hCryptProv;
  6308. < static int DonColorSchemeId;
  6309. < static COLORREF DonTextColor;
  6310. < static COLORREF DonBkgColor;
  6311. <
  6312. < wstring DonText = L"";
  6313. <
  6314. 75,87d62
  6315. <
  6316. <   if (hCryptProv != 0)
  6317. <   {
  6318. <       OsPrngAvailable = FALSE;
  6319. <       CryptReleaseContext (hCryptProv, 0);
  6320. <       hCryptProv = 0;
  6321. <   }
  6322. <
  6323. <   if (hDonTextFont != NULL)
  6324. <   {
  6325. <       DeleteObject (hDonTextFont);
  6326. <       hDonTextFont = NULL;
  6327. <   }
  6328. 148,152d122
  6329. <
  6330. <   case DONATIONS_PAGE:
  6331. <       hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_DONATIONS_PAGE_DLG), hwndDlg,
  6332. <                    (DLGPROC) PageDialogProc);
  6333. <       break;
  6334. 172,199d141
  6335. < static int GetDonVal (int minVal, int maxVal)
  6336. < {
  6337. <   static BOOL prngInitialized = FALSE;
  6338. <   static unsigned __int8 buffer [2];
  6339. <
  6340. <   if (!prngInitialized)
  6341. <   {
  6342. <       if (!CryptAcquireContext (&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)
  6343. <           && !CryptAcquireContext (&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET))
  6344. <           OsPrngAvailable = FALSE;
  6345. <       else
  6346. <           OsPrngAvailable = TRUE;
  6347. <
  6348. <       srand ((unsigned int) time (NULL));
  6349. <       rand(); // Generate and discard the inital value, as it always appears to be somewhat non-random.
  6350. <
  6351. <       prngInitialized = TRUE;
  6352. <   }
  6353. <
  6354. <   if (OsPrngAvailable && CryptGenRandom (hCryptProv, sizeof (buffer), buffer) != 0)
  6355. <   {
  6356. <       return  ((int) ((double) *((uint16 *) buffer) / (0xFFFF+1) * (maxVal + 1 - minVal)) + minVal);
  6357. <   }
  6358. <   else
  6359. <       return  ((int) ((double) rand() / (RAND_MAX+1) * (maxVal + 1 - minVal)) + minVal);
  6360. < }
  6361. <
  6362. <
  6363. 480,567d421
  6364. <
  6365. <       case DONATIONS_PAGE:
  6366. <
  6367. <           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bExtractOnly ? "EXTRACTION_FINISHED_TITLE_DON" : (bUpgrade ? "SETUP_FINISHED_UPGRADE_TITLE_DON" : "SETUP_FINISHED_TITLE_DON")));
  6368. <           SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_INFO), GetString ("SETUP_FINISHED_INFO_DON"));
  6369. <
  6370. <           DonText = L"Please consider making a donation.";
  6371. <
  6372. <
  6373. <           // Colors
  6374. <
  6375. <           switch (DonColorSchemeId)
  6376. <           {
  6377. <           case 2:
  6378. <               // NOP - Default OS colors (foreground and background)
  6379. <               break;
  6380. <
  6381. <           case 3:
  6382. <               // Red
  6383. <               DonTextColor = RGB (255, 255, 255);
  6384. <               DonBkgColor = RGB (255, 0, 0);
  6385. <               break;
  6386. <
  6387. <           case 4:
  6388. <               // Yellow
  6389. <               DonTextColor = RGB (255, 15, 49);
  6390. <               DonBkgColor = RGB (255, 255, 0);
  6391. <               break;
  6392. <
  6393. <           case 5:
  6394. <               // Light red
  6395. <               DonTextColor = RGB (255, 255, 255);
  6396. <               DonBkgColor = RGB (255, 141, 144);
  6397. <               break;
  6398. <
  6399. <           case 6:
  6400. <               // Pink
  6401. <               DonTextColor = RGB (255, 255, 255);
  6402. <               DonBkgColor = RGB (248, 148, 207);
  6403. <               break;
  6404. <
  6405. <           case 7:
  6406. <               // White + red text
  6407. <               DonTextColor = RGB (255, 15, 49);
  6408. <               DonBkgColor = RGB (255, 255, 255);
  6409. <               break;
  6410. <
  6411. <           case 8:
  6412. <               // Blue
  6413. <               DonTextColor = RGB (255, 255, 255);
  6414. <               DonBkgColor = RGB (54, 140, 255);
  6415. <               break;
  6416. <
  6417. <           case 9:
  6418. <               // Green
  6419. <               DonTextColor = RGB (255, 255, 255);
  6420. <               DonBkgColor = RGB (70, 180, 80);
  6421. <               break;
  6422. <           }
  6423. <
  6424. <           {
  6425. <               // Font
  6426. <
  6427. <               LOGFONTW lf;
  6428. <               memset (&lf, 0, sizeof(lf));
  6429. <
  6430. <               // Main font
  6431. <               wcsncpy (lf.lfFaceName, L"Times New Roman", sizeof (lf.lfFaceName)/2);
  6432. <               lf.lfHeight = CompensateDPIFont (-21);
  6433. <               lf.lfWeight = FW_NORMAL;
  6434. <               lf.lfWidth = 0;
  6435. <               lf.lfEscapement = 0;
  6436. <               lf.lfOrientation = 0;
  6437. <               lf.lfItalic = FALSE;
  6438. <               lf.lfUnderline = FALSE;
  6439. <               lf.lfStrikeOut = FALSE;
  6440. <               lf.lfCharSet = DEFAULT_CHARSET;
  6441. <               lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
  6442. <               lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
  6443. <               lf.lfQuality = PROOF_QUALITY;
  6444. <               lf.lfPitchAndFamily = FF_DONTCARE;
  6445. <               hDonTextFont = CreateFontIndirectW (&lf);
  6446. <
  6447. <               if (hDonTextFont == NULL)
  6448. <                   AbortProcessSilent ();
  6449. <           }
  6450. <
  6451. <           return 1;
  6452. 572,576d425
  6453. <   case WM_HELP:
  6454. <       if (bLicenseAccepted)
  6455. <           OpenPageHelp (GetParent (hwndDlg), nCurPageNo);
  6456. <
  6457. <       return 1;
  6458. 580,582d428
  6459. <       bPromptTutorial = FALSE;
  6460. <       bPromptReleaseNotes = FALSE;
  6461. <
  6462. 679,740d524
  6463. <       if (nCurPageNo == DONATIONS_PAGE)
  6464. <       {
  6465. <           switch (lw)
  6466. <           {
  6467. <           case IDC_DONATE:
  6468. <               {
  6469. <                   char tmpstr [200];
  6470. <
  6471. <                   sprintf (tmpstr, "&ref=%d", DonColorSchemeId);
  6472. <
  6473. <                   Applink ("donate", FALSE, tmpstr);
  6474. <               }
  6475. <               return 1;
  6476. <           }
  6477. <       }
  6478. <
  6479. <       return 0;
  6480. <
  6481. <
  6482. <   case WM_PAINT:
  6483. <
  6484. <       if (nCurPageNo == DONATIONS_PAGE)
  6485. <       {
  6486. <           PAINTSTRUCT tmpPaintStruct;
  6487. <           HDC hdc = BeginPaint (hCurPage, &tmpPaintStruct);
  6488. <
  6489. <           if (hdc == NULL)
  6490. <               AbortProcessSilent ();
  6491. <
  6492. <           SelectObject (hdc, hDonTextFont);
  6493. <
  6494. <           if (DonColorSchemeId != 2)
  6495. <           {
  6496. <               HBRUSH tmpBrush = CreateSolidBrush (DonBkgColor);
  6497. <
  6498. <               if (tmpBrush == NULL)
  6499. <                   AbortProcessSilent ();
  6500. <
  6501. <               RECT trect;
  6502. <
  6503. <               trect.left = 0;
  6504. <               trect.right = CompensateXDPI (526);
  6505. <               trect.top  = 0;
  6506. <               trect.bottom = CompensateYDPI (246);
  6507. <
  6508. <               FillRect (hdc, &trect, tmpBrush);
  6509. <
  6510. <               SetTextColor (hdc, DonTextColor);
  6511. <               SetBkColor (hdc, DonBkgColor);
  6512. <           }
  6513. <
  6514. <           SetTextAlign(hdc, TA_CENTER);
  6515. <
  6516. <           TextOutW (hdc,
  6517. <               CompensateXDPI (258),
  6518. <               CompensateYDPI (70),
  6519. <               DonText.c_str(),
  6520. <               DonText.length());
  6521. <          
  6522. <           EndPaint (hCurPage, &tmpPaintStruct);
  6523. <           ReleaseDC (hCurPage, hdc);
  6524. <       }
  6525. 843,844d626
  6526. <           DonColorSchemeId = GetDonVal (2, 9);
  6527. <
  6528. 872,877d653
  6529. <   case WM_HELP:
  6530. <       if (bLicenseAccepted)
  6531. <           OpenPageHelp (hwndDlg, nCurPageNo);
  6532. <
  6533. <       return 1;
  6534. <
  6535. 880,886d655
  6536. <       if (lw == IDHELP)
  6537. <       {
  6538. <           if (bLicenseAccepted)
  6539. <               OpenPageHelp (hwndDlg, nCurPageNo);
  6540. <
  6541. <           return 1;
  6542. <       }
  6543. 906,908d674
  6544. <                   WarningDirect (L"Warning: Please note that this may be the last version of TrueCrypt that supports Windows 2000. If you want to be able to upgrade to future versions of TrueCrypt (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).");
  6545. <
  6546. <
  6547. 964,972d729
  6548. <           else if (nCurPageNo == DONATIONS_PAGE)
  6549. <           {
  6550. <               // 'Finish' button clicked
  6551. <
  6552. <               PostMessage (hwndDlg, WM_CLOSE, 0, 0);
  6553. <
  6554. <               return 1;
  6555. <           }
  6556. <
  6557. 1004,1034d760
  6558. <
  6559. <   case WM_PAINT:
  6560. <
  6561. <       if (nCurPageNo == DONATIONS_PAGE && DonColorSchemeId != 2)
  6562. <       {
  6563. <           HWND hwndItem = GetDlgItem (MainDlg, IDC_MAIN_CONTENT_CANVAS);
  6564. <
  6565. <           PAINTSTRUCT tmpPaintStruct;
  6566. <           HDC hdc = BeginPaint (hwndItem, &tmpPaintStruct);
  6567. <
  6568. <           if (DonColorSchemeId != 2)
  6569. <           {
  6570. <               HBRUSH tmpBrush = CreateSolidBrush (DonBkgColor);
  6571. <              
  6572. <               RECT trect;
  6573. <
  6574. <               trect.left = CompensateXDPI (1);
  6575. <               trect.right = CompensateXDPI (560);
  6576. <               trect.top  = CompensateYDPI (DonColorSchemeId == 7 ? 11 : 0);
  6577. <               trect.bottom = CompensateYDPI (260);
  6578. <
  6579. <               FillRect (hdc, &trect, tmpBrush);
  6580. <           }
  6581. <                  
  6582. <           EndPaint(hwndItem, &tmpPaintStruct);
  6583. <           ReleaseDC (hwndItem, hdc);
  6584. <       }
  6585. <       return 0;
  6586. <
  6587. <
  6588. <
  6589. 1058,1061d783
  6590. <
  6591. <       nCurPageNo = DONATIONS_PAGE;
  6592. <       LoadPage (hwndDlg, DONATIONS_PAGE);
  6593. <
  6594. 1071d792
  6595. <
  6596. 1120,1122d840
  6597. <       nCurPageNo = DONATIONS_PAGE;
  6598. <       LoadPage (hwndDlg, DONATIONS_PAGE);
  6599. <
  6600. 1169,1186d886
  6601. <           }
  6602. <           else
  6603. <           {
  6604. <               if (bPromptReleaseNotes
  6605. <                   && AskYesNo ("AFTER_UPGRADE_RELEASE_NOTES") == IDYES)
  6606. <               {
  6607. <                   Applink ("releasenotes", TRUE, "");
  6608. <               }
  6609. <
  6610. <               bPromptReleaseNotes = FALSE;
  6611. <
  6612. <               if (bPromptTutorial
  6613. <                   && AskYesNo ("AFTER_INSTALL_TUTORIAL") == IDYES)
  6614. <               {
  6615. <                   Applink ("beginnerstutorial", TRUE, "");
  6616. <               }
  6617. <
  6618. <               bPromptTutorial = FALSE;
  6619. diff -b -r tc-7.1/Setup/Wizard.h tc-7.2/Setup/Wizard.h
  6620. 24,26d23
  6621. < extern BOOL bPromptTutorial;
  6622. < extern BOOL bPromptReleaseNotes;
  6623. <
Add Comment
Please, Sign In to add comment