Revert "s3: Do not reference ndr_table_<pipe> in the cli_ routines directly"
[kai/samba-autobuild/.git] / source3 / librpc / gen_ndr / cli_wbint.c
index 3b683a73c3f65a87cd0d2931f43f7e41fc053aa4..3115a20d9df9f3bbbadc4fdf2d1cd745461d0d15 100644 (file)
@@ -39,10 +39,6 @@ struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx,
        /* Out parameters */
        state->orig.out.out_data = _out_data;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Ping, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_Ping_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -91,10 +87,6 @@ static void rpccli_wbint_Ping_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Ping, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -128,10 +120,6 @@ NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli,
        /* In parameters */
        r.in.in_data = in_data;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Ping, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -142,10 +130,6 @@ NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Ping, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -197,10 +181,6 @@ struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx,
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupSid, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_LookupSid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -254,10 +234,6 @@ static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -297,10 +273,6 @@ NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli,
        /* In parameters */
        r.in.sid = sid;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupSid, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -311,10 +283,6 @@ NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -370,10 +338,6 @@ struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx,
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupName, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_LookupName_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -426,10 +390,6 @@ static void rpccli_wbint_LookupName_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupName, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -472,10 +432,6 @@ NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli,
        r.in.name = name;
        r.in.flags = flags;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupName, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -486,10 +442,6 @@ NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupName, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -540,10 +492,6 @@ struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx,
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_Sid2Uid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -595,10 +543,6 @@ static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -638,10 +582,6 @@ NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli,
        r.in.dom_name = dom_name;
        r.in.sid = sid;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -652,10 +592,6 @@ NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -705,10 +641,6 @@ struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx,
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_Sid2Gid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -760,10 +692,6 @@ static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -803,10 +731,6 @@ NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli,
        r.in.dom_name = dom_name;
        r.in.sid = sid;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -817,10 +741,6 @@ NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -870,10 +790,6 @@ struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx,
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_Uid2Sid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -925,10 +841,6 @@ static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -968,10 +880,6 @@ NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli,
        r.in.dom_name = dom_name;
        r.in.uid = uid;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -982,10 +890,6 @@ NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -1035,10 +939,6 @@ struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx,
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
                             "rpccli_wbint_Gid2Sid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
@@ -1090,10 +990,6 @@ static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
@@ -1133,10 +1029,6 @@ NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli,
        r.in.dom_name = dom_name;
        r.in.gid = gid;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
@@ -1147,10 +1039,6 @@ NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli,
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
@@ -1162,27 +1050,26 @@ NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-struct rpccli_wbint_QueryUser_state {
-       struct wbint_QueryUser orig;
-       struct wbint_QueryUser tmp;
+struct rpccli_wbint_AllocateUid_state {
+       struct wbint_AllocateUid orig;
+       struct wbint_AllocateUid tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq);
+static void rpccli_wbint_AllocateUid_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
-                                              struct tevent_context *ev,
-                                              struct rpc_pipe_client *cli,
-                                              struct dom_sid *_sid /* [in] [ref] */,
-                                              struct wbint_userinfo *_info /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_AllocateUid_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                uint64_t *_uid /* [out] [ref] */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_QueryUser_state *state;
+       struct rpccli_wbint_AllocateUid_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_QueryUser_state);
+                               struct rpccli_wbint_AllocateUid_state);
        if (req == NULL) {
                return NULL;
        }
@@ -1190,20 +1077,15 @@ struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       state->orig.in.sid = _sid;
 
        /* Out parameters */
-       state->orig.out.info = _info;
+       state->orig.out.uid = _uid;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QueryUser, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_QueryUser_out_memory");
+                            "rpccli_wbint_AllocateUid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
                return tevent_req_post(req, ev);
        }
@@ -1213,21 +1095,21 @@ struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_QUERYUSER,
+                                   NDR_WBINT_ALLOCATEUID,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_AllocateUid_done, req);
        return req;
 }
 
