From d5292b1fcf049272a61753dc15eaf6782e2d6a14 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 13 Feb 2017 08:17:57 +0000 Subject: [PATCH] winnt.h: Implement RtlSecureZeroMemory. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Alexandre Julliard --- include/winbase.h | 1 + include/winnt.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/winbase.h b/include/winbase.h index b07d4df41eb..4ec6f9a9db0 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 72c399b410f..de7622fbe6f 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 typedef struct _OBJECT_TYPE_LIST {