diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/Windows/MemoryLock.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/CPP/Windows/MemoryLock.h b/CPP/Windows/MemoryLock.h new file mode 100644 index 0000000..dcaf182 --- /dev/null +++ b/CPP/Windows/MemoryLock.h | |||
@@ -0,0 +1,40 @@ | |||
1 | // Windows/MemoryLock.h | ||
2 | |||
3 | #ifndef __WINDOWS_MEMORY_LOCK_H | ||
4 | #define __WINDOWS_MEMORY_LOCK_H | ||
5 | |||
6 | #include "../Common/MyWindows.h" | ||
7 | |||
8 | namespace NWindows { | ||
9 | namespace NSecurity { | ||
10 | |||
11 | #ifndef UNDER_CE | ||
12 | |||
13 | bool EnablePrivilege(LPCTSTR privilegeName, bool enable = true); | ||
14 | |||
15 | inline bool EnablePrivilege_LockMemory(bool enable = true) | ||
16 | { | ||
17 | return EnablePrivilege(SE_LOCK_MEMORY_NAME, enable); | ||
18 | } | ||
19 | |||
20 | inline void EnablePrivilege_SymLink() | ||
21 | { | ||
22 | /* Probably we do not to set any Privilege for junction points. | ||
23 | But we need them for Symbolic links */ | ||
24 | NSecurity::EnablePrivilege(SE_RESTORE_NAME); | ||
25 | |||
26 | /* Probably we need only SE_RESTORE_NAME, but there is also | ||
27 | SE_CREATE_SYMBOLIC_LINK_NAME. So we set it also. Do we need it? */ | ||
28 | |||
29 | NSecurity::EnablePrivilege(TEXT("SeCreateSymbolicLinkPrivilege")); // SE_CREATE_SYMBOLIC_LINK_NAME | ||
30 | |||
31 | // Do we need to set SE_BACKUP_NAME ? | ||
32 | } | ||
33 | |||
34 | unsigned Get_LargePages_RiskLevel(); | ||
35 | |||
36 | #endif | ||
37 | |||
38 | }} | ||
39 | |||
40 | #endif | ||