public static extern bool Wow64GetThreadContext(IntPtr hThread, ref CONTEXT lpContext);
public static CONTEXT GetThreadContext(IntPtr hThread) { CONTEXT context = new CONTEXT(); context.ContextFlags = (uint) CONTEXT_FLAGS.CONTEXT_ALL; if(GetThreadContext(hThread, ref context) == false) if(Wow64GetThreadContext(hThread, ref context) == false) throw new DebugException(); return context; }