Author: tkreuzer
Date: Fri Nov 22 12:14:47 2013
New Revision: 61074
URL:
http://svn.reactos.org/svn/reactos?rev=61074&view=rev
Log:
[NTOSKRNL]
Fix MmGetSessionLocaleId and implement MmSetSessionLocaleId
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/mm/ARM3/session.c
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Fri Nov 22 12:14:47 2013
@@ -1798,3 +1798,8 @@
MmGetSessionById(
_In_ ULONG SessionId);
+_IRQL_requires_max_(APC_LEVEL)
+VOID
+NTAPI
+MmSetSessionLocaleId(
+ _In_ LCID LocaleId);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/session.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] Fri Nov 22 12:14:47 2013
@@ -80,9 +80,9 @@
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
@@ -101,6 +101,31 @@
//
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