[ros-diffs] [tkreuzer] 35359: The TEB member is called ClientID not Cid on all Windows versions I could check (XP, 2k3, vista).

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat Aug 16 01:40:43 CEST 2008


Author: tkreuzer
Date: Fri Aug 15 18:40:42 2008
New Revision: 35359

URL: http://svn.reactos.org/svn/reactos?rev=35359&view=rev
Log:
The TEB member is called ClientID not Cid on all Windows versions I could check (XP, 2k3, vista).

Modified:
    branches/ros-amd64-bringup/reactos/dll/ntdll/csr/api.c
    branches/ros-amd64-bringup/reactos/dll/ntdll/csr/connect.c
    branches/ros-amd64-bringup/reactos/dll/win32/gdi32/main/dllmain.c
    branches/ros-amd64-bringup/reactos/dll/win32/kernel32/file/pipe.c
    branches/ros-amd64-bringup/reactos/dll/win32/kernel32/process/proc.c
    branches/ros-amd64-bringup/reactos/dll/win32/kernel32/thread/thread.c
    branches/ros-amd64-bringup/reactos/dll/win32/user32/windows/window.c
    branches/ros-amd64-bringup/reactos/include/ndk/pstypes.h
    branches/ros-amd64-bringup/reactos/lib/rtl/critical.c
    branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c
    branches/ros-amd64-bringup/reactos/lib/rtl/resource.c
    branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c
    branches/ros-amd64-bringup/reactos/subsystems/win32/win32k/ntuser/event.c

Modified: branches/ros-amd64-bringup/reactos/dll/ntdll/csr/api.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/ntdll/csr/api.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/ntdll/csr/api.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/ntdll/csr/api.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -73,7 +73,7 @@
     /* 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,

Modified: branches/ros-amd64-bringup/reactos/dll/ntdll/csr/connect.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/ntdll/csr/connect.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/ntdll/csr/connect.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/ntdll/csr/connect.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -152,7 +152,7 @@
     {
         /* 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);
        

Modified: branches/ros-amd64-bringup/reactos/dll/win32/gdi32/main/dllmain.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/win32/gdi32/main/dllmain.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/win32/gdi32/main/dllmain.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/win32/gdi32/main/dllmain.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -48,7 +48,7 @@
     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;
 }

Modified: branches/ros-amd64-bringup/reactos/dll/win32/kernel32/file/pipe.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/win32/kernel32/file/pipe.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/win32/kernel32/file/pipe.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/win32/kernel32/file/pipe.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -55,7 +55,7 @@
     /* Create the pipe name */
     swprintf(Buffer,
              L"\\Device\\NamedPipe\\Win32Pipes.%08x.%08x",
-             NtCurrentTeb()->Cid.UniqueProcess,
+             NtCurrentTeb()->ClientId.UniqueProcess,
              PipeId);
     RtlInitUnicodeString(&PipeName, Buffer);
 

Modified: branches/ros-amd64-bringup/reactos/dll/win32/kernel32/process/proc.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/win32/kernel32/process/proc.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -272,7 +272,7 @@
 DWORD STDCALL
 GetCurrentProcessId(VOID)
 {
-  return((DWORD)GetTeb()->Cid.UniqueProcess);
+  return((DWORD)GetTeb()->ClientId.UniqueProcess);
 }
 
 

Modified: branches/ros-amd64-bringup/reactos/dll/win32/kernel32/thread/thread.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/win32/kernel32/thread/thread.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/win32/kernel32/thread/thread.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/win32/kernel32/thread/thread.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -319,7 +319,7 @@
 WINAPI
 GetCurrentThreadId(VOID)
 {
-    return (DWORD)(NtCurrentTeb()->Cid).UniqueThread;
+    return (DWORD)(NtCurrentTeb()->ClientId).UniqueThread;
 }
 
 /*

Modified: branches/ros-amd64-bringup/reactos/dll/win32/user32/windows/window.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/win32/user32/windows/window.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -1313,8 +1313,8 @@
     { // 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.

Modified: branches/ros-amd64-bringup/reactos/include/ndk/pstypes.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/ndk/pstypes.h?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ndk/pstypes.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ndk/pstypes.h [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -755,7 +755,7 @@
 {
     NT_TIB Tib;
     PVOID EnvironmentPointer;
-    CLIENT_ID Cid;
+    CLIENT_ID ClientId;
     PVOID ActiveRpcHandle;
     PVOID ThreadLocalStoragePointer;
     struct _PEB *ProcessEnvironmentBlock;

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/critical.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/critical.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/critical.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/critical.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -310,7 +310,7 @@
         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 @@
         /* 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 @@
 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 @@
     CritcalSectionDebugData = RtlpAllocateDebugInfo();
     DPRINT("Allocated Debug Data: %p inside Process: %p\n",
            CritcalSectionDebugData,
-           NtCurrentTeb()->Cid.UniqueProcess);
+           NtCurrentTeb()->ClientId.UniqueProcess);
 
     if (!CritcalSectionDebugData) {
 
@@ -657,11 +657,11 @@
                                     -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);

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -234,7 +234,7 @@
                                 IN OUT PRTL_DEBUG_INFORMATION Buf)
 {
    NTSTATUS Status = STATUS_SUCCESS;
-   ULONG Pid = (ULONG_PTR) NtCurrentTeb()->Cid.UniqueProcess;
+   ULONG Pid = (ULONG_PTR) NtCurrentTeb()->ClientId.UniqueProcess;
 
    Buf->Flags = DebugInfoMask;
    Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION);

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/resource.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/resource.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/resource.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/resource.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -94,7 +94,7 @@
       }
     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 @@
 	  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 @@
    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 @@
 
    if (Resource->NumberActive == 1)
      {
-	Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread;
+	Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread;
 	Resource->NumberActive = -1;
      }
    else
@@ -233,7 +233,7 @@
 	   return;
 
 	RtlEnterCriticalSection(&Resource->Lock);
-	Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread;
+	Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread;
 	Resource->NumberActive = -1;
      }
    RtlLeaveCriticalSection(&Resource->Lock);

Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -452,7 +452,7 @@
     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;

Modified: branches/ros-amd64-bringup/reactos/subsystems/win32/win32k/ntuser/event.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/subsystems/win32/win32k/ntuser/event.c?rev=35359&r1=35358&r2=35359&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Fri Aug 15 18:40:42 2008
@@ -155,7 +155,7 @@
                                       hwnd,
                              pEP->idObject,
                               pEP->idChild,
- (DWORD)(NtCurrentTeb()->Cid).UniqueThread,
+ (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
                   (DWORD)EngGetTickCount(),
                                  pEH->Proc);
    return Result;
@@ -185,14 +185,14 @@
         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 @@
                                      Window->hSelf,
                                           idObject,
                                            idChild,
-         (DWORD)(NtCurrentTeb()->Cid).UniqueThread,
+    (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
                           (DWORD)EngGetTickCount(),
                                          pEH->Proc);
         }



More information about the Ros-diffs mailing list