Author: tkreuzer
Date: Sun Jul 28 13:54:42 2013
New Revision: 59592
URL:
http://svn.reactos.org/svn/reactos?rev=59592&view=rev
Log:
[CSRSRV]
Use symbolic constant for number of hash buckets and use it where appropriate (fixing one
missing location).
Modified:
trunk/reactos/subsystems/win32/csrsrv/api.h
trunk/reactos/subsystems/win32/csrsrv/procsup.c
trunk/reactos/subsystems/win32/csrsrv/thredsup.c
Modified: trunk/reactos/subsystems/win32/csrsrv/api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/ap…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/api.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/api.h [iso-8859-1] Sun Jul 28 13:54:42 2013
@@ -45,7 +45,8 @@
extern HANDLE CsrApiPort;
extern HANDLE CsrSmApiPort;
extern HANDLE CsrSbApiPort;
-extern LIST_ENTRY CsrThreadHashTable[257];
+#define NUMBER_THREAD_HASH_BUCKETS 257
+extern LIST_ENTRY CsrThreadHashTable[NUMBER_THREAD_HASH_BUCKETS];
extern PCSR_PROCESS CsrRootProcess;
extern UNICODE_STRING CsrDirectoryName;
extern ULONG CsrDebug;
Modified: trunk/reactos/subsystems/win32/csrsrv/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/pr…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/procsup.c [iso-8859-1] Sun Jul 28 13:54:42 2013
@@ -371,7 +371,7 @@
CsrRootProcess->ClientId = NtCurrentTeb()->ClientId;
/* Initialize the Thread Hash List */
- for (i = 0; i < 256; i++) InitializeListHead(&CsrThreadHashTable[i]);
+ for (i = 0; i < NUMBER_THREAD_HASH_BUCKETS; i++)
InitializeListHead(&CsrThreadHashTable[i]);
/* Initialize the Wait Lock */
return RtlInitializeCriticalSection(&CsrWaitListsLock);
@@ -1382,7 +1382,7 @@
/* Acquire process lock */
CsrAcquireProcessLock();
-
+
/* Get the list pointers */
NextEntry = CsrRootProcess->ListLink.Flink;
while (NextEntry != &CsrRootProcess->ListLink)
@@ -1397,13 +1397,13 @@
CsrProcess->Flags &= ~CsrProcessSkipShutdown;
CsrProcess->ShutdownFlags = 0;
}
-
+
/* Set shudown Priority */
CsrSetToShutdownPriority();
/* Loop all processes */
//DPRINT1("Enumerating for LUID: %lx %lx\n", CallerLuid->HighPart,
CallerLuid->LowPart);
-
+
/* Start looping */
while (TRUE)
{
Modified: trunk/reactos/subsystems/win32/csrsrv/thredsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/th…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/thredsup.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/thredsup.c [iso-8859-1] Sun Jul 28 13:54:42
2013
@@ -14,11 +14,11 @@
#define NDEBUG
#include <debug.h>
-#define CsrHashThread(t) (HandleToUlong(t) % 257)
+#define CsrHashThread(t) (HandleToUlong(t) % NUMBER_THREAD_HASH_BUCKETS)
/* GLOBALS ********************************************************************/
-LIST_ENTRY CsrThreadHashTable[257];
+LIST_ENTRY CsrThreadHashTable[NUMBER_THREAD_HASH_BUCKETS];
/* PRIVATE FUNCTIONS **********************************************************/