Hello, in mingw-w64 winnt.h file is one occurrence of using _UCRT macro:
#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);
#else
while(cnt) {
*vptr++ = 0;
cnt--;
}
#endif /* __x86_64 */
return ptr;
}
#else /* intrinsic in kernel32 */
PVOID WINAPI RtlSecureZeroMemory(PVOID ptr,SIZE_T cnt);
#endif /* !__CRT__NO_INLINE // !__WIDL__ */
What is the point of allowing to use inline version of
RtlSecureZeroMemory for UCRT and disallowing for msvcrt?
I found commit 2a7e9255dfe46be06cd45bce91c5aa2e8bc1be25 which just says
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.
but does not explain why.
I think that WinAPI header files and WinAPI dll library should be
independent of used CRT library, and should behave same whether compiled
with msvcrt.dll or ucrtbase.dll.
Do you know something more about this _UCRT check for RtlSecureZeroMemory?
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public