[NTOSKRNL]

Fix MmGetSessionLocaleId and implement MmSetSessionLocaleId

svn path=/trunk/; revision=61074
This commit is contained in:
Timo Kreuzer 2013-11-22 12:14:47 +00:00
parent 49642d5bb1
commit d018fb6027
2 changed files with 32 additions and 2 deletions

View file

@ -1798,3 +1798,8 @@ NTAPI
MmGetSessionById(
_In_ ULONG SessionId);
_IRQL_requires_max_(APC_LEVEL)
VOID
NTAPI
MmSetSessionLocaleId(
_In_ LCID LocaleId);

View file

@ -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)