亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dlgcode.c

?? turecrypt6.0版本的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
 Legal Notice: Some portions of the source code contained in this file were
 derived from the source code of Encryption for the Masses 2.02a, which is
 Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
 Agreement for Encryption for the Masses'. Modifications and additions to
 the original source code (contained in this file) and all other portions of
 this file are Copyright (c) 2003-2008 TrueCrypt Foundation and are governed
 by the TrueCrypt License 2.5 the full text of which is contained in the
 file License.txt included in TrueCrypt binary and source code distribution
 packages. */

#include "Tcdefs.h"

#include <dbt.h>
#include <fcntl.h>
#include <io.h>
#include <math.h>
#include <shlobj.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <time.h>

#include "Resource.h"

#include "Apidrvr.h"
#include "BootEncryption.h"
#include "Combo.h"
#include "Crc.h"
#include "Crypto.h"
#include "Dictionary.h"
#include "Dlgcode.h"
#include "EncryptionThreadPool.h"
#include "Endian.h"
#include "Language.h"
#include "Keyfiles.h"
#include "Mount/Mount.h"
#include "Pkcs5.h"
#include "Random.h"
#include "Registry.h"
#include "Tests.h"
#include "Volumes.h"
#include "Wipe.h"
#include "Xml.h"
#include "Xts.h"

using namespace TrueCrypt;

#ifdef VOLFORMAT
#include "Format/Tcformat.h"
#endif

#ifdef SETUP
#include "Setup/Setup.h"
#endif

LONG DriverVersion;

char *LastDialogId;
char szHelpFile[TC_MAX_PATH];
char szHelpFile2[TC_MAX_PATH];
HFONT hFixedDigitFont = NULL;
HFONT hBoldFont = NULL;
HFONT hTitleFont = NULL;
HFONT hFixedFont = NULL;

HFONT hUserFont = NULL;
HFONT hUserUnderlineFont = NULL;
HFONT hUserBoldFont = NULL;
HFONT hUserUnderlineBoldFont = NULL;

int ScreenDPI = USER_DEFAULT_SCREEN_DPI;
double DPIScaleFactorX = 1;
double DPIScaleFactorY = 1;
double DlgAspectRatio = 1;

HWND MainDlg = NULL;
wchar_t *lpszTitle = NULL;

BOOL Silent = FALSE;
BOOL bPreserveTimestamp = TRUE;
BOOL bStartOnLogon = FALSE;
BOOL bMountDevicesOnLogon = FALSE;
BOOL bMountFavoritesOnLogon = FALSE;

BOOL bHistory = FALSE;

// Status of detection of hidden sectors (whole-system-drive encryption). 
// 0 - Unknown/undetermined/success, 1: Detection is or was in progress (but did not complete e.g. due to system crash).
int HiddenSectorDetectionStatus = 0;	

int nCurrentOS = 0;
int CurrentOSMajor = 0;
int CurrentOSMinor = 0;
int CurrentOSServicePack = 0;
BOOL RemoteSession = FALSE;
BOOL UacElevated = FALSE;

BOOL bTravelerModeConfirmed = FALSE;		// TRUE if it is certain that the instance is running in traveler mode

/* Globals used by Mount and Format (separately per instance) */ 
BOOL KeyFilesEnable = FALSE;
KeyFile	*FirstKeyFile = NULL;
KeyFilesDlgParam		defaultKeyFilesParam;

BOOL IgnoreWmDeviceChange = FALSE;

/* Handle to the device driver */
HANDLE hDriver = INVALID_HANDLE_VALUE;

/* This mutex is used to prevent multiple instances of the wizard or main app from dealing with system encryption */
volatile HANDLE hSysEncMutex = NULL;		

/* This mutex is used to prevent multiple instances of the wizard or main app from trying to install or
register the driver or from trying to launch it in traveler mode at the same time. */
volatile HANDLE hDriverSetupMutex = NULL;

/* This mutex is used to prevent users from running the main TrueCrypt app or the wizard while an instance
of the TrueCrypt installer is running (which is also useful for enforcing restart before the apps can be used). */
volatile HANDLE hAppSetupMutex = NULL;

HINSTANCE hInst = NULL;
HCURSOR hCursor = NULL;

ATOM hDlgClass, hSplashClass;

/* This value may changed only by calling ChangeSystemEncryptionStatus(). Only the wizard can change it
(others may still read it though). */
int SystemEncryptionStatus = SYSENC_STATUS_NONE;	

/* Only the wizard can change this value (others may only read it). */
WipeAlgorithmId nWipeMode = TC_WIPE_NONE;

