[NDK] Put ZwCreateKeyedEvent in NDK where it belongs.

[EX] Remove "KeGetCurrentProcess" and just use the EPROCESS Pcb member for type correctness instead of inventing a new macro to hide the casting.
[PS] Remove stray INIT_FUNCTION (doesn't do much on a prototype).
[IO] Define _IO_DEBUG_ to 0 again after someone forgot to leave it on 4 years ago (only bloated the code since IopTraceLevel was 0 anyway).

svn path=/trunk/; revision=69354
This commit is contained in:
Stefan Ginsberg 2015-09-25 18:40:56 +00:00
parent 549ecc5195
commit 0ad0cb4df8
4 changed files with 15 additions and 15 deletions

View file

@ -673,6 +673,17 @@ ZwCreateEventPair(
_In_ POBJECT_ATTRIBUTES ObjectAttributes _In_ POBJECT_ATTRIBUTES ObjectAttributes
); );
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSYSAPI
NTSTATUS
NTAPI
ZwCreateKeyedEvent(
_Out_ PHANDLE OutHandle,
_In_ ACCESS_MASK AccessMask,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ ULONG Flags
);
NTSYSAPI NTSYSAPI
NTSTATUS NTSTATUS
NTAPI NTAPI

View file

@ -25,16 +25,6 @@ typedef struct _EX_KEYED_EVENT
} HashTable[NUM_KEY_HASH_BUCKETS]; } HashTable[NUM_KEY_HASH_BUCKETS];
} EX_KEYED_EVENT, *PEX_KEYED_EVENT; } EX_KEYED_EVENT, *PEX_KEYED_EVENT;
NTSTATUS
NTAPI
ZwCreateKeyedEvent(
_Out_ PHANDLE OutHandle,
_In_ ACCESS_MASK AccessMask,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ ULONG Flags);
#define KeGetCurrentProcess() ((PKPROCESS)PsGetCurrentProcess())
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
PEX_KEYED_EVENT ExpCritSecOutOfMemoryEvent; PEX_KEYED_EVENT ExpCritSecOutOfMemoryEvent;
@ -128,14 +118,14 @@ ExpReleaseOrWaitForKeyedEvent(
_In_ BOOLEAN Release) _In_ BOOLEAN Release)
{ {
PETHREAD Thread, CurrentThread; PETHREAD Thread, CurrentThread;
PKPROCESS CurrentProcess; PEPROCESS CurrentProcess;
PLIST_ENTRY ListEntry, WaitListHead1, WaitListHead2; PLIST_ENTRY ListEntry, WaitListHead1, WaitListHead2;
NTSTATUS Status; NTSTATUS Status;
ULONG_PTR HashIndex; ULONG_PTR HashIndex;
PVOID PreviousKeyedWaitValue; PVOID PreviousKeyedWaitValue;
/* Get the current process */ /* Get the current process */
CurrentProcess = KeGetCurrentProcess(); CurrentProcess = PsGetCurrentProcess();
/* Calculate the hash index */ /* Calculate the hash index */
HashIndex = (ULONG_PTR)KeyedWaitValue >> 5; HashIndex = (ULONG_PTR)KeyedWaitValue >> 5;
@ -171,7 +161,7 @@ ExpReleaseOrWaitForKeyedEvent(
ListEntry = ListEntry->Flink; ListEntry = ListEntry->Flink;
/* Check if this thread is a correct waiter */ /* Check if this thread is a correct waiter */
if ((Thread->Tcb.Process == CurrentProcess) && if ((Thread->Tcb.Process == &CurrentProcess->Pcb) &&
(Thread->KeyedWaitValue == KeyedWaitValue)) (Thread->KeyedWaitValue == KeyedWaitValue))
{ {
/* Remove the thread from the list */ /* Remove the thread from the list */

View file

@ -10,7 +10,7 @@
// //
// Define this if you want debugging support // Define this if you want debugging support
// //
#define _IO_DEBUG_ 0x01 #define _IO_DEBUG_ 0x00
// //
// These define the Debug Masks Supported // These define the Debug Masks Supported

View file

@ -417,7 +417,6 @@ PspIsProcessExiting(IN PEPROCESS Process);
// //
NTSTATUS NTSTATUS
NTAPI NTAPI
INIT_FUNCTION
ApphelpCacheInitialize(VOID); ApphelpCacheInitialize(VOID);
VOID VOID