/* receive a composite session setup reply */ NTSTATUS smb_composite_sesssetup_recv(struct composite_context *c) { NTSTATUS status; status = composite_wait(c); talloc_free(c); return status; }
NTSTATUS wreplsrv_pull_cycle_recv(struct composite_context *c) { NTSTATUS status; status = composite_wait(c); talloc_free(c); return status; }
NTSTATUS libnet_UnbecomeDC_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, struct libnet_UnbecomeDC *r) { NTSTATUS status; status = composite_wait(c); ZERO_STRUCT(r->out); talloc_free(c); return status; }
static BOOL torture_wbem_login_async(struct torture_context *torture) { BOOL ret = True; TALLOC_CTX *mem_ctx = talloc_init("torture_wbem_login_async"); struct com_context *com_ctx = NULL; const char *binding = NULL; struct composite_context *c = NULL; struct composite_context *new_ctx = NULL; struct GUID clsid; struct GUID iid; /* * Initialize our COM and DCOM contexts. */ com_init_ctx(&com_ctx, NULL); dcom_client_init(com_ctx, cmdline_credentials); /* * Pull our needed test arguments from the torture parameters subsystem. */ binding = torture_setting_string(torture, "binding", NULL); /* * Create a new composite for our call sequence, with the private data being * our return flag. */ c = composite_create(mem_ctx, com_ctx->event_ctx); c->private_data = &ret; /* * Create the parameters needed for the activation call: we need the CLSID * and IID for the specific interface we're after. */ GUID_from_string(CLSID_WBEMLEVEL1LOGIN, &clsid); GUID_from_string(COM_IWBEMLEVEL1LOGIN_UUID, &iid); /* * Fire off the asynchronous activation request with all the needed * input parameters. Then wait for the composite to be done within the * context of this function, which allows all the asynchronous magic to * still happen. */ new_ctx = dcom_activate_send(c, &clsid, binding, 1, &iid, com_ctx); composite_continue(c, new_ctx, torture_wbem_login_async_cont, c); composite_wait(new_ctx); talloc_free(c); talloc_report_full(mem_ctx, stdout); return ret; }
NTSTATUS wb_init_domain_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, struct wbsrv_domain **result) { NTSTATUS status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct init_domain_state *state = talloc_get_type(c->private_data, struct init_domain_state); *result = talloc_steal(mem_ctx, state->domain); } talloc_free(c); return status; }
static NTSTATUS wreplsrv_pull_table_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, struct wreplsrv_pull_table_io *io) { NTSTATUS status; status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct wreplsrv_pull_table_state *state = talloc_get_type(c->private_data, struct wreplsrv_pull_table_state); io->out.num_owners = state->table_io.out.num_partners; io->out.owners = talloc_reference(mem_ctx, state->table_io.out.partners); } talloc_free(c); return status; }
static NTSTATUS wreplsrv_pull_names_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, struct wreplsrv_pull_names_io *io) { NTSTATUS status; status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct wreplsrv_pull_names_state *state = talloc_get_type(c->private_data, struct wreplsrv_pull_names_state); io->out.num_names = state->pull_io.out.num_names; io->out.names = talloc_move(mem_ctx, &state->pull_io.out.names); } talloc_free(c); return status; }
static NTSTATUS wreplsrv_out_connect_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, struct wreplsrv_out_connection **wreplconn) { NTSTATUS status; status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct wreplsrv_out_connect_state *state = talloc_get_type(c->private_data, struct wreplsrv_out_connect_state); if (state->wreplconn) { *wreplconn = talloc_reference(mem_ctx, state->wreplconn); if (!*wreplconn) status = NT_STATUS_NO_MEMORY; } else { status = NT_STATUS_INVALID_CONNECTION; } } talloc_free(c); return status; }
/* recv side of async dcerpc bind request */ NTSTATUS dcerpc_bind_recv(struct composite_context *ctx) { NTSTATUS result = composite_wait(ctx); talloc_free(ctx); return result; }
/* block until a composite function has completed, then return the status. Free the composite context before returning */ _PUBLIC_ NTSTATUS composite_wait_free(struct composite_context *c) { NTSTATUS status = composite_wait(c); talloc_free(c); return status; }