r18101: Use composite_create function and add monitor function pointer
authorRafal Szczesniak <mimir@samba.org>
Tue, 5 Sep 2006 17:56:35 +0000 (17:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:17:16 +0000 (14:17 -0500)
to the state structure.

rafal
(This used to be commit 76d73bc97dfcbba0667b8d831bfbf3113a8edfcb)

source4/libnet/libnet_domain.c

index 80ae5476253158ecd9418c37be12ff3575b893af..806d9d0fd1019b94e1b9a3a1731df6cc743312f5 100644 (file)
@@ -48,6 +48,9 @@ struct domain_open_samr_state {
        uint32_t                  access_mask;
        struct policy_handle      connect_handle;
        struct policy_handle      domain_handle;
+
+       /* information about the progress */
+       void (*monitor_fn)(struct monitor_msg*);
 };
 
 
@@ -252,15 +255,14 @@ struct composite_context *libnet_DomainOpenSamr_send(struct libnet_context *ctx,
        struct composite_context *c;
        struct domain_open_samr_state *s;
 
-       c = talloc_zero(ctx, struct composite_context);
+       c = composite_create(ctx, ctx->event_ctx);
        if (c == NULL) return NULL;
 
        s = talloc_zero(c, struct domain_open_samr_state);
        if (composite_nomem(s, c)) return c;
 
-       c->state        = COMPOSITE_STATE_IN_PROGRESS;
        c->private_data = s;
-       c->event_ctx    = ctx->event_ctx;
+       s->monitor_fn   = monitor;
 
        s->ctx                 = ctx;
        s->pipe                = ctx->samr.pipe;
@@ -375,6 +377,9 @@ struct domain_open_lsa_state {
        struct lsa_OpenPolicy2   openpol;
        struct policy_handle handle;
        struct dcerpc_pipe *pipe;
+
+       /* information about the progress */
+       void (*monitor_fn)(struct monitor_msg*);
 };