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

View file

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

View file

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

View file

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

View file

@ -95,13 +95,21 @@ PspUserThreadStartup(IN PKSTART_ROUTINE StartRoutine,
/* 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);
}
}

View file

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