VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Registry.h
blob: ea449d3e0b5b503d0765864278f34326ad3bd358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 Derived from source code of TrueCrypt 7.1a, which is
 Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
 by the TrueCrypt License 3.0.

 Modifications and additions to the original source code (contained in this file)
 and all other portions of this file are Copyright (c) 2013-2017 IDRIX
 and are 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.
*/

#ifdef  __cplusplus
extern "C" {
#endif

BOOL ReadLocalMachineRegistryDword (wchar_t *subKey, wchar_t *name, DWORD *value);
BOOL ReadLocalMachineRegistryMultiString (wchar_t *subKey, wchar_t *name, wchar_t *value, DWORD *size);
BOOL ReadLocalMachineRegistryString (const wchar_t *subKey, wchar_t *name, wchar_t *value, DWORD *size);
BOOL ReadLocalMachineRegistryStringNonReflected (const wchar_t *subKey, wchar_t *name, wchar_t *str, DWORD *size, BOOL b32bitApp);
int ReadRegistryInt (wchar_t *subKey, wchar_t *name, int defaultValue);
wchar_t *ReadRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *defaultValue, wchar_t *str, int maxLen);
DWORD ReadRegistryBytes (wchar_t *path, wchar_t *name, char *value, int maxLen);
void WriteRegistryInt (wchar_t *subKey, wchar_t *name, int value);
BOOL WriteLocalMachineRegistryDword (wchar_t *subKey, wchar_t *name, DWORD value);
BOOL WriteLocalMachineRegistryMultiString (wchar_t *subKey, wchar_t *name, wchar_t *multiString, DWORD size);
BOOL WriteLocalMachineRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *str, BOOL expandable);
void WriteRegistryString (wchar_t *subKey, wchar_t *name, wchar_t *str);
BOOL WriteRegistryBytes (wchar_t *path, wchar_t *name, char *str, DWORD size);
BOOL DeleteLocalMachineRegistryKey (wchar_t *parentKey, wchar_t *subKeyToDelete);
void DeleteRegistryValue (wchar_t *subKey, wchar_t *name);
void GetStartupRegKeyName (wchar_t *regk, size_t cbRegk);
void GetRestorePointRegKeyName (wchar_t *regk, size_t cbRegk);

#ifdef  __cplusplus
}
#endif
an>="arrow_right.gif" alt=">>" style="margin-top: 5px"> <a href="Data%20Leaks.html">Data Leaks</a> <img src="arrow_right.gif" alt=">>" style="margin-top: 5px"> <a href="Paging%20File.html">Paging File</a> </p></div> <div class="wikidoc"> <h1>Paging File</h1> <div style="text-align:left; margin-top:19px; margin-bottom:19px; padding-top:0px; padding-bottom:0px"> <em style="text-align:left">Note: The issue described below does <strong style="text-align:left"> not</strong> affect you if the system partition or system drive is encrypted (for more information, see the chapter <a href="System%20Encryption.html" style="text-align:left; color:#0080c0; text-decoration:none.html"> System Encryption</a>) and if all paging files are located on one or more of the partitions within the key scope of <a href="System%20Encryption.html" style="text-align:left; color:#0080c0; text-decoration:none.html"> system encryption</a>, for example, on the partition where Windows is installed (for more information, see the fourth paragraph in this subsection</em><em style="text-align:left">).</em></div> <div style="text-align:left; margin-top:19px; margin-bottom:19px; padding-top:0px; padding-bottom:0px"> Paging files, also called swap files, are used by Windows to hold parts of programs and data files that do not fit in memory. This means that sensitive data, which you believe are only stored in RAM, can actually be written <em style="text-align:left">unencrypted</em> to a hard drive by Windows without you knowing. <br style="text-align:left"> <br style="text-align:left"> Note that VeraCrypt <em style="text-align:left">cannot</em> prevent the contents of sensitive files that are opened in RAM from being saved <em style="text-align:left">unencrypted</em> to a paging file (note that when you open a file stored on a VeraCrypt volume, for example, in a text editor, then the content of the file is stored <em style="text-align:left">unencrypted</em> in RAM).</div> <div style="text-align:left; margin-top:19px; margin-bottom:19px; padding-top:0px; padding-bottom:0px"> <strong style="text-align:left">To prevent the issues described above</strong>, encrypt the system partition/drive (for information on how to do so, see the chapter <a href="System%20Encryption.html" style="text-align:left; color:#0080c0; text-decoration:none.html"> System Encryption</a>) and make sure that all paging files are located on one or more of the partitions within the key scope of system encryption (for example, on the partition where Windows is installed). Note that the last condition is typically met on Windows XP by default. However, Windows Vista and later versions of Windows are configured by default to create paging files on any suitable volume. Therefore, before, you start using VeraCrypt, you must follow these steps: Right-click the '<em style="text-align:left">Computer</em>' (or '<em style="text-align:left">My Computer</em>') icon on the desktop or in the <em style="text-align:left">Start Menu</em>, and then select <em style="text-align:left"> Properties</em> &gt; (<span style="text-align:left">on Windows Vista or later</span>: &gt; <em style="text-align:left">Advanced System Settings</em> &gt;) <em style="text-align:left"> Advanced </em>tab &gt; section <em style="text-align:left">Performance </em>&gt; <em style="text-align:left"> Settings &gt; Advanced </em>tab &gt; section <em style="text-align:left">Virtual memory </em>&gt;<em style="text-align:left"> Change</em>. On Windows Vista or later, disable '<em style="text-align:left">Automatically manage paging file size for all drives</em>'. Then make sure that the list of volumes available for paging file creation contains only volumes within the intended key scope of system encryption (for example, the volume where Windows is installed). To disable paging file creation on a particular volume, select it, then select '<em style="text-align:left">No paging file</em>' and click <em style="text-align:left">Set</em>. When done, click <em style="text-align:left"> OK</em> and restart the computer. <br style="text-align:left"> <br style="text-align:left"> <em style="text-align:left">Note: You may also want to consider creating a hidden operating system (for more information, see the section <a href="Hidden%20Operating%20System.html" style="text-align:left; color:#0080c0; text-decoration:none.html"> Hidden Operating System</a>)</em>.</div> </div><div class="ClearBoth"></div></body></html>