aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ml_win32
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /modules/ml_win32
Initial checkin1.5.6
Diffstat (limited to 'modules/ml_win32')
-rw-r--r--modules/ml_win32/mlock.cpp27
-rw-r--r--modules/ml_win32/modinfo.txt8
2 files changed, 35 insertions, 0 deletions
diff --git a/modules/ml_win32/mlock.cpp b/modules/ml_win32/mlock.cpp
new file mode 100644
index 000000000..7384beb07
--- /dev/null
+++ b/modules/ml_win32/mlock.cpp
@@ -0,0 +1,27 @@
+/*************************************************
+* Memory Locking Functions Source File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#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);
+ }
+
+}
diff --git a/modules/ml_win32/modinfo.txt b/modules/ml_win32/modinfo.txt
new file mode 100644
index 000000000..31b5d2afa
--- /dev/null
+++ b/modules/ml_win32/modinfo.txt
@@ -0,0 +1,8 @@
+realname "Memory Locking for Windows"
+
+replace_file mlock.cpp
+
+<os>
+windows
+cygwin
+</os>