mirror of
https://github.com/reactos/reactos.git
synced 2025-01-10 16:18:16 +00:00
[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:
parent
4a32024814
commit
db4cbee9dc
1 changed files with 43 additions and 29 deletions
|
@ -160,46 +160,60 @@ CreateRemoteThread(HANDLE hProcess,
|
|||
|
||||
#ifdef SXS_SUPPORT_ENABLED
|
||||
/* Are we in the same process? */
|
||||
if (Process = NtCurrentProcess())
|
||||
if (hProcess == NtCurrentProcess())
|
||||
{
|
||||
PTEB Teb;
|
||||
PVOID ActivationContextStack;
|
||||
PTHREAD_BASIC_INFORMATION ThreadBasicInfo;
|
||||
PACTIVATION_CONTEXT_BASIC_INFORMATION ActivationCtxInfo;
|
||||
THREAD_BASIC_INFORMATION ThreadBasicInfo;
|
||||
ACTIVATION_CONTEXT_BASIC_INFORMATION ActivationCtxInfo;
|
||||
ULONG_PTR Cookie;
|
||||
ULONG retLen;
|
||||
|
||||
/* Get the TEB */
|
||||
Status = NtQueryInformationThread(hThread,
|
||||
ThreadBasicIformation,
|
||||
ThreadBasicInformation,
|
||||
&ThreadBasicInfo,
|
||||
sizeof(ThreadBasicInfo),
|
||||
NULL);
|
||||
|
||||
/* 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)
|
||||
&retLen);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* Activate it */
|
||||
Status = RtlActivateActivationContextEx(1,
|
||||
Teb,
|
||||
ActivationCtxInfo.hActCtx,
|
||||
&Cookie);
|
||||
/* Allocate the Activation Context Stack */
|
||||
Status = RtlAllocateActivationContextStack(&ActivationContextStack);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue