benilla-re systems structs docs

s_stringTypeMode

global · crt

Address
0x883ba4 · 4 bytes, up to 0x883ba7
Type
int32_t
Meaning
Holds which call ___crtGetStringTypeW makes: 0 undecided, 1 GetStringTypeW, 2 GetStringTypeA
Confidence
verified, proof one
Finding
crt/ctype#wide-character-types

Finding: Wide character types in crt: characters

___crtGetStringTypeW(type, src, n, out, code_page, lcid) decides on its first call whether the system has GetStringTypeW, by calling it on a one-unit empty string. When it has, each call is GetStringTypeW(type, src, n, out). When it has not and GetStringTypeA answers, it converts the units to bytes in the code page, the runtime's by default, asks GetStringTypeA for the locale, the locale word by default, and copies the n answers out only when the call wrote exactly n; otherwise, or when neither call works, it answers 0. _iswctype asks it for one unit's CT_CTYPE1 bits.

The derivation is in the doc.