def METHOD_NAME(data, cap_ptr):
    buf = ctypes.create_string_buffer(data, len(data))
    acc = list()
    while cap_ptr != 0:
        caplist = CapabilityListRegister.from_buffer_copy(buf, cap_ptr)
        if caplist.id in capability_parsers.keys():
            acc.append(capability_parsers[caplist.id](buf, cap_ptr))
        else:
            acc.append(caplist)
        cap_ptr = caplist.next_cap_ptr
    return acc