1370b324cSopenharmony_ci// Windows/MemoryLock.h 2370b324cSopenharmony_ci 3370b324cSopenharmony_ci#ifndef ZIP7_INC_WINDOWS_MEMORY_LOCK_H 4370b324cSopenharmony_ci#define ZIP7_INC_WINDOWS_MEMORY_LOCK_H 5370b324cSopenharmony_ci 6370b324cSopenharmony_ci#include "../Common/MyWindows.h" 7370b324cSopenharmony_ci 8370b324cSopenharmony_cinamespace NWindows { 9370b324cSopenharmony_cinamespace NSecurity { 10370b324cSopenharmony_ci 11370b324cSopenharmony_ci#ifndef UNDER_CE 12370b324cSopenharmony_ci 13370b324cSopenharmony_cibool EnablePrivilege(LPCTSTR privilegeName, bool enable = true); 14370b324cSopenharmony_ci 15370b324cSopenharmony_ciinline bool EnablePrivilege_LockMemory(bool enable = true) 16370b324cSopenharmony_ci{ 17370b324cSopenharmony_ci return EnablePrivilege(SE_LOCK_MEMORY_NAME, enable); 18370b324cSopenharmony_ci} 19370b324cSopenharmony_ci 20370b324cSopenharmony_ciinline void EnablePrivilege_SymLink() 21370b324cSopenharmony_ci{ 22370b324cSopenharmony_ci /* Probably we do not to set any Privilege for junction points. 23370b324cSopenharmony_ci But we need them for Symbolic links */ 24370b324cSopenharmony_ci NSecurity::EnablePrivilege(SE_RESTORE_NAME); 25370b324cSopenharmony_ci 26370b324cSopenharmony_ci /* Probably we need only SE_RESTORE_NAME, but there is also 27370b324cSopenharmony_ci SE_CREATE_SYMBOLIC_LINK_NAME. So we set it also. Do we need it? */ 28370b324cSopenharmony_ci 29370b324cSopenharmony_ci NSecurity::EnablePrivilege(TEXT("SeCreateSymbolicLinkPrivilege")); // SE_CREATE_SYMBOLIC_LINK_NAME 30370b324cSopenharmony_ci 31370b324cSopenharmony_ci // Do we need to set SE_BACKUP_NAME ? 32370b324cSopenharmony_ci} 33370b324cSopenharmony_ci 34370b324cSopenharmony_ciunsigned Get_LargePages_RiskLevel(); 35370b324cSopenharmony_ci 36370b324cSopenharmony_ci#endif 37370b324cSopenharmony_ci 38370b324cSopenharmony_ci}} 39370b324cSopenharmony_ci 40370b324cSopenharmony_ci#endif 41