mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +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
|
IN PEPROCESS Process
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
MmGetSessionIdEx(
|
||||||
|
IN PEPROCESS Process
|
||||||
|
);
|
||||||
|
|
||||||
/* marea.c *******************************************************************/
|
/* marea.c *******************************************************************/
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -1561,6 +1561,21 @@ MmGetSessionId(IN PEPROCESS Process)
|
||||||
return SessionGlobal->SessionId;
|
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
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal)
|
MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal)
|
||||||
|
|
|
@ -987,7 +987,7 @@
|
||||||
@ stdcall PsGetProcessSectionBaseAddress(ptr)
|
@ stdcall PsGetProcessSectionBaseAddress(ptr)
|
||||||
@ stdcall PsGetProcessSecurityPort(ptr)
|
@ stdcall PsGetProcessSecurityPort(ptr)
|
||||||
@ stdcall PsGetProcessSessionId(ptr)
|
@ stdcall PsGetProcessSessionId(ptr)
|
||||||
;PsGetProcessSessionIdEx
|
@ stdcall PsGetProcessSessionIdEx(ptr)
|
||||||
@ stdcall PsGetProcessWin32Process(ptr)
|
@ stdcall PsGetProcessWin32Process(ptr)
|
||||||
@ stdcall PsGetProcessWin32WindowStation(ptr)
|
@ stdcall PsGetProcessWin32WindowStation(ptr)
|
||||||
;@ cdecl -arch=x86_64 PsGetProcessWow64Process()
|
;@ cdecl -arch=x86_64 PsGetProcessWow64Process()
|
||||||
|
|
|
@ -1149,11 +1149,21 @@ PsGetProcessSecurityPort(PEPROCESS Process)
|
||||||
*/
|
*/
|
||||||
ULONG
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
PsGetProcessSessionId(PEPROCESS Process)
|
PsGetProcessSessionId(IN PEPROCESS Process)
|
||||||
{
|
{
|
||||||
return MmGetSessionId(Process);
|
return MmGetSessionId(Process);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
PsGetProcessSessionIdEx(IN PEPROCESS Process)
|
||||||
|
{
|
||||||
|
return MmGetSessionIdEx(Process);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue