'List the names of all keys and values.'

def ListNames(self):

    if (not self.IsDirectory()):
        return
    if (self.hive is None):
        for name in dir(_winreg):
            if name.startswith('HKEY_'):
                (yield name)
        return
    try:
        with OpenKey(self.hive, self.local_path) as key:
            (self.number_of_keys, self.number_of_values, self.last_modified) = QueryInfoKey(key)
            for i in xrange(self.number_of_keys):
                try:
                    (yield EnumKey(key, i))
                except exceptions.WindowsError:
                    pass
            for i in xrange(self.number_of_values):
                try:
                    (name, unused_value, unused_value_type) = EnumValue(key, i)
                    (yield name)
                except exceptions.WindowsError:
                    pass
    except exceptions.WindowsError as e:
        raise IOError(('Unable    to    list    key    %s:    %s' % (self.key_name, e)))
