mirror of https://github.com/vxunderground/VX-API
17 lines
398 B
C++
17 lines
398 B
C++
#include "StringManipulation.h"
|
|
|
|
SIZE_T WCharStringToCharString(_Inout_ PCHAR Destination, _In_ PWCHAR Source, _In_ 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;
|
|
} |