mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 21:44:31 +00:00
- Use the Spare0 array, present in EPROCESS instead of ReactOS-specific members for Process Locking (temporary fix until pushlocks are used).
svn path=/trunk/; revision=21933
This commit is contained in:
parent
bf6dcf5f85
commit
93a0bb6787
|
@ -200,9 +200,6 @@ typedef struct _ROS_EPROCESS
|
|||
UCHAR PriorityClass;
|
||||
MM_AVL_TABLE VadRoot;
|
||||
ULONG Cookie;
|
||||
KEVENT LockEvent;
|
||||
ULONG LockCount;
|
||||
struct _KTHREAD *LockOwner;
|
||||
MADDRESS_SPACE AddressSpace;
|
||||
} ROS_EPROCESS, *PROS_EPROCESS;
|
||||
#include <poppack.h>
|
||||
|
|
|
@ -14,6 +14,11 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
#define LockEvent Spare0[0]
|
||||
#define LockCount Spare0[1]
|
||||
#define LockOwner Spare0[2]
|
||||
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
PETHREAD PspReaperList = NULL;
|
||||
|
@ -159,6 +164,9 @@ PspDeleteProcess(PVOID ObjectBody)
|
|||
ExDestroyHandle(PspCidTable, Process->UniqueProcessId);
|
||||
}
|
||||
|
||||
/* Delete the process lock */
|
||||
ExFreePool(((PROS_EPROCESS)Process)->LockEvent);
|
||||
|
||||
/* KDB hook */
|
||||
KDB_DELETEPROCESS_HOOK(Process);
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
#define LockEvent Spare0[0]
|
||||
#define LockCount Spare0[1]
|
||||
#define LockOwner Spare0[2]
|
||||
|
||||
/* GLOBALS ******************************************************************/
|
||||
|
||||
PEPROCESS PsInitialSystemProcess = NULL;
|
||||
|
@ -52,7 +56,7 @@ PsLockProcess(PROS_EPROCESS Process, BOOLEAN Timeout)
|
|||
/* we got the lock or already locked it */
|
||||
if(InterlockedIncrementUL(&Process->LockCount) == 1)
|
||||
{
|
||||
KeClearEvent(&Process->LockEvent);
|
||||
KeClearEvent(Process->LockEvent);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -61,7 +65,7 @@ PsLockProcess(PROS_EPROCESS Process, BOOLEAN Timeout)
|
|||
{
|
||||
if(++Attempts > 2)
|
||||
{
|
||||
Status = KeWaitForSingleObject(&Process->LockEvent,
|
||||
Status = KeWaitForSingleObject(Process->LockEvent,
|
||||
Executive,
|
||||
KernelMode,
|
||||
FALSE,
|
||||
|
@ -99,7 +103,7 @@ PsUnlockProcess(PROS_EPROCESS Process)
|
|||
if(InterlockedDecrementUL(&Process->LockCount) == 0)
|
||||
{
|
||||
(void)InterlockedExchangePointer(&Process->LockOwner, NULL);
|
||||
KeSetEvent(&Process->LockEvent, IO_NO_INCREMENT, FALSE);
|
||||
KeSetEvent(Process->LockEvent, IO_NO_INCREMENT, FALSE);
|
||||
}
|
||||
|
||||
KeLeaveCriticalRegion();
|
||||
|
@ -325,7 +329,10 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
|
||||
/* Setup the Lock Event */
|
||||
DPRINT("Initialzing Process Lock\n");
|
||||
KeInitializeEvent(&((PROS_EPROCESS)Process)->LockEvent, SynchronizationEvent, FALSE);
|
||||
((PROS_EPROCESS)Process)->LockEvent = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(KEVENT),
|
||||
TAG('P', 's', 'L', 'k'));
|
||||
KeInitializeEvent(((PROS_EPROCESS)Process)->LockEvent, SynchronizationEvent, FALSE);
|
||||
|
||||
/* Setup the Thread List Head */
|
||||
DPRINT("Initialzing Process ThreadListHead\n");
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
#define LockEvent Spare0[0]
|
||||
#define LockCount Spare0[1]
|
||||
#define LockOwner Spare0[2]
|
||||
|
||||
extern LARGE_INTEGER ShortPsLockDelay, PsLockTimeout;
|
||||
extern LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY];
|
||||
|
||||
|
@ -253,7 +257,9 @@ PsInitProcessManagment(VOID)
|
|||
MmInitializeAddressSpace((PROS_EPROCESS)PsInitialSystemProcess,
|
||||
&((PROS_EPROCESS)PsInitialSystemProcess)->AddressSpace);
|
||||
|
||||
KeInitializeEvent(&((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent, SynchronizationEvent, FALSE);
|
||||
((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent =
|
||||
ExAllocatePoolWithTag(PagedPool, sizeof(KEVENT), TAG('P', 's', 'L', 'k'));
|
||||
KeInitializeEvent(((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent, SynchronizationEvent, FALSE);
|
||||
|
||||
#if defined(__GNUC__)
|
||||
KProcess->DirectoryTableBase =
|
||||
|
|
Loading…
Reference in a new issue