[kernel32]

- Fix broken code inside SXS_SUPPORT_ENABLED define and add some DPRINTs. Still unused.

svn path=/trunk/; revision=44341
This commit is contained in:
Michael Martin 2009-12-01 11:48:06 +00:00
parent 4a32024814
commit db4cbee9dc

View file

@ -160,46 +160,60 @@ CreateRemoteThread(HANDLE hProcess,
#ifdef SXS_SUPPORT_ENABLED #ifdef SXS_SUPPORT_ENABLED
/* Are we in the same process? */ /* Are we in the same process? */
if (Process = NtCurrentProcess()) if (hProcess == NtCurrentProcess())
{ {
PTEB Teb; PTEB Teb;
PVOID ActivationContextStack; PVOID ActivationContextStack;
PTHREAD_BASIC_INFORMATION ThreadBasicInfo; THREAD_BASIC_INFORMATION ThreadBasicInfo;
PACTIVATION_CONTEXT_BASIC_INFORMATION ActivationCtxInfo; ACTIVATION_CONTEXT_BASIC_INFORMATION ActivationCtxInfo;
ULONG_PTR Cookie; ULONG_PTR Cookie;
ULONG retLen;
/* Get the TEB */ /* Get the TEB */
Status = NtQueryInformationThread(hThread, Status = NtQueryInformationThread(hThread,
ThreadBasicIformation, ThreadBasicInformation,
&ThreadBasicInfo, &ThreadBasicInfo,
sizeof(ThreadBasicInfo), sizeof(ThreadBasicInfo),
NULL); &retLen);
if (NT_SUCCESS(Status))
/* Allocate the Activation Context Stack */
Status = RtlAllocateActivationContextStack(&ActivationContextStack);
Teb = ThreadBasicInfo.TebBaseAddress;
/* Save it */
Teb->ActivationContextStackPointer = ActivationContextStack;
/* Query the Context */
Status = RtlQueryInformationActivationContext(1,
0,
NULL,
ActivationContextBasicInformation,
&ActivationCtxInfo,
sizeof(ActivationCtxInfo),
NULL);
/* Does it need to be activated? */
if (!ActivationCtxInfo.hActCtx)
{ {
/* Activate it */ /* Allocate the Activation Context Stack */
Status = RtlActivateActivationContextEx(1, Status = RtlAllocateActivationContextStack(&ActivationContextStack);
Teb,
ActivationCtxInfo.hActCtx,
&Cookie);
} }
if (NT_SUCCESS(Status))
{
Teb = ThreadBasicInfo.TebBaseAddress;
/* Save it */
Teb->ActivationContextStackPointer = ActivationContextStack;
/* Query the Context */
Status = RtlQueryInformationActivationContext(1,
0,
NULL,
ActivationContextBasicInformation,
&ActivationCtxInfo,
sizeof(ActivationCtxInfo),
&retLen);
if (NT_SUCCESS(Status))
{
/* Does it need to be activated? */
if (!ActivationCtxInfo.hActCtx)
{
/* Activate it */
Status = RtlActivateActivationContext(1,
ActivationCtxInfo.hActCtx,
&Cookie);
if (!NT_SUCCESS(Status))
DPRINT1("RtlActivateActivationContext failed %x\n", Status);
}
}
else
DPRINT1("RtlQueryInformationActivationContext failed %x\n", Status);
}
else
DPRINT1("RtlAllocateActivationContextStack failed %x\n", Status);
} }
#endif #endif