headers: use inline version of RtlSecureZeroMemory for UCRT builds
There's an intrinsic version in the kernel32 library. But it's not supposed
to be used with UCRT builds.
RtlSecureZeroMemory is not found in -O0 + UCRT builds without this fix.
In the Windows SDK it's a forced inline version no matter what.
(and there's an ARM version)
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h
index 7da2f78..ec53138 100644
--- a/mingw-w64-headers/include/winnt.h
+++ b/mingw-w64-headers/include/winnt.h
@@ -8934,10 +8934,8 @@
#define HEAP_PSEUDO_TAG_FLAG 0x8000
#define HEAP_TAG_SHIFT 18
- PVOID WINAPI RtlSecureZeroMemory(PVOID ptr,SIZE_T cnt);
-
-#if !defined (__CRT__NO_INLINE) && !defined (__WIDL__)
- __CRT_INLINE PVOID WINAPI RtlSecureZeroMemory(PVOID ptr,SIZE_T cnt) {
+#if (!defined (__CRT__NO_INLINE) || defined(_UCRT)) && !defined (__WIDL__)
+ __forceinline PVOID RtlSecureZeroMemory(PVOID ptr,SIZE_T cnt) {
volatile char *vptr =(volatile char *)ptr;
#ifdef __x86_64
__stosb((PBYTE)((DWORD64)vptr),0,cnt);
@@ -8949,6 +8947,8 @@
#endif /* __x86_64 */
return ptr;
}
+#else /* intrinsic in kernel32 */
+ PVOID WINAPI RtlSecureZeroMemory(PVOID ptr,SIZE_T cnt);
#endif /* !__CRT__NO_INLINE // !__WIDL__ */
/* Let this macro fail for non-desktop mode. AFAIU this should be better an inline-function ... */