Author: ion
Date: Thu Jul 27 22:28:26 2006
New Revision: 23323
URL:
http://svn.reactos.org/svn/reactos?rev=23323&view=rev
Log:
- Fix some last STDCALL->NTAPI problems.
- Generate KUSER_SHARED_DATA cookie if it doesn't already exist when a user-mode
thread runs.
- Remove the last Ps entry from kernel fun.
Modified:
trunk/reactos/ntoskrnl/KrnlFun.c
trunk/reactos/ntoskrnl/ps/debug.c
trunk/reactos/ntoskrnl/ps/process.c
trunk/reactos/ntoskrnl/ps/query.c
trunk/reactos/ntoskrnl/ps/thread.c
trunk/reactos/ntoskrnl/ps/win32.c
Modified: trunk/reactos/ntoskrnl/KrnlFun.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/KrnlFun.c?rev=233…
==============================================================================
--- trunk/reactos/ntoskrnl/KrnlFun.c (original)
+++ trunk/reactos/ntoskrnl/KrnlFun.c Thu Jul 27 22:28:26 2006
@@ -23,9 +23,6 @@
// - Verify ShareAccess APIs, XP added some new semantics.
// - Add support for Fast Dispatch I/O.
//
-// Ps:
-// - Generate process cookie for user-more thread.
-//
// Ob:
// - Fix bug related to Deferred Loading (don't requeue active work item).
// - Add Directory Lock.
Modified: trunk/reactos/ntoskrnl/ps/debug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/debug.c?rev=23…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/debug.c (original)
+++ trunk/reactos/ntoskrnl/ps/debug.c Thu Jul 27 22:28:26 2006
@@ -28,7 +28,7 @@
#ifdef DBG
VOID
-STDCALL
+NTAPI
PspDumpThreads(BOOLEAN IncludeSystem)
{
PLIST_ENTRY CurrentThread, CurrentProcess;
Modified: trunk/reactos/ntoskrnl/ps/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/process.c (original)
+++ trunk/reactos/ntoskrnl/ps/process.c Thu Jul 27 22:28:26 2006
@@ -994,10 +994,11 @@
/*
* @implemented
*/
-HANDLE STDCALL
+HANDLE
+NTAPI
PsGetCurrentProcessId(VOID)
{
- return((HANDLE)PsGetCurrentProcess()->UniqueProcessId);
+ return (HANDLE)PsGetCurrentProcess()->UniqueProcessId;
}
/*
@@ -1074,7 +1075,7 @@
* @implemented
*/
BOOLEAN
-STDCALL
+NTAPI
PsIsProcessBeingDebugged(PEPROCESS Process)
{
return Process->DebugPort != NULL;
Modified: trunk/reactos/ntoskrnl/ps/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=23…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/query.c (original)
+++ trunk/reactos/ntoskrnl/ps/query.c Thu Jul 27 22:28:26 2006
@@ -400,7 +400,7 @@
/* Get the current process and cookie */
Process = PsGetCurrentProcess();
Cookie = Process->Cookie;
- if(!Cookie)
+ if (!Cookie)
{
LARGE_INTEGER SystemTime;
ULONG NewCookie;
@@ -416,7 +416,7 @@
Cookie = InterlockedCompareExchange((LONG*)&Process->Cookie,
NewCookie,
Cookie);
- if(!Cookie) Cookie = NewCookie;
+ if (!Cookie) Cookie = NewCookie;
/* Set return length */
Length = sizeof(ULONG);
Modified: trunk/reactos/ntoskrnl/ps/thread.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/thread.c (original)
+++ trunk/reactos/ntoskrnl/ps/thread.c Thu Jul 27 22:28:26 2006
@@ -95,13 +95,21 @@
/* Do we have a cookie set yet? */
if (!SharedUserData->Cookie)
{
- /*
- * FIXME: Generate cookie
- * Formula (roughly): Per-CPU Page Fault ^ Per-CPU Interrupt Time ^
- * Global System Time ^ Stack Address of where
- * the LARGE_INTEGER containing the Global System
- * Time is.
- */
+ LARGE_INTEGER SystemTime;
+ ULONG NewCookie;
+ PKPRCB Prcb;
+
+ /* Generate a new cookie */
+ KeQuerySystemTime(&SystemTime);
+ Prcb = KeGetCurrentPrcb();
+ NewCookie = Prcb->MmPageFaultCount ^ Prcb->InterruptTime ^
+ SystemTime.u.LowPart ^ SystemTime.u.HighPart ^
+ (ULONG)&SystemTime;
+
+ /* Set the new cookie*/
+ InterlockedCompareExchange((LONG*)&SharedUserData->Cookie,
+ NewCookie,
+ 0);
}
}
Modified: trunk/reactos/ntoskrnl/ps/win32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/win32.c?rev=23…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/win32.c (original)
+++ trunk/reactos/ntoskrnl/ps/win32.c Thu Jul 27 22:28:26 2006
@@ -114,7 +114,7 @@
}
NTSTATUS
-STDCALL
+NTAPI
NtW32Call(IN ULONG RoutineIndex,
IN PVOID Argument,
IN ULONG ArgumentLength,