CaplockString

StringLengthW is a dependency for some code segments.

VOID CaplockStringW(PWCHAR String)
{
    for (; *String; ++String)
    {
        WCHAR c = *String;
        if (c >= L'a' && c <= L'z')
            *String = (WCHAR)(c - (L'a' - L'A'));
    }
}

VOID User32CaplockStringW(PWCHAR String)
{
    CharUpperBuffW(String, (DWORD)StringLengthW(String));
}

VOID WinNLSCaplockStringW(PWCHAR String)
{
    LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, String, -1, String, (INT)StringLengthW(String) + 1);
}

VOID BlCaplockStringW(PWCHAR String)
{
    for (; *String; ++String)
    {
        WCHAR c = *String;
        *String = c - ((c >= L'a' && c <= L'z') << 5);
    }
}

VOID LookupTableCaplockStringW(PWCHAR String)
{
    for (; *String; ++String)
    {
        WCHAR c = *String;
        *String = c & ~(((WCHAR)(c - L'a') < 26) * 0x20);
    }
}

Last updated