-static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
+static void rpccli_wbint_AllocateUid_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QueryUser_state);
+       struct rpccli_wbint_AllocateUid_state *state = tevent_req_data(
+               req, struct rpccli_wbint_AllocateUid_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -1245,7 +1127,7 @@ static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.uid = *state->tmp.out.uid;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -1253,19 +1135,15 @@ static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
-                                    TALLOC_CTX *mem_ctx,
-                                    NTSTATUS *result)
+NTSTATUS rpccli_wbint_AllocateUid_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
 {
-       struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QueryUser_state);
+       struct rpccli_wbint_AllocateUid_state *state = tevent_req_data(
+               req, struct rpccli_wbint_AllocateUid_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -1283,67 +1161,56 @@ NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct dom_sid *sid /* [in] [ref] */,
-                               struct wbint_userinfo *info /* [out] [ref] */)
+NTSTATUS rpccli_wbint_AllocateUid(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 uint64_t *uid /* [out] [ref] */)
 {
-       struct wbint_QueryUser r;
+       struct wbint_AllocateUid r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.sid = sid;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QueryUser, &r);
-       }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_QUERYUSER,
+                               NDR_WBINT_ALLOCATEUID,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *info = *r.out.info;
+       *uid = *r.out.uid;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_LookupUserAliases_state {
-       struct wbint_LookupUserAliases orig;
-       struct wbint_LookupUserAliases tmp;
+struct rpccli_wbint_AllocateGid_state {
+       struct wbint_AllocateGid orig;
+       struct wbint_AllocateGid tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq);
+static void rpccli_wbint_AllocateGid_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
-                                                      struct tevent_context *ev,
-                                                      struct rpc_pipe_client *cli,
-                                                      struct wbint_SidArray *_sids /* [in] [ref] */,
-                                                      struct wbint_RidArray *_rids /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_AllocateGid_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                uint64_t *_gid /* [out] [ref] */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_LookupUserAliases_state *state;
+       struct rpccli_wbint_AllocateGid_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_LookupUserAliases_state);
+                               struct rpccli_wbint_AllocateGid_state);
        if (req == NULL) {
                return NULL;
        }
@@ -1351,20 +1218,15 @@ struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       state->orig.in.sids = _sids;
 
        /* Out parameters */
-       state->orig.out.rids = _rids;
+       state->orig.out.gid = _gid;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_LookupUserAliases_out_memory");
+                            "rpccli_wbint_AllocateGid_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
                return tevent_req_post(req, ev);
        }
@@ -1374,21 +1236,21 @@ struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_LOOKUPUSERALIASES,
+                                   NDR_WBINT_ALLOCATEGID,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_AllocateGid_done, req);
        return req;
 }
 
-static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
+static void rpccli_wbint_AllocateGid_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupUserAliases_state);
+       struct rpccli_wbint_AllocateGid_state *state = tevent_req_data(
+               req, struct rpccli_wbint_AllocateGid_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -1406,7 +1268,7 @@ static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.rids = *state->tmp.out.rids;
+       *state->orig.out.gid = *state->tmp.out.gid;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -1414,19 +1276,15 @@ static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
-                                            TALLOC_CTX *mem_ctx,
-                                            NTSTATUS *result)
+NTSTATUS rpccli_wbint_AllocateGid_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
 {
-       struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupUserAliases_state);
+       struct rpccli_wbint_AllocateGid_state *state = tevent_req_data(
+               req, struct rpccli_wbint_AllocateGid_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -1444,67 +1302,57 @@ NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct wbint_SidArray *sids /* [in] [ref] */,
-                                       struct wbint_RidArray *rids /* [out] [ref] */)
+NTSTATUS rpccli_wbint_AllocateGid(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 uint64_t *gid /* [out] [ref] */)
 {
-       struct wbint_LookupUserAliases r;
+       struct wbint_AllocateGid r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.sids = sids;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &r);
-       }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_LOOKUPUSERALIASES,
+                               NDR_WBINT_ALLOCATEGID,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *rids = *r.out.rids;
+       *gid = *r.out.gid;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_LookupUserGroups_state {
-       struct wbint_LookupUserGroups orig;
-       struct wbint_LookupUserGroups tmp;
+struct rpccli_wbint_QueryUser_state {
+       struct wbint_QueryUser orig;
+       struct wbint_QueryUser tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq);
+static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
-                                                     struct tevent_context *ev,
-                                                     struct rpc_pipe_client *cli,
-                                                     struct dom_sid *_sid /* [in] [ref] */,
-                                                     struct wbint_SidArray *_sids /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct dom_sid *_sid /* [in] [ref] */,
+                                              struct wbint_userinfo *_info /* [out] [ref] */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_LookupUserGroups_state *state;
+       struct rpccli_wbint_QueryUser_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_LookupUserGroups_state);
+                               struct rpccli_wbint_QueryUser_state);
        if (req == NULL) {
                return NULL;
        }
@@ -1515,17 +1363,13 @@ struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
        state->orig.in.sid = _sid;
 
        /* Out parameters */
-       state->orig.out.sids = _sids;
+       state->orig.out.info = _info;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_LookupUserGroups_out_memory");
+                            "rpccli_wbint_QueryUser_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
                return tevent_req_post(req, ev);
        }
@@ -1535,21 +1379,21 @@ struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_LOOKUPUSERGROUPS,
+                                   NDR_WBINT_QUERYUSER,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req);
        return req;
 }
 
-static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
+static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupUserGroups_state);
+       struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QueryUser_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -1567,7 +1411,7 @@ static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.sids = *state->tmp.out.sids;
+       *state->orig.out.info = *state->tmp.out.info;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -1575,19 +1419,15 @@ static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
-                                           TALLOC_CTX *mem_ctx,
-                                           NTSTATUS *result)
+NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
 {
-       struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupUserGroups_state);
+       struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QueryUser_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -1605,66 +1445,59 @@ NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct dom_sid *sid /* [in] [ref] */,
-                                      struct wbint_SidArray *sids /* [out] [ref] */)
+NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct dom_sid *sid /* [in] [ref] */,
+                               struct wbint_userinfo *info /* [out] [ref] */)
 {
-       struct wbint_LookupUserGroups r;
+       struct wbint_QueryUser r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.sid = sid;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_LOOKUPUSERGROUPS,
+                               NDR_WBINT_QUERYUSER,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *sids = *r.out.sids;
+       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_QuerySequenceNumber_state {
-       struct wbint_QuerySequenceNumber orig;
-       struct wbint_QuerySequenceNumber tmp;
+struct rpccli_wbint_LookupUserAliases_state {
+       struct wbint_LookupUserAliases orig;
+       struct wbint_LookupUserAliases tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq);
+static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
-                                                        struct tevent_context *ev,
-                                                        struct rpc_pipe_client *cli,
-                                                        uint32_t *_sequence /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct wbint_SidArray *_sids /* [in] [ref] */,
+                                                      struct wbint_RidArray *_rids /* [out] [ref] */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_QuerySequenceNumber_state *state;
+       struct rpccli_wbint_LookupUserAliases_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_QuerySequenceNumber_state);
+                               struct rpccli_wbint_LookupUserAliases_state);
        if (req == NULL) {
                return NULL;
        }
@@ -1672,19 +1505,16 @@ struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.sids = _sids;
 
        /* Out parameters */
-       state->orig.out.sequence = _sequence;
+       state->orig.out.rids = _rids;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, &state->orig);
-       }
-
        state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_QuerySequenceNumber_out_memory");
+                            "rpccli_wbint_LookupUserAliases_out_memory");
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
                return tevent_req_post(req, ev);
        }
@@ -1694,21 +1524,21 @@ struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_QUERYSEQUENCENUMBER,
+                                   NDR_WBINT_LOOKUPUSERALIASES,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_QuerySequenceNumber_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req);
        return req;
 }
 
-static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
+static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QuerySequenceNumber_state);
+       struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupUserAliases_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -1726,7 +1556,7 @@ static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.sequence = *state->tmp.out.sequence;
+       *state->orig.out.rids = *state->tmp.out.rids;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -1734,19 +1564,15 @@ static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
-                                              TALLOC_CTX *mem_ctx,
-                                              NTSTATUS *result)
+NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
 {
-       struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QuerySequenceNumber_state);
+       struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupUserAliases_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -1764,31 +1590,170 @@ NTSTATUS rpccli_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         uint32_t *sequence /* [out] [ref] */)
+NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct wbint_SidArray *sids /* [in] [ref] */,
+                                       struct wbint_RidArray *rids /* [out] [ref] */)
 {
-       struct wbint_QuerySequenceNumber r;
+       struct wbint_LookupUserAliases r;
        NTSTATUS status;
 
        /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, &r);