BOOL bSysPartitionSelected = FALSE;		/* TRUE if the user selected the system partition via the Select Device dialog */
BOOL bSysDriveSelected = FALSE;			/* TRUE if the user selected the system drive via the Select Device dialog */

/* To populate these arrays, call GetSysDevicePaths(). If they contain valid paths, bCachedSysDevicePathsValid is TRUE. */
char SysPartitionDevicePath [TC_MAX_PATH];
char SysDriveDevicePath [TC_MAX_PATH];
char bCachedSysDevicePathsValid = FALSE;
BOOL bRawDevicesDlgProcInstantExit = FALSE;

BOOL bHyperLinkBeingTracked = FALSE;

int WrongPwdRetryCounter = 0;

static FILE *ConfigFileHandle;
char *ConfigBuffer;

#define RANDPOOL_DISPLAY_REFRESH_INTERVAL	30
#define RANDPOOL_DISPLAY_ROWS 20
#define RANDPOOL_DISPLAY_COLUMNS 32

/* Windows dialog class */
#define WINDOWS_DIALOG_CLASS "#32770"

/* Custom class names */
#define TC_DLG_CLASS "CustomDlg"
#define TC_SPLASH_CLASS "SplashDlg"

/* Benchmarks */

#ifndef SETUP

#define BENCHMARK_MAX_ITEMS 100
#define BENCHMARK_DEFAULT_BUF_SIZE	BYTES_PER_MB
#define HASH_FNC_BENCHMARKS	FALSE 	// For development purposes only. Must be FALSE when building a public release.
#define PKCS5_BENCHMARKS	FALSE	// For development purposes only. Must be FALSE when building a public release.
#if PKCS5_BENCHMARKS && HASH_FNC_BENCHMARKS
#error PKCS5_BENCHMARKS and HASH_FNC_BENCHMARKS are both TRUE (at least one of them should be FALSE).
#endif

enum 
{
	BENCHMARK_SORT_BY_NAME = 0,
	BENCHMARK_SORT_BY_SPEED
};

typedef struct 
{
	int id;
	char name[100];
	unsigned __int64 encSpeed;
	unsigned __int64 decSpeed;
	unsigned __int64 meanBytesPerSec;
} BENCHMARK_REC;

BENCHMARK_REC benchmarkTable [BENCHMARK_MAX_ITEMS];
int benchmarkTotalItems = 0;
int benchmarkBufferSize = BENCHMARK_DEFAULT_BUF_SIZE;
int benchmarkLastBufferSize = BENCHMARK_DEFAULT_BUF_SIZE;
int benchmarkSortMethod = BENCHMARK_SORT_BY_SPEED;
LARGE_INTEGER benchmarkPerformanceFrequency;

#endif	// #ifndef SETUP


void cleanup ()
{
	/* Cleanup the GDI fonts */
	if (hFixedFont != NULL)
		DeleteObject (hFixedFont);
	if (hFixedDigitFont != NULL)
		DeleteObject (hFixedDigitFont);
	if (hBoldFont != NULL)
		DeleteObject (hBoldFont);
	if (hTitleFont != NULL)
		DeleteObject (hTitleFont);
	if (hUserFont != NULL)
		DeleteObject (hUserFont);
	if (hUserUnderlineFont != NULL)
		DeleteObject (hUserUnderlineFont);
	if (hUserBoldFont != NULL)
		DeleteObject (hUserBoldFont);
	if (hUserUnderlineBoldFont != NULL)
		DeleteObject (hUserUnderlineBoldFont);

	/* Cleanup our dialog class */
	if (hDlgClass)
		UnregisterClass (TC_DLG_CLASS, hInst);
	if (hSplashClass)
		UnregisterClass (TC_SPLASH_CLASS, hInst);

	/* Close the device driver handle */
	if (hDriver != INVALID_HANDLE_VALUE)
	{
		// Unload driver mode if possible (non-install mode) 
		if (IsNonInstallMode ())
		{
			// If a dismount was forced in the lifetime of the driver, Windows may later prevent it to be loaded again from
			// the same path. Therefore, the driver will not be unloaded even though it was loaded in non-install mode.
			int refDevDeleted;
			DWORD dwResult;

			if (!DeviceIoControl (hDriver, TC_IOCTL_WAS_REFERENCED_DEVICE_DELETED, NULL, 0, &refDevDeleted, sizeof (refDevDeleted), &dwResult, NULL))
				refDevDeleted = 0;

			if (!refDevDeleted)
				DriverUnload ();
			else
			{
				CloseHandle (hDriver);
				hDriver = INVALID_HANDLE_VALUE;
			}
		}
		else
		{
			CloseHandle (hDriver);
			hDriver = INVALID_HANDLE_VALUE;
		}
	}

	if (ConfigBuffer != NULL)
	{
		free (ConfigBuffer);
		ConfigBuffer = NULL;
	}

	CoUninitialize ();

	CloseSysEncMutex ();

#ifndef SETUP
	EncryptionThreadPoolStop();
#endif
}


