示例#1
0
void bio_put_obj(struct binder_io* bio, void* ptr) {
  struct flat_binder_object* obj;

  obj = bio_alloc_obj(bio);
  if (!obj)
    return;

  obj->flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
  obj->type = BINDER_TYPE_BINDER;
  obj->binder = (uintptr_t)ptr;
  obj->cookie = 0;
}
示例#2
0
void bio_put_ref(struct binder_io* bio, uint32_t handle) {
  struct flat_binder_object* obj;

  if (handle)
    obj = bio_alloc_obj(bio);
  else
    obj = bio_alloc(bio, sizeof(*obj));

  if (!obj)
    return;

  obj->flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
  obj->type = BINDER_TYPE_HANDLE;
  obj->handle = handle;
  obj->cookie = 0;
}
示例#3
0
void bio_put_ref(struct binder_io *bio, void *ptr)
{
    struct binder_object *obj;

    if (ptr)
        obj = bio_alloc_obj(bio);
    else
        obj = bio_alloc(bio, sizeof(*obj));

    if (!obj)
        return;

    obj->flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
    obj->type = BINDER_TYPE_HANDLE;
    obj->pointer = ptr;
    obj->cookie = 0;
}