WbSetTrapFrame

NTSTATUS __stdcall WbSetTrapFrame(INT64 a1, INT64 a2){
  _EWOW64PROCESS *WoW64Process; 
  _ETHREAD *CurrentThread; 
  int ContextThreadInternal; 
  unsigned __int16 Machine; 

  WoW64Process = KeGetCurrentThread()->ApcState.Process->WoW64Process;
  if( WoW64Process )
  {
    Machine = WoW64Process->Machine;
    if( Machine == 332 || Machine == 452 )
      return WbSetWowTrapFrame((_DWORD *)a1, (_DWORD *)a2);
  }
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --CurrentThread->Tcb.SpecialApcDisable;
  *(_DWORD *)(a1 + 96) = 1048577;
  ContextThreadInternal = PspGetContextThreadInternal(KeGetCurrentThread(), (_CONTEXT *)(a1 + 48), 0, 1, 1u);
  if( ContextThreadInternal >= 0 )
  {
    *(_QWORD *)(a1 + 296) = *(_QWORD *)(a2 + 8);
    *(_QWORD *)(a1 + 200) = *(_QWORD *)a2;
    *(_DWORD *)(a1 + 116) = *(_DWORD *)(a2 + 16);
    ContextThreadInternal = PspSetContextThreadInternal((PETHREAD)KeGetCurrentThread(), (_CONTEXT *)(a1 + 48), 0, 1, 3u);
  }
  KiLeaveGuardedRegionUnsafe((__int64)KeGetCurrentThread());
  return ContextThreadInternal;
}

Referenced by:

WbHeapExecuteCall
sub_14065EC80