void
LowerCaseCopy (char *lpszDest, char *lpszSource)
{
	int i = strlen (lpszSource);

	lpszDest[i] = 0;
	while (--i >= 0)
	{
		lpszDest[i] = (char) tolower (lpszSource[i]);
	}

}

void
UpperCaseCopy (char *lpszDest, char *lpszSource)
{
	int i = strlen (lpszSource);

	lpszDest[i] = 0;
	while (--i >= 0)
	{
		lpszDest[i] = (char) toupper (lpszSource[i]);
	}
}


BOOL IsVolumeDeviceHosted (char *lpszDiskFile)
{
	return strstr (lpszDiskFile, "\\Device\\") == lpszDiskFile
		|| strstr (lpszDiskFile, "\\DEVICE\\") == lpszDiskFile;
}


void
CreateFullVolumePath (char *lpszDiskFile, char *lpszFileName, BOOL * bDevice)
{
	if (strcmp (lpszFileName, "Floppy (A:)") == 0)
		strcpy (lpszFileName, "\\Device\\Floppy0");
	else if (strcmp (lpszFileName, "Floppy (B:)") == 0)
		strcpy (lpszFileName, "\\Device\\Floppy1");

	UpperCaseCopy (lpszDiskFile, lpszFileName);

	*bDevice = FALSE;

	if (memcmp (lpszDiskFile, "\\DEVICE", sizeof (char) * 7) == 0)
	{
		*bDevice = TRUE;
	}

	strcpy (lpszDiskFile, lpszFileName);

#if _DEBUG
	OutputDebugString ("CreateFullVolumePath: ");
	OutputDebugString (lpszDiskFile);
	OutputDebugString ("\n");
#endif

}

int
FakeDosNameForDevice (char *lpszDiskFile, char *lpszDosDevice, char *lpszCFDevice, BOOL bNameOnly)
{
	BOOL bDosLinkCreated = TRUE;
	sprintf (lpszDosDevice, "truecrypt%lu", GetCurrentProcessId ());

	if (bNameOnly == FALSE)
		bDosLinkCreated = DefineDosDevice (DDD_RAW_TARGET_PATH, lpszDosDevice, lpszDiskFile);

	if (bDosLinkCreated == FALSE)
		return ERR_OS_ERROR;
	else
		sprintf (lpszCFDevice, "\\\\.\\%s", lpszDosDevice);

	return 0;
}

int
RemoveFakeDosName (char *lpszDiskFile, char *lpszDosDevice)
{
	BOOL bDosLinkRemoved = DefineDosDevice (DDD_RAW_TARGET_PATH | DDD_EXACT_MATCH_ON_REMOVE |
			DDD_REMOVE_DEFINITION, lpszDosDevice, lpszDiskFile);
	if (bDosLinkRemoved == FALSE)
	{
		return ERR_OS_ERROR;
	}

	return 0;
}


void
AbortProcess (char *stringId)
{
	// Note that this function also causes localcleanup() to be called (see atexit())
	MessageBeep (MB_ICONEXCLAMATION);
	MessageBoxW (NULL, GetString (stringId), lpszTitle, ICON_HAND);
	exit (1);
}

void
AbortProcessSilent (void)
{
	// Note that this function also causes localcleanup() to be called (see atexit())
	exit (1);
}

void *
err_malloc (size_t size)
{
	void *z = (void *) TCalloc (size);
	if (z)
		return z;
	AbortProcess ("OUTOFMEMORY");
	return 0;
}

char *
err_strdup (char *lpszText)
{
	int j = (strlen (lpszText) + 1) * sizeof (char);
	char *z = (char *) err_malloc (j);
	memmove (z, lpszText, j);
	return z;
}

