mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Fixed the calculation of the hash for the process data.
svn path=/trunk/; revision=18756
This commit is contained in:
parent
fea86552f0
commit
aaa2a0d33a
1 changed files with 8 additions and 7 deletions
|
@ -37,7 +37,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrGetProcessData(HANDLE ProcessId)
|
|||
ULONG hash;
|
||||
PCSRSS_PROCESS_DATA pProcessData;
|
||||
|
||||
hash = ((ULONG_PTR)ProcessId & ~0x3) % (sizeof(ProcessData) / sizeof(*ProcessData));
|
||||
hash = ((ULONG_PTR)ProcessId >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData));
|
||||
|
||||
LOCK;
|
||||
|
||||
|
@ -59,7 +59,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrCreateProcessData(HANDLE ProcessId)
|
|||
CLIENT_ID ClientId;
|
||||
NTSTATUS Status;
|
||||
|
||||
hash = ((ULONG_PTR)ProcessId & ~0x3) % (sizeof(ProcessData) / sizeof(*ProcessData));
|
||||
hash = ((ULONG_PTR)ProcessId >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData));
|
||||
|
||||
LOCK;
|
||||
|
||||
|
@ -100,7 +100,10 @@ PCSRSS_PROCESS_DATA STDCALL CsrCreateProcessData(HANDLE ProcessId)
|
|||
RtlFreeHeap(CsrssApiHeap, 0, pProcessData);
|
||||
pProcessData = NULL;
|
||||
}
|
||||
RtlInitializeCriticalSection(&pProcessData->HandleTableLock);
|
||||
else
|
||||
{
|
||||
RtlInitializeCriticalSection(&pProcessData->HandleTableLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -110,7 +113,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrCreateProcessData(HANDLE ProcessId)
|
|||
UNLOCK;
|
||||
if (pProcessData == NULL)
|
||||
{
|
||||
DbgPrint("CSR: CsrGetProcessData() failed\n");
|
||||
DPRINT1("CsrCreateProcessData() failed\n");
|
||||
}
|
||||
return pProcessData;
|
||||
}
|
||||
|
@ -121,7 +124,7 @@ NTSTATUS STDCALL CsrFreeProcessData(HANDLE Pid)
|
|||
UINT c;
|
||||
PCSRSS_PROCESS_DATA pProcessData, pPrevProcessData = NULL;
|
||||
|
||||
hash = ((ULONG_PTR)Pid & ~0x3) % (sizeof(ProcessData) / sizeof(*ProcessData));
|
||||
hash = ((ULONG_PTR)Pid >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData));
|
||||
|
||||
LOCK;
|
||||
|
||||
|
@ -142,9 +145,7 @@ NTSTATUS STDCALL CsrFreeProcessData(HANDLE Pid)
|
|||
}
|
||||
if (pProcessData->Console)
|
||||
{
|
||||
RtlEnterCriticalSection(&ProcessDataLock);
|
||||
RemoveEntryList(&pProcessData->ProcessEntry);
|
||||
RtlLeaveCriticalSection(&ProcessDataLock);
|
||||
}
|
||||
if (pProcessData->HandleTable)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue