- 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.

svn path=/trunk/; revision=23323
This commit is contained in:
Alex Ionescu 2006-07-27 18:28:26 +00:00
parent 22b41d9acf
commit 6e6d9ed927
6 changed files with 23 additions and 17 deletions

View file

@ -23,9 +23,6 @@
// - Verify ShareAccess APIs, XP added some new semantics. // - Verify ShareAccess APIs, XP added some new semantics.
// - Add support for Fast Dispatch I/O. // - Add support for Fast Dispatch I/O.
// //
// Ps:
// - Generate process cookie for user-more thread.
//
// Ob: // Ob:
// - Fix bug related to Deferred Loading (don't requeue active work item). // - Fix bug related to Deferred Loading (don't requeue active work item).
// - Add Directory Lock. // - Add Directory Lock.

View file

@ -28,7 +28,7 @@ typedef struct _GET_SET_CTX_CONTEXT
#ifdef DBG #ifdef DBG
VOID VOID
STDCALL NTAPI
PspDumpThreads(BOOLEAN IncludeSystem) PspDumpThreads(BOOLEAN IncludeSystem)
{ {
PLIST_ENTRY CurrentThread, CurrentProcess; PLIST_ENTRY CurrentThread, CurrentProcess;

View file

@ -994,10 +994,11 @@ PsGetProcessPriorityClass(PEPROCESS Process)
/* /*
* @implemented * @implemented
*/ */
HANDLE STDCALL HANDLE
NTAPI
PsGetCurrentProcessId(VOID) PsGetCurrentProcessId(VOID)
{ {
return((HANDLE)PsGetCurrentProcess()->UniqueProcessId); return (HANDLE)PsGetCurrentProcess()->UniqueProcessId;
} }
/* /*
@ -1074,7 +1075,7 @@ PsGetProcessWin32WindowStation(PEPROCESS Process)
* @implemented * @implemented
*/ */
BOOLEAN BOOLEAN
STDCALL NTAPI
PsIsProcessBeingDebugged(PEPROCESS Process) PsIsProcessBeingDebugged(PEPROCESS Process)
{ {
return Process->DebugPort != NULL; return Process->DebugPort != NULL;

View file

@ -400,7 +400,7 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
/* Get the current process and cookie */ /* Get the current process and cookie */
Process = PsGetCurrentProcess(); Process = PsGetCurrentProcess();
Cookie = Process->Cookie; Cookie = Process->Cookie;
if(!Cookie) if (!Cookie)
{ {
LARGE_INTEGER SystemTime; LARGE_INTEGER SystemTime;
ULONG NewCookie; ULONG NewCookie;
@ -416,7 +416,7 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
Cookie = InterlockedCompareExchange((LONG*)&Process->Cookie, Cookie = InterlockedCompareExchange((LONG*)&Process->Cookie,
NewCookie, NewCookie,
Cookie); Cookie);
if(!Cookie) Cookie = NewCookie; if (!Cookie) Cookie = NewCookie;
/* Set return length */ /* Set return length */
Length = sizeof(ULONG); Length = sizeof(ULONG);

View file

@ -95,13 +95,21 @@ PspUserThreadStartup(IN PKSTART_ROUTINE StartRoutine,
/* Do we have a cookie set yet? */ /* Do we have a cookie set yet? */
if (!SharedUserData->Cookie) if (!SharedUserData->Cookie)
{ {
/* LARGE_INTEGER SystemTime;
* FIXME: Generate cookie ULONG NewCookie;
* Formula (roughly): Per-CPU Page Fault ^ Per-CPU Interrupt Time ^ PKPRCB Prcb;
* Global System Time ^ Stack Address of where
* the LARGE_INTEGER containing the Global System /* Generate a new cookie */
* Time is. 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);
} }
} }

View file

@ -114,7 +114,7 @@ PsEstablishWin32Callouts(IN PWIN32_CALLOUTS_FPNS CalloutData)
} }
NTSTATUS NTSTATUS
STDCALL NTAPI
NtW32Call(IN ULONG RoutineIndex, NtW32Call(IN ULONG RoutineIndex,
IN PVOID Argument, IN PVOID Argument,
IN ULONG ArgumentLength, IN ULONG ArgumentLength,