diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index c2b849a10d1..53ef8be0144 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -1798,3 +1798,8 @@ NTAPI MmGetSessionById( _In_ ULONG SessionId); +_IRQL_requires_max_(APC_LEVEL) +VOID +NTAPI +MmSetSessionLocaleId( + _In_ LCID LocaleId); diff --git a/reactos/ntoskrnl/mm/ARM3/session.c b/reactos/ntoskrnl/mm/ARM3/session.c index 4ce6ed58f0b..b748101899d 100644 --- a/reactos/ntoskrnl/mm/ARM3/session.c +++ b/reactos/ntoskrnl/mm/ARM3/session.c @@ -80,9 +80,9 @@ MmGetSessionLocaleId(VOID) Process = PsGetCurrentProcess(); // - // Check if it's the Session Leader + // Check if it's NOT the Session Leader // - if (Process->Vm.Flags.SessionLeader) + if (!Process->Vm.Flags.SessionLeader) { // // Make sure it has a valid Session @@ -102,6 +102,31 @@ MmGetSessionLocaleId(VOID) return PsDefaultThreadLocaleId; } +_IRQL_requires_max_(APC_LEVEL) +VOID +NTAPI +MmSetSessionLocaleId( + _In_ LCID LocaleId) +{ + PEPROCESS CurrentProcess; + PAGED_CODE(); + + /* Get the current process and check if it is in a session */ + CurrentProcess = PsGetCurrentProcess(); + if ((CurrentProcess->Vm.Flags.SessionLeader == 0) && + (CurrentProcess->Session != NULL)) + { + /* Set the session locale Id */ + ((PMM_SESSION_SPACE)CurrentProcess->Session)->LocaleId = LocaleId; + } + else + { + /* Set the default locale */ + PsDefaultThreadLocaleId = LocaleId; + } +} + + VOID NTAPI MiInitializeSessionIds(VOID)