-       }
+       r.in.sids = sids;
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_QUERYSEQUENCENUMBER,
+                               NDR_WBINT_LOOKUPUSERALIASES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, &r);
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *rids = *r.out.rids;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_LookupUserGroups_state {
+       struct wbint_LookupUserGroups orig;
+       struct wbint_LookupUserGroups tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct dom_sid *_sid /* [in] [ref] */,
+                                                     struct wbint_SidArray *_sids /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_LookupUserGroups_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_LookupUserGroups_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.sid = _sid;
+
+       /* Out parameters */
+       state->orig.out.sids = _sids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_LookupUserGroups_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_LOOKUPUSERGROUPS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req);
+       return req;
+}
+
+static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupUserGroups_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.sids = *state->tmp.out.sids;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupUserGroups_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct dom_sid *sid /* [in] [ref] */,
+                                      struct wbint_SidArray *sids /* [out] [ref] */)
+{
+       struct wbint_LookupUserGroups r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.sid = sid;
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_LOOKUPUSERGROUPS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1796,34 +1761,905 @@ NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *sequence = *r.out.sequence;
+       *sids = *r.out.sids;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_LookupGroupMembers_state {
-       struct wbint_LookupGroupMembers orig;
-       struct wbint_LookupGroupMembers tmp;
+struct rpccli_wbint_QuerySequenceNumber_state {
+       struct wbint_QuerySequenceNumber orig;
+       struct wbint_QuerySequenceNumber tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq);
+static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
-                                                       struct tevent_context *ev,
-                                                       struct rpc_pipe_client *cli,
-                                                       struct dom_sid *_sid /* [in] [ref] */,
-                                                       enum lsa_SidType _type /* [in]  */,
-                                                       struct wbint_Principals *_members /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        uint32_t *_sequence /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_QuerySequenceNumber_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_QuerySequenceNumber_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+       state->orig.out.sequence = _sequence;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_QuerySequenceNumber_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_QUERYSEQUENCENUMBER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_QuerySequenceNumber_done, req);
+       return req;
+}
+
+static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QuerySequenceNumber_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.sequence = *state->tmp.out.sequence;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result)
+{
+       struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QuerySequenceNumber_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         uint32_t *sequence /* [out] [ref] */)
+{
+       struct wbint_QuerySequenceNumber r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_QUERYSEQUENCENUMBER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *sequence = *r.out.sequence;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_LookupGroupMembers_state {
+       struct wbint_LookupGroupMembers orig;
+       struct wbint_LookupGroupMembers tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct dom_sid *_sid /* [in] [ref] */,
+                                                       enum lsa_SidType _type /* [in]  */,
+                                                       struct wbint_Principals *_members /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_LookupGroupMembers_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_LookupGroupMembers_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.sid = _sid;
+       state->orig.in.type = _type;
+
+       /* Out parameters */
+       state->orig.out.members = _members;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_LookupGroupMembers_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_LOOKUPGROUPMEMBERS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_LookupGroupMembers_done, req);
+       return req;
+}
+
+static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupGroupMembers_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.members = *state->tmp.out.members;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_LookupGroupMembers_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupGroupMembers_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct dom_sid *sid /* [in] [ref] */,
+                                        enum lsa_SidType type /* [in]  */,
+                                        struct wbint_Principals *members /* [out] [ref] */)
+{
+       struct wbint_LookupGroupMembers r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.sid = sid;
+       r.in.type = type;
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_LOOKUPGROUPMEMBERS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *members = *r.out.members;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_QueryUserList_state {
+       struct wbint_QueryUserList orig;
+       struct wbint_QueryUserList tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct wbint_userinfos *_users /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_QueryUserList_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_QueryUserList_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+       state->orig.out.users = _users;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_QueryUserList_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_QUERYUSERLIST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_QueryUserList_done, req);
+       return req;
+}
+
+static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QueryUserList_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.users = *state->tmp.out.users;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QueryUserList_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct wbint_userinfos *users /* [out] [ref] */)
+{
+       struct wbint_QueryUserList r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_QUERYUSERLIST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *users = *r.out.users;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_QueryGroupList_state {
+       struct wbint_QueryGroupList orig;
+       struct wbint_QueryGroupList tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct wbint_Principals *_groups /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_QueryGroupList_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_QueryGroupList_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+       state->orig.out.groups = _groups;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_QueryGroupList_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_QUERYGROUPLIST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_QueryGroupList_done, req);
+       return req;
+}
+
+static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QueryGroupList_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.groups = *state->tmp.out.groups;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
+               req, struct rpccli_wbint_QueryGroupList_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct wbint_Principals *groups /* [out] [ref] */)
+{
+       struct wbint_QueryGroupList r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_QUERYGROUPLIST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *groups = *r.out.groups;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_DsGetDcName_state {
+       struct wbint_DsGetDcName orig;
+       struct wbint_DsGetDcName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_domain_name /* [in] [ref,charset(UTF8)] */,
+                                                struct GUID *_domain_guid /* [in] [unique] */,
+                                                const char *_site_name /* [in] [unique,charset(UTF8)] */,
+                                                uint32_t _flags /* [in]  */,
+                                                struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_DsGetDcName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_DsGetDcName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_name = _domain_name;
+       state->orig.in.domain_guid = _domain_guid;
+       state->orig.in.site_name = _site_name;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.dc_info = _dc_info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_DsGetDcName_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_DSGETDCNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_DsGetDcName_done, req);
+       return req;
+}
+
+static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
+               req, struct rpccli_wbint_DsGetDcName_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.dc_info = *state->tmp.out.dc_info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
+               req, struct rpccli_wbint_DsGetDcName_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *domain_name /* [in] [ref,charset(UTF8)] */,
+                                 struct GUID *domain_guid /* [in] [unique] */,
+                                 const char *site_name /* [in] [unique,charset(UTF8)] */,
+                                 uint32_t flags /* [in]  */,
+                                 struct netr_DsRGetDCNameInfo **dc_info /* [out] [ref] */)
+{
+       struct wbint_DsGetDcName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_name = domain_name;
+       r.in.domain_guid = domain_guid;
+       r.in.site_name = site_name;
+       r.in.flags = flags;
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_DSGETDCNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *dc_info = *r.out.dc_info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_LookupRids_state {
+       struct wbint_LookupRids orig;
+       struct wbint_LookupRids tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct wbint_RidArray *_rids /* [in] [ref] */,
+                                               struct wbint_Principals *_names /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wbint_LookupRids_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wbint_LookupRids_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.rids = _rids;
+
+       /* Out parameters */
+       state->orig.out.names = _names;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wbint_LookupRids_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wbint,
+                                   NDR_WBINT_LOOKUPRIDS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wbint_LookupRids_done, req);
+       return req;
+}
+
+static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupRids_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.names = *state->tmp.out.names;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_LookupRids_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
+               req, struct rpccli_wbint_LookupRids_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct wbint_RidArray *rids /* [in] [ref] */,
+                                struct wbint_Principals *names /* [out] [ref] */)
+{
+       struct wbint_LookupRids r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.rids = rids;
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wbint,
+                               NDR_WBINT_LOOKUPRIDS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *names = *r.out.names;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_wbint_CheckMachineAccount_state {
+       struct wbint_CheckMachineAccount orig;
+       struct wbint_CheckMachineAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_CheckMachineAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_CheckMachineAccount_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_LookupGroupMembers_state *state;
+       struct rpccli_wbint_CheckMachineAccount_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_LookupGroupMembers_state);
+                               struct rpccli_wbint_CheckMachineAccount_state);
        if (req == NULL) {
                return NULL;
        }
