Register types rather than constructors, display structs as classes.
[jelmer/samba4-debian.git] / source / winbind / wb_cmd_usersids.c
index 1aebeae91361d9aee555a1f92acb99df64b5e926..b414cf631305a1a501384ec4451d3df37e16be84 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -57,11 +56,9 @@ struct composite_context *wb_cmd_usersids_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_usersids_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_usersids_state);
        if (state == NULL) goto failed;
@@ -125,11 +122,11 @@ static void usersids_recv_domain(struct composite_context *ctx)
        state->rids.count = 0;
        state->rids.ids = NULL;
 
-       state->r.in.domain_handle = domain->domain_handle;
+       state->r.in.domain_handle = &domain->libnet_ctx->samr.handle;
        state->r.in.sids = &state->lsa_sids;
        state->r.out.rids = &state->rids;
 
-       req = dcerpc_samr_GetAliasMembership_send(domain->samr_pipe, state,
+       req = dcerpc_samr_GetAliasMembership_send(domain->libnet_ctx->samr.pipe, state,
                                                  &state->r);
        composite_continue_rpc(state->ctx, req, usersids_recv_aliases, state);
 }
@@ -137,7 +134,7 @@ static void usersids_recv_domain(struct composite_context *ctx)
 static void usersids_recv_aliases(struct rpc_request *req)
 {
        struct cmd_usersids_state *state =
-               talloc_get_type(req->async.private,
+               talloc_get_type(req->async.private_data,
                                struct cmd_usersids_state);
        int i;