Package winappdbg :: Package win32 :: Module kernel32 :: Class Handle
[hide private]
[frames] | no frames]

Class Handle

source code


Encapsulates Win32 handles to avoid leaking them.


See Also: ProcessHandle, ThreadHandle, FileHandle, SnapshotHandle

Instance Methods [hide private]
 
__init__(self, aHandle=None, bOwnership=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__del__(self)
Closes the Win32 handle when the Python object is destroyed.
source code
 
__enter__(self)
Compatibility with the "with" Python statement.
source code
 
__exit__(self, type, value, traceback)
Compatibility with the "with" Python statement.
source code
Handle
__copy__(self)
Duplicates the Win32 handle when copying the Python object.
source code
Handle
__deepcopy__(self)
Duplicates the Win32 handle when copying the Python object.
source code
 
close(self)
Closes the Win32 handle.
source code
 
_close(self)
Low-level close method.
source code
Handle
dup(self)
Returns: A new handle to the same Win32 object.
source code
 
wait(self, dwMilliseconds=None)
Wait for the Win32 object to be signaled.
source code
 
__repr__(self)
repr(x)
source code
 
__get_inherit(self) source code
 
__set_inherit(self, value) source code
 
__get_protectFromClose(self) source code
 
__set_protectFromClose(self, value) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
from_param(value)
Compatibility with ctypes.
 
_normalize(value)
Normalize handle values.
Class Variables [hide private]
  __bLeakDetection = False
Instance Variables [hide private]
bool inherit
True if the handle is to be inherited by child processes, False otherwise.
bool protectFromClose
Set to True to prevent the handle from being closed.
Properties [hide private]
  value
  _as_parameter_
Compatibility with ctypes.

Inherited from object: __class__

Method Details [hide private]

__init__(self, aHandle=None, bOwnership=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • aHandle (int) - Win32 handle value.
  • bOwnership (bool) - True if we own the handle and we need to close it. False if someone else will be calling CloseHandle.
Overrides: object.__init__

__copy__(self)

source code 

Duplicates the Win32 handle when copying the Python object.

Returns: Handle
A new handle to the same Win32 object.

__deepcopy__(self)

source code 

Duplicates the Win32 handle when copying the Python object.

Returns: Handle
A new handle to the same win32 object.

from_param(value)
Static Method

 

Compatibility with ctypes. Allows passing transparently a Handle object to an API call.

Parameters:
  • value (int) - Numeric handle value.

_close(self)

source code 

Low-level close method. This is a private method, do not call it.

dup(self)

source code 
Returns: Handle
A new handle to the same Win32 object.

wait(self, dwMilliseconds=None)

source code 

Wait for the Win32 object to be signaled.

Parameters:
  • dwMilliseconds (int) - (Optional) Timeout value in milliseconds. Use INFINITE or None for no timeout.

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Instance Variable Details [hide private]

inherit

True if the handle is to be inherited by child processes, False otherwise.
Get Method:
__get_inherit(self)
Set Method:
__set_inherit(self, value)

protectFromClose

Set to True to prevent the handle from being closed. Must be set to False before you're done using the handle, or it will be left open until the debugger exits. Use with care!
Get Method:
__get_protectFromClose(self)
Set Method:
__set_protectFromClose(self, value)

Property Details [hide private]

value

Get Method:
unreachable.value(self)

_as_parameter_

Compatibility with ctypes. Allows passing transparently a Handle object to an API call.

Get Method:
unreachable._as_parameter_(self) - Compatibility with ctypes.