@@ -1831,45 +2667,32 @@ struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       state->orig.in.sid = _sid;
-       state->orig.in.type = _type;
 
        /* Out parameters */
-       state->orig.out.members = _members;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, &state->orig);
-       }
-
-       state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_LookupGroupMembers_out_memory");
-       if (tevent_req_nomem(state->out_mem_ctx, req)) {
-               return tevent_req_post(req, ev);
-       }
-
        /* make a temporary copy, that we pass to the dispatch function */
        state->tmp = state->orig;
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_LOOKUPGROUPMEMBERS,
+                                   NDR_WBINT_CHECKMACHINEACCOUNT,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_LookupGroupMembers_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_CheckMachineAccount_done, req);
        return req;
 }
 
-static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
+static void rpccli_wbint_CheckMachineAccount_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupGroupMembers_state);
+       struct rpccli_wbint_CheckMachineAccount_state *state = tevent_req_data(
+               req, struct rpccli_wbint_CheckMachineAccount_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -1887,7 +2710,6 @@ static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.members = *state->tmp.out.members;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -1895,19 +2717,15 @@ static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupGroupMembers, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_LookupGroupMembers_recv(struct tevent_req *req,
-                                             TALLOC_CTX *mem_ctx,
-                                             NTSTATUS *result)
+NTSTATUS rpccli_wbint_CheckMachineAccount_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result)
 {
-       struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupGroupMembers_state);
+       struct rpccli_wbint_CheckMachineAccount_state *state = tevent_req_data(
+               req, struct rpccli_wbint_CheckMachineAccount_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -1925,68 +2743,53 @@ NTSTATUS rpccli_wbint_LookupGroupMembers_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct dom_sid *sid /* [in] [ref] */,
-                                        enum lsa_SidType type /* [in]  */,
-                                        struct wbint_Principals *members /* [out] [ref] */)
+NTSTATUS rpccli_wbint_CheckMachineAccount(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx)
 {
-       struct wbint_LookupGroupMembers r;
+       struct wbint_CheckMachineAccount r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.sid = sid;
-       r.in.type = type;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, &r);
-       }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_LOOKUPGROUPMEMBERS,
+                               NDR_WBINT_CHECKMACHINEACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupGroupMembers, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *members = *r.out.members;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_QueryUserList_state {
-       struct wbint_QueryUserList orig;
-       struct wbint_QueryUserList tmp;
+struct rpccli_wbint_ChangeMachineAccount_state {
+       struct wbint_ChangeMachineAccount orig;
+       struct wbint_ChangeMachineAccount tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq);
+static void rpccli_wbint_ChangeMachineAccount_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
-                                                  struct tevent_context *ev,
-                                                  struct rpc_pipe_client *cli,
-                                                  struct wbint_userinfos *_users /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_ChangeMachineAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_QueryUserList_state *state;
+       struct rpccli_wbint_ChangeMachineAccount_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_QueryUserList_state);
+                               struct rpccli_wbint_ChangeMachineAccount_state);
        if (req == NULL) {
                return NULL;
        }
