(self)
Opens a new handle to the module.

        The new handle is stored in the L{hFile} property.
Opens a new handle to the module.
Opens a new handle to the module .
def open_handle(self):
        """
        Opens a new handle to the module.

        The new handle is stored in the L{hFile} property.
        """

        if not self.get_filename():
            msg = "Cannot retrieve filename for module at %s"
            msg = msg % HexDump.address( self.get_base() )
            raise Exception(msg)

        hFile = win32.CreateFile(self.get_filename(),
                                           dwShareMode = win32.FILE_SHARE_READ,
                                 dwCreationDisposition = win32.OPEN_EXISTING)

        # In case hFile was set to an actual handle value instead of a Handle
        # object. This shouldn't happen unless the user tinkered with hFile.
        if not hasattr(self.hFile, '__del__'):
            self.close_handle()

        self.hFile = hFile
def open_handle ( self ) : if not self . get_filename ( ) : msg = "Cannot retrieve filename for module at %s" msg = msg % HexDump . address ( self . get_base ( ) ) raise Exception ( msg ) hFile = win32 . CreateFile ( self . get_filename ( ) , dwShareMode = win32 . FILE_SHARE_READ , dwCreationDisposition = win32 . OPEN_EXISTING ) # In case hFile was set to an actual handle value instead of a Handle # object. This shouldn't happen unless the user tinkered with hFile. if not hasattr ( self . hFile , '__del__' ) : self . close_handle ( ) self . hFile = hFile