MmGetSessionLocaleId

INT64 __fastcall MmGetSessionLocaleId(){
  __int64 v0; 
  __int64 v1; 
  v0 = *((_QWORD *)KeGetCurrentThread() + 23);
  v1 = *(_QWORD *)(v0 + 1368);
  if( !v1 || (*(_DWORD *)(v0 + 2172) & 0x1000) != 0 )
    return(unsigned int)PsDefaultThreadLocaleId;
  else
    return *(unsigned int *)(v1 + 96);
}

Referenced by:

NtQueryDefaultLocale
PspUserThreadStartup