@@ -1996,41 +2799,30 @@ struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
        /* In parameters */
 
        /* Out parameters */
-       state->orig.out.users = _users;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &state->orig);
-       }
-
-       state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_QueryUserList_out_memory");
-       if (tevent_req_nomem(state->out_mem_ctx, req)) {
-               return tevent_req_post(req, ev);
-       }
-
        /* make a temporary copy, that we pass to the dispatch function */
        state->tmp = state->orig;
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_QUERYUSERLIST,
+                                   NDR_WBINT_CHANGEMACHINEACCOUNT,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_QueryUserList_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_ChangeMachineAccount_done, req);
        return req;
 }
 
-static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
+static void rpccli_wbint_ChangeMachineAccount_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QueryUserList_state);
+       struct rpccli_wbint_ChangeMachineAccount_state *state = tevent_req_data(
+               req, struct rpccli_wbint_ChangeMachineAccount_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -2048,7 +2840,6 @@ static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.users = *state->tmp.out.users;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -2056,19 +2847,15 @@ static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
-                                        TALLOC_CTX *mem_ctx,
-                                        NTSTATUS *result)
+NTSTATUS rpccli_wbint_ChangeMachineAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
 {
-       struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QueryUserList_state);
+       struct rpccli_wbint_ChangeMachineAccount_state *state = tevent_req_data(
+               req, struct rpccli_wbint_ChangeMachineAccount_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -2086,64 +2873,56 @@ NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct wbint_userinfos *users /* [out] [ref] */)
+NTSTATUS rpccli_wbint_ChangeMachineAccount(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx)
 {
-       struct wbint_QueryUserList r;
+       struct wbint_ChangeMachineAccount r;
        NTSTATUS status;
 
        /* In parameters */
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &r);
-       }
-
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_QUERYUSERLIST,
+                               NDR_WBINT_CHANGEMACHINEACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *users = *r.out.users;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_QueryGroupList_state {
-       struct wbint_QueryGroupList orig;
-       struct wbint_QueryGroupList tmp;
+struct rpccli_wbint_SetMapping_state {
+       struct wbint_SetMapping orig;
+       struct wbint_SetMapping tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq);
+static void rpccli_wbint_SetMapping_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
-                                                   struct tevent_context *ev,
-                                                   struct rpc_pipe_client *cli,
-                                                   struct wbint_Principals *_groups /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_SetMapping_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct dom_sid *_sid /* [in] [ref] */,
+                                               enum wbint_IdType _type /* [in]  */,
+                                               uint64_t _id /* [in]  */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_QueryGroupList_state *state;
+       struct rpccli_wbint_SetMapping_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_QueryGroupList_state);
+                               struct rpccli_wbint_SetMapping_state);
        if (req == NULL) {
                return NULL;
        }
@@ -2151,43 +2930,35 @@ struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.sid = _sid;
+       state->orig.in.type = _type;
+       state->orig.in.id = _id;
 
        /* Out parameters */
-       state->orig.out.groups = _groups;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &state->orig);
-       }
-
-       state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_QueryGroupList_out_memory");
-       if (tevent_req_nomem(state->out_mem_ctx, req)) {
-               return tevent_req_post(req, ev);
-       }
-
        /* make a temporary copy, that we pass to the dispatch function */
        state->tmp = state->orig;
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_QUERYGROUPLIST,
+                                   NDR_WBINT_SETMAPPING,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_QueryGroupList_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_SetMapping_done, req);
        return req;
 }
 
-static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
+static void rpccli_wbint_SetMapping_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QueryGroupList_state);
+       struct rpccli_wbint_SetMapping_state *state = tevent_req_data(
+               req, struct rpccli_wbint_SetMapping_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -2205,7 +2976,6 @@ static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.groups = *state->tmp.out.groups;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -2213,19 +2983,15 @@ static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
-                                         TALLOC_CTX *mem_ctx,
-                                         NTSTATUS *result)
+NTSTATUS rpccli_wbint_SetMapping_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
 {
-       struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
-               req, struct rpccli_wbint_QueryGroupList_state);
+       struct rpccli_wbint_SetMapping_state *state = tevent_req_data(
+               req, struct rpccli_wbint_SetMapping_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -2243,68 +3009,62 @@ NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct wbint_Principals *groups /* [out] [ref] */)
+NTSTATUS rpccli_wbint_SetMapping(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct dom_sid *sid /* [in] [ref] */,
+                                enum wbint_IdType type /* [in]  */,
+                                uint64_t id /* [in]  */)
 {
-       struct wbint_QueryGroupList r;
+       struct wbint_SetMapping r;
        NTSTATUS status;
 
        /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &r);