DWORD
handleWin32Error (HWND hwndDlg)
{
	PWSTR lpMsgBuf;
	DWORD dwError = GetLastError ();

	if (Silent || dwError == 0 || dwError == ERROR_INVALID_WINDOW_HANDLE)
		return dwError;

	// Access denied
	if (dwError == ERROR_ACCESS_DENIED && !IsAdmin ())
	{
		Error ("ERR_ACCESS_DENIED");
		SetLastError (dwError);		// Preserve the original error code
		return dwError;
	}

	FormatMessageW (
		FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
			      NULL,
			      dwError,
			      MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),	/* Default language */
			      (PWSTR) &lpMsgBuf,
			      0,
			      NULL
	    );

	MessageBoxW (hwndDlg, lpMsgBuf, lpszTitle, ICON_HAND);
	LocalFree (lpMsgBuf);

	// User-friendly hardware error explanation
	if (dwError == ERROR_CRC || dwError == ERROR_IO_DEVICE || dwError == ERROR_BAD_CLUSTERS
		|| dwError == ERROR_SEM_TIMEOUT) // Semaphore timeout is sometimes reported instead of an I/O error
	{
		Error ("ERR_HARDWARE_ERROR");
	}

	// Device not ready
	if (dwError == ERROR_NOT_READY)
		CheckSystemAutoMount();

	SetLastError (dwError);		// Preserve the original error code

	return dwError;
}

BOOL
translateWin32Error (wchar_t *lpszMsgBuf, int nWSizeOfBuf)
{
	DWORD dwError = GetLastError ();

	if (FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError,
			   MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),	/* Default language */
			   lpszMsgBuf, nWSizeOfBuf, NULL))
	{
		SetLastError (dwError);		// Preserve the original error code
		return TRUE;
	}

	SetLastError (dwError);			// Preserve the original error code
	return FALSE;
}


// If the user has a non-default screen DPI, all absolute font sizes must be
// converted using this function.
int CompensateDPIFont (int val)
{
	if (ScreenDPI == USER_DEFAULT_SCREEN_DPI)
		return val;
	else
	{
		double tmpVal = (double) val * DPIScaleFactorY * DlgAspectRatio * 0.999;

		if (tmpVal > 0)
			return (int) floor(tmpVal);
		else
			return (int) ceil(tmpVal);
	}
}


