diff options
Diffstat (limited to 'src/allocation/ml_win32/mlock.cpp')
-rw-r--r-- | src/allocation/ml_win32/mlock.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/allocation/ml_win32/mlock.cpp b/src/allocation/ml_win32/mlock.cpp new file mode 100644 index 000000000..8c5919934 --- /dev/null +++ b/src/allocation/ml_win32/mlock.cpp @@ -0,0 +1,27 @@ +/************************************************* +* Memory Locking Functions Source File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#include <botan/util.h> +#include <windows.h> + +namespace Botan { + +/************************************************* +* Lock an area of memory into RAM * +*************************************************/ +void lock_mem(void* ptr, u32bit bytes) + { + VirtualLock(ptr, bytes); + } + +/************************************************* +* Unlock a previously locked region of memory * +*************************************************/ +void unlock_mem(void* ptr, u32bit bytes) + { + VirtualUnlock(ptr, bytes); + } + +} |