REDIVIVUS

Proposals / #1375

Recover the Mac byte-to-wide string copy contract

checked · by eejitgames · submitted 2026-11-06

Mac002b7ac0 still declares an undefined result and three undefined4 inputs. The complete body reads source bytes, zero-extends them into destination WORDs, uses signed count tests and returns the original destination in full EAX on every normal path. Recover WCHAR*(WCHAR*,char*,int32_t), preserving chosen names and cdecl. Windows00526f20 already has that typed contract and matching native behavior. Caller buffer bytes/counts and subsequent wide-string use confirm the element units. Of167 Mac references,166 are direct calls and the remaining one is linker metadata. Issue91 concerns Windows call nesting; proposal1108 changes a caller's local buffer, not this Mac signature.

Changes 1, applied together

  1. Set prototype mac 0x002b7ac0

    signatureundefined STRING_CopyCharToWCharWithSetMaxSize(undefined4 pDestination, undefined4 pSource, undefined4 nSize)→WCHAR * STRING_CopyCharToWCharWithSetMaxSize(WCHAR * pDestination, char * pSource, int32_t nSize)
    convention__cdecl