-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
63,289 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
Copyright 2013-2015 IDRIX | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
____________________________________________________________ | ||
|
||
Copyright (c) 2008-2012 TrueCrypt Developers Association. All rights reserved. | ||
|
||
Governed by the TrueCrypt License 3.0 the full text of which is contained in | ||
the file License.txt included in TrueCrypt binary and source code distribution | ||
packages. | ||
____________________________________________________________ | ||
|
||
License agreement for Encryption for the Masses. | ||
|
||
Copyright (C) 1998-2000 Paul Le Roux. All Rights Reserved. | ||
|
||
This product can be copied and distributed free of charge, | ||
including source code. | ||
|
||
You may modify this product and source code, and distribute such | ||
modifications, and you may derive new works based on this | ||
product, provided that: | ||
|
||
1. Any product which is simply derived from this product cannot | ||
be called E4M, or Encryption for the Masses. | ||
|
||
2. If you use any of the source code in your product, and your | ||
product is distributed with source code, you must include this | ||
notice with those portions of this source code that you use. | ||
|
||
Or, | ||
|
||
If your product is distributed in binary form only, you must | ||
display on any packaging, and marketing materials which | ||
reference your product, a notice which states: | ||
|
||
"This product uses components written by Paul Le Roux | ||
<[email protected]>" | ||
|
||
3. If you use any of the source code originally by Eric Young, | ||
you must in addition follow his terms and conditions. | ||
|
||
4. Nothing requires that you accept this License, as you have | ||
not signed it. However, nothing else grants you permission to | ||
modify or distribute the product or its derivative works. | ||
|
||
These actions are prohibited by law if you do not accept this | ||
License. | ||
|
||
5. If any of these license terms is found to be to broad in | ||
scope, and declared invalid by any court or legal process, you | ||
agree that all other terms shall not be so affected, and shall | ||
remain valid and enforceable. | ||
|
||
6. THIS PROGRAM IS DISTRIBUTED FREE OF CHARGE, THEREFORE THERE | ||
IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | ||
APPLICABLE LAW. UNLESS OTHERWISE STATED THE PROGRAM IS PROVIDED | ||
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR | ||
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE | ||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS | ||
WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE | ||
COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
|
||
7. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | ||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY | ||
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE | ||
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, | ||
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR | ||
INABILITY TO USE THE PROGRAM, INCLUDING BUT NOT LIMITED TO LOSS | ||
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | ||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH | ||
ANY OTHER PROGRAMS, EVEN IF SUCH HOLDER OR OTHER PARTY HAD | ||
PREVIOUSLY BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||
____________________________________________________________ | ||
|
||
Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. | ||
All rights reserved. | ||
|
||
LICENSE TERMS | ||
|
||
The free distribution and use of this software is allowed (with | ||
or without changes) provided that: | ||
|
||
1. source code distributions include the above copyright | ||
notice, this list of conditions and the following | ||
disclaimer; | ||
|
||
2. binary distributions include the above copyright notice, | ||
this list of conditions and the following disclaimer in | ||
their documentation; | ||
|
||
3. the name of the copyright holder is not used to endorse | ||
products built using this software without specific written | ||
permission. | ||
|
||
DISCLAIMER | ||
|
||
This software is provided 'as is' with no explicit or implied | ||
warranties in respect of its properties, including, but not | ||
limited to, correctness and/or fitness for purpose. | ||
____________________________________________________________ | ||
|
||
Copyright (C) 2002-2004 Mark Adler, all rights reserved | ||
version 1.8, 9 Jan 2004 | ||
|
||
This software is provided 'as-is', without any express or | ||
implied warranty. In no event will the author be held liable | ||
for any damages arising from the use of this software. | ||
|
||
Permission is granted to anyone to use this software for any | ||
purpose, including commercial applications, and to alter it and | ||
redistribute it freely, subject to the following restrictions: | ||
|
||
1. The origin of this software must not be misrepresented; you | ||
must not claim that you wrote the original software. If you | ||
use this software in a product, an acknowledgment in the | ||
product documentation would be appreciated but is not | ||
required. | ||
2. Altered source versions must be plainly marked as such, and | ||
must not be misrepresented as being the original software. | ||
3. This notice may not be removed or altered from any source | ||
distribution. | ||
____________________________________________________________ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
/* | ||
Copyright (c) 2013-2016 IDRIX. All rights reserved. | ||
Governed by the Apache License 2.0 the full text of which is | ||
contained in the file License.txt included in VeraCrypt binary and source | ||
code distribution packages. | ||
*/ | ||
|
||
|
||
// ConcealDrive.cpp : main source file for ConcealDrive.exe | ||
// | ||
|
||
#include "stdafx.h" | ||
|
||
#include <atlframe.h> | ||
#include <atlctrls.h> | ||
#include <atldlgs.h> | ||
|
||
#include "resource.h" | ||
|
||
#include "MainDlg.h" | ||
|
||
CAppModule _Module; | ||
|
||
int ScreenDPI = USER_DEFAULT_SCREEN_DPI; | ||
double DPIScaleFactorX = 1; | ||
double DPIScaleFactorY = 1; | ||
double DlgAspectRatio = 1; | ||
|
||
// This function currently serves the following purposes: | ||
// - Determines scaling factors for current screen DPI and GUI aspect ratio. | ||
// - Determines how Windows skews the GUI aspect ratio (which happens when the user has a non-default DPI). | ||
// The determined values must be used when performing some GUI operations and calculations. | ||
BOOL CALLBACK AuxiliaryDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) | ||
{ | ||
switch (msg) | ||
{ | ||
case WM_INITDIALOG: | ||
{ | ||
HDC hDC = GetDC (hwndDlg); | ||
|
||
if (hDC) | ||
{ | ||
ScreenDPI = GetDeviceCaps (hDC, LOGPIXELSY); | ||
ReleaseDC (hwndDlg, hDC); | ||
} | ||
|
||
DPIScaleFactorX = 1; | ||
DPIScaleFactorY = 1; | ||
DlgAspectRatio = 1; | ||
|
||
if (ScreenDPI != USER_DEFAULT_SCREEN_DPI) | ||
{ | ||
// Windows skews the GUI aspect ratio if the user has a non-default DPI. Hence, working with | ||
// actual screen DPI is redundant and leads to incorrect results. What really matters here is | ||
// how Windows actually renders our GUI. This is determined by comparing the expected and current | ||
// sizes of a hidden calibration text field. | ||
|
||
RECT trec; | ||
|
||
trec.right = 0; | ||
trec.bottom = 0; | ||
|
||
GetClientRect (GetDlgItem (hwndDlg, IDC_ASPECT_RATIO_CALIBRATION_BOX), &trec); | ||
|
||
if (trec.right != 0 && trec.bottom != 0) | ||
{ | ||
// The size of the 282x282 IDC_ASPECT_RATIO_CALIBRATION_BOX rendered at the default DPI (96) is 423x458 | ||
DPIScaleFactorX = (double) trec.right / 423; | ||
DPIScaleFactorY = (double) trec.bottom / 458; | ||
DlgAspectRatio = DPIScaleFactorX / DPIScaleFactorY; | ||
} | ||
} | ||
|
||
EndDialog (hwndDlg, 0); | ||
return 1; | ||
} | ||
|
||
case WM_CLOSE: | ||
EndDialog (hwndDlg, 0); | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
RTLINITUNICODESTRING RtlInitUnicodeString = NULL; | ||
NTOPENSYMBOLICLINKOBJECT NtOpenSymbolicLinkObject = NULL; | ||
NTQUERYSYMBOLICLINKOBJECT NtQuerySymbolicLinkObject = NULL; | ||
NTCLOSE NtClose= NULL; | ||
|
||
|
||
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpstrCmdLine*/, int /*nCmdShow*/) | ||
{ | ||
HRESULT hRes = ::CoInitialize(NULL); | ||
// If you are running on NT 4.0 or higher you can use the following call instead to | ||
// make the EXE free threaded. This means that calls come in on a random RPC thread. | ||
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); | ||
ATLASSERT(SUCCEEDED(hRes)); | ||
|
||
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used | ||
::DefWindowProc(NULL, 0, 0, 0L); | ||
|
||
AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls | ||
|
||
hRes = _Module.Init(NULL, hInstance); | ||
ATLASSERT(SUCCEEDED(hRes)); | ||
|
||
HMODULE _hModule = LoadLibrary(_T("ntdll.dll")); | ||
|
||
RtlInitUnicodeString = (RTLINITUNICODESTRING)GetProcAddress(_hModule, "RtlInitUnicodeString"); | ||
NtOpenSymbolicLinkObject = (NTOPENSYMBOLICLINKOBJECT)GetProcAddress(_hModule, "NtOpenSymbolicLinkObject"); | ||
NtQuerySymbolicLinkObject = (NTQUERYSYMBOLICLINKOBJECT)GetProcAddress(_hModule, "NtQuerySymbolicLinkObject"); | ||
NtClose = (NTCLOSE) GetProcAddress(_hModule, "NtClose"); | ||
|
||
// DPI and GUI aspect ratio | ||
DialogBoxParamW (hInstance, MAKEINTRESOURCEW (IDD_DPI), NULL, | ||
(DLGPROC) AuxiliaryDlgProc, (LPARAM) 1); | ||
|
||
int nRet = 0; | ||
// BLOCK: Run application | ||
{ | ||
CMainDlg dlgMain; | ||
nRet = dlgMain.DoModal(); | ||
} | ||
|
||
_Module.Term(); | ||
::CoUninitialize(); | ||
|
||
return nRet; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// ConcealDrive.h |
Oops, something went wrong.