From 016e9111567a1c7832ab3506da429c562787f9fb Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 16:38:02 +0000 Subject: [PATCH] merge 35359 from ros-amd64-bringup branch: The TEB member is called ClientId not Cid on all Windows versions I could check (XP, 2k3, vista). svn path=/trunk/; revision=35631 --- reactos/dll/ntdll/csr/api.c | 2 +- reactos/dll/ntdll/csr/connect.c | 2 +- reactos/dll/win32/gdi32/main/dllmain.c | 2 +- reactos/dll/win32/kernel32/file/pipe.c | 2 +- reactos/dll/win32/kernel32/process/proc.c | 2 +- reactos/dll/win32/kernel32/thread/thread.c | 2 +- reactos/dll/win32/user32/windows/window.c | 4 ++-- reactos/include/ndk/pstypes.h | 2 +- reactos/lib/rtl/critical.c | 12 ++++++------ reactos/lib/rtl/dbgbuffer.c | 2 +- reactos/lib/rtl/resource.c | 10 +++++----- reactos/ntoskrnl/mm/procsup.c | 2 +- reactos/subsystems/win32/win32k/ntuser/event.c | 8 ++++---- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/reactos/dll/ntdll/csr/api.c b/reactos/dll/ntdll/csr/api.c index ad1033fd72a..20e0ae7cbf1 100644 --- a/reactos/dll/ntdll/csr/api.c +++ b/reactos/dll/ntdll/csr/api.c @@ -73,7 +73,7 @@ CsrIdentifyAlertableThread (VOID) /* Set up the data for CSR */ DbgBreakPoint(); IdentifyAlertableThread = &ApiMessage.IdentifyAlertableThread; - IdentifyAlertableThread->Cid = NtCurrentTeb()->Cid; + IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId; /* Call it */ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, diff --git a/reactos/dll/ntdll/csr/connect.c b/reactos/dll/ntdll/csr/connect.c index 658cd3c1030..dc6bb7c49fd 100644 --- a/reactos/dll/ntdll/csr/connect.c +++ b/reactos/dll/ntdll/csr/connect.c @@ -152,7 +152,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage, { /* This is a server-to-server call. Save our CID and do a direct call */ DbgBreakPoint(); - ApiMessage->Header.ClientId = NtCurrentTeb()->Cid; + ApiMessage->Header.ClientId = NtCurrentTeb()->ClientId; Status = CsrServerApiRoutine(&ApiMessage->Header, &ApiMessage->Header); diff --git a/reactos/dll/win32/gdi32/main/dllmain.c b/reactos/dll/win32/gdi32/main/dllmain.c index 0e06d490e34..afd9764e912 100644 --- a/reactos/dll/win32/gdi32/main/dllmain.c +++ b/reactos/dll/win32/gdi32/main/dllmain.c @@ -48,7 +48,7 @@ GdiProcessSetup (VOID) GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; GdiDevCaps = &GdiSharedHandleTable->DevCaps; - CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess; + CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess; GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList; GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; } diff --git a/reactos/dll/win32/kernel32/file/pipe.c b/reactos/dll/win32/kernel32/file/pipe.c index a44f2c42681..fe4ff1e00d8 100644 --- a/reactos/dll/win32/kernel32/file/pipe.c +++ b/reactos/dll/win32/kernel32/file/pipe.c @@ -55,7 +55,7 @@ CreatePipe(PHANDLE hReadPipe, /* Create the pipe name */ swprintf(Buffer, L"\\Device\\NamedPipe\\Win32Pipes.%08x.%08x", - NtCurrentTeb()->Cid.UniqueProcess, + NtCurrentTeb()->ClientId.UniqueProcess, PipeId); RtlInitUnicodeString(&PipeName, Buffer); diff --git a/reactos/dll/win32/kernel32/process/proc.c b/reactos/dll/win32/kernel32/process/proc.c index 06e5f21a35e..7fe90e6844a 100644 --- a/reactos/dll/win32/kernel32/process/proc.c +++ b/reactos/dll/win32/kernel32/process/proc.c @@ -272,7 +272,7 @@ GetCurrentThread(VOID) DWORD STDCALL GetCurrentProcessId(VOID) { - return((DWORD)GetTeb()->Cid.UniqueProcess); + return((DWORD)GetTeb()->ClientId.UniqueProcess); } diff --git a/reactos/dll/win32/kernel32/thread/thread.c b/reactos/dll/win32/kernel32/thread/thread.c index 1d003ef6b3e..e5247a38ef1 100644 --- a/reactos/dll/win32/kernel32/thread/thread.c +++ b/reactos/dll/win32/kernel32/thread/thread.c @@ -319,7 +319,7 @@ DWORD WINAPI GetCurrentThreadId(VOID) { - return (DWORD)(NtCurrentTeb()->Cid).UniqueThread; + return (DWORD)(NtCurrentTeb()->ClientId).UniqueThread; } /* diff --git a/reactos/dll/win32/user32/windows/window.c b/reactos/dll/win32/user32/windows/window.c index f598c38f999..6fe94533d6d 100644 --- a/reactos/dll/win32/user32/windows/window.c +++ b/reactos/dll/win32/user32/windows/window.c @@ -1313,8 +1313,8 @@ GetWindowThreadProcessId(HWND hWnd, { // We are current. //FIXME("Current!\n"); if ( lpdwProcessId ) - *lpdwProcessId = (DWORD)NtCurrentTeb()->Cid.UniqueProcess; - Ret = (DWORD)NtCurrentTeb()->Cid.UniqueThread; + *lpdwProcessId = (DWORD)NtCurrentTeb()->ClientId.UniqueProcess; + Ret = (DWORD)NtCurrentTeb()->ClientId.UniqueThread; } else { // Ask kernel for info. diff --git a/reactos/include/ndk/pstypes.h b/reactos/include/ndk/pstypes.h index 77498367863..d19f7ef3604 100644 --- a/reactos/include/ndk/pstypes.h +++ b/reactos/include/ndk/pstypes.h @@ -729,7 +729,7 @@ typedef struct _TEB { NT_TIB Tib; PVOID EnvironmentPointer; - CLIENT_ID Cid; + CLIENT_ID ClientId; PVOID ActiveRpcHandle; PVOID ThreadLocalStoragePointer; struct _PEB *ProcessEnvironmentBlock; diff --git a/reactos/lib/rtl/critical.c b/reactos/lib/rtl/critical.c index 5dda956f6f6..da7314429a1 100644 --- a/reactos/lib/rtl/critical.c +++ b/reactos/lib/rtl/critical.c @@ -310,7 +310,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n", DebugInfo, EntryId, - NtCurrentTeb()->Cid.UniqueProcess); + NtCurrentTeb()->ClientId.UniqueProcess); RtlpDebugInfoFreeList[EntryId] = FALSE; } else { @@ -318,7 +318,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) /* It's a dynamic one, so free from the heap */ DPRINT("Freeing from Heap: %p inside Process: %p\n", DebugInfo, - NtCurrentTeb()->Cid.UniqueProcess); + NtCurrentTeb()->ClientId.UniqueProcess); RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); } @@ -424,7 +424,7 @@ NTSTATUS NTAPI RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) { - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; + HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread; /* Try to Lock it */ if (_InterlockedIncrement(&CriticalSection->LockCount) != 0) { @@ -522,7 +522,7 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection, CritcalSectionDebugData = RtlpAllocateDebugInfo(); DPRINT("Allocated Debug Data: %p inside Process: %p\n", CritcalSectionDebugData, - NtCurrentTeb()->Cid.UniqueProcess); + NtCurrentTeb()->ClientId.UniqueProcess); if (!CritcalSectionDebugData) { @@ -657,11 +657,11 @@ RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -1) == -1) { /* It's ours */ - CriticalSection->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + CriticalSection->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; CriticalSection->RecursionCount = 1; return TRUE; - } else if (CriticalSection->OwningThread == NtCurrentTeb()->Cid.UniqueThread) { + } else if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { /* It's already ours */ _InterlockedIncrement(&CriticalSection->LockCount); diff --git a/reactos/lib/rtl/dbgbuffer.c b/reactos/lib/rtl/dbgbuffer.c index f723fe12839..323940956c3 100644 --- a/reactos/lib/rtl/dbgbuffer.c +++ b/reactos/lib/rtl/dbgbuffer.c @@ -234,7 +234,7 @@ RtlQueryProcessDebugInformation(IN ULONG ProcessId, IN OUT PRTL_DEBUG_INFORMATION Buf) { NTSTATUS Status = STATUS_SUCCESS; - ULONG Pid = (ULONG) NtCurrentTeb()->Cid.UniqueProcess; + ULONG Pid = (ULONG) NtCurrentTeb()->ClientId.UniqueProcess; Buf->Flags = DebugInfoMask; Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION); diff --git a/reactos/lib/rtl/resource.c b/reactos/lib/rtl/resource.c index 2861b6bc8b4..8a21e0aefbc 100644 --- a/reactos/lib/rtl/resource.c +++ b/reactos/lib/rtl/resource.c @@ -94,7 +94,7 @@ start: } else if (Resource->NumberActive < 0) /* exclusive lock in progress */ { - if (Resource->OwningThread == NtCurrentTeb()->Cid.UniqueThread) + if (Resource->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { retVal = TRUE; Resource->NumberActive--; @@ -120,7 +120,7 @@ wait: goto wait; } if (retVal == TRUE) - Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; done: RtlLeaveCriticalSection(&Resource->Lock); return retVal; @@ -141,7 +141,7 @@ start: RtlEnterCriticalSection(&Resource->Lock); if (Resource->NumberActive < 0) { - if (Resource->OwningThread == NtCurrentTeb()->Cid.UniqueThread) + if (Resource->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { Resource->NumberActive--; retVal = TRUE; @@ -218,7 +218,7 @@ RtlConvertSharedToExclusive(PRTL_RESOURCE Resource) if (Resource->NumberActive == 1) { - Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; Resource->NumberActive = -1; } else @@ -233,7 +233,7 @@ RtlConvertSharedToExclusive(PRTL_RESOURCE Resource) return; RtlEnterCriticalSection(&Resource->Lock); - Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; Resource->NumberActive = -1; } RtlLeaveCriticalSection(&Resource->Lock); diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index fdfd902b4aa..83e1af8f003 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -452,7 +452,7 @@ MmCreateTeb(PEPROCESS Process, Teb->Tib.Self = (PNT_TIB)Teb; /* Set TEB Data */ - Teb->Cid = *ClientId; + Teb->ClientId = *ClientId; Teb->RealClientId = *ClientId; Teb->ProcessEnvironmentBlock = Process->Peb; Teb->CurrentLocale = PsDefaultThreadLocaleId; diff --git a/reactos/subsystems/win32/win32k/ntuser/event.c b/reactos/subsystems/win32/win32k/ntuser/event.c index 5c379685435..12cca3a551b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/event.c +++ b/reactos/subsystems/win32/win32k/ntuser/event.c @@ -155,7 +155,7 @@ co_EVENT_CallEvents( DWORD event, hwnd, pEP->idObject, pEP->idChild, - (DWORD)(NtCurrentTeb()->Cid).UniqueThread, + (DWORD)(NtCurrentTeb()->ClientId).UniqueThread, (DWORD)EngGetTickCount(), pEH->Proc); return Result; @@ -185,14 +185,14 @@ IntNotifyWinEvent( if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL)) { // if all process || all thread || other thread same process if (!(pEH->idProcess) || !(pEH->idThread) || - ((DWORD)(NtCurrentTeb()->Cid).UniqueProcess == pEH->idProcess)) + ((DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess)) { Result = IntCallLowLevelEvent(pEH, Event, Window->hSelf, idObject, idChild); } }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process) else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) && ( ((pEH->idProcess && - (DWORD)(NtCurrentTeb()->Cid).UniqueProcess == pEH->idProcess) && + (DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess) && !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) || !pEH->idProcess ) ) { @@ -201,7 +201,7 @@ IntNotifyWinEvent( Window->hSelf, idObject, idChild, - (DWORD)(NtCurrentTeb()->Cid).UniqueThread, + (DWORD)(NtCurrentTeb()->ClientId).UniqueThread, (DWORD)EngGetTickCount(), pEH->Proc); }