MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / _handle_create_thread

Method _handle_create_thread

windows/debug/debugger.py:808–825  ·  view source on GitHub ↗

Handle CREATE_THREAD_DEBUG_EVENT

(self, debug_event)

Source from the content-addressed store, hash-verified

806 return retvalue
807
808 def _handle_create_thread(self, debug_event):
809 """Handle CREATE_THREAD_DEBUG_EVENT"""
810 create_thread = debug_event.u.CreateThread
811 # Duplicate handle, so garbage collection of the thread does not
812 # break the debug API invariant (those x_event handle are close by the debug API itself)
813 thread_handle = HANDLE()
814 cp_handle = windows.current_process.handle
815 winproxy.DuplicateHandle(cp_handle, create_thread.hThread, cp_handle, ctypes.byref(thread_handle), dwOptions=DUPLICATE_SAME_ACCESS)
816 new_thread = WinThread._from_handle(thread_handle.value)
817 self.threads[new_thread.tid] = new_thread
818 # The new thread is on the thread pool: we can now update the debugger state
819 self._update_debugger_state(debug_event)
820 self._explicit_single_step[self.current_thread.tid] = False
821 self._breakpoint_to_reput[self.current_thread.tid] = []
822 self._hardware_breakpoint[self.current_thread.tid] = {}
823 self._setup_pending_breakpoints_new_thread(self.current_thread)
824 with self.DisabledMemoryBreakpoint():
825 return self.on_create_thread(create_thread)
826
827
828 def _handle_exit_thread(self, debug_event):

Callers

nothing calls this directly

Calls 5

on_create_threadMethod · 0.95
_from_handleMethod · 0.45

Tested by

no test coverage detected