mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 12:23:30 +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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user