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

Class Handle


Encapsulates Win32 handles to avoid leaking them.


See Also: ProcessHandle, ThreadHandle, FileHandle

Instance Methods [hide private]
 
__init__(self, aHandle=None, bOwnership=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__del__(self)
Closes the Win32 handle when the Python object is destroyed.
Handle
__copy__(self)
Duplicates the Win32 handle when copying the Python object.
Handle
__deepcopy__(self)
Duplicates the Win32 handle when copying the Python object.
 
close(self)
Closes the Win32 handle.
Handle
dup(self)
Returns: A new handle to the same Win32 object.
 
wait(self, dwMilliseconds=None)
Wait for the Win32 object to be signaled.

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

Class Methods [hide private]
 
from_param(cls, value)
Compatibility with ctypes.
Properties [hide private]
  _as_parameter_
Compatibility with ctypes.

Inherited from object: __class__

Method Details [hide private]

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

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • aHandle (int) - Win32 handle object.
  • 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)

 

Duplicates the Win32 handle when copying the Python object.

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

__deepcopy__(self)

 

Duplicates the Win32 handle when copying the Python object.

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

from_param(cls, value)
Class Method

 

Compatibility with ctypes. Allows receiving transparently a Handle object from an API call.

dup(self)

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

wait(self, dwMilliseconds=None)

 

Wait for the Win32 object to be signaled.

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

Property Details [hide private]

_as_parameter_

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

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