mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOSKRNL]: Implement and export PsGetProcessSessionIdEx, and MmGetSessionIdEx. Dedicated to hbelusca. If you look at the diff (please don't), yes, this is seriously how it works in Windows.
svn path=/trunk/; revision=60317
This commit is contained in:
parent
2cdfc40af8
commit
7e3fbb3780
4 changed files with 33 additions and 2 deletions
|
@ -493,6 +493,12 @@ MmGetSessionId(
|
|||
IN PEPROCESS Process
|
||||
);
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
MmGetSessionIdEx(
|
||||
IN PEPROCESS Process
|
||||
);
|
||||
|
||||
/* marea.c *******************************************************************/
|
||||
|
||||
NTSTATUS
|
||||
|
|
|
@ -1561,6 +1561,21 @@ MmGetSessionId(IN PEPROCESS Process)
|
|||
return SessionGlobal->SessionId;
|
||||
}
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
MmGetSessionIdEx(IN PEPROCESS Process)
|
||||
{
|
||||
PMM_SESSION_SPACE SessionGlobal;
|
||||
|
||||
/* The session leader is always session zero */
|
||||
if (Process->Vm.Flags.SessionLeader == 1) return 0;
|
||||
|
||||
/* Otherwise, get the session global, and read the session ID from it */
|
||||
SessionGlobal = (PMM_SESSION_SPACE)Process->Session;
|
||||
if (!SessionGlobal) return -1;
|
||||
return SessionGlobal->SessionId;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal)
|
||||
|
|
|
@ -987,7 +987,7 @@
|
|||
@ stdcall PsGetProcessSectionBaseAddress(ptr)
|
||||
@ stdcall PsGetProcessSecurityPort(ptr)
|
||||
@ stdcall PsGetProcessSessionId(ptr)
|
||||
;PsGetProcessSessionIdEx
|
||||
@ stdcall PsGetProcessSessionIdEx(ptr)
|
||||
@ stdcall PsGetProcessWin32Process(ptr)
|
||||
@ stdcall PsGetProcessWin32WindowStation(ptr)
|
||||
;@ cdecl -arch=x86_64 PsGetProcessWow64Process()
|
||||
|
|
|
@ -1149,11 +1149,21 @@ PsGetProcessSecurityPort(PEPROCESS Process)
|
|||
*/
|
||||
ULONG
|
||||
NTAPI
|
||||
PsGetProcessSessionId(PEPROCESS Process)
|
||||
PsGetProcessSessionId(IN PEPROCESS Process)
|
||||
{
|
||||
return MmGetSessionId(Process);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
ULONG
|
||||
NTAPI
|
||||
PsGetProcessSessionIdEx(IN PEPROCESS Process)
|
||||
{
|
||||
return MmGetSessionIdEx(Process);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue