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

Instance Methods [hide private]
 
__init__(self, aHandle=None, bOwnership=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__del__(self)
Closes the Win32 handle when the Python object is destroyed.
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
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

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

Static Methods [hide private]
 
from_param(value)
Compatibility with ctypes.
source code
 
_normalize(value)
Normalize handle values.
source code
Properties [hide private]
  _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 x.__class__.__doc__ 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

source code 

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

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

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.

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.