-       }
+       r.in.sid = sid;
+       r.in.type = type;
+       r.in.id = id;
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_QUERYGROUPLIST,
+                               NDR_WBINT_SETMAPPING,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *groups = *r.out.groups;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_DsGetDcName_state {
-       struct wbint_DsGetDcName orig;
-       struct wbint_DsGetDcName tmp;
+struct rpccli_wbint_RemoveMapping_state {
+       struct wbint_RemoveMapping orig;
+       struct wbint_RemoveMapping tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq);
+static void rpccli_wbint_RemoveMapping_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
-                                                struct tevent_context *ev,
-                                                struct rpc_pipe_client *cli,
-                                                const char *_domain_name /* [in] [ref,charset(UTF8)] */,
-                                                struct GUID *_domain_guid /* [in] [unique] */,
-                                                const char *_site_name /* [in] [unique,charset(UTF8)] */,
-                                                uint32_t _flags /* [in]  */,
-                                                struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_RemoveMapping_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct dom_sid *_sid /* [in] [ref] */,
+                                                  enum wbint_IdType _type /* [in]  */,
+                                                  uint64_t _id /* [in]  */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_DsGetDcName_state *state;
+       struct rpccli_wbint_RemoveMapping_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_DsGetDcName_state);
+                               struct rpccli_wbint_RemoveMapping_state);
        if (req == NULL) {
                return NULL;
        }
@@ -2312,47 +3072,35 @@ struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       state->orig.in.domain_name = _domain_name;
-       state->orig.in.domain_guid = _domain_guid;
-       state->orig.in.site_name = _site_name;
-       state->orig.in.flags = _flags;
+       state->orig.in.sid = _sid;
+       state->orig.in.type = _type;
+       state->orig.in.id = _id;
 
        /* Out parameters */
-       state->orig.out.dc_info = _dc_info;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &state->orig);
-       }
-
-       state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_DsGetDcName_out_memory");
-       if (tevent_req_nomem(state->out_mem_ctx, req)) {
-               return tevent_req_post(req, ev);
-       }
-
        /* make a temporary copy, that we pass to the dispatch function */
        state->tmp = state->orig;
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_DSGETDCNAME,
+                                   NDR_WBINT_REMOVEMAPPING,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_DsGetDcName_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_RemoveMapping_done, req);
        return req;
 }
 
-static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
+static void rpccli_wbint_RemoveMapping_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
-               req, struct rpccli_wbint_DsGetDcName_state);
+       struct rpccli_wbint_RemoveMapping_state *state = tevent_req_data(
+               req, struct rpccli_wbint_RemoveMapping_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -2370,7 +3118,6 @@ static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.dc_info = *state->tmp.out.dc_info;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -2378,19 +3125,15 @@ static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
-                                      TALLOC_CTX *mem_ctx,
-                                      NTSTATUS *result)
+NTSTATUS rpccli_wbint_RemoveMapping_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
 {
-       struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
-               req, struct rpccli_wbint_DsGetDcName_state);
+       struct rpccli_wbint_RemoveMapping_state *state = tevent_req_data(
+               req, struct rpccli_wbint_RemoveMapping_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -2408,73 +3151,61 @@ NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *domain_name /* [in] [ref,charset(UTF8)] */,
-                                 struct GUID *domain_guid /* [in] [unique] */,
-                                 const char *site_name /* [in] [unique,charset(UTF8)] */,
-                                 uint32_t flags /* [in]  */,
-                                 struct netr_DsRGetDCNameInfo **dc_info /* [out] [ref] */)
+NTSTATUS rpccli_wbint_RemoveMapping(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct dom_sid *sid /* [in] [ref] */,
+                                   enum wbint_IdType type /* [in]  */,
+                                   uint64_t id /* [in]  */)
 {
-       struct wbint_DsGetDcName r;
+       struct wbint_RemoveMapping r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.domain_name = domain_name;
-       r.in.domain_guid = domain_guid;
-       r.in.site_name = site_name;
-       r.in.flags = flags;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &r);
-       }
+       r.in.sid = sid;
+       r.in.type = type;
+       r.in.id = id;
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_DSGETDCNAME,
+                               NDR_WBINT_REMOVEMAPPING,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *dc_info = *r.out.dc_info;
 
        /* Return result */
        return r.out.result;
 }
 
