Create WCharStringToCharString.cpp

This commit is contained in:
vxunderground
2022-07-14 22:15:08 -05:00
committed by GitHub
parent 9f2931c7bb
commit c9ec089ade
@@ -0,0 +1,15 @@
SIZE_T WCharStringToCharString(PCHAR Destination, PWCHAR Source, SIZE_T MaximumAllowed)
{
INT Length = (INT)MaximumAllowed;
while (--Length >= 0)
{
#pragma warning( push )
#pragma warning( disable : 4244)
if (!(*Destination++ = *Source++))
return MaximumAllowed - Length - 1;
#pragma warning( pop )
}
return MaximumAllowed - Length;
}