//
// wcscpy_s from 0x18013407c to 0x1801340e1 (101 bytes)
//
// 8 xrefs:
// > common_getenv_s @ 0x180128ef9
// > common_assert_to_message_box_build_string @ 0x180130f15
// > common_assert_to_message_box_build_string @ 0x180130fb8
// > create_environment @ 0x1801320bc
// > common_set_variable_in_environment_nolock @ 0x18013b354
// > copy_environment @ 0x18013b584
// > tzset_from_environment_nolock @ 0x18013ce07
// > ??> @ 0x180203230
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
errno_t __cdecl wcscpy_s(wchar_t *Destination, rsize_t SizeInWords, const wchar_t *Source)
{
errno_t v3; // ebx
int *v4; // rax
wchar_t *v6; // r9
signed __int64 v7; // r8
wchar_t v8; // ax
v3 = 0;
if ( !Destination || !SizeInWords )
goto LABEL_5;
if ( !Source )
{
*Destination = 0;
LABEL_5:
v4 = errno();
v3 = 22;
LABEL_6:
*v4 = v3;
invalid_parameter_noinfo();
return v3;
}
v6 = Destination;
v7 = (char *)Source - (char *)Destination;
do
{
v8 = *(wchar_t *)((char *)v6 + v7);
*v6++ = v8;
if ( !v8 )
break;
--SizeInWords;
}
while ( SizeInWords );
if ( !SizeInWords )
{
*Destination = 0;
v4 = errno();
v3 = 34;
goto LABEL_6;
}
return v3;
}