Author: hbelusca
Date: Sat Sep 21 20:46:42 2013
New Revision: 60296
URL:
http://svn.reactos.org/svn/reactos?rev=60296&view=rev
Log:
[NTOS]
- Implement PsGetCurrentThreadProcess, PsGetCurrentThreadProcessId and
PsGetCurrentThreadTeb based on their non-current versions.
- Fix PsGetThreadSessionId to call MmGetSessionId.
- Fix the return value type of PsGetJobSessionId.
- Remove an unneeded cast.
Modified:
trunk/reactos/ntoskrnl/ntoskrnl.spec
trunk/reactos/ntoskrnl/ps/job.c
trunk/reactos/ntoskrnl/ps/query.c
trunk/reactos/ntoskrnl/ps/thread.c
Modified: trunk/reactos/ntoskrnl/ntoskrnl.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.spec?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] Sat Sep 21 20:46:42 2013
@@ -963,11 +963,11 @@
@ stdcall PsGetCurrentThread() KeGetCurrentThread
@ stdcall PsGetCurrentThreadId()
@ stdcall PsGetCurrentThreadPreviousMode()
-;PsGetCurrentThreadProcess
-;PsGetCurrentThreadProcessId
+@ stdcall PsGetCurrentThreadProcess()
+@ stdcall PsGetCurrentThreadProcessId()
@ stdcall PsGetCurrentThreadStackBase()
@ stdcall PsGetCurrentThreadStackLimit()
-;PsGetCurrentThreadTeb
+@ stdcall PsGetCurrentThreadTeb()
@ stdcall PsGetCurrentThreadWin32Thread()
;PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion
@ stdcall PsGetJobLock(ptr)
Modified: trunk/reactos/ntoskrnl/ps/job.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/job.c?rev=6029…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/job.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/job.c [iso-8859-1] Sat Sep 21 20:46:42 2013
@@ -527,12 +527,12 @@
/*
* @implemented
*/
-PVOID
+ULONG
NTAPI
PsGetJobSessionId ( PEJOB Job )
{
ASSERT(Job);
- return (PVOID)Job->SessionId;
+ return Job->SessionId;
}
Modified: trunk/reactos/ntoskrnl/ps/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=60…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] Sat Sep 21 20:46:42 2013
@@ -419,7 +419,7 @@
_SEH2_TRY
{
/* Write back the Session ID */
- SessionInfo->SessionId = PtrToUlong(PsGetProcessSessionId(Process));
+ SessionInfo->SessionId = PsGetProcessSessionId(Process);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
Modified: trunk/reactos/ntoskrnl/ps/thread.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=6…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] Sat Sep 21 20:46:42 2013
@@ -669,8 +669,38 @@
/*
* @implemented
*/
+ULONG
+NTAPI
+PsGetThreadFreezeCount(IN PETHREAD Thread)
+{
+ return Thread->Tcb.FreezeCount;
+}
+
+/*
+ * @implemented
+ */
+BOOLEAN
+NTAPI
+PsGetThreadHardErrorsAreDisabled(IN PETHREAD Thread)
+{
+ return Thread->HardErrorsAreDisabled ? TRUE : FALSE;
+}
+
+/*
+ * @implemented
+ */
HANDLE
NTAPI
+PsGetThreadId(IN PETHREAD Thread)
+{
+ return Thread->Cid.UniqueThread;
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+NTAPI
PsGetCurrentThreadId(VOID)
{
return PsGetCurrentThread()->Cid.UniqueThread;
@@ -679,61 +709,51 @@
/*
* @implemented
*/
+PEPROCESS
+NTAPI
+PsGetThreadProcess(IN PETHREAD Thread)
+{
+ return Thread->ThreadsProcess;
+}
+
+/*
+ * @implemented
+ */
+PEPROCESS
+NTAPI
+PsGetCurrentThreadProcess(VOID)
+{
+ return PsGetCurrentThread()->ThreadsProcess;
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+NTAPI
+PsGetThreadProcessId(IN PETHREAD Thread)
+{
+ return Thread->Cid.UniqueProcess;
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+NTAPI
+PsGetCurrentThreadProcessId(VOID)
+{
+ return PsGetCurrentThread()->Cid.UniqueProcess;
+}
+
+/*
+ * @implemented
+ */
ULONG
NTAPI
-PsGetThreadFreezeCount(IN PETHREAD Thread)
-{
- return Thread->Tcb.FreezeCount;
-}
-
-/*
- * @implemented
- */
-BOOLEAN
-NTAPI
-PsGetThreadHardErrorsAreDisabled(IN PETHREAD Thread)
-{
- return Thread->HardErrorsAreDisabled ? TRUE : FALSE;
-}
-
-/*
- * @implemented
- */
-HANDLE
-NTAPI
-PsGetThreadId(IN PETHREAD Thread)
-{
- return Thread->Cid.UniqueThread;
-}
-
-/*
- * @implemented
- */
-PEPROCESS
-NTAPI
-PsGetThreadProcess(IN PETHREAD Thread)
-{
- return Thread->ThreadsProcess;
-}
-
-/*
- * @implemented
- */
-HANDLE
-NTAPI
-PsGetThreadProcessId(IN PETHREAD Thread)
-{
- return Thread->Cid.UniqueProcess;
-}
-
-/*
- * @implemented
- */
-HANDLE
-NTAPI
PsGetThreadSessionId(IN PETHREAD Thread)
{
- return (HANDLE)Thread->ThreadsProcess->Session;
+ return MmGetSessionId(Thread->ThreadsProcess);
}
/*
@@ -749,11 +769,31 @@
/*
* @implemented
*/
+PTEB
+NTAPI
+PsGetCurrentThreadTeb(VOID)
+{
+ return PsGetCurrentThread()->Tcb.Teb;
+}
+
+/*
+ * @implemented
+ */
PVOID
NTAPI
PsGetThreadWin32Thread(IN PETHREAD Thread)
{
return Thread->Tcb.Win32Thread;
+}
+
+/*
+ * @implemented
+ */
+PVOID
+NTAPI
+PsGetCurrentThreadWin32Thread(VOID)
+{
+ return PsGetCurrentThread()->Tcb.Win32Thread;
}
/*
@@ -825,16 +865,6 @@
IN BOOLEAN HardErrorsAreDisabled)
{
Thread->HardErrorsAreDisabled = HardErrorsAreDisabled;
-}
-
-/*
- * @implemented
- */
-PVOID
-NTAPI
-PsGetCurrentThreadWin32Thread(VOID)
-{
- return PsGetCurrentThread()->Tcb.Win32Thread;
}
/*