From fa5cd6e23cbad457e81b2698ba844a5ea1e94ba0 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Thu, 1 Feb 2007 21:44:23 +0000 Subject: [PATCH] - Compile csrss with intrinsics - Remove the intrlck dependency svn path=/trunk/; revision=25671 --- reactos/subsystems/win32/csrss/api/handle.c | 8 ++++---- reactos/subsystems/win32/csrss/csrss.h | 2 ++ reactos/subsystems/win32/csrss/csrss.rbuild | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/subsystems/win32/csrss/api/handle.c b/reactos/subsystems/win32/csrss/api/handle.c index ae57db53853..64fec674b29 100644 --- a/reactos/subsystems/win32/csrss/api/handle.c +++ b/reactos/subsystems/win32/csrss/api/handle.c @@ -88,7 +88,7 @@ CsrReleaseObjectByPointer(Object_t *Object) unsigned DefIndex; /* dec ref count */ - if (InterlockedDecrement(&Object->ReferenceCount) == 0) + if (_InterlockedDecrement(&Object->ReferenceCount) == 0) { Found = FALSE; for (DefIndex = 0; ! Found && DefIndex < ObjectDefinitionsCount; DefIndex++) @@ -166,13 +166,13 @@ NTSTATUS STDCALL CsrInsertObject( PCSRSS_PROCESS_DATA ProcessData, PHANDLE Handl RtlCopyMemory(Block, ProcessData->HandleTable, ProcessData->HandleTableSize * sizeof(HANDLE)); - Block = InterlockedExchangePointer(&ProcessData->HandleTable, Block); + Block = _InterlockedExchangePointer((volatile void*)&ProcessData->HandleTable, Block); RtlFreeHeap( CsrssApiHeap, 0, Block ); ProcessData->HandleTableSize += 64; } ProcessData->HandleTable[i] = Object; *Handle = (HANDLE)(((i + 1) << 2) | 0x3); - InterlockedIncrement( &Object->ReferenceCount ); + _InterlockedIncrement( &Object->ReferenceCount ); RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return(STATUS_SUCCESS); } @@ -207,7 +207,7 @@ NTSTATUS STDCALL CsrDuplicateHandleTable(PCSRSS_PROCESS_DATA SourceProcessData, if (SourceProcessData->HandleTable[i]) { TargetProcessData->HandleTable[i] = SourceProcessData->HandleTable[i]; - InterlockedIncrement( &SourceProcessData->HandleTable[i]->ReferenceCount ); + _InterlockedIncrement( &SourceProcessData->HandleTable[i]->ReferenceCount ); } } RtlLeaveCriticalSection(&SourceProcessData->HandleTableLock); diff --git a/reactos/subsystems/win32/csrss/csrss.h b/reactos/subsystems/win32/csrss/csrss.h index 686c4adea12..447c2e03521 100644 --- a/reactos/subsystems/win32/csrss/csrss.h +++ b/reactos/subsystems/win32/csrss/csrss.h @@ -5,6 +5,8 @@ #define NTOS_MODE_USER #include +#include + /* Build Number */ #include diff --git a/reactos/subsystems/win32/csrss/csrss.rbuild b/reactos/subsystems/win32/csrss/csrss.rbuild index 5ae14e0ce30..2dd26262566 100644 --- a/reactos/subsystems/win32/csrss/csrss.rbuild +++ b/reactos/subsystems/win32/csrss/csrss.rbuild @@ -10,7 +10,6 @@ nt - intrlck ntdll smdll