'A generator of all keys and values.'

def ListFiles(self):

    if (not self.IsDirectory()):
        return
    if (self.hive is None):
        for name in dir(_winreg):
            if name.startswith('HKEY_'):
                response = rdf_client.StatEntry(st_mode=stat.S_IFDIR)
                response_pathspec = self.pathspec.Copy()
                response_pathspec.last.path = utils.JoinPath(response_pathspec.last.path, name)
                response.pathspec = response_pathspec
                (yield response)
        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:
                    name = EnumKey(key, i)
                    key_name = utils.JoinPath(self.local_path, name)
                    try:
                        with OpenKey(self.hive, key_name) as subkey:
                            (value, value_type) = QueryValueEx(subkey, '')
                    except exceptions.WindowsError:
                        (value, value_type) = (None, None)
                    response = self._Stat(name, value, value_type)
                    response.st_mode = stat.S_IFDIR
                    (yield response)
                except exceptions.WindowsError:
                    pass
            for i in xrange(self.number_of_values):
                try:
                    (name, value, value_type) = EnumValue(key, i)
                    response = self._Stat(name, value, value_type)
                    response.st_mode = stat.S_IFREG
                    (yield response)
                except exceptions.WindowsError:
                    pass
    except exceptions.WindowsError as e:
        raise IOError(('Unable    to    list    key    %s:    %s' % (self.key_name, e)))
