MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / get_handle

Method get_handle

pydevd_attach_to_process/winappdbg/thread.py:313–341  ·  view source on GitHub ↗

Returns a handle to the thread with I{at least} the access rights requested. @note: If a handle was previously opened and has the required access rights, it's reused. If not, a new handle is opened with the combination of the old and new

(self, dwDesiredAccess=win32.THREAD_ALL_ACCESS)

Source from the content-addressed store, hash-verified

311 self.hThread = None
312
313 def get_handle(self, dwDesiredAccess=win32.THREAD_ALL_ACCESS):
314 """
315 Returns a handle to the thread with I{at least} the access rights
316 requested.
317
318 @note:
319 If a handle was previously opened and has the required access
320 rights, it's reused. If not, a new handle is opened with the
321 combination of the old and new access rights.
322
323 @type dwDesiredAccess: int
324 @param dwDesiredAccess: Desired access rights.
325 See: U{http://msdn.microsoft.com/en-us/library/windows/desktop/ms686769(v=vs.85).aspx}
326
327 @rtype: ThreadHandle
328 @return: Handle to the thread.
329
330 @raise WindowsError: It's not possible to open a handle to the thread
331 with the requested access rights. This tipically happens because
332 the target thread belongs to system process and the debugger is not
333 runnning with administrative rights.
334 """
335 if self.hThread in (None, win32.INVALID_HANDLE_VALUE):
336 self.open_handle(dwDesiredAccess)
337 else:
338 dwAccess = self.hThread.dwAccess
339 if (dwAccess | dwDesiredAccess) != dwAccess:
340 self.open_handle(dwAccess | dwDesiredAccess)
341 return self.hThread
342
343 def clear(self):
344 """

Callers 14

get_pidMethod · 0.95
waitMethod · 0.95
killMethod · 0.95
suspendMethod · 0.95
resumeMethod · 0.95
get_exit_codeMethod · 0.95
get_contextMethod · 0.95
set_contextMethod · 0.95
is_hiddenMethod · 0.95
get_teb_addressMethod · 0.95
get_linear_addressMethod · 0.95
__get_stack_traceMethod · 0.95

Calls 1

open_handleMethod · 0.95

Tested by

no test coverage detected