Index: /trunk/include/iprt/mem.h
===================================================================
--- /trunk/include/iprt/mem.h	(revision 30826)
+++ /trunk/include/iprt/mem.h	(revision 30827)
@@ -4,5 +4,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -254,4 +254,13 @@
 RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW;
 
+/**
+ * Goes thru some pains to make sure the specified memory block is thoroughly
+ * scrambled.
+ *
+ * @param   pv          The start of the memory block.
+ * @param   cb          The size of the memory block.
+ * @param   cMinPasses  The minimum number of passes to make.
+ */
+RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW;
 
 #ifdef IN_RING0
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 30826)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 30827)
@@ -259,4 +259,5 @@
 	common/misc/RTFileOpenF.cpp \
 	common/misc/RTFileOpenV.cpp \
+	common/misc/RTMemWipeThoroughly.cpp \
 	common/misc/assert.cpp \
 	common/misc/buildconfig.cpp \
Index: /trunk/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp	(revision 30827)
+++ /trunk/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp	(revision 30827)
@@ -0,0 +1,55 @@
+/* $Id$ */
+/** @file
+ * IPRT - RTMemWipeThoroughly.
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <iprt/mem.h>
+#include "internal/iprt.h"
+
+#include <iprt/asm.h>
+#include <iprt/rand.h>
+#include <iprt/string.h>
+
+
+RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW
+{
+    size_t cPasses = RT_MIN(cMinPasses, 6);
+
+    do
+    {
+        memset(pv, 0xff, cb);
+        ASMMemoryFence();
+
+        memset(pv, 0x00, cb);
+        ASMMemoryFence();
+
+        RTRandBytes(pv, cb);
+        ASMMemoryFence();
+    } while (cPasses-- > 0);
+}
+
