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
This commit is contained in:
Timo Kreuzer 2008-08-25 16:38:02 +00:00
parent b81b76caab
commit 016e911156
13 changed files with 26 additions and 26 deletions

View file

@ -73,7 +73,7 @@ CsrIdentifyAlertableThread (VOID)
/* Set up the data for CSR */ /* Set up the data for CSR */
DbgBreakPoint(); DbgBreakPoint();
IdentifyAlertableThread = &ApiMessage.IdentifyAlertableThread; IdentifyAlertableThread = &ApiMessage.IdentifyAlertableThread;
IdentifyAlertableThread->Cid = NtCurrentTeb()->Cid; IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId;
/* Call it */ /* Call it */
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,

View file

@ -152,7 +152,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
{ {
/* This is a server-to-server call. Save our CID and do a direct call */ /* This is a server-to-server call. Save our CID and do a direct call */
DbgBreakPoint(); DbgBreakPoint();
ApiMessage->Header.ClientId = NtCurrentTeb()->Cid; ApiMessage->Header.ClientId = NtCurrentTeb()->ClientId;
Status = CsrServerApiRoutine(&ApiMessage->Header, Status = CsrServerApiRoutine(&ApiMessage->Header,
&ApiMessage->Header); &ApiMessage->Header);

View file

@ -48,7 +48,7 @@ GdiProcessSetup (VOID)
GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
GdiDevCaps = &GdiSharedHandleTable->DevCaps; GdiDevCaps = &GdiSharedHandleTable->DevCaps;
CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess; CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess;
GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList; GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
} }

View file

@ -55,7 +55,7 @@ CreatePipe(PHANDLE hReadPipe,
/* Create the pipe name */ /* Create the pipe name */
swprintf(Buffer, swprintf(Buffer,
L"\\Device\\NamedPipe\\Win32Pipes.%08x.%08x", L"\\Device\\NamedPipe\\Win32Pipes.%08x.%08x",
NtCurrentTeb()->Cid.UniqueProcess, NtCurrentTeb()->ClientId.UniqueProcess,
PipeId); PipeId);
RtlInitUnicodeString(&PipeName, Buffer); RtlInitUnicodeString(&PipeName, Buffer);

View file

@ -272,7 +272,7 @@ GetCurrentThread(VOID)
DWORD STDCALL DWORD STDCALL
GetCurrentProcessId(VOID) GetCurrentProcessId(VOID)
{ {
return((DWORD)GetTeb()->Cid.UniqueProcess); return((DWORD)GetTeb()->ClientId.UniqueProcess);
} }

View file

@ -319,7 +319,7 @@ DWORD
WINAPI WINAPI
GetCurrentThreadId(VOID) GetCurrentThreadId(VOID)
{ {
return (DWORD)(NtCurrentTeb()->Cid).UniqueThread; return (DWORD)(NtCurrentTeb()->ClientId).UniqueThread;
} }
/* /*

View file

@ -1313,8 +1313,8 @@ GetWindowThreadProcessId(HWND hWnd,
{ // We are current. { // We are current.
//FIXME("Current!\n"); //FIXME("Current!\n");
if ( lpdwProcessId ) if ( lpdwProcessId )
*lpdwProcessId = (DWORD)NtCurrentTeb()->Cid.UniqueProcess; *lpdwProcessId = (DWORD)NtCurrentTeb()->ClientId.UniqueProcess;
Ret = (DWORD)NtCurrentTeb()->Cid.UniqueThread; Ret = (DWORD)NtCurrentTeb()->ClientId.UniqueThread;
} }
else else
{ // Ask kernel for info. { // Ask kernel for info.

View file

@ -729,7 +729,7 @@ typedef struct _TEB
{ {
NT_TIB Tib; NT_TIB Tib;
PVOID EnvironmentPointer; PVOID EnvironmentPointer;
CLIENT_ID Cid; CLIENT_ID ClientId;
PVOID ActiveRpcHandle; PVOID ActiveRpcHandle;
PVOID ThreadLocalStoragePointer; PVOID ThreadLocalStoragePointer;
struct _PEB *ProcessEnvironmentBlock; struct _PEB *ProcessEnvironmentBlock;

View file

@ -310,7 +310,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n", DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n",
DebugInfo, DebugInfo,
EntryId, EntryId,
NtCurrentTeb()->Cid.UniqueProcess); NtCurrentTeb()->ClientId.UniqueProcess);
RtlpDebugInfoFreeList[EntryId] = FALSE; RtlpDebugInfoFreeList[EntryId] = FALSE;
} else { } else {
@ -318,7 +318,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
/* It's a dynamic one, so free from the heap */ /* It's a dynamic one, so free from the heap */
DPRINT("Freeing from Heap: %p inside Process: %p\n", DPRINT("Freeing from Heap: %p inside Process: %p\n",
DebugInfo, DebugInfo,
NtCurrentTeb()->Cid.UniqueProcess); NtCurrentTeb()->ClientId.UniqueProcess);
RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo);
} }
@ -424,7 +424,7 @@ NTSTATUS
NTAPI NTAPI
RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
{ {
HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread;
/* Try to Lock it */ /* Try to Lock it */
if (_InterlockedIncrement(&CriticalSection->LockCount) != 0) { if (_InterlockedIncrement(&CriticalSection->LockCount) != 0) {
@ -522,7 +522,7 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection,
CritcalSectionDebugData = RtlpAllocateDebugInfo(); CritcalSectionDebugData = RtlpAllocateDebugInfo();
DPRINT("Allocated Debug Data: %p inside Process: %p\n", DPRINT("Allocated Debug Data: %p inside Process: %p\n",
CritcalSectionDebugData, CritcalSectionDebugData,
NtCurrentTeb()->Cid.UniqueProcess); NtCurrentTeb()->ClientId.UniqueProcess);
if (!CritcalSectionDebugData) { if (!CritcalSectionDebugData) {
@ -657,11 +657,11 @@ RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
-1) == -1) { -1) == -1) {
/* It's ours */ /* It's ours */
CriticalSection->OwningThread = NtCurrentTeb()->Cid.UniqueThread; CriticalSection->OwningThread = NtCurrentTeb()->ClientId.UniqueThread;
CriticalSection->RecursionCount = 1; CriticalSection->RecursionCount = 1;
return TRUE; return TRUE;
} else if (CriticalSection->OwningThread == NtCurrentTeb()->Cid.UniqueThread) { } else if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) {
/* It's already ours */ /* It's already ours */
_InterlockedIncrement(&CriticalSection->LockCount); _InterlockedIncrement(&CriticalSection->LockCount);

View file

@ -234,7 +234,7 @@ RtlQueryProcessDebugInformation(IN ULONG ProcessId,
IN OUT PRTL_DEBUG_INFORMATION Buf) IN OUT PRTL_DEBUG_INFORMATION Buf)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
ULONG Pid = (ULONG) NtCurrentTeb()->Cid.UniqueProcess; ULONG Pid = (ULONG) NtCurrentTeb()->ClientId.UniqueProcess;
Buf->Flags = DebugInfoMask; Buf->Flags = DebugInfoMask;
Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION); Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION);

