clear out the lower 2 bits of a pid before using it to calculate the
hash as they may vary
Modified: trunk/reactos/subsys/csrss/api/process.c
_____
Modified: trunk/reactos/subsys/csrss/api/process.c
--- trunk/reactos/subsys/csrss/api/process.c 2005-07-28 23:22:47 UTC
(rev 16848)
+++ trunk/reactos/subsys/csrss/api/process.c 2005-07-28 23:29:44 UTC
(rev 16849)
@@ -37,7 +37,7 @@
ULONG hash;
PCSRSS_PROCESS_DATA pProcessData;
- hash = (ULONG_PTR)ProcessId % (sizeof(ProcessData) /
sizeof(*ProcessData));
+ hash = ((ULONG_PTR)ProcessId & ~0x3) % (sizeof(ProcessData) /
sizeof(*ProcessData));
LOCK;
@@ -59,7 +59,7 @@
CLIENT_ID ClientId;
NTSTATUS Status;
- hash = (ULONG_PTR)ProcessId % (sizeof(ProcessData) /
sizeof(*ProcessData));
+ hash = ((ULONG_PTR)ProcessId & ~0x3) % (sizeof(ProcessData) /
sizeof(*ProcessData));
LOCK;
@@ -121,7 +121,7 @@
UINT c;
PCSRSS_PROCESS_DATA pProcessData, pPrevProcessData = NULL;
- hash = (ULONG_PTR)Pid % (sizeof(ProcessData) / sizeof(*ProcessData));
+ hash = ((ULONG_PTR)Pid & ~0x3) % (sizeof(ProcessData) /
sizeof(*ProcessData));
LOCK;
Show replies by date