'Processes a given path.
Args:
path: Path (as a string) to post-process.
Returns:
A list of paths with environment variables replaced with their
values. If the mapping had a list of values for a particular variable,
instead of just one value, then all possible replacements will be
returned.'

def Process(self, path):

    path = re.sub(self.SYSTEMROOT_RE, '%systemroot%', path, count=1)
    path = re.sub(self.SYSTEM32_RE, '%systemroot%\\\\system32', path, count=1)
    matches_iter = self.WIN_ENVIRON_REGEX.finditer(path)
    var_names = set((m.group(1).lower() for m in matches_iter))
    results = [path]
    for var_name in var_names:
        try:
            (var_regex, var_value) = self.vars_map[var_name]
        except KeyError:
            continue
        if isinstance(var_value, basestring):
            replacements = [var_value]
        else:
            replacements = var_value
        processed_results = []
        for result in results:
            for repl in replacements:
                processed_results.append(var_regex.sub((lambda _: repl), result))
        results = processed_results
    return results
