diff options
author | mvel <mvel@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
commit | bd30392c4cc92487950adc375c07adf52da1d592 (patch) | |
tree | e8d1a3f19b7fc890bcef6e4cc5de41f1d88c9ac3 /util/system/protect.h | |
parent | 5d50718e66d9c037dc587a0211110b7d25a66185 (diff) | |
download | ydb-bd30392c4cc92487950adc375c07adf52da1d592.tar.gz |
Restoring authorship annotation for <mvel@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/protect.h')
-rw-r--r-- | util/system/protect.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/protect.h b/util/system/protect.h index 26714f3e92..da024548de 100644 --- a/util/system/protect.h +++ b/util/system/protect.h @@ -1,25 +1,25 @@ -#pragma once - +#pragma once + #include "defaults.h" - + #include <util/generic/flags.h> -enum EProtectMemoryMode { +enum EProtectMemoryMode { PM_NONE = 0x00, // no access allowed PM_READ = 0x01, // read access allowed - PM_WRITE = 0x02, // write access allowed + PM_WRITE = 0x02, // write access allowed PM_EXEC = 0x04 // execute access allowed -}; - +}; + Y_DECLARE_FLAGS(EProtectMemory, EProtectMemoryMode) Y_DECLARE_OPERATORS_FOR_FLAGS(EProtectMemory) -/** - * Set protection mode on memory block - * @param addr Block address to be protected - * @param length Block size in bytes - * @param mode A bitwise combination of @c EProtectMemoryMode flags - * @note On Windows there is no write-only protection mode, - * so PM_WRITE will be translated to (PM_READ | PM_WRITE) on Windows. - **/ +/** + * Set protection mode on memory block + * @param addr Block address to be protected + * @param length Block size in bytes + * @param mode A bitwise combination of @c EProtectMemoryMode flags + * @note On Windows there is no write-only protection mode, + * so PM_WRITE will be translated to (PM_READ | PM_WRITE) on Windows. + **/ void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode); |