1 // Windows/MemoryLock.h 2 3 #ifndef __WINDOWS_MEMORY_LOCK_H 4 #define __WINDOWS_MEMORY_LOCK_H 5 6 namespace NWindows { 7 namespace NSecurity { 8 9 #ifndef UNDER_CE 10 11 bool EnablePrivilege(LPCTSTR privilegeName, bool enable = true); 12 13 inline bool EnablePrivilege_LockMemory(bool enable = true) 14 { 15 return EnablePrivilege(SE_LOCK_MEMORY_NAME, enable); 16 } 17 EnablePrivilege_SymLink()18inline void EnablePrivilege_SymLink() 19 { 20 /* Probably we do not to set any Privilege for junction points. 21 But we need them for Symbolic links */ 22 NSecurity::EnablePrivilege(SE_RESTORE_NAME); 23 24 /* Probably we need only SE_RESTORE_NAME, but there is also 25 SE_CREATE_SYMBOLIC_LINK_NAME. So we set it also. Do we need it? */ 26 27 NSecurity::EnablePrivilege(TEXT("SeCreateSymbolicLinkPrivilege")); // SE_CREATE_SYMBOLIC_LINK_NAME 28 29 // Do we need to set SE_BACKUP_NAME ? 30 } 31 32 #endif 33 34 }} 35 36 #endif 37