// If the user has a non-default screen DPI, some screen coordinates and sizes must
// be converted using this function
int CompensateXDPI (int val)
{
	if (ScreenDPI == USER_DEFAULT_SCREEN_DPI)
		return val;
	else
	{
		double tmpVal = (double) val * DPIScaleFactorX;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区精品久久久| 一区二区三区欧美| 欧美成人欧美edvon| 欧美三片在线视频观看| 91美女福利视频| 一本到三区不卡视频| 91尤物视频在线观看| 不卡电影一区二区三区| 99热这里都是精品| 91影视在线播放| 91福利精品视频| 欧美日韩免费一区二区三区视频| 欧美日本在线视频| 欧美久久久久久蜜桃| 91精品国产乱码久久蜜臀| 91精品国产欧美一区二区成人| 337p亚洲精品色噜噜狠狠| 欧美一级欧美三级在线观看 | 91久久一区二区| 色诱亚洲精品久久久久久| 色94色欧美sute亚洲13| 欧美丝袜自拍制服另类| 91精品国产品国语在线不卡| 日韩视频一区在线观看| 久久综合九色综合97婷婷| 国产精品美女久久久久久久久| 亚洲同性gay激情无套| 一区二区三区中文字幕| 日本欧美一区二区三区| 国精产品一区一区三区mba视频 | 日韩精品中午字幕| 久久精品亚洲精品国产欧美| 中文字幕在线播放不卡一区| 中文字幕中文字幕一区| 91麻豆自制传媒国产之光| 欧美日韩免费在线视频| 精品剧情在线观看| 国产精品国模大尺度视频| 亚洲欧美国产77777| 日本欧美肥老太交大片| 国产精品一色哟哟哟| 日本久久一区二区三区| 欧美一区二区视频观看视频 | 亚洲人吸女人奶水| 日韩一区欧美二区| 国产91清纯白嫩初高中在线观看 | 久久综合色综合88| 中文字幕在线不卡| 午夜视频在线观看一区二区 | 丁香婷婷综合激情五月色| 一本久道久久综合中文字幕 | 亚洲久草在线视频| 美国精品在线观看| 91在线云播放| 亚洲精品一区二区三区精华液 | 国产精品美女一区二区| 婷婷成人激情在线网| 国产激情视频一区二区在线观看| 在线亚洲一区观看| 久久免费电影网| 午夜精品久久久久影视| 高清国产一区二区| 69堂精品视频| 亚洲视频综合在线| 韩国v欧美v亚洲v日本v| 欧美午夜影院一区| 国产区在线观看成人精品| 婷婷亚洲久悠悠色悠在线播放| 风间由美一区二区av101| 欧美一级二级三级蜜桃| 亚洲欧洲综合另类在线| 国产成人在线看| 日韩一区二区三区免费看 | 欧美videos大乳护士334| 亚洲欧美日韩国产另类专区| 国产精品99久久久久久久vr| 欧美精品一级二级三级| 亚洲日本护士毛茸茸| 麻豆精品视频在线观看视频| 日本电影亚洲天堂一区| 中文字幕制服丝袜成人av| 国产麻豆精品theporn| 717成人午夜免费福利电影| 一区二区激情小说| 99热这里都是精品| 中文字幕精品—区二区四季| 黄色日韩三级电影| 欧美v日韩v国产v| 免费国产亚洲视频| 欧美高清hd18日本| 日韩黄色片在线观看| 欧美亚洲高清一区二区三区不卡| 亚洲欧美日韩久久| 99精品视频一区二区| 国产精品久久三| 国产成人精品免费看| 26uuu精品一区二区三区四区在线| 麻豆视频一区二区| 精品国产免费久久 | 成人精品一区二区三区中文字幕| wwwwww.欧美系列| 九九**精品视频免费播放| 91麻豆精品国产91久久久久久久久| 夜色激情一区二区| 欧美日韩一区高清| 性欧美疯狂xxxxbbbb| 欧美影院一区二区| 午夜视频一区二区| 欧美一区二区视频网站| 久久精品噜噜噜成人88aⅴ| 欧美xxxxx裸体时装秀| 国精产品一区一区三区mba视频| 久久亚洲精品小早川怜子| 国产美女精品一区二区三区| 久久久久综合网| 成人精品国产一区二区4080| 《视频一区视频二区| 91色乱码一区二区三区| 一区二区三区 在线观看视频| 欧美日韩一区三区| 日韩电影免费在线观看网站| 日韩欧美中文字幕公布| 久久99国产精品尤物| 久久色.com| 成人福利视频网站| 亚洲综合区在线| 91精品国产麻豆| 国产精品一区在线| 日韩美女视频一区| 欧美日韩视频专区在线播放| 日本麻豆一区二区三区视频| 精品福利一区二区三区| av在线综合网| 亚洲二区在线视频| 精品久久久久久久久久久久久久久 | 一色屋精品亚洲香蕉网站| 在线亚洲一区二区| 美腿丝袜亚洲色图| 国产精品乱码久久久久久| 色婷婷综合在线| 蜜臀91精品一区二区三区 | 亚洲一二三四久久| 欧美xxxxx裸体时装秀| www.亚洲色图.com| 日韩中文字幕一区二区三区| 久久婷婷综合激情| 一本一本久久a久久精品综合麻豆| 亚洲高清视频在线| 久久精品一区二区三区四区| 91国偷自产一区二区使用方法| 美女脱光内衣内裤视频久久网站| 久久精品夜色噜噜亚洲a∨| 91国内精品野花午夜精品 | 欧美三片在线视频观看| 国产一区二区在线看| 亚洲一二三级电影| 国产午夜亚洲精品午夜鲁丝片| 色视频成人在线观看免| 狠狠色2019综合网| 亚洲丶国产丶欧美一区二区三区| 337p日本欧洲亚洲大胆色噜噜| 色哟哟精品一区| 九一久久久久久| 亚洲成人久久影院| 中文无字幕一区二区三区| 欧美日韩国产高清一区二区三区| 粉嫩一区二区三区在线看| 日韩黄色一级片| 亚洲欧美区自拍先锋| 久久久影视传媒| 777欧美精品| 在线观看日产精品| 99在线精品一区二区三区| 麻豆成人91精品二区三区| 亚洲伊人伊色伊影伊综合网| 中文字幕第一区| 精品日韩99亚洲| 欧美精品亚洲二区| 在线欧美一区二区| 99在线视频精品| 丁香婷婷综合色啪| 国内精品嫩模私拍在线| 日本亚洲最大的色成网站www| 亚洲精品欧美在线| 一区免费观看视频| 国产农村妇女毛片精品久久麻豆 | 国产精品卡一卡二卡三| www国产亚洲精品久久麻豆| 欧美高清www午色夜在线视频| 91蜜桃视频在线| www.久久久久久久久| 国产99久久久国产精品潘金网站| 麻豆精品一区二区av白丝在线| 午夜精品福利久久久| 亚洲在线免费播放| 亚洲精品国产一区二区精华液| 中文字幕乱码日本亚洲一区二区| 久久久综合激的五月天| 久久久久久一级片| 久久久国产一区二区三区四区小说|