Alistair Leslie-Hughes : winnt.h: Implement RtlSecureZeroMemory.

Alexandre Julliard julliard at winehq.org
Tue Feb 14 16:24:50 CST 2017


Module: wine
Branch: master
Commit: d5292b1fcf049272a61753dc15eaf6782e2d6a14
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d5292b1fcf049272a61753dc15eaf6782e2d6a14

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Mon Feb 13 08:17:57 2017 +0000

winnt.h: Implement RtlSecureZeroMemory.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/winbase.h | 1 +
 include/winnt.h   | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/include/winbase.h b/include/winbase.h
index b07d4df..4ec6f9a 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2778,6 +2778,7 @@ WINBASEAPI UINT        WINAPI _lwrite(HFILE,LPCSTR,UINT);
 #define     MoveMemory RtlMoveMemory
 #define     ZeroMemory RtlZeroMemory
 #define     CopyMemory RtlCopyMemory
+#define     SecureZeroMemory RtlSecureZeroMemory
 
 /* Wine internal functions */
 
diff --git a/include/winnt.h b/include/winnt.h
index 72c399b..de7622f 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -5436,6 +5436,14 @@ typedef enum _CM_ERROR_CONTROL_TYPE
 #define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
 #define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
 
+static FORCEINLINE void *RtlSecureZeroMemory(void *buffer, SIZE_T length)
+{
+    volatile char *ptr = buffer;
+
+    while (length--) *ptr++ = 0;
+    return buffer;
+}
+
 #include <guiddef.h>
 
 typedef struct _OBJECT_TYPE_LIST {




More information about the wine-cvs mailing list