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

Class ThreadHandle

pydevd_attach_to_process/winappdbg/win32/kernel32.py:861–901  ·  view source on GitHub ↗

Win32 thread handle. @type dwAccess: int @ivar dwAccess: Current access flags to this handle. This is the same value passed to L{OpenThread}. Can only be C{None} if C{aHandle} is also C{None}. Defaults to L{THREAD_ALL_ACCESS}. @see: L{Handle}

Source from the content-addressed store, hash-verified

859
860
861class ThreadHandle(Handle):
862 """
863 Win32 thread handle.
864
865 @type dwAccess: int
866 @ivar dwAccess: Current access flags to this handle.
867 This is the same value passed to L{OpenThread}.
868 Can only be C{None} if C{aHandle} is also C{None}.
869 Defaults to L{THREAD_ALL_ACCESS}.
870
871 @see: L{Handle}
872 """
873
874 def __init__(self, aHandle=None, bOwnership=True, dwAccess=THREAD_ALL_ACCESS):
875 """
876 @type aHandle: int
877 @param aHandle: Win32 handle value.
878
879 @type bOwnership: bool
880 @param bOwnership:
881 C{True} if we own the handle and we need to close it.
882 C{False} if someone else will be calling L{CloseHandle}.
883
884 @type dwAccess: int
885 @param dwAccess: Current access flags to this handle.
886 This is the same value passed to L{OpenThread}.
887 Can only be C{None} if C{aHandle} is also C{None}.
888 Defaults to L{THREAD_ALL_ACCESS}.
889 """
890 super(ThreadHandle, self).__init__(aHandle, bOwnership)
891 self.dwAccess = dwAccess
892 if aHandle is not None and dwAccess is None:
893 msg = "Missing access flags for thread handle: %x" % aHandle
894 raise TypeError(msg)
895
896 def get_tid(self):
897 """
898 @rtype: int
899 @return: Thread global ID.
900 """
901 return GetThreadId(self.value)
902
903
904class FileHandle(Handle):

Callers 5

get_thread_handleMethod · 0.90
get_thread_handleMethod · 0.90
__init__Method · 0.85
CreateRemoteThreadFunction · 0.85
OpenThreadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected