def METHOD_NAME(self, r, name, tp):
    """Reads value from registry, handling special types"""
    if tp in (list, tuple):
        size, trash = winreg.QueryValueEx(r, "%s_size" % (name,))
        value = []
        for i in range(0, size):
            value.append(self.METHOD_NAME(r, "%s_%s" % (name, i), None))
        return value
    else:
        value, keytype = winreg.QueryValueEx(r, name)
        if isinstance(value, int) and value > 0xFFFF:
            value = -(value - 0xFFFF)
        return value