View file

@ -94,7 +94,7 @@ start:
} }
else if (Resource->NumberActive < 0) /* exclusive lock in progress */ else if (Resource->NumberActive < 0) /* exclusive lock in progress */
{ {
if (Resource->OwningThread == NtCurrentTeb()->Cid.UniqueThread) if (Resource->OwningThread == NtCurrentTeb()->ClientId.UniqueThread)
{ {
retVal = TRUE; retVal = TRUE;
Resource->NumberActive--; Resource->NumberActive--;
@ -120,7 +120,7 @@ wait:
goto wait; goto wait;
} }
if (retVal == TRUE) if (retVal == TRUE)
Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread;
done: done:
RtlLeaveCriticalSection(&Resource->Lock); RtlLeaveCriticalSection(&Resource->Lock);
return retVal; return retVal;
@ -141,7 +141,7 @@ start:
RtlEnterCriticalSection(&Resource->Lock); RtlEnterCriticalSection(&Resource->Lock);
if (Resource->NumberActive < 0) if (Resource->NumberActive < 0)
{ {
if (Resource->OwningThread == NtCurrentTeb()->Cid.UniqueThread) if (Resource->OwningThread == NtCurrentTeb()->ClientId.UniqueThread)
{ {
Resource->NumberActive--; Resource->NumberActive--;
retVal = TRUE; retVal = TRUE;
@ -218,7 +218,7 @@ RtlConvertSharedToExclusive(PRTL_RESOURCE Resource)
if (Resource->NumberActive == 1) if (Resource->NumberActive == 1)
{ {
Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread;
Resource->NumberActive = -1; Resource->NumberActive = -1;
} }
else else
@ -233,7 +233,7 @@ RtlConvertSharedToExclusive(PRTL_RESOURCE Resource)
return; return;
RtlEnterCriticalSection(&Resource->Lock); RtlEnterCriticalSection(&Resource->Lock);
Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread;
Resource->NumberActive = -1; Resource->NumberActive = -1;
} }
RtlLeaveCriticalSection(&Resource->Lock); RtlLeaveCriticalSection(&Resource->Lock);

View file

@ -452,7 +452,7 @@ MmCreateTeb(PEPROCESS Process,
Teb->Tib.Self = (PNT_TIB)Teb; Teb->Tib.Self = (PNT_TIB)Teb;
/* Set TEB Data */ /* Set TEB Data */
Teb->Cid = *ClientId; Teb->ClientId = *ClientId;
Teb->RealClientId = *ClientId; Teb->RealClientId = *ClientId;
Teb->ProcessEnvironmentBlock = Process->Peb; Teb->ProcessEnvironmentBlock = Process->Peb;
Teb->CurrentLocale = PsDefaultThreadLocaleId; Teb->CurrentLocale = PsDefaultThreadLocaleId;

View file

@ -155,7 +155,7 @@ co_EVENT_CallEvents( DWORD event,
hwnd, hwnd,
pEP->idObject, pEP->idObject,
pEP->idChild, pEP->idChild,
(DWORD)(NtCurrentTeb()->Cid).UniqueThread, (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
(DWORD)EngGetTickCount(), (DWORD)EngGetTickCount(),
pEH->Proc); pEH->Proc);
return Result; return Result;
@ -185,14 +185,14 @@ IntNotifyWinEvent(
if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL)) if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL))
{ // if all process || all thread || other thread same process { // if all process || all thread || other thread same process
if (!(pEH->idProcess) || !(pEH->idThread) || 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); Result = IntCallLowLevelEvent(pEH, Event, Window->hSelf, idObject, idChild);
} }
}// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process) }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) && else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) &&
( ((pEH->idProcess && ( ((pEH->idProcess &&
(DWORD)(NtCurrentTeb()->Cid).UniqueProcess == pEH->idProcess) && (DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess) &&
!(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) || !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) ||
!pEH->idProcess ) ) !pEH->idProcess ) )
{ {
@ -201,7 +201,7 @@ IntNotifyWinEvent(
Window->hSelf, Window->hSelf,
idObject, idObject,
idChild, idChild,
(DWORD)(NtCurrentTeb()->Cid).UniqueThread, (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
(DWORD)EngGetTickCount(), (DWORD)EngGetTickCount(),
pEH->Proc); pEH->Proc);
} }