"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "DriveFilter.h" see the
Fossies "Dox" file reference documentation.
1 /*
2 Derived from source code of TrueCrypt 7.1a, which is
3 Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
4 by the TrueCrypt License 3.0.
5
6 Modifications and additions to the original source code (contained in this file)
7 and all other portions of this file are Copyright (c) 2013-2017 IDRIX
8 and are governed by the Apache License 2.0 the full text of which is
9 contained in the file License.txt included in VeraCrypt binary and source
10 code distribution packages.
11 */
12
13 #ifndef TC_HEADER_DRIVER_DRIVE_FILTER
14 #define TC_HEADER_DRIVER_DRIVE_FILTER
15
16 #include "TCdefs.h"
17 #include "Boot/Windows/BootCommon.h"
18 #include "EncryptedIoQueue.h"
19
20 typedef struct _DriveFilterExtension
21 {
22 BOOL bRootDevice;
23 BOOL IsVolumeDevice;
24 BOOL IsDriveFilterDevice;
25 BOOL IsVolumeFilterDevice;
26 uint64 MagicNumber;
27
28 PDEVICE_OBJECT DeviceObject;
29 PDEVICE_OBJECT LowerDeviceObject;
30 PDEVICE_OBJECT Pdo;
31
32 ULONG SystemStorageDeviceNumber;
33 BOOL SystemStorageDeviceNumberValid;
34
35 int64 ConfiguredEncryptedAreaStart;
36 int64 ConfiguredEncryptedAreaEnd;
37
38 uint32 VolumeHeaderSaltCrc32;
39 EncryptedIoQueue Queue;
40
41 BOOL BootDrive;
42 BOOL VolumeHeaderPresent;
43 BOOL DriveMounted;
44
45 KEVENT MountWorkItemCompletedEvent;
46
47 CRYPTO_INFO *HeaderCryptoInfo;
48 BOOL HiddenSystem;
49
50 } DriveFilterExtension;
51
52 #define TC_BOOT_DRIVE_FILTER_EXTENSION_MAGIC_NUMBER 0x5645524142455854
53
54 extern BOOL BootArgsValid;
55 extern BootArguments BootArgs;
56 extern PKTHREAD EncryptionSetupThread;
57 extern PKTHREAD DecoySystemWipeThread;
58
59 NTSTATUS AbortBootEncryptionSetup ();
60 NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo);
61 NTSTATUS DriveFilterDispatchIrp (PDEVICE_OBJECT DeviceObject, PIRP Irp);
62 void GetBootDriveVolumeProperties (PIRP irp, PIO_STACK_LOCATION irpSp);
63 void GetBootEncryptionAlgorithmName (PIRP irp, PIO_STACK_LOCATION irpSp);
64 void GetBootEncryptionStatus (PIRP irp, PIO_STACK_LOCATION irpSp);
65 void GetBootLoaderVersion (PIRP irp, PIO_STACK_LOCATION irpSp);
66 void GetBootLoaderFingerprint (PIRP irp, PIO_STACK_LOCATION irpSp);
67 NTSTATUS GetSetupResult ();
68 DriveFilterExtension *GetBootDriveFilterExtension ();
69 CRYPTO_INFO *GetSystemDriveCryptoInfo ();
70 BOOL IsBootDriveMounted ();
71 BOOL IsBootEncryptionSetupInProgress ();
72 BOOL IsHiddenSystemRunning ();
73 NTSTATUS LoadBootArguments ();
74 static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension);
75 NTSTATUS StartBootEncryptionSetup (PDEVICE_OBJECT DeviceObject, PIRP irp, PIO_STACK_LOCATION irpSp);
76 void ReopenBootVolumeHeader (PIRP irp, PIO_STACK_LOCATION irpSp);
77 NTSTATUS StartDecoySystemWipe (PDEVICE_OBJECT DeviceObject, PIRP irp, PIO_STACK_LOCATION irpSp);
78 void StartLegacyHibernationDriverFilter ();
79 NTSTATUS AbortDecoySystemWipe ();
80 BOOL IsDecoySystemWipeInProgress();
81 NTSTATUS GetDecoySystemWipeResult();
82 void GetDecoySystemWipeStatus (PIRP irp, PIO_STACK_LOCATION irpSp);
83 uint64 GetBootDriveLength ();
84 NTSTATUS WriteBootDriveSector (PIRP irp, PIO_STACK_LOCATION irpSp);
85
86 #define TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE (1536 * 1024)
87 #define TC_ENCRYPTION_SETUP_HEADER_UPDATE_THRESHOLD (64 * 1024 * 1024)
88 #define TC_HIBERNATION_WRITE_BUFFER_SIZE (128 * 1024)
89
90 #endif // TC_HEADER_DRIVER_DRIVE_FILTER