-struct rpccli_wbint_LookupRids_state {
-       struct wbint_LookupRids orig;
-       struct wbint_LookupRids tmp;
+struct rpccli_wbint_SetHWM_state {
+       struct wbint_SetHWM orig;
+       struct wbint_SetHWM tmp;
        TALLOC_CTX *out_mem_ctx;
        NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 };
 
-static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq);
+static void rpccli_wbint_SetHWM_done(struct tevent_req *subreq);
 
-struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
-                                               struct tevent_context *ev,
-                                               struct rpc_pipe_client *cli,
-                                               struct wbint_RidArray *_rids /* [in] [ref] */,
-                                               struct wbint_Principals *_names /* [out] [ref] */)
+struct tevent_req *rpccli_wbint_SetHWM_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli,
+                                           enum wbint_IdType _type /* [in]  */,
+                                           uint64_t _id /* [in]  */)
 {
        struct tevent_req *req;
-       struct rpccli_wbint_LookupRids_state *state;
+       struct rpccli_wbint_SetHWM_state *state;
        struct tevent_req *subreq;
 
        req = tevent_req_create(mem_ctx, &state,
-                               struct rpccli_wbint_LookupRids_state);
+                               struct rpccli_wbint_SetHWM_state);
        if (req == NULL) {
                return NULL;
        }
@@ -2482,44 +3213,34 @@ struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
        state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       state->orig.in.rids = _rids;
+       state->orig.in.type = _type;
+       state->orig.in.id = _id;
 
        /* Out parameters */
-       state->orig.out.names = _names;
 
        /* Result */
        ZERO_STRUCT(state->orig.out.result);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupRids, &state->orig);
-       }
-
-       state->out_mem_ctx = talloc_named_const(state, 0,
-                            "rpccli_wbint_LookupRids_out_memory");
-       if (tevent_req_nomem(state->out_mem_ctx, req)) {
-               return tevent_req_post(req, ev);
-       }
-
        /* make a temporary copy, that we pass to the dispatch function */
        state->tmp = state->orig;
 
        subreq = cli->dispatch_send(state, ev, cli,
                                    &ndr_table_wbint,
-                                   NDR_WBINT_LOOKUPRIDS,
+                                   NDR_WBINT_SETHWM,
                                    &state->tmp);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, rpccli_wbint_LookupRids_done, req);
+       tevent_req_set_callback(subreq, rpccli_wbint_SetHWM_done, req);
        return req;
 }
 
-static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
+static void rpccli_wbint_SetHWM_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupRids_state);
+       struct rpccli_wbint_SetHWM_state *state = tevent_req_data(
+               req, struct rpccli_wbint_SetHWM_state);
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
@@ -2537,7 +3258,6 @@ static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
        }
 
        /* Copy out parameters */
-       *state->orig.out.names = *state->tmp.out.names;
 
        /* Copy result */
        state->orig.out.result = state->tmp.out.result;
@@ -2545,19 +3265,15 @@ static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
        /* Reset temporary structure */
        ZERO_STRUCT(state->tmp);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupRids, &state->orig);
-       }
-
        tevent_req_done(req);
 }
 
-NTSTATUS rpccli_wbint_LookupRids_recv(struct tevent_req *req,
-                                     TALLOC_CTX *mem_ctx,
-                                     NTSTATUS *result)
+NTSTATUS rpccli_wbint_SetHWM_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 NTSTATUS *result)
 {
-       struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
-               req, struct rpccli_wbint_LookupRids_state);
+       struct rpccli_wbint_SetHWM_state *state = tevent_req_data(
+               req, struct rpccli_wbint_SetHWM_state);
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -2575,41 +3291,33 @@ NTSTATUS rpccli_wbint_LookupRids_recv(struct tevent_req *req,
        return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct wbint_RidArray *rids /* [in] [ref] */,
-                                struct wbint_Principals *names /* [out] [ref] */)
+NTSTATUS rpccli_wbint_SetHWM(struct rpc_pipe_client *cli,
+                            TALLOC_CTX *mem_ctx,
+                            enum wbint_IdType type /* [in]  */,
+                            uint64_t id /* [in]  */)
 {
-       struct wbint_LookupRids r;
+       struct wbint_SetHWM r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.rids = rids;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wbint_LookupRids, &r);
-       }
+       r.in.type = type;
+       r.in.id = id;
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_wbint,
-                               NDR_WBINT_LOOKUPRIDS,
+                               NDR_WBINT_SETHWM,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wbint_LookupRids, &r);
-       }
-
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
        /* Return variables */
-       *names = *r.out.names;
 
        /* Return result */
        return r.out.result;