mingw: Add upstream RtlSecureZeroMemory implementation.

Closes #22475.
This commit is contained in:
Alex Rønne Petersen
2025-01-13 03:19:39 +01:00
parent fb43e91b22
commit 8019694e17
2 changed files with 18 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#define __CRT__NO_INLINE 1
#include <windows.h>
PVOID WINAPI RtlSecureZeroMemory(PVOID ptr,SIZE_T cnt)
{
volatile char *vptr = (volatile char *)ptr;
#ifdef __x86_64
__stosb ((PBYTE)((DWORD64)vptr),0,cnt);
#else
while (cnt != 0)
{
*vptr++ = 0;
cnt--;
}
#endif /* __x86_64 */
return ptr;
}
+1
View File
@@ -487,6 +487,7 @@ const mingw32_generic_src = [_][]const u8{
"crt" ++ path.sep_str ++ "cxa_atexit.c",
"crt" ++ path.sep_str ++ "cxa_thread_atexit.c",
"crt" ++ path.sep_str ++ "tls_atexit.c",
"crt" ++ path.sep_str ++ "intrincs" ++ path.sep_str ++ "RtlSecureZeroMemory.c",
// mingwex
"cfguard" ++ path.sep_str ++ "mingw_cfguard_support.c",
"complex" ++ path.sep_str ++ "_cabs.c",