librpc: rerun "make idl"
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jul 2009 16:56:42 +0000 (18:56 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 31 Jul 2009 12:13:55 +0000 (14:13 +0200)
metze

32 files changed:
librpc/gen_ndr/cli_dfs.c
librpc/gen_ndr/cli_dfs.h
librpc/gen_ndr/cli_drsuapi.c
librpc/gen_ndr/cli_drsuapi.h
librpc/gen_ndr/cli_dssetup.c
librpc/gen_ndr/cli_dssetup.h
librpc/gen_ndr/cli_echo.c
librpc/gen_ndr/cli_echo.h
librpc/gen_ndr/cli_epmapper.c
librpc/gen_ndr/cli_epmapper.h
librpc/gen_ndr/cli_eventlog.c
librpc/gen_ndr/cli_eventlog.h
librpc/gen_ndr/cli_initshutdown.c
librpc/gen_ndr/cli_initshutdown.h
librpc/gen_ndr/cli_lsa.c
librpc/gen_ndr/cli_lsa.h
librpc/gen_ndr/cli_netlogon.c
librpc/gen_ndr/cli_netlogon.h
librpc/gen_ndr/cli_ntsvcs.c
librpc/gen_ndr/cli_ntsvcs.h
librpc/gen_ndr/cli_samr.c
librpc/gen_ndr/cli_samr.h
librpc/gen_ndr/cli_spoolss.c
librpc/gen_ndr/cli_spoolss.h
librpc/gen_ndr/cli_srvsvc.c
librpc/gen_ndr/cli_srvsvc.h
librpc/gen_ndr/cli_svcctl.c
librpc/gen_ndr/cli_svcctl.h
librpc/gen_ndr/cli_winreg.c
librpc/gen_ndr/cli_winreg.h
librpc/gen_ndr/cli_wkssvc.c
librpc/gen_ndr/cli_wkssvc.h

index e8691dc63596fe9ef2906b036f0bd4feef9f46ad..685e3b5e75e82f1003fda779bac233e396811e52 100644 (file)
@@ -6,6 +6,115 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_dfs.h"
 
+struct rpccli_dfs_GetManagerVersion_state {
+       struct dfs_GetManagerVersion orig;
+       struct dfs_GetManagerVersion tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_GetManagerVersion_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_GetManagerVersion_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    enum dfs_ManagerVersion *_version /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_GetManagerVersion_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_GetManagerVersion_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+       state->orig.out.version = _version;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_GetManagerVersion, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_GetManagerVersion_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_netdfs,
+                                   NDR_DFS_GETMANAGERVERSION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_GetManagerVersion_done, req);
+       return req;
+}
+
+static void rpccli_dfs_GetManagerVersion_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_GetManagerVersion_state *state = tevent_req_data(
+               req, struct rpccli_dfs_GetManagerVersion_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.version = *state->tmp.out.version;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_GetManagerVersion_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_dfs_GetManagerVersion_state *state = tevent_req_data(
+               req, struct rpccli_dfs_GetManagerVersion_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      enum dfs_ManagerVersion *version /* [out] [ref] */)
@@ -44,6 +153,126 @@ NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_dfs_Add_state {
+       struct dfs_Add orig;
+       struct dfs_Add tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Add_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Add_send(TALLOC_CTX *mem_ctx,
+                                      struct tevent_context *ev,
+                                      struct rpc_pipe_client *cli,
+                                      const char *_path /* [in] [ref,charset(UTF16)] */,
+                                      const char *_server /* [in] [ref,charset(UTF16)] */,
+                                      const char *_share /* [in] [unique,charset(UTF16)] */,
+                                      const char *_comment /* [in] [unique,charset(UTF16)] */,
+                                      uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_Add_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Add_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.path = _path;
+       state->orig.in.server = _server;
+       state->orig.in.share = _share;
+       state->orig.in.comment = _comment;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Add, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_ADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_Add_done, req);
+       return req;
+}
+
+static void rpccli_dfs_Add_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Add_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Add_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Add, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Add_recv(struct tevent_req *req,
+                            TALLOC_CTX *mem_ctx,
+                            WERROR *result)
+{
+       struct rpccli_dfs_Add_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Add_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_dfs_Add(struct rpc_pipe_client *cli,
                        TALLOC_CTX *mem_ctx,
                        const char *path /* [in] [ref,charset(UTF16)] */,
@@ -95,6 +324,122 @@ NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_Remove_state {
+       struct dfs_Remove orig;
+       struct dfs_Remove tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Remove_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Remove_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
+                                         const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                         const char *_sharename /* [in] [unique,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_Remove_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Remove_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.dfs_entry_path = _dfs_entry_path;
+       state->orig.in.servername = _servername;
+       state->orig.in.sharename = _sharename;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Remove, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_REMOVE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_Remove_done, req);
+       return req;
+}
+
+static void rpccli_dfs_Remove_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Remove_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Remove_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Remove, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Remove_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_dfs_Remove_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Remove_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_dfs_Remove(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */,
@@ -142,6 +487,126 @@ NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_SetInfo_state {
+       struct dfs_SetInfo orig;
+       struct dfs_SetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_SetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_SetInfo_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli,
+                                          const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
+                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                          const char *_sharename /* [in] [unique,charset(UTF16)] */,
+                                          uint32_t _level /* [in]  */,
+                                          union dfs_Info *_info /* [in] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_SetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_SetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.dfs_entry_path = _dfs_entry_path;
+       state->orig.in.servername = _servername;
+       state->orig.in.sharename = _sharename;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_SetInfo, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_SETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_SetInfo_done, req);
+       return req;
+}
+
+static void rpccli_dfs_SetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_SetInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_SetInfo_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_SetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_SetInfo_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result)
+{
+       struct rpccli_dfs_SetInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_SetInfo_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_dfs_SetInfo(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            const char *dfs_entry_path /* [in] [charset(UTF16)] */,
@@ -193,6 +658,133 @@ NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_GetInfo_state {
+       struct dfs_GetInfo orig;
+       struct dfs_GetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_GetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_GetInfo_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli,
+                                          const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
+                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                          const char *_sharename /* [in] [unique,charset(UTF16)] */,
+                                          uint32_t _level /* [in]  */,
+                                          union dfs_Info *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_GetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_GetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.dfs_entry_path = _dfs_entry_path;
+       state->orig.in.servername = _servername;
+       state->orig.in.sharename = _sharename;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_GetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_GetInfo_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_netdfs,
+                                   NDR_DFS_GETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_GetInfo_done, req);
+       return req;
+}
+
+static void rpccli_dfs_GetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_GetInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_GetInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_GetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_GetInfo_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result)
+{
+       struct rpccli_dfs_GetInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_GetInfo_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_dfs_GetInfo(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            const char *dfs_entry_path /* [in] [charset(UTF16)] */,
@@ -244,47 +836,179 @@ NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli,
-                        TALLOC_CTX *mem_ctx,
-                        uint32_t level /* [in]  */,
-                        uint32_t bufsize /* [in]  */,
-                        struct dfs_EnumStruct *info /* [in,out] [unique] */,
-                        uint32_t *total /* [in,out] [unique] */,
-                        WERROR *werror)
+struct rpccli_dfs_Enum_state {
+       struct dfs_Enum orig;
+       struct dfs_Enum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Enum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Enum_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       struct rpc_pipe_client *cli,
+                                       uint32_t _level /* [in]  */,
+                                       uint32_t _bufsize /* [in]  */,
+                                       struct dfs_EnumStruct *_info /* [in,out] [unique] */,
+                                       uint32_t *_total /* [in,out] [unique] */)
 {
-       struct dfs_Enum r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_dfs_Enum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Enum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.level = level;
-       r.in.bufsize = bufsize;
-       r.in.info = info;
-       r.in.total = total;
+       state->orig.in.level = _level;
+       state->orig.in.bufsize = _bufsize;
+       state->orig.in.info = _info;
+       state->orig.in.total = _total;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.total = _total;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(dfs_Enum, &r);
+               NDR_PRINT_IN_DEBUG(dfs_Enum, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netdfs,
-                               NDR_DFS_ENUM,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_Enum_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_ENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_dfs_Enum_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(dfs_Enum, &r);
+static void rpccli_dfs_Enum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Enum_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Enum_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       /* Return variables */
-       if (info && r.out.info) {
+       /* Copy out parameters */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       if (state->orig.out.total && state->tmp.out.total) {
+               *state->orig.out.total = *state->tmp.out.total;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Enum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Enum_recv(struct tevent_req *req,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *result)
+{
+       struct rpccli_dfs_Enum_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Enum_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_dfs_Enum(struct rpc_pipe_client *cli,
+                        TALLOC_CTX *mem_ctx,
+                        uint32_t level /* [in]  */,
+                        uint32_t bufsize /* [in]  */,
+                        struct dfs_EnumStruct *info /* [in,out] [unique] */,
+                        uint32_t *total /* [in,out] [unique] */,
+                        WERROR *werror)
+{
+       struct dfs_Enum r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.level = level;
+       r.in.bufsize = bufsize;
+       r.in.info = info;
+       r.in.total = total;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Enum, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netdfs,
+                               NDR_DFS_ENUM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Enum, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        if (total && r.out.total) {
@@ -299,6 +1023,116 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_Rename_state {
+       struct dfs_Rename orig;
+       struct dfs_Rename tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Rename_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Rename_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_Rename_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Rename_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Rename, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_RENAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_Rename_done, req);
+       return req;
+}
+
+static void rpccli_dfs_Rename_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Rename_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Rename_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Rename, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Rename_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_dfs_Rename_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Rename_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_dfs_Rename(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
@@ -340,6 +1174,116 @@ NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_Move_state {
+       struct dfs_Move orig;
+       struct dfs_Move tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Move_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Move_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_Move_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Move_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Move, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_MOVE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_Move_done, req);
+       return req;
+}
+
+static void rpccli_dfs_Move_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Move_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Move_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Move, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Move_recv(struct tevent_req *req,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *result)
+{
+       struct rpccli_dfs_Move_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Move_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_dfs_Move(struct rpc_pipe_client *cli,
                         TALLOC_CTX *mem_ctx,
                         WERROR *werror)
@@ -381,6 +1325,116 @@ NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_ManagerGetConfigInfo_state {
+       struct dfs_ManagerGetConfigInfo orig;
+       struct dfs_ManagerGetConfigInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_ManagerGetConfigInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_ManagerGetConfigInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_ManagerGetConfigInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_ManagerGetConfigInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_ManagerGetConfigInfo, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_MANAGERGETCONFIGINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_ManagerGetConfigInfo_done, req);
+       return req;
+}
+
+static void rpccli_dfs_ManagerGetConfigInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_ManagerGetConfigInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_ManagerGetConfigInfo_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_ManagerGetConfigInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_dfs_ManagerGetConfigInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_ManagerGetConfigInfo_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_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror)
@@ -422,6 +1476,116 @@ NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_ManagerSendSiteInfo_state {
+       struct dfs_ManagerSendSiteInfo orig;
+       struct dfs_ManagerSendSiteInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_ManagerSendSiteInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_ManagerSendSiteInfo_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_ManagerSendSiteInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_ManagerSendSiteInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_ManagerSendSiteInfo, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_MANAGERSENDSITEINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_ManagerSendSiteInfo_done, req);
+       return req;
+}
+
+static void rpccli_dfs_ManagerSendSiteInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_ManagerSendSiteInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_ManagerSendSiteInfo_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_ManagerSendSiteInfo_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_dfs_ManagerSendSiteInfo_state *state = tevent_req_data(
+               req, struct rpccli_dfs_ManagerSendSiteInfo_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_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror)
@@ -463,6 +1627,144 @@ NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_AddFtRoot_state {
+       struct dfs_AddFtRoot orig;
+       struct dfs_AddFtRoot tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_AddFtRoot_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_AddFtRoot_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_servername /* [in] [charset(UTF16)] */,
+                                            const char *_dns_servername /* [in] [charset(UTF16)] */,
+                                            const char *_dfsname /* [in] [charset(UTF16)] */,
+                                            const char *_rootshare /* [in] [charset(UTF16)] */,
+                                            const char *_comment /* [in] [charset(UTF16)] */,
+                                            const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
+                                            uint8_t _unknown1 /* [in]  */,
+                                            uint32_t _flags /* [in]  */,
+                                            struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_AddFtRoot_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_AddFtRoot_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.dns_servername = _dns_servername;
+       state->orig.in.dfsname = _dfsname;
+       state->orig.in.rootshare = _rootshare;
+       state->orig.in.comment = _comment;
+       state->orig.in.dfs_config_dn = _dfs_config_dn;
+       state->orig.in.unknown1 = _unknown1;
+       state->orig.in.flags = _flags;
+       state->orig.in.unknown2 = _unknown2;
+
+       /* Out parameters */
+       state->orig.out.unknown2 = _unknown2;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_AddFtRoot, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_AddFtRoot_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_netdfs,
+                                   NDR_DFS_ADDFTROOT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_AddFtRoot_done, req);
+       return req;
+}
+
+static void rpccli_dfs_AddFtRoot_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_AddFtRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_AddFtRoot_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 */
+       if (state->orig.out.unknown2 && state->tmp.out.unknown2) {
+               *state->orig.out.unknown2 = *state->tmp.out.unknown2;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_AddFtRoot_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result)
+{
+       struct rpccli_dfs_AddFtRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_AddFtRoot_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_dfs_AddFtRoot(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *servername /* [in] [charset(UTF16)] */,
@@ -525,6 +1827,138 @@ NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_RemoveFtRoot_state {
+       struct dfs_RemoveFtRoot orig;
+       struct dfs_RemoveFtRoot tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_RemoveFtRoot_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_RemoveFtRoot_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char *_dns_servername /* [in] [charset(UTF16)] */,
+                                               const char *_dfsname /* [in] [charset(UTF16)] */,
+                                               const char *_rootshare /* [in] [charset(UTF16)] */,
+                                               uint32_t _flags /* [in]  */,
+                                               struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_RemoveFtRoot_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_RemoveFtRoot_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.dns_servername = _dns_servername;
+       state->orig.in.dfsname = _dfsname;
+       state->orig.in.rootshare = _rootshare;
+       state->orig.in.flags = _flags;
+       state->orig.in.unknown = _unknown;
+
+       /* Out parameters */
+       state->orig.out.unknown = _unknown;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_RemoveFtRoot_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_netdfs,
+                                   NDR_DFS_REMOVEFTROOT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_RemoveFtRoot_done, req);
+       return req;
+}
+
+static void rpccli_dfs_RemoveFtRoot_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_RemoveFtRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_RemoveFtRoot_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 */
+       if (state->orig.out.unknown && state->tmp.out.unknown) {
+               *state->orig.out.unknown = *state->tmp.out.unknown;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_RemoveFtRoot_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_dfs_RemoveFtRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_RemoveFtRoot_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_dfs_RemoveFtRoot(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
@@ -547,38 +1981,156 @@ NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli,
        r.in.unknown = unknown;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, &r);
+               NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netdfs,
+                               NDR_DFS_REMOVEFTROOT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (unknown && r.out.unknown) {
+               *unknown = *r.out.unknown;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_dfs_AddStdRoot_state {
+       struct dfs_AddStdRoot orig;
+       struct dfs_AddStdRoot tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_AddStdRoot_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_AddStdRoot_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             const char *_servername /* [in] [charset(UTF16)] */,
+                                             const char *_rootshare /* [in] [charset(UTF16)] */,
+                                             const char *_comment /* [in] [charset(UTF16)] */,
+                                             uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_AddStdRoot_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_AddStdRoot_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.rootshare = _rootshare;
+       state->orig.in.comment = _comment;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_AddStdRoot, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netdfs,
-                               NDR_DFS_REMOVEFTROOT,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_ADDSTDROOT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_AddStdRoot_done, req);
+       return req;
+}
+
+static void rpccli_dfs_AddStdRoot_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_AddStdRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_AddStdRoot_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, &r);
+               NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_AddStdRoot_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_dfs_AddStdRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_AddStdRoot_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       if (unknown && r.out.unknown) {
-               *unknown = *r.out.unknown;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli,
@@ -630,6 +2182,122 @@ NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_RemoveStdRoot_state {
+       struct dfs_RemoveStdRoot orig;
+       struct dfs_RemoveStdRoot tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_RemoveStdRoot_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_RemoveStdRoot_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_servername /* [in] [charset(UTF16)] */,
+                                                const char *_rootshare /* [in] [charset(UTF16)] */,
+                                                uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_RemoveStdRoot_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_RemoveStdRoot_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.rootshare = _rootshare;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_RemoveStdRoot, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_REMOVESTDROOT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_RemoveStdRoot_done, req);
+       return req;
+}
+
+static void rpccli_dfs_RemoveStdRoot_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_RemoveStdRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_RemoveStdRoot_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_RemoveStdRoot_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_dfs_RemoveStdRoot_state *state = tevent_req_data(
+               req, struct rpccli_dfs_RemoveStdRoot_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_dfs_RemoveStdRoot(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *servername /* [in] [charset(UTF16)] */,
@@ -677,6 +2345,120 @@ NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_ManagerInitialize_state {
+       struct dfs_ManagerInitialize orig;
+       struct dfs_ManagerInitialize tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_ManagerInitialize_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_ManagerInitialize_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_servername /* [in] [ref,charset(UTF16)] */,
+                                                    uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_ManagerInitialize_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_ManagerInitialize_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_ManagerInitialize, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_MANAGERINITIALIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_ManagerInitialize_done, req);
+       return req;
+}
+
+static void rpccli_dfs_ManagerInitialize_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_ManagerInitialize_state *state = tevent_req_data(
+               req, struct rpccli_dfs_ManagerInitialize_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_ManagerInitialize_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_dfs_ManagerInitialize_state *state = tevent_req_data(
+               req, struct rpccli_dfs_ManagerInitialize_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_dfs_ManagerInitialize(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *servername /* [in] [ref,charset(UTF16)] */,
@@ -722,6 +2504,124 @@ NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_AddStdRootForced_state {
+       struct dfs_AddStdRootForced orig;
+       struct dfs_AddStdRootForced tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_AddStdRootForced_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_AddStdRootForced_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_servername /* [in] [charset(UTF16)] */,
+                                                   const char *_rootshare /* [in] [charset(UTF16)] */,
+                                                   const char *_comment /* [in] [charset(UTF16)] */,
+                                                   const char *_store /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_AddStdRootForced_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_AddStdRootForced_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.rootshare = _rootshare;
+       state->orig.in.comment = _comment;
+       state->orig.in.store = _store;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_AddStdRootForced, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_ADDSTDROOTFORCED,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_AddStdRootForced_done, req);
+       return req;
+}
+
+static void rpccli_dfs_AddStdRootForced_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_AddStdRootForced_state *state = tevent_req_data(
+               req, struct rpccli_dfs_AddStdRootForced_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_AddStdRootForced_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_dfs_AddStdRootForced_state *state = tevent_req_data(
+               req, struct rpccli_dfs_AddStdRootForced_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_dfs_AddStdRootForced(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *servername /* [in] [charset(UTF16)] */,
@@ -771,6 +2671,136 @@ NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_GetDcAddress_state {
+       struct dfs_GetDcAddress orig;
+       struct dfs_GetDcAddress tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_GetDcAddress_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_GetDcAddress_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
+                                               uint8_t *_is_root /* [in,out] [ref] */,
+                                               uint32_t *_ttl /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_GetDcAddress_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_GetDcAddress_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.server_fullname = _server_fullname;
+       state->orig.in.is_root = _is_root;
+       state->orig.in.ttl = _ttl;
+
+       /* Out parameters */
+       state->orig.out.server_fullname = _server_fullname;
+       state->orig.out.is_root = _is_root;
+       state->orig.out.ttl = _ttl;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_GetDcAddress_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_netdfs,
+                                   NDR_DFS_GETDCADDRESS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_GetDcAddress_done, req);
+       return req;
+}
+
+static void rpccli_dfs_GetDcAddress_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_GetDcAddress_state *state = tevent_req_data(
+               req, struct rpccli_dfs_GetDcAddress_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.server_fullname = *state->tmp.out.server_fullname;
+       *state->orig.out.is_root = *state->tmp.out.is_root;
+       *state->orig.out.ttl = *state->tmp.out.ttl;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_GetDcAddress_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_dfs_GetDcAddress_state *state = tevent_req_data(
+               req, struct rpccli_dfs_GetDcAddress_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_dfs_GetDcAddress(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
@@ -799,28 +2829,146 @@ NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *server_fullname = *r.out.server_fullname;
+       *is_root = *r.out.is_root;
+       *ttl = *r.out.ttl;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_dfs_SetDcAddress_state {
+       struct dfs_SetDcAddress orig;
+       struct dfs_SetDcAddress tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_SetDcAddress_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_SetDcAddress_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char *_server_fullname /* [in] [charset(UTF16)] */,
+                                               uint32_t _flags /* [in]  */,
+                                               uint32_t _ttl /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_SetDcAddress_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_SetDcAddress_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.server_fullname = _server_fullname;
+       state->orig.in.flags = _flags;
+       state->orig.in.ttl = _ttl;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_SETDCADDRESS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_SetDcAddress_done, req);
+       return req;
+}
+
+static void rpccli_dfs_SetDcAddress_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_SetDcAddress_state *state = tevent_req_data(
+               req, struct rpccli_dfs_SetDcAddress_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, &r);
+               NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_SetDcAddress_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_dfs_SetDcAddress_state *state = tevent_req_data(
+               req, struct rpccli_dfs_SetDcAddress_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *server_fullname = *r.out.server_fullname;
-       *is_root = *r.out.is_root;
-       *ttl = *r.out.ttl;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli,
@@ -872,6 +3020,120 @@ NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_FlushFtTable_state {
+       struct dfs_FlushFtTable orig;
+       struct dfs_FlushFtTable tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_FlushFtTable_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_FlushFtTable_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char *_rootshare /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_FlushFtTable_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_FlushFtTable_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.rootshare = _rootshare;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_FlushFtTable, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_FLUSHFTTABLE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_FlushFtTable_done, req);
+       return req;
+}
+
+static void rpccli_dfs_FlushFtTable_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_FlushFtTable_state *state = tevent_req_data(
+               req, struct rpccli_dfs_FlushFtTable_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_FlushFtTable_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_dfs_FlushFtTable_state *state = tevent_req_data(
+               req, struct rpccli_dfs_FlushFtTable_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_dfs_FlushFtTable(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
@@ -917,6 +3179,116 @@ NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_Add2_state {
+       struct dfs_Add2 orig;
+       struct dfs_Add2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Add2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Add2_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_Add2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Add2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Add2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_ADD2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_Add2_done, req);
+       return req;
+}
+
+static void rpccli_dfs_Add2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Add2_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Add2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Add2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Add2_recv(struct tevent_req *req,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *result)
+{
+       struct rpccli_dfs_Add2_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Add2_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_dfs_Add2(struct rpc_pipe_client *cli,
                         TALLOC_CTX *mem_ctx,
                         WERROR *werror)
@@ -958,6 +3330,116 @@ NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_Remove2_state {
+       struct dfs_Remove2 orig;
+       struct dfs_Remove2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_Remove2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_Remove2_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_Remove2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_Remove2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_Remove2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_REMOVE2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_Remove2_done, req);
+       return req;
+}
+
+static void rpccli_dfs_Remove2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_Remove2_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Remove2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_Remove2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_Remove2_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result)
+{
+       struct rpccli_dfs_Remove2_state *state = tevent_req_data(
+               req, struct rpccli_dfs_Remove2_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_dfs_Remove2(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            WERROR *werror)
@@ -999,6 +3481,140 @@ NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_EnumEx_state {
+       struct dfs_EnumEx orig;
+       struct dfs_EnumEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_EnumEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_EnumEx_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         const char *_dfs_name /* [in] [charset(UTF16)] */,
+                                         uint32_t _level /* [in]  */,
+                                         uint32_t _bufsize /* [in]  */,
+                                         struct dfs_EnumStruct *_info /* [in,out] [unique] */,
+                                         uint32_t *_total /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_EnumEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_EnumEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.dfs_name = _dfs_name;
+       state->orig.in.level = _level;
+       state->orig.in.bufsize = _bufsize;
+       state->orig.in.info = _info;
+       state->orig.in.total = _total;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.total = _total;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_EnumEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dfs_EnumEx_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_netdfs,
+                                   NDR_DFS_ENUMEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_EnumEx_done, req);
+       return req;
+}
+
+static void rpccli_dfs_EnumEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_EnumEx_state *state = tevent_req_data(
+               req, struct rpccli_dfs_EnumEx_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       if (state->orig.out.total && state->tmp.out.total) {
+               *state->orig.out.total = *state->tmp.out.total;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_EnumEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_EnumEx_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_dfs_EnumEx_state *state = tevent_req_data(
+               req, struct rpccli_dfs_EnumEx_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_dfs_EnumEx(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           const char *dfs_name /* [in] [charset(UTF16)] */,
@@ -1056,6 +3672,116 @@ NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dfs_SetInfo2_state {
+       struct dfs_SetInfo2 orig;
+       struct dfs_SetInfo2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dfs_SetInfo2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dfs_SetInfo2_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dfs_SetInfo2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dfs_SetInfo2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dfs_SetInfo2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netdfs,
+                                   NDR_DFS_SETINFO2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dfs_SetInfo2_done, req);
+       return req;
+}
+
+static void rpccli_dfs_SetInfo2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dfs_SetInfo2_state *state = tevent_req_data(
+               req, struct rpccli_dfs_SetInfo2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dfs_SetInfo2_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *result)
+{
+       struct rpccli_dfs_SetInfo2_state *state = tevent_req_data(
+               req, struct rpccli_dfs_SetInfo2_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_dfs_SetInfo2(struct rpc_pipe_client *cli,
                             TALLOC_CTX *mem_ctx,
                             WERROR *werror)
index 9e40a5695b07702ccd9db1b1b7aba1988b2309ce..ed958e211edc6e673c78ecca70d81cc07c86cfc6 100644 (file)
@@ -1,9 +1,26 @@
 #include "../librpc/gen_ndr/ndr_dfs.h"
 #ifndef __CLI_NETDFS__
 #define __CLI_NETDFS__
+struct tevent_req *rpccli_dfs_GetManagerVersion_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    enum dfs_ManagerVersion *_version /* [out] [ref] */);
+NTSTATUS rpccli_dfs_GetManagerVersion_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      enum dfs_ManagerVersion *version /* [out] [ref] */);
+struct tevent_req *rpccli_dfs_Add_send(TALLOC_CTX *mem_ctx,
+                                      struct tevent_context *ev,
+                                      struct rpc_pipe_client *cli,
+                                      const char *_path /* [in] [ref,charset(UTF16)] */,
+                                      const char *_server /* [in] [ref,charset(UTF16)] */,
+                                      const char *_share /* [in] [unique,charset(UTF16)] */,
+                                      const char *_comment /* [in] [unique,charset(UTF16)] */,
+                                      uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_dfs_Add_recv(struct tevent_req *req,
+                            TALLOC_CTX *mem_ctx,
+                            WERROR *result);
 NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli,
                        TALLOC_CTX *mem_ctx,
                        const char *path /* [in] [ref,charset(UTF16)] */,
@@ -12,12 +29,32 @@ NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli,
                        const char *comment /* [in] [unique,charset(UTF16)] */,
                        uint32_t flags /* [in]  */,
                        WERROR *werror);
+struct tevent_req *rpccli_dfs_Remove_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
+                                         const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                         const char *_sharename /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_dfs_Remove_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */,
                           const char *servername /* [in] [unique,charset(UTF16)] */,
                           const char *sharename /* [in] [unique,charset(UTF16)] */,
                           WERROR *werror);
+struct tevent_req *rpccli_dfs_SetInfo_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli,
+                                          const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
+                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                          const char *_sharename /* [in] [unique,charset(UTF16)] */,
+                                          uint32_t _level /* [in]  */,
+                                          union dfs_Info *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_dfs_SetInfo_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result);
 NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            const char *dfs_entry_path /* [in] [charset(UTF16)] */,
@@ -26,6 +63,17 @@ NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli,
                            uint32_t level /* [in]  */,
                            union dfs_Info *info /* [in] [ref,switch_is(level)] */,
                            WERROR *werror);
+struct tevent_req *rpccli_dfs_GetInfo_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli,
+                                          const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
+                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                          const char *_sharename /* [in] [unique,charset(UTF16)] */,
+                                          uint32_t _level /* [in]  */,
+                                          union dfs_Info *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_dfs_GetInfo_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result);
 NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            const char *dfs_entry_path /* [in] [charset(UTF16)] */,
@@ -34,6 +82,16 @@ NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli,
                            uint32_t level /* [in]  */,
                            union dfs_Info *info /* [out] [ref,switch_is(level)] */,
                            WERROR *werror);
+struct tevent_req *rpccli_dfs_Enum_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       struct rpc_pipe_client *cli,
+                                       uint32_t _level /* [in]  */,
+                                       uint32_t _bufsize /* [in]  */,
+                                       struct dfs_EnumStruct *_info /* [in,out] [unique] */,
+                                       uint32_t *_total /* [in,out] [unique] */);
+NTSTATUS rpccli_dfs_Enum_recv(struct tevent_req *req,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *result);
 NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli,
                         TALLOC_CTX *mem_ctx,
                         uint32_t level /* [in]  */,
@@ -41,18 +99,57 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli,
                         struct dfs_EnumStruct *info /* [in,out] [unique] */,
                         uint32_t *total /* [in,out] [unique] */,
                         WERROR *werror);
+struct tevent_req *rpccli_dfs_Rename_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_Rename_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_dfs_Move_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_Move_recv(struct tevent_req *req,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *result);
 NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli,
                         TALLOC_CTX *mem_ctx,
                         WERROR *werror);
+struct tevent_req *rpccli_dfs_ManagerGetConfigInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_ManagerGetConfigInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_dfs_ManagerSendSiteInfo_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_ManagerSendSiteInfo_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror);
+struct tevent_req *rpccli_dfs_AddFtRoot_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_servername /* [in] [charset(UTF16)] */,
+                                            const char *_dns_servername /* [in] [charset(UTF16)] */,
+                                            const char *_dfsname /* [in] [charset(UTF16)] */,
+                                            const char *_rootshare /* [in] [charset(UTF16)] */,
+                                            const char *_comment /* [in] [charset(UTF16)] */,
+                                            const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
+                                            uint8_t _unknown1 /* [in]  */,
+                                            uint32_t _flags /* [in]  */,
+                                            struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */);
+NTSTATUS rpccli_dfs_AddFtRoot_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result);
 NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *servername /* [in] [charset(UTF16)] */,
@@ -65,6 +162,18 @@ NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli,
                              uint32_t flags /* [in]  */,
                              struct dfs_UnknownStruct **unknown2 /* [in,out] [unique] */,
                              WERROR *werror);
+struct tevent_req *rpccli_dfs_RemoveFtRoot_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char *_dns_servername /* [in] [charset(UTF16)] */,
+                                               const char *_dfsname /* [in] [charset(UTF16)] */,
+                                               const char *_rootshare /* [in] [charset(UTF16)] */,
+                                               uint32_t _flags /* [in]  */,
+                                               struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */);
+NTSTATUS rpccli_dfs_RemoveFtRoot_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
@@ -74,6 +183,16 @@ NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli,
                                 uint32_t flags /* [in]  */,
                                 struct dfs_UnknownStruct **unknown /* [in,out] [unique] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_dfs_AddStdRoot_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             const char *_servername /* [in] [charset(UTF16)] */,
+                                             const char *_rootshare /* [in] [charset(UTF16)] */,
+                                             const char *_comment /* [in] [charset(UTF16)] */,
+                                             uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_dfs_AddStdRoot_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               const char *servername /* [in] [charset(UTF16)] */,
@@ -81,17 +200,44 @@ NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli,
                               const char *comment /* [in] [charset(UTF16)] */,
                               uint32_t flags /* [in]  */,
                               WERROR *werror);
+struct tevent_req *rpccli_dfs_RemoveStdRoot_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_servername /* [in] [charset(UTF16)] */,
+                                                const char *_rootshare /* [in] [charset(UTF16)] */,
+                                                uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_dfs_RemoveStdRoot_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *servername /* [in] [charset(UTF16)] */,
                                  const char *rootshare /* [in] [charset(UTF16)] */,
                                  uint32_t flags /* [in]  */,
                                  WERROR *werror);
+struct tevent_req *rpccli_dfs_ManagerInitialize_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_servername /* [in] [ref,charset(UTF16)] */,
+                                                    uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_dfs_ManagerInitialize_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *servername /* [in] [ref,charset(UTF16)] */,
                                      uint32_t flags /* [in]  */,
                                      WERROR *werror);
+struct tevent_req *rpccli_dfs_AddStdRootForced_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_servername /* [in] [charset(UTF16)] */,
+                                                   const char *_rootshare /* [in] [charset(UTF16)] */,
+                                                   const char *_comment /* [in] [charset(UTF16)] */,
+                                                   const char *_store /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_dfs_AddStdRootForced_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *servername /* [in] [charset(UTF16)] */,
@@ -99,6 +245,16 @@ NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli,
                                     const char *comment /* [in] [charset(UTF16)] */,
                                     const char *store /* [in] [charset(UTF16)] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_dfs_GetDcAddress_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
+                                               uint8_t *_is_root /* [in,out] [ref] */,
+                                               uint32_t *_ttl /* [in,out] [ref] */);
+NTSTATUS rpccli_dfs_GetDcAddress_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
@@ -106,6 +262,16 @@ NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli,
                                 uint8_t *is_root /* [in,out] [ref] */,
                                 uint32_t *ttl /* [in,out] [ref] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_dfs_SetDcAddress_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char *_server_fullname /* [in] [charset(UTF16)] */,
+                                               uint32_t _flags /* [in]  */,
+                                               uint32_t _ttl /* [in]  */);
+NTSTATUS rpccli_dfs_SetDcAddress_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
@@ -113,17 +279,48 @@ NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli,
                                 uint32_t flags /* [in]  */,
                                 uint32_t ttl /* [in]  */,
                                 WERROR *werror);
+struct tevent_req *rpccli_dfs_FlushFtTable_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_servername /* [in] [charset(UTF16)] */,
+                                               const char *_rootshare /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_dfs_FlushFtTable_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *servername /* [in] [charset(UTF16)] */,
                                 const char *rootshare /* [in] [charset(UTF16)] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_dfs_Add2_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_Add2_recv(struct tevent_req *req,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *result);
 NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli,
                         TALLOC_CTX *mem_ctx,
                         WERROR *werror);
+struct tevent_req *rpccli_dfs_Remove2_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_Remove2_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result);
 NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            WERROR *werror);
+struct tevent_req *rpccli_dfs_EnumEx_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         const char *_dfs_name /* [in] [charset(UTF16)] */,
+                                         uint32_t _level /* [in]  */,
+                                         uint32_t _bufsize /* [in]  */,
+                                         struct dfs_EnumStruct *_info /* [in,out] [unique] */,
+                                         uint32_t *_total /* [in,out] [unique] */);
+NTSTATUS rpccli_dfs_EnumEx_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           const char *dfs_name /* [in] [charset(UTF16)] */,
@@ -132,6 +329,12 @@ NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli,
                           struct dfs_EnumStruct *info /* [in,out] [unique] */,
                           uint32_t *total /* [in,out] [unique] */,
                           WERROR *werror);
+struct tevent_req *rpccli_dfs_SetInfo2_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dfs_SetInfo2_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *result);
 NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli,
                             TALLOC_CTX *mem_ctx,
                             WERROR *werror);
index be83eebe1f772ca16fd4a8f72757cc48ba0288d6..14c89aa19406982a5c9960c4bb370edfb188f4c4 100644 (file)
@@ -6,6 +6,133 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_drsuapi.h"
 
+struct rpccli_drsuapi_DsBind_state {
+       struct drsuapi_DsBind orig;
+       struct drsuapi_DsBind tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsBind_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct GUID *_bind_guid /* [in] [unique] */,
+                                             struct drsuapi_DsBindInfoCtr *_bind_info /* [in,out] [unique] */,
+                                             struct policy_handle *_bind_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsBind_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsBind_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_guid = _bind_guid;
+       state->orig.in.bind_info = _bind_info;
+
+       /* Out parameters */
+       state->orig.out.bind_info = _bind_info;
+       state->orig.out.bind_handle = _bind_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsBind, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsBind_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_drsuapi,
+                                   NDR_DRSUAPI_DSBIND,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsBind_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsBind_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsBind_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsBind_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 */
+       if (state->orig.out.bind_info && state->tmp.out.bind_info) {
+               *state->orig.out.bind_info = *state->tmp.out.bind_info;
+       }
+       *state->orig.out.bind_handle = *state->tmp.out.bind_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsBind, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsBind_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_drsuapi_DsBind_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsBind_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_drsuapi_DsBind(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct GUID *bind_guid /* [in] [unique] */,
@@ -56,6 +183,126 @@ NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_DsUnbind_state {
+       struct drsuapi_DsUnbind orig;
+       struct drsuapi_DsUnbind tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsUnbind_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_bind_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsUnbind_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsUnbind_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+
+       /* Out parameters */
+       state->orig.out.bind_handle = _bind_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsUnbind, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsUnbind_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_drsuapi,
+                                   NDR_DRSUAPI_DSUNBIND,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsUnbind_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsUnbind_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsUnbind_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsUnbind_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.bind_handle = *state->tmp.out.bind_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsUnbind, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsUnbind_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_drsuapi_DsUnbind_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsUnbind_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_drsuapi_DsUnbind(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *bind_handle /* [in,out] [ref] */,
@@ -100,6 +347,122 @@ NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_DsReplicaSync_state {
+       struct drsuapi_DsReplicaSync orig;
+       struct drsuapi_DsReplicaSync tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsReplicaSync_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsReplicaSync_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                    int32_t _level /* [in]  */,
+                                                    union drsuapi_DsReplicaSyncRequest _req /* [in] [switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsReplicaSync_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsReplicaSync_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaSync, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_DSREPLICASYNC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaSync_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsReplicaSync_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsReplicaSync_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsReplicaSync_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaSync, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsReplicaSync_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_drsuapi_DsReplicaSync_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsReplicaSync_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_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *bind_handle /* [in] [ref] */,
@@ -147,6 +510,134 @@ NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_DsGetNCChanges_state {
+       struct drsuapi_DsGetNCChanges orig;
+       struct drsuapi_DsGetNCChanges tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsGetNCChanges_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                     int32_t _level /* [in]  */,
+                                                     union drsuapi_DsGetNCChangesRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                     int32_t *_level_out /* [out] [ref] */,
+                                                     union drsuapi_DsGetNCChangesCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsGetNCChanges_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsGetNCChanges_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetNCChanges, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsGetNCChanges_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_drsuapi,
+                                   NDR_DRSUAPI_DSGETNCCHANGES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetNCChanges_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsGetNCChanges_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsGetNCChanges_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetNCChanges_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNCChanges, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsGetNCChanges_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_drsuapi_DsGetNCChanges_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetNCChanges_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_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *bind_handle /* [in] [ref] */,
@@ -198,6 +689,122 @@ NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_DsReplicaUpdateRefs_state {
+       struct drsuapi_DsReplicaUpdateRefs orig;
+       struct drsuapi_DsReplicaUpdateRefs tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsReplicaUpdateRefs_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsReplicaUpdateRefs_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                          int32_t _level /* [in]  */,
+                                                          union drsuapi_DsReplicaUpdateRefsRequest _req /* [in] [switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsReplicaUpdateRefs_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsReplicaUpdateRefs_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaUpdateRefs, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_DSREPLICAUPDATEREFS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaUpdateRefs_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsReplicaUpdateRefs_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsReplicaUpdateRefs_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsReplicaUpdateRefs_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaUpdateRefs, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_drsuapi_DsReplicaUpdateRefs_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsReplicaUpdateRefs_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_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *bind_handle /* [in] [ref] */,
@@ -245,50 +852,270 @@ NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+struct rpccli_DRSUAPI_REPLICA_ADD_state {
+       struct DRSUAPI_REPLICA_ADD orig;
+       struct DRSUAPI_REPLICA_ADD tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_REPLICA_ADD_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_REPLICA_ADD_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
 {
-       struct DRSUAPI_REPLICA_ADD r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_REPLICA_ADD_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_REPLICA_ADD_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_ADD, &r);
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_ADD, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_drsuapi,
-                               NDR_DRSUAPI_REPLICA_ADD,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_REPLICA_ADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_REPLICA_ADD_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_ADD, &r);
+static void rpccli_DRSUAPI_REPLICA_ADD_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_REPLICA_ADD_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_ADD_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       /* Return variables */
+       /* Copy out parameters */
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_ADD, &state->orig);
        }
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_done(req);
 }
 
-NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+NTSTATUS rpccli_DRSUAPI_REPLICA_ADD_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_DRSUAPI_REPLICA_ADD_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_ADD_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_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct DRSUAPI_REPLICA_ADD r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_ADD, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_drsuapi,
+                               NDR_DRSUAPI_REPLICA_ADD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_ADD, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_DRSUAPI_REPLICA_DEL_state {
+       struct DRSUAPI_REPLICA_DEL orig;
+       struct DRSUAPI_REPLICA_DEL tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_REPLICA_DEL_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_REPLICA_DEL_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_REPLICA_DEL_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_REPLICA_DEL_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_DEL, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_REPLICA_DEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_REPLICA_DEL_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_REPLICA_DEL_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_REPLICA_DEL_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_DEL_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_DEL, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_REPLICA_DEL_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_DRSUAPI_REPLICA_DEL_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_DEL_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_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
 {
        struct DRSUAPI_REPLICA_DEL r;
        NTSTATUS status;
@@ -327,6 +1154,116 @@ NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_DRSUAPI_REPLICA_MODIFY_state {
+       struct DRSUAPI_REPLICA_MODIFY orig;
+       struct DRSUAPI_REPLICA_MODIFY tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_REPLICA_MODIFY_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_REPLICA_MODIFY_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_REPLICA_MODIFY_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_REPLICA_MODIFY_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_MODIFY, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_REPLICA_MODIFY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_REPLICA_MODIFY_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_REPLICA_MODIFY_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_REPLICA_MODIFY_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_MODIFY_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_MODIFY, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_DRSUAPI_REPLICA_MODIFY_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_MODIFY_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_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror)
@@ -368,6 +1305,116 @@ NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_DRSUAPI_VERIFY_NAMES_state {
+       struct DRSUAPI_VERIFY_NAMES orig;
+       struct DRSUAPI_VERIFY_NAMES tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_VERIFY_NAMES_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_VERIFY_NAMES_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_VERIFY_NAMES_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_VERIFY_NAMES_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_VERIFY_NAMES, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_VERIFY_NAMES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_VERIFY_NAMES_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_VERIFY_NAMES_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_VERIFY_NAMES_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_VERIFY_NAMES_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_VERIFY_NAMES, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_DRSUAPI_VERIFY_NAMES_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_VERIFY_NAMES_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_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror)
@@ -409,6 +1456,134 @@ NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_DsGetMemberships_state {
+       struct drsuapi_DsGetMemberships orig;
+       struct drsuapi_DsGetMemberships tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsGetMemberships_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsGetMemberships_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       int32_t _level /* [in]  */,
+                                                       union drsuapi_DsGetMembershipsRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       int32_t *_level_out /* [out] [ref] */,
+                                                       union drsuapi_DsGetMembershipsCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsGetMemberships_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsGetMemberships_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetMemberships, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsGetMemberships_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_drsuapi,
+                                   NDR_DRSUAPI_DSGETMEMBERSHIPS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetMemberships_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsGetMemberships_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsGetMemberships_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetMemberships_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetMemberships, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsGetMemberships_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_drsuapi_DsGetMemberships_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetMemberships_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_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *bind_handle /* [in] [ref] */,
@@ -460,23 +1635,1000 @@ NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         WERROR *werror)
+struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state {
+       struct DRSUAPI_INTER_DOMAIN_MOVE orig;
+       struct DRSUAPI_INTER_DOMAIN_MOVE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_INTER_DOMAIN_MOVE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_INTER_DOMAIN_MOVE_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_INTER_DOMAIN_MOVE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_INTER_DOMAIN_MOVE_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_INTER_DOMAIN_MOVE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_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_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *werror)
+{
+       struct DRSUAPI_INTER_DOMAIN_MOVE r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_drsuapi,
+                               NDR_DRSUAPI_INTER_DOMAIN_MOVE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_drsuapi_DsGetNT4ChangeLog_state {
+       struct drsuapi_DsGetNT4ChangeLog orig;
+       struct drsuapi_DsGetNT4ChangeLog tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsGetNT4ChangeLog_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        union drsuapi_DsGetNT4ChangeLogRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                        uint32_t *_level_out /* [out] [ref] */,
+                                                        union drsuapi_DsGetNT4ChangeLogInfo *_info /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsGetNT4ChangeLog_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsGetNT4ChangeLog_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetNT4ChangeLog, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsGetNT4ChangeLog_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_drsuapi,
+                                   NDR_DRSUAPI_DSGETNT4CHANGELOG,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetNT4ChangeLog_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsGetNT4ChangeLog_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsGetNT4ChangeLog_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetNT4ChangeLog_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNT4ChangeLog, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_drsuapi_DsGetNT4ChangeLog_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetNT4ChangeLog_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_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *bind_handle /* [in] [ref] */,
+                                         uint32_t level /* [in]  */,
+                                         union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */,
+                                         uint32_t *level_out /* [out] [ref] */,
+                                         union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */,
+                                         WERROR *werror)
+{
+       struct drsuapi_DsGetNT4ChangeLog r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.bind_handle = bind_handle;
+       r.in.level = level;
+       r.in.req = req;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetNT4ChangeLog, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_drsuapi,
+                               NDR_DRSUAPI_DSGETNT4CHANGELOG,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNT4ChangeLog, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *level_out = *r.out.level_out;
+       *info = *r.out.info;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_drsuapi_DsCrackNames_state {
+       struct drsuapi_DsCrackNames orig;
+       struct drsuapi_DsCrackNames tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsCrackNames_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                   int32_t _level /* [in]  */,
+                                                   union drsuapi_DsNameRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                   int32_t *_level_out /* [out] [ref] */,
+                                                   union drsuapi_DsNameCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsCrackNames_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsCrackNames_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsCrackNames, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsCrackNames_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_drsuapi,
+                                   NDR_DRSUAPI_DSCRACKNAMES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsCrackNames_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsCrackNames_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsCrackNames_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsCrackNames_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsCrackNames, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsCrackNames_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_drsuapi_DsCrackNames_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsCrackNames_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_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *bind_handle /* [in] [ref] */,
+                                    int32_t level /* [in]  */,
+                                    union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */,
+                                    int32_t *level_out /* [out] [ref] */,
+                                    union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
+                                    WERROR *werror)
+{
+       struct drsuapi_DsCrackNames r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.bind_handle = bind_handle;
+       r.in.level = level;
+       r.in.req = req;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsCrackNames, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_drsuapi,
+                               NDR_DRSUAPI_DSCRACKNAMES,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsCrackNames, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *level_out = *r.out.level_out;
+       *ctr = *r.out.ctr;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_drsuapi_DsWriteAccountSpn_state {
+       struct drsuapi_DsWriteAccountSpn orig;
+       struct drsuapi_DsWriteAccountSpn tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsWriteAccountSpn_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                        int32_t _level /* [in]  */,
+                                                        union drsuapi_DsWriteAccountSpnRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                        int32_t *_level_out /* [out] [ref] */,
+                                                        union drsuapi_DsWriteAccountSpnResult *_res /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsWriteAccountSpn_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsWriteAccountSpn_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.res = _res;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsWriteAccountSpn, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsWriteAccountSpn_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_drsuapi,
+                                   NDR_DRSUAPI_DSWRITEACCOUNTSPN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsWriteAccountSpn_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsWriteAccountSpn_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsWriteAccountSpn_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsWriteAccountSpn_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.res = *state->tmp.out.res;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsWriteAccountSpn, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsWriteAccountSpn_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_drsuapi_DsWriteAccountSpn_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsWriteAccountSpn_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_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *bind_handle /* [in] [ref] */,
+                                         int32_t level /* [in]  */,
+                                         union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */,
+                                         int32_t *level_out /* [out] [ref] */,
+                                         union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */,
+                                         WERROR *werror)
+{
+       struct drsuapi_DsWriteAccountSpn r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.bind_handle = bind_handle;
+       r.in.level = level;
+       r.in.req = req;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsWriteAccountSpn, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_drsuapi,
+                               NDR_DRSUAPI_DSWRITEACCOUNTSPN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsWriteAccountSpn, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *level_out = *r.out.level_out;
+       *res = *r.out.res;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_drsuapi_DsRemoveDSServer_state {
+       struct drsuapi_DsRemoveDSServer orig;
+       struct drsuapi_DsRemoveDSServer tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsRemoveDSServer_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       int32_t _level /* [in]  */,
+                                                       union drsuapi_DsRemoveDSServerRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       int32_t *_level_out /* [out] [ref] */,
+                                                       union drsuapi_DsRemoveDSServerResult *_res /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsRemoveDSServer_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsRemoveDSServer_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.res = _res;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsRemoveDSServer, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsRemoveDSServer_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_drsuapi,
+                                   NDR_DRSUAPI_DSREMOVEDSSERVER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsRemoveDSServer_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsRemoveDSServer_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsRemoveDSServer_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsRemoveDSServer_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.res = *state->tmp.out.res;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsRemoveDSServer, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsRemoveDSServer_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_drsuapi_DsRemoveDSServer_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsRemoveDSServer_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_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *bind_handle /* [in] [ref] */,
+                                        int32_t level /* [in]  */,
+                                        union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */,
+                                        int32_t *level_out /* [out] [ref] */,
+                                        union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */,
+                                        WERROR *werror)
+{
+       struct drsuapi_DsRemoveDSServer r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.bind_handle = bind_handle;
+       r.in.level = level;
+       r.in.req = req;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsRemoveDSServer, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_drsuapi,
+                               NDR_DRSUAPI_DSREMOVEDSSERVER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsRemoveDSServer, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *level_out = *r.out.level_out;
+       *res = *r.out.res;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state {
+       struct DRSUAPI_REMOVE_DS_DOMAIN orig;
+       struct DRSUAPI_REMOVE_DS_DOMAIN tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_REMOVE_DS_DOMAIN_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_REMOVE_DS_DOMAIN_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_REMOVE_DS_DOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_REMOVE_DS_DOMAIN_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_REMOVE_DS_DOMAIN_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_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_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
 {
-       struct DRSUAPI_INTER_DOMAIN_MOVE r;
+       struct DRSUAPI_REMOVE_DS_DOMAIN r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r);
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_drsuapi,
-                               NDR_DRSUAPI_INTER_DOMAIN_MOVE,
+                               NDR_DRSUAPI_REMOVE_DS_DOMAIN,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -484,7 +2636,7 @@ NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r);
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -501,67 +2653,144 @@ NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *bind_handle /* [in] [ref] */,
-                                         uint32_t level /* [in]  */,
-                                         union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */,
-                                         uint32_t *level_out /* [out] [ref] */,
-                                         union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */,
-                                         WERROR *werror)
+struct rpccli_drsuapi_DsGetDomainControllerInfo_state {
+       struct drsuapi_DsGetDomainControllerInfo orig;
+       struct drsuapi_DsGetDomainControllerInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsGetDomainControllerInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsGetDomainControllerInfo_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                                int32_t _level /* [in]  */,
+                                                                union drsuapi_DsGetDCInfoRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                                int32_t *_level_out /* [out] [ref] */,
+                                                                union drsuapi_DsGetDCInfoCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
 {
-       struct drsuapi_DsGetNT4ChangeLog r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsGetDomainControllerInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsGetDomainControllerInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.bind_handle = bind_handle;
-       r.in.level = level;
-       r.in.req = req;
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(drsuapi_DsGetNT4ChangeLog, &r);
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetDomainControllerInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_drsuapi,
-                               NDR_DRSUAPI_DSGETNT4CHANGELOG,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsGetDomainControllerInfo_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_drsuapi,
+                                   NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetDomainControllerInfo_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsGetDomainControllerInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsGetDomainControllerInfo_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetDomainControllerInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNT4ChangeLog, &r);
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetDomainControllerInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_drsuapi_DsGetDomainControllerInfo_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetDomainControllerInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *level_out = *r.out.level_out;
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *bind_handle /* [in] [ref] */,
-                                    int32_t level /* [in]  */,
-                                    union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */,
-                                    int32_t *level_out /* [out] [ref] */,
-                                    union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
-                                    WERROR *werror)
+NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 struct policy_handle *bind_handle /* [in] [ref] */,
+                                                 int32_t level /* [in]  */,
+                                                 union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */,
+                                                 int32_t *level_out /* [out] [ref] */,
+                                                 union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
+                                                 WERROR *werror)
 {
-       struct drsuapi_DsCrackNames r;
+       struct drsuapi_DsGetDomainControllerInfo r;
        NTSTATUS status;
 
        /* In parameters */
@@ -570,13 +2799,13 @@ NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
        r.in.req = req;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(drsuapi_DsCrackNames, &r);
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetDomainControllerInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_drsuapi,
-                               NDR_DRSUAPI_DSCRACKNAMES,
+                               NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -584,7 +2813,7 @@ NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(drsuapi_DsCrackNames, &r);
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetDomainControllerInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -603,67 +2832,144 @@ NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *bind_handle /* [in] [ref] */,
-                                         int32_t level /* [in]  */,
-                                         union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */,
-                                         int32_t *level_out /* [out] [ref] */,
-                                         union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */,
-                                         WERROR *werror)
+struct rpccli_drsuapi_DsAddEntry_state {
+       struct drsuapi_DsAddEntry orig;
+       struct drsuapi_DsAddEntry tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsAddEntry_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                 int32_t _level /* [in]  */,
+                                                 union drsuapi_DsAddEntryRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                 int32_t *_level_out /* [out] [ref] */,
+                                                 union drsuapi_DsAddEntryCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
 {
-       struct drsuapi_DsWriteAccountSpn r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsAddEntry_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsAddEntry_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.bind_handle = bind_handle;
-       r.in.level = level;
-       r.in.req = req;
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(drsuapi_DsWriteAccountSpn, &r);
+               NDR_PRINT_IN_DEBUG(drsuapi_DsAddEntry, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_drsuapi,
-                               NDR_DRSUAPI_DSWRITEACCOUNTSPN,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsAddEntry_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_drsuapi,
+                                   NDR_DRSUAPI_DSADDENTRY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsAddEntry_done, req);
+       return req;
+}
 
+static void rpccli_drsuapi_DsAddEntry_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsAddEntry_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsAddEntry_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(drsuapi_DsWriteAccountSpn, &r);
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsAddEntry, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsAddEntry_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_drsuapi_DsAddEntry_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsAddEntry_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *level_out = *r.out.level_out;
-       *res = *r.out.res;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *bind_handle /* [in] [ref] */,
-                                        int32_t level /* [in]  */,
-                                        union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */,
-                                        int32_t *level_out /* [out] [ref] */,
-                                        union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */,
-                                        WERROR *werror)
+NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *bind_handle /* [in] [ref] */,
+                                  int32_t level /* [in]  */,
+                                  union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */,
+                                  int32_t *level_out /* [out] [ref] */,
+                                  union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
+                                  WERROR *werror)
 {
-       struct drsuapi_DsRemoveDSServer r;
+       struct drsuapi_DsAddEntry r;
        NTSTATUS status;
 
        /* In parameters */
@@ -672,13 +2978,13 @@ NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
        r.in.req = req;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(drsuapi_DsRemoveDSServer, &r);
+               NDR_PRINT_IN_DEBUG(drsuapi_DsAddEntry, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_drsuapi,
-                               NDR_DRSUAPI_DSREMOVEDSSERVER,
+                               NDR_DRSUAPI_DSADDENTRY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -686,7 +2992,7 @@ NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(drsuapi_DsRemoveDSServer, &r);
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsAddEntry, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -695,7 +3001,7 @@ NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
 
        /* Return variables */
        *level_out = *r.out.level_out;
-       *res = *r.out.res;
+       *ctr = *r.out.ctr;
 
        /* Return result */
        if (werror) {
@@ -705,72 +3011,133 @@ NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+struct rpccli_DRSUAPI_EXECUTE_KCC_state {
+       struct DRSUAPI_EXECUTE_KCC orig;
+       struct DRSUAPI_EXECUTE_KCC tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_EXECUTE_KCC_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_EXECUTE_KCC_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
 {
-       struct DRSUAPI_REMOVE_DS_DOMAIN r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_EXECUTE_KCC_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_EXECUTE_KCC_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r);
+               NDR_PRINT_IN_DEBUG(DRSUAPI_EXECUTE_KCC, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_drsuapi,
-                               NDR_DRSUAPI_REMOVE_DS_DOMAIN,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_EXECUTE_KCC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_EXECUTE_KCC_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_EXECUTE_KCC_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_EXECUTE_KCC_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_EXECUTE_KCC_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r);
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_EXECUTE_KCC, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_DRSUAPI_EXECUTE_KCC_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_EXECUTE_KCC_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
-                                                 TALLOC_CTX *mem_ctx,
-                                                 struct policy_handle *bind_handle /* [in] [ref] */,
-                                                 int32_t level /* [in]  */,
-                                                 union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */,
-                                                 int32_t *level_out /* [out] [ref] */,
-                                                 union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
-                                                 WERROR *werror)
+NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
 {
-       struct drsuapi_DsGetDomainControllerInfo r;
+       struct DRSUAPI_EXECUTE_KCC r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.bind_handle = bind_handle;
-       r.in.level = level;
-       r.in.req = req;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(drsuapi_DsGetDomainControllerInfo, &r);
+               NDR_PRINT_IN_DEBUG(DRSUAPI_EXECUTE_KCC, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_drsuapi,
-                               NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO,
+                               NDR_DRSUAPI_EXECUTE_KCC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -778,7 +3145,7 @@ NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetDomainControllerInfo, &r);
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_EXECUTE_KCC, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -786,8 +3153,6 @@ NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *level_out = *r.out.level_out;
-       *ctr = *r.out.ctr;
 
        /* Return result */
        if (werror) {
@@ -797,96 +3162,132 @@ NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct policy_handle *bind_handle /* [in] [ref] */,
-                                  int32_t level /* [in]  */,
-                                  union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */,
-                                  int32_t *level_out /* [out] [ref] */,
-                                  union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
-                                  WERROR *werror)
+struct rpccli_drsuapi_DsReplicaGetInfo_state {
+       struct drsuapi_DsReplicaGetInfo orig;
+       struct drsuapi_DsReplicaGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsReplicaGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       enum drsuapi_DsReplicaGetInfoLevel _level /* [in]  */,
+                                                       union drsuapi_DsReplicaGetInfoRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       enum drsuapi_DsReplicaInfoType *_info_type /* [out] [ref] */,
+                                                       union drsuapi_DsReplicaInfo *_info /* [out] [ref,switch_is(*info_type)] */)
 {
-       struct drsuapi_DsAddEntry r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsReplicaGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsReplicaGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.bind_handle = bind_handle;
-       r.in.level = level;
-       r.in.req = req;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(drsuapi_DsAddEntry, &r);
-       }
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_drsuapi,
-                               NDR_DRSUAPI_DSADDENTRY,
-                               &r);
+       /* Out parameters */
+       state->orig.out.info_type = _info_type;
+       state->orig.out.info = _info;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(drsuapi_DsAddEntry, &r);
+               NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaGetInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsReplicaGetInfo_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *level_out = *r.out.level_out;
-       *ctr = *r.out.ctr;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_DSREPLICAGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
-
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaGetInfo_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+static void rpccli_drsuapi_DsReplicaGetInfo_done(struct tevent_req *subreq)
 {
-       struct DRSUAPI_EXECUTE_KCC r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsReplicaGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsReplicaGetInfo_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(DRSUAPI_EXECUTE_KCC, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_drsuapi,
-                               NDR_DRSUAPI_EXECUTE_KCC,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info_type = *state->tmp.out.info_type;
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(DRSUAPI_EXECUTE_KCC, &r);
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaGetInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsReplicaGetInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_drsuapi_DsReplicaGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsReplicaGetInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli,
@@ -940,6 +3341,116 @@ NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_DRSUAPI_ADD_SID_HISTORY_state {
+       struct DRSUAPI_ADD_SID_HISTORY orig;
+       struct DRSUAPI_ADD_SID_HISTORY tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_ADD_SID_HISTORY_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_ADD_SID_HISTORY_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_ADD_SID_HISTORY_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_ADD_SID_HISTORY_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_ADD_SID_HISTORY, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_ADD_SID_HISTORY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_ADD_SID_HISTORY_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_ADD_SID_HISTORY_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_ADD_SID_HISTORY_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_ADD_SID_HISTORY_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_ADD_SID_HISTORY, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_DRSUAPI_ADD_SID_HISTORY_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_ADD_SID_HISTORY_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_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror)
@@ -981,6 +3492,134 @@ NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_DsGetMemberships2_state {
+       struct drsuapi_DsGetMemberships2 orig;
+       struct drsuapi_DsGetMemberships2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_DsGetMemberships2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_DsGetMemberships2_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                        int32_t _level /* [in]  */,
+                                                        union drsuapi_DsGetMemberships2Request *_req /* [in] [ref,switch_is(level)] */,
+                                                        int32_t *_level_out /* [out] [ref] */,
+                                                        union drsuapi_DsGetMemberships2Ctr *_ctr /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_DsGetMemberships2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_DsGetMemberships2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_DsGetMemberships2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_DsGetMemberships2_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_drsuapi,
+                                   NDR_DRSUAPI_DSGETMEMBERSHIPS2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetMemberships2_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_DsGetMemberships2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_DsGetMemberships2_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetMemberships2_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_DsGetMemberships2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_DsGetMemberships2_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_drsuapi_DsGetMemberships2_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_DsGetMemberships2_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_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *bind_handle /* [in] [ref] */,
@@ -1032,6 +3671,116 @@ NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state {
+       struct DRSUAPI_REPLICA_VERIFY_OBJECTS orig;
+       struct DRSUAPI_REPLICA_VERIFY_OBJECTS tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_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_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               WERROR *werror)
@@ -1073,6 +3822,116 @@ NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state {
+       struct DRSUAPI_GET_OBJECT_EXISTENCE orig;
+       struct DRSUAPI_GET_OBJECT_EXISTENCE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_drsuapi,
+                                   NDR_DRSUAPI_GET_OBJECT_EXISTENCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_done, req);
+       return req;
+}
+
+static void rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state *state = tevent_req_data(
+               req, struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_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_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror)
@@ -1114,6 +3973,134 @@ NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_drsuapi_QuerySitesByCost_state {
+       struct drsuapi_QuerySitesByCost orig;
+       struct drsuapi_QuerySitesByCost tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_drsuapi_QuerySitesByCost_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_drsuapi_QuerySitesByCost_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       int32_t _level /* [in]  */,
+                                                       union drsuapi_QuerySitesByCostRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       int32_t *_level_out /* [out] [ref] */,
+                                                       union drsuapi_QuerySitesByCostCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_drsuapi_QuerySitesByCost_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_drsuapi_QuerySitesByCost_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.bind_handle = _bind_handle;
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(drsuapi_QuerySitesByCost, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_drsuapi_QuerySitesByCost_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_drsuapi,
+                                   NDR_DRSUAPI_QUERYSITESBYCOST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_drsuapi_QuerySitesByCost_done, req);
+       return req;
+}
+
+static void rpccli_drsuapi_QuerySitesByCost_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_drsuapi_QuerySitesByCost_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_QuerySitesByCost_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(drsuapi_QuerySitesByCost, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_drsuapi_QuerySitesByCost_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_drsuapi_QuerySitesByCost_state *state = tevent_req_data(
+               req, struct rpccli_drsuapi_QuerySitesByCost_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_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *bind_handle /* [in] [ref] */,
index 65bc26a60de99b3c960692e98db2930b92e26e95..447528110d90c7425225d65223ace8eb0c9e73ea 100644 (file)
@@ -1,22 +1,58 @@
 #include "../librpc/gen_ndr/ndr_drsuapi.h"
 #ifndef __CLI_DRSUAPI__
 #define __CLI_DRSUAPI__
+struct tevent_req *rpccli_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct GUID *_bind_guid /* [in] [unique] */,
+                                             struct drsuapi_DsBindInfoCtr *_bind_info /* [in,out] [unique] */,
+                                             struct policy_handle *_bind_handle /* [out] [ref] */);
+NTSTATUS rpccli_drsuapi_DsBind_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct GUID *bind_guid /* [in] [unique] */,
                               struct drsuapi_DsBindInfoCtr *bind_info /* [in,out] [unique] */,
                               struct policy_handle *bind_handle /* [out] [ref] */,
                               WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_bind_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_drsuapi_DsUnbind_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *bind_handle /* [in,out] [ref] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsReplicaSync_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                    int32_t _level /* [in]  */,
+                                                    union drsuapi_DsReplicaSyncRequest _req /* [in] [switch_is(level)] */);
+NTSTATUS rpccli_drsuapi_DsReplicaSync_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *bind_handle /* [in] [ref] */,
                                      int32_t level /* [in]  */,
                                      union drsuapi_DsReplicaSyncRequest req /* [in] [switch_is(level)] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                     int32_t _level /* [in]  */,
+                                                     union drsuapi_DsGetNCChangesRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                     int32_t *_level_out /* [out] [ref] */,
+                                                     union drsuapi_DsGetNCChangesCtr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsGetNCChanges_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *bind_handle /* [in] [ref] */,
@@ -25,24 +61,68 @@ NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli,
                                       int32_t *level_out /* [out] [ref] */,
                                       union drsuapi_DsGetNCChangesCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsReplicaUpdateRefs_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                          int32_t _level /* [in]  */,
+                                                          union drsuapi_DsReplicaUpdateRefsRequest _req /* [in] [switch_is(level)] */);
+NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *bind_handle /* [in] [ref] */,
                                            int32_t level /* [in]  */,
                                            union drsuapi_DsReplicaUpdateRefsRequest req /* [in] [switch_is(level)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_REPLICA_ADD_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_REPLICA_ADD_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_REPLICA_DEL_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_REPLICA_DEL_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_REPLICA_MODIFY_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_VERIFY_NAMES_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsGetMemberships_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       int32_t _level /* [in]  */,
+                                                       union drsuapi_DsGetMembershipsRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       int32_t *_level_out /* [out] [ref] */,
+                                                       union drsuapi_DsGetMembershipsCtr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsGetMemberships_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *bind_handle /* [in] [ref] */,
@@ -51,9 +131,26 @@ NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli,
                                         int32_t *level_out /* [out] [ref] */,
                                         union drsuapi_DsGetMembershipsCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_INTER_DOMAIN_MOVE_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        union drsuapi_DsGetNT4ChangeLogRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                        uint32_t *_level_out /* [out] [ref] */,
+                                                        union drsuapi_DsGetNT4ChangeLogInfo *_info /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *bind_handle /* [in] [ref] */,
@@ -62,6 +159,17 @@ NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli,
                                          uint32_t *level_out /* [out] [ref] */,
                                          union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                   int32_t _level /* [in]  */,
+                                                   union drsuapi_DsNameRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                   int32_t *_level_out /* [out] [ref] */,
+                                                   union drsuapi_DsNameCtr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsCrackNames_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *bind_handle /* [in] [ref] */,
@@ -70,6 +178,17 @@ NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
                                     int32_t *level_out /* [out] [ref] */,
                                     union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                        int32_t _level /* [in]  */,
+                                                        union drsuapi_DsWriteAccountSpnRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                        int32_t *_level_out /* [out] [ref] */,
+                                                        union drsuapi_DsWriteAccountSpnResult *_res /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsWriteAccountSpn_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *bind_handle /* [in] [ref] */,
@@ -78,6 +197,17 @@ NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli,
                                          int32_t *level_out /* [out] [ref] */,
                                          union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       int32_t _level /* [in]  */,
+                                                       union drsuapi_DsRemoveDSServerRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       int32_t *_level_out /* [out] [ref] */,
+                                                       union drsuapi_DsRemoveDSServerResult *_res /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsRemoveDSServer_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *bind_handle /* [in] [ref] */,
@@ -86,9 +216,26 @@ NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
                                         int32_t *level_out /* [out] [ref] */,
                                         union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_REMOVE_DS_DOMAIN_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsGetDomainControllerInfo_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                                int32_t _level /* [in]  */,
+                                                                union drsuapi_DsGetDCInfoRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                                int32_t *_level_out /* [out] [ref] */,
+                                                                union drsuapi_DsGetDCInfoCtr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  struct policy_handle *bind_handle /* [in] [ref] */,
@@ -97,6 +244,17 @@ NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
                                                  int32_t *level_out /* [out] [ref] */,
                                                  union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
                                                  WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                 int32_t _level /* [in]  */,
+                                                 union drsuapi_DsAddEntryRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                 int32_t *_level_out /* [out] [ref] */,
+                                                 union drsuapi_DsAddEntryCtr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsAddEntry_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *bind_handle /* [in] [ref] */,
@@ -105,9 +263,26 @@ NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli,
                                   int32_t *level_out /* [out] [ref] */,
                                   union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_EXECUTE_KCC_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       enum drsuapi_DsReplicaGetInfoLevel _level /* [in]  */,
+                                                       union drsuapi_DsReplicaGetInfoRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       enum drsuapi_DsReplicaInfoType *_info_type /* [out] [ref] */,
+                                                       union drsuapi_DsReplicaInfo *_info /* [out] [ref,switch_is(*info_type)] */);
+NTSTATUS rpccli_drsuapi_DsReplicaGetInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *bind_handle /* [in] [ref] */,
@@ -116,9 +291,26 @@ NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli,
                                         enum drsuapi_DsReplicaInfoType *info_type /* [out] [ref] */,
                                         union drsuapi_DsReplicaInfo *info /* [out] [ref,switch_is(*info_type)] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_ADD_SID_HISTORY_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror);
+struct tevent_req *rpccli_drsuapi_DsGetMemberships2_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                        int32_t _level /* [in]  */,
+                                                        union drsuapi_DsGetMemberships2Request *_req /* [in] [ref,switch_is(level)] */,
+                                                        int32_t *_level_out /* [out] [ref] */,
+                                                        union drsuapi_DsGetMemberships2Ctr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_DsGetMemberships2_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *bind_handle /* [in] [ref] */,
@@ -127,12 +319,35 @@ NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli,
                                          int32_t *level_out /* [out] [ref] */,
                                          union drsuapi_DsGetMemberships2Ctr *ctr /* [out] [ref,switch_is(*level_out)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               WERROR *werror);
+struct tevent_req *rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_drsuapi_QuerySitesByCost_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_bind_handle /* [in] [ref] */,
+                                                       int32_t _level /* [in]  */,
+                                                       union drsuapi_QuerySitesByCostRequest *_req /* [in] [ref,switch_is(level)] */,
+                                                       int32_t *_level_out /* [out] [ref] */,
+                                                       union drsuapi_QuerySitesByCostCtr *_ctr /* [out] [ref,switch_is(*level_out)] */);
+NTSTATUS rpccli_drsuapi_QuerySitesByCost_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *bind_handle /* [in] [ref] */,
index 6cf923ff82b9ef28f12777fde656a25aa282a231..f0a75c9102a2ef04cd2f70c89546f495032520f1 100644 (file)
@@ -6,6 +6,129 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_dssetup.h"
 
+struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_state {
+       struct dssetup_DsRoleGetPrimaryDomainInformation orig;
+       struct dssetup_DsRoleGetPrimaryDomainInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleGetPrimaryDomainInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleGetPrimaryDomainInformation_send(TALLOC_CTX *mem_ctx,
+                                                                        struct tevent_context *ev,
+                                                                        struct rpc_pipe_client *cli,
+                                                                        enum dssetup_DsRoleInfoLevel _level /* [in]  */,
+                                                                        union dssetup_DsRoleInfo *_info /* [out] [unique,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_dssetup_DsRoleGetPrimaryDomainInformation_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_dssetup,
+                                   NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleGetPrimaryDomainInformation_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleGetPrimaryDomainInformation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation_recv(struct tevent_req *req,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleGetPrimaryDomainInformation_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_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli,
                                                          TALLOC_CTX *mem_ctx,
                                                          enum dssetup_DsRoleInfoLevel level /* [in]  */,
@@ -53,6 +176,116 @@ NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleDnsNameToFlatName_state {
+       struct dssetup_DsRoleDnsNameToFlatName orig;
+       struct dssetup_DsRoleDnsNameToFlatName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleDnsNameToFlatName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleDnsNameToFlatName_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleDnsNameToFlatName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleDnsNameToFlatName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleDnsNameToFlatName, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleDnsNameToFlatName_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleDnsNameToFlatName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleDnsNameToFlatName_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDnsNameToFlatName_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleDnsNameToFlatName_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDnsNameToFlatName_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_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                WERROR *werror)
@@ -94,6 +327,116 @@ NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleDcAsDc_state {
+       struct dssetup_DsRoleDcAsDc orig;
+       struct dssetup_DsRoleDcAsDc tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleDcAsDc_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleDcAsDc_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleDcAsDc_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleDcAsDc_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsDc, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEDCASDC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleDcAsDc_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleDcAsDc_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleDcAsDc_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDcAsDc_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleDcAsDc_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleDcAsDc_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDcAsDc_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_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror)
@@ -135,6 +478,116 @@ NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleDcAsReplica_state {
+       struct dssetup_DsRoleDcAsReplica orig;
+       struct dssetup_DsRoleDcAsReplica tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleDcAsReplica_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleDcAsReplica_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleDcAsReplica_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleDcAsReplica_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsReplica, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEDCASREPLICA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleDcAsReplica_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleDcAsReplica_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleDcAsReplica_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDcAsReplica_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleDcAsReplica_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleDcAsReplica_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDcAsReplica_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_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          WERROR *werror)
@@ -176,6 +629,116 @@ NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleDemoteDc_state {
+       struct dssetup_DsRoleDemoteDc orig;
+       struct dssetup_DsRoleDemoteDc tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleDemoteDc_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleDemoteDc_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleDemoteDc_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleDemoteDc_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleDemoteDc, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEDEMOTEDC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleDemoteDc_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleDemoteDc_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleDemoteDc_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDemoteDc_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleDemoteDc_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleDemoteDc_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleDemoteDc_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_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror)
@@ -217,6 +780,116 @@ NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleGetDcOperationProgress_state {
+       struct dssetup_DsRoleGetDcOperationProgress orig;
+       struct dssetup_DsRoleGetDcOperationProgress tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleGetDcOperationProgress_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleGetDcOperationProgress_send(TALLOC_CTX *mem_ctx,
+                                                                   struct tevent_context *ev,
+                                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleGetDcOperationProgress_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleGetDcOperationProgress_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleGetDcOperationProgress_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleGetDcOperationProgress_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleGetDcOperationProgress_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleGetDcOperationProgress_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress_recv(struct tevent_req *req,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleGetDcOperationProgress_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleGetDcOperationProgress_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_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli,
                                                     TALLOC_CTX *mem_ctx,
                                                     WERROR *werror)
@@ -258,6 +931,116 @@ NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleGetDcOperationResults_state {
+       struct dssetup_DsRoleGetDcOperationResults orig;
+       struct dssetup_DsRoleGetDcOperationResults tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleGetDcOperationResults_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleGetDcOperationResults_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleGetDcOperationResults_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleGetDcOperationResults_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleGetDcOperationResults_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleGetDcOperationResults_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleGetDcOperationResults_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleGetDcOperationResults_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleGetDcOperationResults_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleGetDcOperationResults_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_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    WERROR *werror)
@@ -299,6 +1082,116 @@ NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleCancel_state {
+       struct dssetup_DsRoleCancel orig;
+       struct dssetup_DsRoleCancel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleCancel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleCancel_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleCancel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleCancel_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLECANCEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleCancel_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleCancel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleCancel_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleCancel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleCancel_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleCancel_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleCancel_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_dssetup_DsRoleCancel(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror)
@@ -340,6 +1233,116 @@ NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_state {
+       struct dssetup_DsRoleServerSaveStateForUpgrade orig;
+       struct dssetup_DsRoleServerSaveStateForUpgrade tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleServerSaveStateForUpgrade_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleServerSaveStateForUpgrade_send(TALLOC_CTX *mem_ctx,
+                                                                      struct tevent_context *ev,
+                                                                      struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleServerSaveStateForUpgrade_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleServerSaveStateForUpgrade_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade_recv(struct tevent_req *req,
+                                                            TALLOC_CTX *mem_ctx,
+                                                            WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleServerSaveStateForUpgrade_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_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli,
                                                        TALLOC_CTX *mem_ctx,
                                                        WERROR *werror)
@@ -381,6 +1384,116 @@ NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_state {
+       struct dssetup_DsRoleUpgradeDownlevelServer orig;
+       struct dssetup_DsRoleUpgradeDownlevelServer tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleUpgradeDownlevelServer_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleUpgradeDownlevelServer_send(TALLOC_CTX *mem_ctx,
+                                                                   struct tevent_context *ev,
+                                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleUpgradeDownlevelServer_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleUpgradeDownlevelServer_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer_recv(struct tevent_req *req,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleUpgradeDownlevelServer_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_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli,
                                                     TALLOC_CTX *mem_ctx,
                                                     WERROR *werror)
@@ -422,6 +1535,116 @@ NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_state {
+       struct dssetup_DsRoleAbortDownlevelServerUpgrade orig;
+       struct dssetup_DsRoleAbortDownlevelServerUpgrade tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_send(TALLOC_CTX *mem_ctx,
+                                                                        struct tevent_context *ev,
+                                                                        struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_dssetup,
+                                   NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_done, req);
+       return req;
+}
+
+static void rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_recv(struct tevent_req *req,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *result)
+{
+       struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_state *state = tevent_req_data(
+               req, struct rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_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_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli,
                                                          TALLOC_CTX *mem_ctx,
                                                          WERROR *werror)
index e6847c3e06d9b0e91668b5fe52b06de04e8404e9..24b476496f1b31119134e7596c8d198cb32a6dfd 100644 (file)
 #include "../librpc/gen_ndr/ndr_dssetup.h"
 #ifndef __CLI_DSSETUP__
 #define __CLI_DSSETUP__
+struct tevent_req *rpccli_dssetup_DsRoleGetPrimaryDomainInformation_send(TALLOC_CTX *mem_ctx,
+                                                                        struct tevent_context *ev,
+                                                                        struct rpc_pipe_client *cli,
+                                                                        enum dssetup_DsRoleInfoLevel _level /* [in]  */,
+                                                                        union dssetup_DsRoleInfo *_info /* [out] [unique,switch_is(level)] */);
+NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation_recv(struct tevent_req *req,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli,
                                                          TALLOC_CTX *mem_ctx,
                                                          enum dssetup_DsRoleInfoLevel level /* [in]  */,
                                                          union dssetup_DsRoleInfo *info /* [out] [unique,switch_is(level)] */,
                                                          WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleDnsNameToFlatName_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleDcAsDc_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleDcAsDc_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleDcAsReplica_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleDcAsReplica_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleDemoteDc_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleDemoteDc_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleGetDcOperationProgress_send(TALLOC_CTX *mem_ctx,
+                                                                   struct tevent_context *ev,
+                                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress_recv(struct tevent_req *req,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli,
                                                     TALLOC_CTX *mem_ctx,
                                                     WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleGetDcOperationResults_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleCancel_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleCancel_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleServerSaveStateForUpgrade_send(TALLOC_CTX *mem_ctx,
+                                                                      struct tevent_context *ev,
+                                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade_recv(struct tevent_req *req,
+                                                            TALLOC_CTX *mem_ctx,
+                                                            WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli,
                                                        TALLOC_CTX *mem_ctx,
                                                        WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleUpgradeDownlevelServer_send(TALLOC_CTX *mem_ctx,
+                                                                   struct tevent_context *ev,
+                                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer_recv(struct tevent_req *req,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli,
                                                     TALLOC_CTX *mem_ctx,
                                                     WERROR *werror);
+struct tevent_req *rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_send(TALLOC_CTX *mem_ctx,
+                                                                        struct tevent_context *ev,
+                                                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade_recv(struct tevent_req *req,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *result);
 NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli,
                                                          TALLOC_CTX *mem_ctx,
                                                          WERROR *werror);
index ff369c7d5a9f65b6e76879a3a9d141c02b432f31..fd18666e4089d444a4545e76e25b9c91c64b2b8c 100644 (file)
@@ -6,6 +6,117 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_echo.h"
 
+struct rpccli_echo_AddOne_state {
+       struct echo_AddOne orig;
+       struct echo_AddOne tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_AddOne_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_AddOne_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli,
+                                          uint32_t _in_data /* [in]  */,
+                                          uint32_t *_out_data /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_AddOne_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_AddOne_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.in_data = _in_data;
+
+       /* Out parameters */
+       state->orig.out.out_data = _out_data;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_AddOne, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_AddOne_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_rpcecho,
+                                   NDR_ECHO_ADDONE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_AddOne_done, req);
+       return req;
+}
+
+static void rpccli_echo_AddOne_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_AddOne_state *state = tevent_req_data(
+               req, struct rpccli_echo_AddOne_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.out_data = *state->tmp.out.out_data;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_AddOne, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_AddOne_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_AddOne_state *state = tevent_req_data(
+               req, struct rpccli_echo_AddOne_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            uint32_t in_data /* [in]  */,
@@ -46,6 +157,119 @@ NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_EchoData_state {
+       struct echo_EchoData orig;
+       struct echo_EchoData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_EchoData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_EchoData_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            uint32_t _len /* [in]  */,
+                                            uint8_t *_in_data /* [in] [size_is(len)] */,
+                                            uint8_t *_out_data /* [out] [size_is(len)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_EchoData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_EchoData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.len = _len;
+       state->orig.in.in_data = _in_data;
+
+       /* Out parameters */
+       state->orig.out.out_data = _out_data;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_EchoData, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_EchoData_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_rpcecho,
+                                   NDR_ECHO_ECHODATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_EchoData_done, req);
+       return req;
+}
+
+static void rpccli_echo_EchoData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_EchoData_state *state = tevent_req_data(
+               req, struct rpccli_echo_EchoData_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 */
+       memcpy(state->orig.out.out_data, state->tmp.out.out_data, state->tmp.in.len * sizeof(*state->orig.out.out_data));
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_EchoData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_EchoData_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_EchoData_state *state = tevent_req_data(
+               req, struct rpccli_echo_EchoData_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              uint32_t len /* [in]  */,
@@ -88,6 +312,110 @@ NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_SinkData_state {
+       struct echo_SinkData orig;
+       struct echo_SinkData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_SinkData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_SinkData_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            uint32_t _len /* [in]  */,
+                                            uint8_t *_data /* [in] [size_is(len)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_SinkData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_SinkData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.len = _len;
+       state->orig.in.data = _data;
+
+       /* Out parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_SinkData, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_rpcecho,
+                                   NDR_ECHO_SINKDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_SinkData_done, req);
+       return req;
+}
+
+static void rpccli_echo_SinkData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_SinkData_state *state = tevent_req_data(
+               req, struct rpccli_echo_SinkData_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 */
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_SinkData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_SinkData_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_SinkData_state *state = tevent_req_data(
+               req, struct rpccli_echo_SinkData_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              uint32_t len /* [in]  */,
@@ -128,6 +456,117 @@ NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_SourceData_state {
+       struct echo_SourceData orig;
+       struct echo_SourceData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_SourceData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_SourceData_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint32_t _len /* [in]  */,
+                                              uint8_t *_data /* [out] [size_is(len)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_SourceData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_SourceData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.len = _len;
+
+       /* Out parameters */
+       state->orig.out.data = _data;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_SourceData, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_SourceData_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_rpcecho,
+                                   NDR_ECHO_SOURCEDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_SourceData_done, req);
+       return req;
+}
+
+static void rpccli_echo_SourceData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_SourceData_state *state = tevent_req_data(
+               req, struct rpccli_echo_SourceData_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 */
+       memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.len * sizeof(*state->orig.out.data));
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_SourceData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_SourceData_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_SourceData_state *state = tevent_req_data(
+               req, struct rpccli_echo_SourceData_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint32_t len /* [in]  */,
@@ -168,6 +607,117 @@ NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_TestCall_state {
+       struct echo_TestCall orig;
+       struct echo_TestCall tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_TestCall_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_TestCall_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_s1 /* [in] [ref,charset(UTF16)] */,
+                                            const char **_s2 /* [out] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_TestCall_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_TestCall_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.s1 = _s1;
+
+       /* Out parameters */
+       state->orig.out.s2 = _s2;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_TestCall, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_TestCall_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_rpcecho,
+                                   NDR_ECHO_TESTCALL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_TestCall_done, req);
+       return req;
+}
+
+static void rpccli_echo_TestCall_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_TestCall_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestCall_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.s2 = *state->tmp.out.s2;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_TestCall, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_TestCall_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_TestCall_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestCall_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *s1 /* [in] [ref,charset(UTF16)] */,
@@ -208,6 +758,127 @@ NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_TestCall2_state {
+       struct echo_TestCall2 orig;
+       struct echo_TestCall2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_TestCall2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_TestCall2_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t _level /* [in]  */,
+                                             union echo_Info *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_TestCall2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_TestCall2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_TestCall2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_TestCall2_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_rpcecho,
+                                   NDR_ECHO_TESTCALL2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_TestCall2_done, req);
+       return req;
+}
+
+static void rpccli_echo_TestCall2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_TestCall2_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestCall2_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_TestCall2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_TestCall2_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_echo_TestCall2_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestCall2_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_echo_TestCall2(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint16_t level /* [in]  */,
@@ -248,6 +919,118 @@ NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_echo_TestSleep_state {
+       struct echo_TestSleep orig;
+       struct echo_TestSleep tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_TestSleep_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_TestSleep_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint32_t _seconds /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_TestSleep_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_TestSleep_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.seconds = _seconds;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_TestSleep, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_rpcecho,
+                                   NDR_ECHO_TESTSLEEP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_TestSleep_done, req);
+       return req;
+}
+
+static void rpccli_echo_TestSleep_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_TestSleep_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestSleep_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_TestSleep, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_TestSleep_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   uint32 *result)
+{
+       struct rpccli_echo_TestSleep_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestSleep_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_echo_TestSleep(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint32_t seconds /* [in]  */)
@@ -286,6 +1069,124 @@ NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_TestEnum_state {
+       struct echo_TestEnum orig;
+       struct echo_TestEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_TestEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_TestEnum_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
+                                            struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
+                                            union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_TestEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_TestEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.foo1 = _foo1;
+       state->orig.in.foo2 = _foo2;
+       state->orig.in.foo3 = _foo3;
+
+       /* Out parameters */
+       state->orig.out.foo1 = _foo1;
+       state->orig.out.foo2 = _foo2;
+       state->orig.out.foo3 = _foo3;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_TestEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_TestEnum_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_rpcecho,
+                                   NDR_ECHO_TESTENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_TestEnum_done, req);
+       return req;
+}
+
+static void rpccli_echo_TestEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_TestEnum_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestEnum_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.foo1 = *state->tmp.out.foo1;
+       *state->orig.out.foo2 = *state->tmp.out.foo2;
+       *state->orig.out.foo3 = *state->tmp.out.foo3;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_TestEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_TestEnum_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_TestEnum_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestEnum_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              enum echo_Enum1 *foo1 /* [in,out] [ref] */,
@@ -331,6 +1232,116 @@ NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_TestSurrounding_state {
+       struct echo_TestSurrounding orig;
+       struct echo_TestSurrounding tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_TestSurrounding_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct echo_Surrounding *_data /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_TestSurrounding_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_TestSurrounding_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.data = _data;
+
+       /* Out parameters */
+       state->orig.out.data = _data;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_echo_TestSurrounding_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_rpcecho,
+                                   NDR_ECHO_TESTSURROUNDING,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_TestSurrounding_done, req);
+       return req;
+}
+
+static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestSurrounding_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.data = *state->tmp.out.data;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_TestSurrounding_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx)
+{
+       struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestSurrounding_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);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct echo_Surrounding *data /* [in,out] [ref] */)
@@ -370,6 +1381,118 @@ NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_echo_TestDoublePointer_state {
+       struct echo_TestDoublePointer orig;
+       struct echo_TestDoublePointer tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_echo_TestDoublePointer_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     uint16_t ***_data /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_echo_TestDoublePointer_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_echo_TestDoublePointer_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.data = _data;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_rpcecho,
+                                   NDR_ECHO_TESTDOUBLEPOINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_echo_TestDoublePointer_done, req);
+       return req;
+}
+
+static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestDoublePointer_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_echo_TestDoublePointer_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           uint16 *result)
+{
+       struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
+               req, struct rpccli_echo_TestDoublePointer_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_echo_TestDoublePointer(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       uint16_t ***data /* [in] [ref] */)
index 46dd830a4e48427aa90e982555cf9743b819ed41..e3a4a163081dd0c2f3950a0cdba6f29cc20074c9 100644 (file)
 #include "../librpc/gen_ndr/ndr_echo.h"
 #ifndef __CLI_RPCECHO__
 #define __CLI_RPCECHO__
+struct tevent_req *rpccli_echo_AddOne_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli,
+                                          uint32_t _in_data /* [in]  */,
+                                          uint32_t *_out_data /* [out] [ref] */);
+NTSTATUS rpccli_echo_AddOne_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            uint32_t in_data /* [in]  */,
                            uint32_t *out_data /* [out] [ref] */);
+struct tevent_req *rpccli_echo_EchoData_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            uint32_t _len /* [in]  */,
+                                            uint8_t *_in_data /* [in] [size_is(len)] */,
+                                            uint8_t *_out_data /* [out] [size_is(len)] */);
+NTSTATUS rpccli_echo_EchoData_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              uint32_t len /* [in]  */,
                              uint8_t *in_data /* [in] [size_is(len)] */,
                              uint8_t *out_data /* [out] [size_is(len)] */);
+struct tevent_req *rpccli_echo_SinkData_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            uint32_t _len /* [in]  */,
+                                            uint8_t *_data /* [in] [size_is(len)] */);
+NTSTATUS rpccli_echo_SinkData_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              uint32_t len /* [in]  */,
                              uint8_t *data /* [in] [size_is(len)] */);
+struct tevent_req *rpccli_echo_SourceData_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint32_t _len /* [in]  */,
+                                              uint8_t *_data /* [out] [size_is(len)] */);
+NTSTATUS rpccli_echo_SourceData_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint32_t len /* [in]  */,
                                uint8_t *data /* [out] [size_is(len)] */);
+struct tevent_req *rpccli_echo_TestCall_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_s1 /* [in] [ref,charset(UTF16)] */,
+                                            const char **_s2 /* [out] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_echo_TestCall_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *s1 /* [in] [ref,charset(UTF16)] */,
                              const char **s2 /* [out] [ref,charset(UTF16)] */);
+struct tevent_req *rpccli_echo_TestCall2_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t _level /* [in]  */,
+                                             union echo_Info *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_echo_TestCall2_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint16_t level /* [in]  */,
                               union echo_Info *info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_echo_TestSleep_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint32_t _seconds /* [in]  */);
+NTSTATUS rpccli_echo_TestSleep_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   uint32 *result);
 NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint32_t seconds /* [in]  */);
+struct tevent_req *rpccli_echo_TestEnum_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
+                                            struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
+                                            union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */);
+NTSTATUS rpccli_echo_TestEnum_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              enum echo_Enum1 *foo1 /* [in,out] [ref] */,
                              struct echo_Enum2 *foo2 /* [in,out] [ref] */,
                              union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */);
+struct tevent_req *rpccli_echo_TestSurrounding_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct echo_Surrounding *_data /* [in,out] [ref] */);
+NTSTATUS rpccli_echo_TestSurrounding_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx);
 NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct echo_Surrounding *data /* [in,out] [ref] */);
+struct tevent_req *rpccli_echo_TestDoublePointer_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     uint16_t ***_data /* [in] [ref] */);
+NTSTATUS rpccli_echo_TestDoublePointer_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           uint16 *result);
 NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       uint16_t ***data /* [in] [ref] */);
index 0ccefa97cb0d551510aa8b023ff552535f7765c6..a271516fb017bdcd0f76a969f8a19726d301af88 100644 (file)
@@ -6,6 +6,122 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_epmapper.h"
 
+struct rpccli_epm_Insert_state {
+       struct epm_Insert orig;
+       struct epm_Insert tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_Insert_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_Insert_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         uint32_t _num_ents /* [in]  */,
+                                         struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */,
+                                         uint32_t _replace /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_Insert_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_Insert_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.num_ents = _num_ents;
+       state->orig.in.entries = _entries;
+       state->orig.in.replace = _replace;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_Insert, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_epmapper,
+                                   NDR_EPM_INSERT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_Insert_done, req);
+       return req;
+}
+
+static void rpccli_epm_Insert_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_Insert_state *state = tevent_req_data(
+               req, struct rpccli_epm_Insert_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_Insert, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_Insert_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               uint32 *result)
+{
+       struct rpccli_epm_Insert_state *state = tevent_req_data(
+               req, struct rpccli_epm_Insert_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_epm_Insert(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           uint32_t num_ents /* [in]  */,
@@ -48,6 +164,120 @@ NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_Delete_state {
+       struct epm_Delete orig;
+       struct epm_Delete tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_Delete_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_Delete_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         uint32_t _num_ents /* [in]  */,
+                                         struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_Delete_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_Delete_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.num_ents = _num_ents;
+       state->orig.in.entries = _entries;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_Delete, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_epmapper,
+                                   NDR_EPM_DELETE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_Delete_done, req);
+       return req;
+}
+
+static void rpccli_epm_Delete_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_Delete_state *state = tevent_req_data(
+               req, struct rpccli_epm_Delete_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_Delete, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_Delete_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               uint32 *result)
+{
+       struct rpccli_epm_Delete_state *state = tevent_req_data(
+               req, struct rpccli_epm_Delete_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_epm_Delete(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           uint32_t num_ents /* [in]  */,
@@ -88,6 +318,142 @@ NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_Lookup_state {
+       struct epm_Lookup orig;
+       struct epm_Lookup tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_Lookup_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_Lookup_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         uint32_t _inquiry_type /* [in]  */,
+                                         struct GUID *_object /* [in] [ptr] */,
+                                         struct rpc_if_id_t *_interface_id /* [in] [ptr] */,
+                                         uint32_t _vers_option /* [in]  */,
+                                         struct policy_handle *_entry_handle /* [in,out] [ref] */,
+                                         uint32_t _max_ents /* [in]  */,
+                                         uint32_t *_num_ents /* [out] [ref] */,
+                                         struct epm_entry_t *_entries /* [out] [length_is(*num_ents),size_is(max_ents)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_Lookup_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_Lookup_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.inquiry_type = _inquiry_type;
+       state->orig.in.object = _object;
+       state->orig.in.interface_id = _interface_id;
+       state->orig.in.vers_option = _vers_option;
+       state->orig.in.entry_handle = _entry_handle;
+       state->orig.in.max_ents = _max_ents;
+
+       /* Out parameters */
+       state->orig.out.entry_handle = _entry_handle;
+       state->orig.out.num_ents = _num_ents;
+       state->orig.out.entries = _entries;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_Lookup, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_epm_Lookup_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_epmapper,
+                                   NDR_EPM_LOOKUP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_Lookup_done, req);
+       return req;
+}
+
+static void rpccli_epm_Lookup_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_Lookup_state *state = tevent_req_data(
+               req, struct rpccli_epm_Lookup_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.entry_handle = *state->tmp.out.entry_handle;
+       *state->orig.out.num_ents = *state->tmp.out.num_ents;
+       memcpy(state->orig.out.entries, state->tmp.out.entries, state->tmp.in.max_ents * sizeof(*state->orig.out.entries));
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_Lookup, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_Lookup_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               uint32 *result)
+{
+       struct rpccli_epm_Lookup_state *state = tevent_req_data(
+               req, struct rpccli_epm_Lookup_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_epm_Lookup(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           uint32_t inquiry_type /* [in]  */,
@@ -141,6 +507,138 @@ NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_Map_state {
+       struct epm_Map orig;
+       struct epm_Map tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_Map_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_Map_send(TALLOC_CTX *mem_ctx,
+                                      struct tevent_context *ev,
+                                      struct rpc_pipe_client *cli,
+                                      struct GUID *_object /* [in] [ptr] */,
+                                      struct epm_twr_t *_map_tower /* [in] [ptr] */,
+                                      struct policy_handle *_entry_handle /* [in,out] [ref] */,
+                                      uint32_t _max_towers /* [in]  */,
+                                      uint32_t *_num_towers /* [out] [ref] */,
+                                      struct epm_twr_p_t *_towers /* [out] [length_is(*num_towers),size_is(max_towers)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_Map_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_Map_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.object = _object;
+       state->orig.in.map_tower = _map_tower;
+       state->orig.in.entry_handle = _entry_handle;
+       state->orig.in.max_towers = _max_towers;
+
+       /* Out parameters */
+       state->orig.out.entry_handle = _entry_handle;
+       state->orig.out.num_towers = _num_towers;
+       state->orig.out.towers = _towers;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_Map, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_epm_Map_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_epmapper,
+                                   NDR_EPM_MAP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_Map_done, req);
+       return req;
+}
+
+static void rpccli_epm_Map_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_Map_state *state = tevent_req_data(
+               req, struct rpccli_epm_Map_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.entry_handle = *state->tmp.out.entry_handle;
+       *state->orig.out.num_towers = *state->tmp.out.num_towers;
+       memcpy(state->orig.out.towers, state->tmp.out.towers, state->tmp.in.max_towers * sizeof(*state->orig.out.towers));
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_Map, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_Map_recv(struct tevent_req *req,
+                            TALLOC_CTX *mem_ctx,
+                            uint32 *result)
+{
+       struct rpccli_epm_Map_state *state = tevent_req_data(
+               req, struct rpccli_epm_Map_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_epm_Map(struct rpc_pipe_client *cli,
                        TALLOC_CTX *mem_ctx,
                        struct GUID *object /* [in] [ptr] */,
@@ -190,6 +688,126 @@ NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_LookupHandleFree_state {
+       struct epm_LookupHandleFree orig;
+       struct epm_LookupHandleFree tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_LookupHandleFree_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_LookupHandleFree_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_entry_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_LookupHandleFree_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_LookupHandleFree_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.entry_handle = _entry_handle;
+
+       /* Out parameters */
+       state->orig.out.entry_handle = _entry_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_epm_LookupHandleFree_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_epmapper,
+                                   NDR_EPM_LOOKUPHANDLEFREE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_LookupHandleFree_done, req);
+       return req;
+}
+
+static void rpccli_epm_LookupHandleFree_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_LookupHandleFree_state *state = tevent_req_data(
+               req, struct rpccli_epm_LookupHandleFree_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.entry_handle = *state->tmp.out.entry_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_LookupHandleFree_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         uint32 *result)
+{
+       struct rpccli_epm_LookupHandleFree_state *state = tevent_req_data(
+               req, struct rpccli_epm_LookupHandleFree_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_epm_LookupHandleFree(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *entry_handle /* [in,out] [ref] */)
@@ -229,6 +847,118 @@ NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_InqObject_state {
+       struct epm_InqObject orig;
+       struct epm_InqObject tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_InqObject_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_InqObject_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct GUID *_epm_object /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_InqObject_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_InqObject_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.epm_object = _epm_object;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_InqObject, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_epmapper,
+                                   NDR_EPM_INQOBJECT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_InqObject_done, req);
+       return req;
+}
+
+static void rpccli_epm_InqObject_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_InqObject_state *state = tevent_req_data(
+               req, struct rpccli_epm_InqObject_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_InqObject, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_InqObject_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  uint32 *result)
+{
+       struct rpccli_epm_InqObject_state *state = tevent_req_data(
+               req, struct rpccli_epm_InqObject_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_epm_InqObject(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct GUID *epm_object /* [in] [ref] */)
@@ -267,6 +997,122 @@ NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_MgmtDelete_state {
+       struct epm_MgmtDelete orig;
+       struct epm_MgmtDelete tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_MgmtDelete_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_MgmtDelete_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint32_t _object_speced /* [in]  */,
+                                             struct GUID *_object /* [in] [ptr] */,
+                                             struct epm_twr_t *_tower /* [in] [ptr] */)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_MgmtDelete_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_MgmtDelete_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.object_speced = _object_speced;
+       state->orig.in.object = _object;
+       state->orig.in.tower = _tower;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_MgmtDelete, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_epmapper,
+                                   NDR_EPM_MGMTDELETE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_MgmtDelete_done, req);
+       return req;
+}
+
+static void rpccli_epm_MgmtDelete_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_MgmtDelete_state *state = tevent_req_data(
+               req, struct rpccli_epm_MgmtDelete_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_MgmtDelete_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   uint32 *result)
+{
+       struct rpccli_epm_MgmtDelete_state *state = tevent_req_data(
+               req, struct rpccli_epm_MgmtDelete_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_epm_MgmtDelete(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint32_t object_speced /* [in]  */,
@@ -309,6 +1155,116 @@ NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+struct rpccli_epm_MapAuth_state {
+       struct epm_MapAuth orig;
+       struct epm_MapAuth tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_epm_MapAuth_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_epm_MapAuth_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_epm_MapAuth_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_epm_MapAuth_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(epm_MapAuth, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_epmapper,
+                                   NDR_EPM_MAPAUTH,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_epm_MapAuth_done, req);
+       return req;
+}
+
+static void rpccli_epm_MapAuth_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_epm_MapAuth_state *state = tevent_req_data(
+               req, struct rpccli_epm_MapAuth_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(epm_MapAuth, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_epm_MapAuth_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                uint32 *result)
+{
+       struct rpccli_epm_MapAuth_state *state = tevent_req_data(
+               req, struct rpccli_epm_MapAuth_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_epm_MapAuth(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx)
 {
index cc1d3a9267badbfc5ac21e730c83146e24b3d05a..285a9d9833e3429eab5e3709a03efe5f3adb2326 100644 (file)
@@ -1,15 +1,46 @@
 #include "../librpc/gen_ndr/ndr_epmapper.h"
 #ifndef __CLI_EPMAPPER__
 #define __CLI_EPMAPPER__
+struct tevent_req *rpccli_epm_Insert_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         uint32_t _num_ents /* [in]  */,
+                                         struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */,
+                                         uint32_t _replace /* [in]  */);
+NTSTATUS rpccli_epm_Insert_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               uint32 *result);
 NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           uint32_t num_ents /* [in]  */,
                           struct epm_entry_t *entries /* [in] [size_is(num_ents)] */,
                           uint32_t replace /* [in]  */);
+struct tevent_req *rpccli_epm_Delete_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         uint32_t _num_ents /* [in]  */,
+                                         struct epm_entry_t *_entries /* [in] [size_is(num_ents)] */);
+NTSTATUS rpccli_epm_Delete_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               uint32 *result);
 NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           uint32_t num_ents /* [in]  */,
                           struct epm_entry_t *entries /* [in] [size_is(num_ents)] */);
+struct tevent_req *rpccli_epm_Lookup_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         uint32_t _inquiry_type /* [in]  */,
+                                         struct GUID *_object /* [in] [ptr] */,
+                                         struct rpc_if_id_t *_interface_id /* [in] [ptr] */,
+                                         uint32_t _vers_option /* [in]  */,
+                                         struct policy_handle *_entry_handle /* [in,out] [ref] */,
+                                         uint32_t _max_ents /* [in]  */,
+                                         uint32_t *_num_ents /* [out] [ref] */,
+                                         struct epm_entry_t *_entries /* [out] [length_is(*num_ents),size_is(max_ents)] */);
+NTSTATUS rpccli_epm_Lookup_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               uint32 *result);
 NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           uint32_t inquiry_type /* [in]  */,
@@ -20,6 +51,18 @@ NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli,
                           uint32_t max_ents /* [in]  */,
                           uint32_t *num_ents /* [out] [ref] */,
                           struct epm_entry_t *entries /* [out] [length_is(*num_ents),size_is(max_ents)] */);
+struct tevent_req *rpccli_epm_Map_send(TALLOC_CTX *mem_ctx,
+                                      struct tevent_context *ev,
+                                      struct rpc_pipe_client *cli,
+                                      struct GUID *_object /* [in] [ptr] */,
+                                      struct epm_twr_t *_map_tower /* [in] [ptr] */,
+                                      struct policy_handle *_entry_handle /* [in,out] [ref] */,
+                                      uint32_t _max_towers /* [in]  */,
+                                      uint32_t *_num_towers /* [out] [ref] */,
+                                      struct epm_twr_p_t *_towers /* [out] [length_is(*num_towers),size_is(max_towers)] */);
+NTSTATUS rpccli_epm_Map_recv(struct tevent_req *req,
+                            TALLOC_CTX *mem_ctx,
+                            uint32 *result);
 NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli,
                        TALLOC_CTX *mem_ctx,
                        struct GUID *object /* [in] [ptr] */,
@@ -28,17 +71,46 @@ NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli,
                        uint32_t max_towers /* [in]  */,
                        uint32_t *num_towers /* [out] [ref] */,
                        struct epm_twr_p_t *towers /* [out] [length_is(*num_towers),size_is(max_towers)] */);
+struct tevent_req *rpccli_epm_LookupHandleFree_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_entry_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_epm_LookupHandleFree_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         uint32 *result);
 NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *entry_handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_epm_InqObject_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct GUID *_epm_object /* [in] [ref] */);
+NTSTATUS rpccli_epm_InqObject_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  uint32 *result);
 NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct GUID *epm_object /* [in] [ref] */);
+struct tevent_req *rpccli_epm_MgmtDelete_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint32_t _object_speced /* [in]  */,
+                                             struct GUID *_object /* [in] [ptr] */,
+                                             struct epm_twr_t *_tower /* [in] [ptr] */);
+NTSTATUS rpccli_epm_MgmtDelete_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   uint32 *result);
 NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint32_t object_speced /* [in]  */,
                               struct GUID *object /* [in] [ptr] */,
                               struct epm_twr_t *tower /* [in] [ptr] */);
+struct tevent_req *rpccli_epm_MapAuth_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_epm_MapAuth_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                uint32 *result);
 NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx);
 #endif /* __CLI_EPMAPPER__ */
index b9cf39dea0a2d4610d44e532a1c377e2b143036c..a53ca13eb41779745256d2ba1f4469e695c99d81 100644 (file)
@@ -6,6 +6,120 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_eventlog.h"
 
+struct rpccli_eventlog_ClearEventLogW_state {
+       struct eventlog_ClearEventLogW orig;
+       struct eventlog_ClearEventLogW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ClearEventLogW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ClearEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct lsa_String *_backupfile /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_ClearEventLogW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ClearEventLogW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.backupfile = _backupfile;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_CLEAREVENTLOGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ClearEventLogW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ClearEventLogW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ClearEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ClearEventLogW_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ClearEventLogW_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_eventlog_ClearEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ClearEventLogW_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_eventlog_ClearEventLogW(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
@@ -46,6 +160,120 @@ NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_eventlog_BackupEventLogW_state {
+       struct eventlog_BackupEventLogW orig;
+       struct eventlog_BackupEventLogW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_BackupEventLogW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_BackupEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       struct lsa_String *_backup_filename /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_BackupEventLogW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_BackupEventLogW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.backup_filename = _backup_filename;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_BACKUPEVENTLOGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_BackupEventLogW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_BackupEventLogW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_BackupEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_BackupEventLogW_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_BackupEventLogW_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_eventlog_BackupEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_BackupEventLogW_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_eventlog_BackupEventLogW(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -86,6 +314,126 @@ NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_eventlog_CloseEventLog_state {
+       struct eventlog_CloseEventLog orig;
+       struct eventlog_CloseEventLog tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_CloseEventLog_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_CloseEventLog_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_CloseEventLog_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_CloseEventLog_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_CloseEventLog_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_eventlog,
+                                   NDR_EVENTLOG_CLOSEEVENTLOG,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_CloseEventLog_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_CloseEventLog_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_CloseEventLog_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_CloseEventLog_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_CloseEventLog_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_CloseEventLog_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_CloseEventLog_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_eventlog_CloseEventLog(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in,out] [ref] */)
@@ -125,64 +473,144 @@ NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              struct policy_handle *handle /* [in,out] [ref] */)
+struct rpccli_eventlog_DeregisterEventSource_state {
+       struct eventlog_DeregisterEventSource orig;
+       struct eventlog_DeregisterEventSource tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_DeregisterEventSource_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_DeregisterEventSource_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in,out] [ref] */)
 {
-       struct eventlog_DeregisterEventSource r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_DeregisterEventSource_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_DeregisterEventSource_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_DEREGISTEREVENTSOURCE,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_DeregisterEventSource_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_eventlog,
+                                   NDR_EVENTLOG_DEREGISTEREVENTSOURCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_DeregisterEventSource_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_DeregisterEventSource_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_DeregisterEventSource_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_DeregisterEventSource_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_DeregisterEventSource_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_eventlog_DeregisterEventSource_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_DeregisterEventSource_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *handle = *r.out.handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *handle /* [in] [ref] */,
-                                      uint32_t *number /* [out] [ref] */)
+NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *handle /* [in,out] [ref] */)
 {
-       struct eventlog_GetNumRecords r;
+       struct eventlog_DeregisterEventSource r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_GETNUMRECORDS,
+                               NDR_EVENTLOG_DEREGISTEREVENTSOURCE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -190,7 +618,7 @@ NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -198,68 +626,152 @@ NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *number = *r.out.number;
+       *handle = *r.out.handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        uint32_t *oldest_entry /* [out] [ref] */)
+struct rpccli_eventlog_GetNumRecords_state {
+       struct eventlog_GetNumRecords orig;
+       struct eventlog_GetNumRecords tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_GetNumRecords_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_GetNumRecords_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     uint32_t *_number /* [out] [ref] */)
 {
-       struct eventlog_GetOldestRecord r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_GetNumRecords_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_GetNumRecords_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.number = _number;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_GETOLDESTRECORD,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_GetNumRecords_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_eventlog,
+                                   NDR_EVENTLOG_GETNUMRECORDS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_GetNumRecords_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_GetNumRecords_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_GetNumRecords_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_GetNumRecords_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.number = *state->tmp.out.number;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_GetNumRecords_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_GetNumRecords_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_GetNumRecords_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *oldest_entry = *r.out.oldest_entry;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      uint32_t *number /* [out] [ref] */)
 {
-       struct eventlog_ChangeNotify r;
+       struct eventlog_GetNumRecords r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_CHANGENOTIFY,
+                               NDR_EVENTLOG_GETNUMRECORDS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -267,7 +779,7 @@ NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -275,13 +787,450 @@ NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *number = *r.out.number;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
+struct rpccli_eventlog_GetOldestRecord_state {
+       struct eventlog_GetOldestRecord orig;
+       struct eventlog_GetOldestRecord tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_GetOldestRecord_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_GetOldestRecord_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t *_oldest_entry /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_GetOldestRecord_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_GetOldestRecord_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.oldest_entry = _oldest_entry;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_GetOldestRecord_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_eventlog,
+                                   NDR_EVENTLOG_GETOLDESTRECORD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_GetOldestRecord_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_GetOldestRecord_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_GetOldestRecord_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_GetOldestRecord_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.oldest_entry = *state->tmp.out.oldest_entry;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_GetOldestRecord_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_eventlog_GetOldestRecord_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_GetOldestRecord_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_eventlog_GetOldestRecord(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        uint32_t *oldest_entry /* [out] [ref] */)
+{
+       struct eventlog_GetOldestRecord r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_GETOLDESTRECORD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *oldest_entry = *r.out.oldest_entry;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_ChangeNotify_state {
+       struct eventlog_ChangeNotify orig;
+       struct eventlog_ChangeNotify tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ChangeNotify_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ChangeNotify_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_ChangeNotify_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ChangeNotify_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_CHANGENOTIFY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ChangeNotify_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ChangeNotify_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ChangeNotify_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ChangeNotify_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ChangeNotify_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_eventlog_ChangeNotify_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ChangeNotify_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_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx)
+{
+       struct eventlog_ChangeNotify r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_CHANGENOTIFY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_OpenEventLogW_state {
+       struct eventlog_OpenEventLogW orig;
+       struct eventlog_OpenEventLogW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_OpenEventLogW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_OpenEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
+                                                     struct lsa_String *_logname /* [in] [ref] */,
+                                                     struct lsa_String *_servername /* [in] [ref] */,
+                                                     uint32_t _major_version /* [in]  */,
+                                                     uint32_t _minor_version /* [in]  */,
+                                                     struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_OpenEventLogW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_OpenEventLogW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.unknown0 = _unknown0;
+       state->orig.in.logname = _logname;
+       state->orig.in.servername = _servername;
+       state->orig.in.major_version = _major_version;
+       state->orig.in.minor_version = _minor_version;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_OpenEventLogW_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_eventlog,
+                                   NDR_EVENTLOG_OPENEVENTLOGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_OpenEventLogW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_OpenEventLogW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_OpenEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenEventLogW_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_OpenEventLogW_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_OpenEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenEventLogW_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_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
                                       struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
                                       struct lsa_String *logname /* [in] [ref] */,
                                       struct lsa_String *servername /* [in] [ref] */,
@@ -314,7 +1263,1347 @@ NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_RegisterEventSourceW_state {
+       struct eventlog_RegisterEventSourceW orig;
+       struct eventlog_RegisterEventSourceW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_RegisterEventSourceW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
+                                                            struct lsa_String *_module_name /* [in] [ref] */,
+                                                            struct lsa_String *_reg_module_name /* [in] [ref] */,
+                                                            uint32_t _major_version /* [in]  */,
+                                                            uint32_t _minor_version /* [in]  */,
+                                                            struct policy_handle *_log_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_RegisterEventSourceW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_RegisterEventSourceW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.unknown0 = _unknown0;
+       state->orig.in.module_name = _module_name;
+       state->orig.in.reg_module_name = _reg_module_name;
+       state->orig.in.major_version = _major_version;
+       state->orig.in.minor_version = _minor_version;
+
+       /* Out parameters */
+       state->orig.out.log_handle = _log_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_RegisterEventSourceW_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_eventlog,
+                                   NDR_EVENTLOG_REGISTEREVENTSOURCEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_RegisterEventSourceW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_RegisterEventSourceW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_RegisterEventSourceW_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.log_handle = *state->tmp.out.log_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_RegisterEventSourceW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result)
+{
+       struct rpccli_eventlog_RegisterEventSourceW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_RegisterEventSourceW_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_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
+                                             struct lsa_String *module_name /* [in] [ref] */,
+                                             struct lsa_String *reg_module_name /* [in] [ref] */,
+                                             uint32_t major_version /* [in]  */,
+                                             uint32_t minor_version /* [in]  */,
+                                             struct policy_handle *log_handle /* [out] [ref] */)
+{
+       struct eventlog_RegisterEventSourceW r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.unknown0 = unknown0;
+       r.in.module_name = module_name;
+       r.in.reg_module_name = reg_module_name;
+       r.in.major_version = major_version;
+       r.in.minor_version = minor_version;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_REGISTEREVENTSOURCEW,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *log_handle = *r.out.log_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_OpenBackupEventLogW_state {
+       struct eventlog_OpenBackupEventLogW orig;
+       struct eventlog_OpenBackupEventLogW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_OpenBackupEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
+                                                           struct lsa_String *_backup_logname /* [in] [ref] */,
+                                                           uint32_t _major_version /* [in]  */,
+                                                           uint32_t _minor_version /* [in]  */,
+                                                           struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_OpenBackupEventLogW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_OpenBackupEventLogW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.unknown0 = _unknown0;
+       state->orig.in.backup_logname = _backup_logname;
+       state->orig.in.major_version = _major_version;
+       state->orig.in.minor_version = _minor_version;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_OpenBackupEventLogW_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_eventlog,
+                                   NDR_EVENTLOG_OPENBACKUPEVENTLOGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_OpenBackupEventLogW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_OpenBackupEventLogW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenBackupEventLogW_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_OpenBackupEventLogW_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result)
+{
+       struct rpccli_eventlog_OpenBackupEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenBackupEventLogW_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_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
+                                            struct lsa_String *backup_logname /* [in] [ref] */,
+                                            uint32_t major_version /* [in]  */,
+                                            uint32_t minor_version /* [in]  */,
+                                            struct policy_handle *handle /* [out] [ref] */)
+{
+       struct eventlog_OpenBackupEventLogW r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.unknown0 = unknown0;
+       r.in.backup_logname = backup_logname;
+       r.in.major_version = major_version;
+       r.in.minor_version = minor_version;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_OPENBACKUPEVENTLOGW,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_ReadEventLogW_state {
+       struct eventlog_ReadEventLogW orig;
+       struct eventlog_ReadEventLogW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ReadEventLogW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ReadEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     uint32_t _flags /* [in]  */,
+                                                     uint32_t _offset /* [in]  */,
+                                                     uint32_t _number_of_bytes /* [in] [range(0,0x7FFFF)] */,
+                                                     uint8_t *_data /* [out] [ref,size_is(number_of_bytes)] */,
+                                                     uint32_t *_sent_size /* [out] [ref] */,
+                                                     uint32_t *_real_size /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_ReadEventLogW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ReadEventLogW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.flags = _flags;
+       state->orig.in.offset = _offset;
+       state->orig.in.number_of_bytes = _number_of_bytes;
+
+       /* Out parameters */
+       state->orig.out.data = _data;
+       state->orig.out.sent_size = _sent_size;
+       state->orig.out.real_size = _real_size;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_ReadEventLogW_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_eventlog,
+                                   NDR_EVENTLOG_READEVENTLOGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ReadEventLogW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ReadEventLogW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ReadEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReadEventLogW_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 */
+       memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.number_of_bytes * sizeof(*state->orig.out.data));
+       *state->orig.out.sent_size = *state->tmp.out.sent_size;
+       *state->orig.out.real_size = *state->tmp.out.real_size;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ReadEventLogW_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_ReadEventLogW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReadEventLogW_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_eventlog_ReadEventLogW(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      uint32_t flags /* [in]  */,
+                                      uint32_t offset /* [in]  */,
+                                      uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */,
+                                      uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */,
+                                      uint32_t *sent_size /* [out] [ref] */,
+                                      uint32_t *real_size /* [out] [ref] */)
+{
+       struct eventlog_ReadEventLogW r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.flags = flags;
+       r.in.offset = offset;
+       r.in.number_of_bytes = number_of_bytes;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_READEVENTLOGW,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       memcpy(data, r.out.data, r.in.number_of_bytes * sizeof(*data));
+       *sent_size = *r.out.sent_size;
+       *real_size = *r.out.real_size;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_ReportEventW_state {
+       struct eventlog_ReportEventW orig;
+       struct eventlog_ReportEventW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ReportEventW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ReportEventW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    time_t _timestamp /* [in]  */,
+                                                    enum eventlogEventTypes _event_type /* [in]  */,
+                                                    uint16_t _event_category /* [in]  */,
+                                                    uint32_t _event_id /* [in]  */,
+                                                    uint16_t _num_of_strings /* [in] [range(0,256)] */,
+                                                    uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
+                                                    struct lsa_String *_servername /* [in] [ref] */,
+                                                    struct dom_sid *_user_sid /* [in] [unique] */,
+                                                    struct lsa_String **_strings /* [in] [unique,size_is(num_of_strings)] */,
+                                                    uint8_t *_data /* [in] [unique,size_is(data_size)] */,
+                                                    uint16_t _flags /* [in]  */,
+                                                    uint32_t *_record_number /* [in,out] [unique] */,
+                                                    time_t *_time_written /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_ReportEventW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ReportEventW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.timestamp = _timestamp;
+       state->orig.in.event_type = _event_type;
+       state->orig.in.event_category = _event_category;
+       state->orig.in.event_id = _event_id;
+       state->orig.in.num_of_strings = _num_of_strings;
+       state->orig.in.data_size = _data_size;
+       state->orig.in.servername = _servername;
+       state->orig.in.user_sid = _user_sid;
+       state->orig.in.strings = _strings;
+       state->orig.in.data = _data;
+       state->orig.in.flags = _flags;
+       state->orig.in.record_number = _record_number;
+       state->orig.in.time_written = _time_written;
+
+       /* Out parameters */
+       state->orig.out.record_number = _record_number;
+       state->orig.out.time_written = _time_written;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_ReportEventW_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_eventlog,
+                                   NDR_EVENTLOG_REPORTEVENTW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ReportEventW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ReportEventW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReportEventW_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 */
+       if (state->orig.out.record_number && state->tmp.out.record_number) {
+               *state->orig.out.record_number = *state->tmp.out.record_number;
+       }
+       if (state->orig.out.time_written && state->tmp.out.time_written) {
+               *state->orig.out.time_written = *state->tmp.out.time_written;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ReportEventW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_eventlog_ReportEventW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReportEventW_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_eventlog_ReportEventW(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *handle /* [in] [ref] */,
+                                     time_t timestamp /* [in]  */,
+                                     enum eventlogEventTypes event_type /* [in]  */,
+                                     uint16_t event_category /* [in]  */,
+                                     uint32_t event_id /* [in]  */,
+                                     uint16_t num_of_strings /* [in] [range(0,256)] */,
+                                     uint32_t data_size /* [in] [range(0,0x3FFFF)] */,
+                                     struct lsa_String *servername /* [in] [ref] */,
+                                     struct dom_sid *user_sid /* [in] [unique] */,
+                                     struct lsa_String **strings /* [in] [unique,size_is(num_of_strings)] */,
+                                     uint8_t *data /* [in] [unique,size_is(data_size)] */,
+                                     uint16_t flags /* [in]  */,
+                                     uint32_t *record_number /* [in,out] [unique] */,
+                                     time_t *time_written /* [in,out] [unique] */)
+{
+       struct eventlog_ReportEventW r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.timestamp = timestamp;
+       r.in.event_type = event_type;
+       r.in.event_category = event_category;
+       r.in.event_id = event_id;
+       r.in.num_of_strings = num_of_strings;
+       r.in.data_size = data_size;
+       r.in.servername = servername;
+       r.in.user_sid = user_sid;
+       r.in.strings = strings;
+       r.in.data = data;
+       r.in.flags = flags;
+       r.in.record_number = record_number;
+       r.in.time_written = time_written;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_REPORTEVENTW,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (record_number && r.out.record_number) {
+               *record_number = *r.out.record_number;
+       }
+       if (time_written && r.out.time_written) {
+               *time_written = *r.out.time_written;
+       }
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_ClearEventLogA_state {
+       struct eventlog_ClearEventLogA orig;
+       struct eventlog_ClearEventLogA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ClearEventLogA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ClearEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_ClearEventLogA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ClearEventLogA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_CLEAREVENTLOGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ClearEventLogA_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ClearEventLogA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ClearEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ClearEventLogA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ClearEventLogA_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_eventlog_ClearEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ClearEventLogA_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_eventlog_ClearEventLogA(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx)
+{
+       struct eventlog_ClearEventLogA r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_CLEAREVENTLOGA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_BackupEventLogA_state {
+       struct eventlog_BackupEventLogA orig;
+       struct eventlog_BackupEventLogA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_BackupEventLogA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_BackupEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_BackupEventLogA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_BackupEventLogA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_BACKUPEVENTLOGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_BackupEventLogA_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_BackupEventLogA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_BackupEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_BackupEventLogA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_BackupEventLogA_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_eventlog_BackupEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_BackupEventLogA_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_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx)
+{
+       struct eventlog_BackupEventLogA r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_BACKUPEVENTLOGA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_OpenEventLogA_state {
+       struct eventlog_OpenEventLogA orig;
+       struct eventlog_OpenEventLogA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_OpenEventLogA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_OpenEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_OpenEventLogA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_OpenEventLogA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_OPENEVENTLOGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_OpenEventLogA_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_OpenEventLogA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_OpenEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenEventLogA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_OpenEventLogA_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_OpenEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenEventLogA_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_eventlog_OpenEventLogA(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx)
+{
+       struct eventlog_OpenEventLogA r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_OPENEVENTLOGA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_eventlog_RegisterEventSourceA_state {
+       struct eventlog_RegisterEventSourceA orig;
+       struct eventlog_RegisterEventSourceA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_RegisterEventSourceA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_RegisterEventSourceA_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_RegisterEventSourceA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_RegisterEventSourceA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_REGISTEREVENTSOURCEA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_RegisterEventSourceA_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_RegisterEventSourceA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_RegisterEventSourceA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_RegisterEventSourceA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_RegisterEventSourceA_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result)
+{
+       struct rpccli_eventlog_RegisterEventSourceA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_RegisterEventSourceA_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_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx)
+{
+       struct eventlog_RegisterEventSourceA r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_eventlog,
+                               NDR_EVENTLOG_REGISTEREVENTSOURCEA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -322,85 +2611,137 @@ NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
-                                             struct lsa_String *module_name /* [in] [ref] */,
-                                             struct lsa_String *reg_module_name /* [in] [ref] */,
-                                             uint32_t major_version /* [in]  */,
-                                             uint32_t minor_version /* [in]  */,
-                                             struct policy_handle *log_handle /* [out] [ref] */)
+struct rpccli_eventlog_OpenBackupEventLogA_state {
+       struct eventlog_OpenBackupEventLogA orig;
+       struct eventlog_OpenBackupEventLogA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_OpenBackupEventLogA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_OpenBackupEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
 {
-       struct eventlog_RegisterEventSourceW r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_OpenBackupEventLogA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_OpenBackupEventLogA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.unknown0 = unknown0;
-       r.in.module_name = module_name;
-       r.in.reg_module_name = reg_module_name;
-       r.in.major_version = major_version;
-       r.in.minor_version = minor_version;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_REGISTEREVENTSOURCEW,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_OPENBACKUPEVENTLOGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_OpenBackupEventLogA_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_OpenBackupEventLogA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_OpenBackupEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenBackupEventLogA_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_OpenBackupEventLogA_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result)
+{
+       struct rpccli_eventlog_OpenBackupEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_OpenBackupEventLogA_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *log_handle = *r.out.log_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
-                                            struct lsa_String *backup_logname /* [in] [ref] */,
-                                            uint32_t major_version /* [in]  */,
-                                            uint32_t minor_version /* [in]  */,
-                                            struct policy_handle *handle /* [out] [ref] */)
+NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx)
 {
-       struct eventlog_OpenBackupEventLogW r;
+       struct eventlog_OpenBackupEventLogA r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.unknown0 = unknown0;
-       r.in.backup_logname = backup_logname;
-       r.in.major_version = major_version;
-       r.in.minor_version = minor_version;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_OPENBACKUPEVENTLOGW,
+                               NDR_EVENTLOG_OPENBACKUPEVENTLOGA,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -408,7 +2749,7 @@ NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -416,106 +2757,137 @@ NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *handle /* [in] [ref] */,
-                                      uint32_t flags /* [in]  */,
-                                      uint32_t offset /* [in]  */,
-                                      uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */,
-                                      uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */,
-                                      uint32_t *sent_size /* [out] [ref] */,
-                                      uint32_t *real_size /* [out] [ref] */)
+struct rpccli_eventlog_ReadEventLogA_state {
+       struct eventlog_ReadEventLogA orig;
+       struct eventlog_ReadEventLogA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ReadEventLogA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ReadEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
 {
-       struct eventlog_ReadEventLogW r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_ReadEventLogA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ReadEventLogA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.flags = flags;
-       r.in.offset = offset;
-       r.in.number_of_bytes = number_of_bytes;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_READEVENTLOGW,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_READEVENTLOGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ReadEventLogA_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ReadEventLogA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ReadEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReadEventLogA_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ReadEventLogA_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_ReadEventLogA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReadEventLogA_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       memcpy(data, r.out.data, r.in.number_of_bytes * sizeof(*data));
-       *sent_size = *r.out.sent_size;
-       *real_size = *r.out.real_size;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *handle /* [in] [ref] */,
-                                     time_t timestamp /* [in]  */,
-                                     enum eventlogEventTypes event_type /* [in]  */,
-                                     uint16_t event_category /* [in]  */,
-                                     uint32_t event_id /* [in]  */,
-                                     uint16_t num_of_strings /* [in] [range(0,256)] */,
-                                     uint32_t data_size /* [in] [range(0,0x3FFFF)] */,
-                                     struct lsa_String *servername /* [in] [ref] */,
-                                     struct dom_sid *user_sid /* [in] [unique] */,
-                                     struct lsa_String **strings /* [in] [unique,size_is(num_of_strings)] */,
-                                     uint8_t *data /* [in] [unique,size_is(data_size)] */,
-                                     uint16_t flags /* [in]  */,
-                                     uint32_t *record_number /* [in,out] [unique] */,
-                                     time_t *time_written /* [in,out] [unique] */)
+NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx)
 {
-       struct eventlog_ReportEventW r;
+       struct eventlog_ReadEventLogA r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.timestamp = timestamp;
-       r.in.event_type = event_type;
-       r.in.event_category = event_category;
-       r.in.event_id = event_id;
-       r.in.num_of_strings = num_of_strings;
-       r.in.data_size = data_size;
-       r.in.servername = servername;
-       r.in.user_sid = user_sid;
-       r.in.strings = strings;
-       r.in.data = data;
-       r.in.flags = flags;
-       r.in.record_number = record_number;
-       r.in.time_written = time_written;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_REPORTEVENTW,
+                               NDR_EVENTLOG_READEVENTLOGA,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -523,7 +2895,7 @@ NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -531,69 +2903,137 @@ NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       if (record_number && r.out.record_number) {
-               *record_number = *r.out.record_number;
-       }
-       if (time_written && r.out.time_written) {
-               *time_written = *r.out.time_written;
-       }
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx)
+struct rpccli_eventlog_ReportEventA_state {
+       struct eventlog_ReportEventA orig;
+       struct eventlog_ReportEventA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ReportEventA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ReportEventA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
 {
-       struct eventlog_ClearEventLogA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_ReportEventA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ReportEventA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_CLEAREVENTLOGA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_REPORTEVENTA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventA_done, req);
+       return req;
+}
 
+static void rpccli_eventlog_ReportEventA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ReportEventA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReportEventA_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ReportEventA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_eventlog_ReportEventA_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReportEventA_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx)
 {
-       struct eventlog_BackupEventLogA r;
+       struct eventlog_ReportEventA r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_BACKUPEVENTLOGA,
+                               NDR_EVENTLOG_REPORTEVENTA,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -601,7 +3041,7 @@ NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -614,58 +3054,132 @@ NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx)
+struct rpccli_eventlog_RegisterClusterSvc_state {
+       struct eventlog_RegisterClusterSvc orig;
+       struct eventlog_RegisterClusterSvc tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_RegisterClusterSvc_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_RegisterClusterSvc_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
 {
-       struct eventlog_OpenEventLogA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_RegisterClusterSvc_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_RegisterClusterSvc_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_OPENEVENTLOGA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_REGISTERCLUSTERSVC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_RegisterClusterSvc_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_RegisterClusterSvc_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_RegisterClusterSvc_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_RegisterClusterSvc_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_RegisterClusterSvc_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result)
+{
+       struct rpccli_eventlog_RegisterClusterSvc_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_RegisterClusterSvc_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx)
 {
-       struct eventlog_RegisterEventSourceA r;
+       struct eventlog_RegisterClusterSvc r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_REGISTEREVENTSOURCEA,
+                               NDR_EVENTLOG_REGISTERCLUSTERSVC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -673,7 +3187,7 @@ NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -686,58 +3200,132 @@ NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx)
+struct rpccli_eventlog_DeregisterClusterSvc_state {
+       struct eventlog_DeregisterClusterSvc orig;
+       struct eventlog_DeregisterClusterSvc tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_DeregisterClusterSvc_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_DeregisterClusterSvc_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
 {
-       struct eventlog_OpenBackupEventLogA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_DeregisterClusterSvc_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_DeregisterClusterSvc_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_OPENBACKUPEVENTLOGA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_DEREGISTERCLUSTERSVC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_DeregisterClusterSvc_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_DeregisterClusterSvc_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_DeregisterClusterSvc_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_DeregisterClusterSvc_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_DeregisterClusterSvc_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result)
+{
+       struct rpccli_eventlog_DeregisterClusterSvc_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_DeregisterClusterSvc_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx)
 {
-       struct eventlog_ReadEventLogA r;
+       struct eventlog_DeregisterClusterSvc r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_READEVENTLOGA,
+                               NDR_EVENTLOG_DEREGISTERCLUSTERSVC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -745,7 +3333,7 @@ NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -758,58 +3346,132 @@ NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx)
+struct rpccli_eventlog_WriteClusterEvents_state {
+       struct eventlog_WriteClusterEvents orig;
+       struct eventlog_WriteClusterEvents tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_WriteClusterEvents_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_WriteClusterEvents_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
 {
-       struct eventlog_ReportEventA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_WriteClusterEvents_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_WriteClusterEvents_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_REPORTEVENTA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_WRITECLUSTEREVENTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_WriteClusterEvents_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_WriteClusterEvents_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_WriteClusterEvents_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_WriteClusterEvents_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_WriteClusterEvents_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result)
+{
+       struct rpccli_eventlog_WriteClusterEvents_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_WriteClusterEvents_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx)
 {
-       struct eventlog_RegisterClusterSvc r;
+       struct eventlog_WriteClusterEvents r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_eventlog,
-                               NDR_EVENTLOG_REGISTERCLUSTERSVC,
+                               NDR_EVENTLOG_WRITECLUSTEREVENTS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -817,7 +3479,7 @@ NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -830,76 +3492,132 @@ NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx)
+struct rpccli_eventlog_GetLogInformation_state {
+       struct eventlog_GetLogInformation orig;
+       struct eventlog_GetLogInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_GetLogInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_GetLogInformation_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _level /* [in]  */,
+                                                         uint8_t *_buffer /* [out] [ref,size_is(buf_size)] */,
+                                                         uint32_t _buf_size /* [in] [range(0,1024)] */,
+                                                         uint32_t *_bytes_needed /* [out] [ref] */)
 {
-       struct eventlog_DeregisterClusterSvc r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_eventlog_GetLogInformation_state *state;
+       struct tevent_req *subreq;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_GetLogInformation_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_DEREGISTERCLUSTERSVC,
-                               &r);
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.buf_size = _buf_size;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.bytes_needed = _bytes_needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r);
+               NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_GetLogInformation_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_GETLOGINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_GetLogInformation_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx)
+static void rpccli_eventlog_GetLogInformation_done(struct tevent_req *subreq)
 {
-       struct eventlog_WriteClusterEvents r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_GetLogInformation_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_GetLogInformation_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_eventlog,
-                               NDR_EVENTLOG_WRITECLUSTEREVENTS,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.buf_size * sizeof(*state->orig.out.buffer));
+       *state->orig.out.bytes_needed = *state->tmp.out.bytes_needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r);
+               NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_GetLogInformation_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_eventlog_GetLogInformation_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_GetLogInformation_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli,
@@ -948,6 +3666,118 @@ NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_eventlog_FlushEventLog_state {
+       struct eventlog_FlushEventLog orig;
+       struct eventlog_FlushEventLog tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_FlushEventLog_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_FlushEventLog_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_FlushEventLog_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_FlushEventLog_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_eventlog,
+                                   NDR_EVENTLOG_FLUSHEVENTLOG,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_FlushEventLog_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_FlushEventLog_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_FlushEventLog_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_FlushEventLog_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_FlushEventLog_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_eventlog_FlushEventLog_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_FlushEventLog_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_eventlog_FlushEventLog(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */)
@@ -986,6 +3816,160 @@ NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_eventlog_ReportEventAndSourceW_state {
+       struct eventlog_ReportEventAndSourceW orig;
+       struct eventlog_ReportEventAndSourceW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_eventlog_ReportEventAndSourceW_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             time_t _timestamp /* [in]  */,
+                                                             enum eventlogEventTypes _event_type /* [in]  */,
+                                                             uint16_t _event_category /* [in]  */,
+                                                             uint32_t _event_id /* [in]  */,
+                                                             struct lsa_String *_sourcename /* [in] [ref] */,
+                                                             uint16_t _num_of_strings /* [in] [range(0,256)] */,
+                                                             uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
+                                                             struct lsa_String *_servername /* [in] [ref] */,
+                                                             struct dom_sid *_user_sid /* [in] [unique] */,
+                                                             struct lsa_String **_strings /* [in] [unique,size_is(num_of_strings)] */,
+                                                             uint8_t *_data /* [in] [unique,size_is(data_size)] */,
+                                                             uint16_t _flags /* [in]  */,
+                                                             uint32_t *_record_number /* [in,out] [unique] */,
+                                                             time_t *_time_written /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_eventlog_ReportEventAndSourceW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_eventlog_ReportEventAndSourceW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.timestamp = _timestamp;
+       state->orig.in.event_type = _event_type;
+       state->orig.in.event_category = _event_category;
+       state->orig.in.event_id = _event_id;
+       state->orig.in.sourcename = _sourcename;
+       state->orig.in.num_of_strings = _num_of_strings;
+       state->orig.in.data_size = _data_size;
+       state->orig.in.servername = _servername;
+       state->orig.in.user_sid = _user_sid;
+       state->orig.in.strings = _strings;
+       state->orig.in.data = _data;
+       state->orig.in.flags = _flags;
+       state->orig.in.record_number = _record_number;
+       state->orig.in.time_written = _time_written;
+
+       /* Out parameters */
+       state->orig.out.record_number = _record_number;
+       state->orig.out.time_written = _time_written;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_eventlog_ReportEventAndSourceW_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_eventlog,
+                                   NDR_EVENTLOG_REPORTEVENTANDSOURCEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_eventlog_ReportEventAndSourceW_done, req);
+       return req;
+}
+
+static void rpccli_eventlog_ReportEventAndSourceW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReportEventAndSourceW_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 */
+       if (state->orig.out.record_number && state->tmp.out.record_number) {
+               *state->orig.out.record_number = *state->tmp.out.record_number;
+       }
+       if (state->orig.out.time_written && state->tmp.out.time_written) {
+               *state->orig.out.time_written = *state->tmp.out.time_written;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_eventlog_ReportEventAndSourceW_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_eventlog_ReportEventAndSourceW_state *state = tevent_req_data(
+               req, struct rpccli_eventlog_ReportEventAndSourceW_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_eventlog_ReportEventAndSourceW(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
index d905676041afd94573f7b6da74e0ef151c9d4cc8..7d54234082bb1d18fbb578f3a0656d3e8bed8d49 100644 (file)
@@ -1,30 +1,94 @@
 #include "../librpc/gen_ndr/ndr_eventlog.h"
 #ifndef __CLI_EVENTLOG__
 #define __CLI_EVENTLOG__
+struct tevent_req *rpccli_eventlog_ClearEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct lsa_String *_backupfile /* [in] [unique] */);
+NTSTATUS rpccli_eventlog_ClearEventLogW_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        struct lsa_String *backupfile /* [in] [unique] */);
+struct tevent_req *rpccli_eventlog_BackupEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       struct lsa_String *_backup_filename /* [in] [ref] */);
+NTSTATUS rpccli_eventlog_BackupEventLogW_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         struct lsa_String *backup_filename /* [in] [ref] */);
+struct tevent_req *rpccli_eventlog_CloseEventLog_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_eventlog_CloseEventLog_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_eventlog_DeregisterEventSource_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_eventlog_DeregisterEventSource_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_eventlog_GetNumRecords_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     uint32_t *_number /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_GetNumRecords_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
                                       uint32_t *number /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_GetOldestRecord_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t *_oldest_entry /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_GetOldestRecord_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         uint32_t *oldest_entry /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_ChangeNotify_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_ChangeNotify_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_OpenEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
+                                                     struct lsa_String *_logname /* [in] [ref] */,
+                                                     struct lsa_String *_servername /* [in] [ref] */,
+                                                     uint32_t _major_version /* [in]  */,
+                                                     uint32_t _minor_version /* [in]  */,
+                                                     struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_OpenEventLogW_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
@@ -33,6 +97,18 @@ NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli,
                                       uint32_t major_version /* [in]  */,
                                       uint32_t minor_version /* [in]  */,
                                       struct policy_handle *handle /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_RegisterEventSourceW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
+                                                            struct lsa_String *_module_name /* [in] [ref] */,
+                                                            struct lsa_String *_reg_module_name /* [in] [ref] */,
+                                                            uint32_t _major_version /* [in]  */,
+                                                            uint32_t _minor_version /* [in]  */,
+                                                            struct policy_handle *_log_handle /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_RegisterEventSourceW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result);
 NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
@@ -41,6 +117,17 @@ NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli,
                                              uint32_t major_version /* [in]  */,
                                              uint32_t minor_version /* [in]  */,
                                              struct policy_handle *log_handle /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_OpenBackupEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct eventlog_OpenUnknown0 *_unknown0 /* [in] [unique] */,
+                                                           struct lsa_String *_backup_logname /* [in] [ref] */,
+                                                           uint32_t _major_version /* [in]  */,
+                                                           uint32_t _minor_version /* [in]  */,
+                                                           struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_OpenBackupEventLogW_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result);
 NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */,
@@ -48,6 +135,19 @@ NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli,
                                             uint32_t major_version /* [in]  */,
                                             uint32_t minor_version /* [in]  */,
                                             struct policy_handle *handle /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_ReadEventLogW_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     uint32_t _flags /* [in]  */,
+                                                     uint32_t _offset /* [in]  */,
+                                                     uint32_t _number_of_bytes /* [in] [range(0,0x7FFFF)] */,
+                                                     uint8_t *_data /* [out] [ref,size_is(number_of_bytes)] */,
+                                                     uint32_t *_sent_size /* [out] [ref] */,
+                                                     uint32_t *_real_size /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_ReadEventLogW_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
@@ -57,6 +157,26 @@ NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli,
                                       uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */,
                                       uint32_t *sent_size /* [out] [ref] */,
                                       uint32_t *real_size /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_ReportEventW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    time_t _timestamp /* [in]  */,
+                                                    enum eventlogEventTypes _event_type /* [in]  */,
+                                                    uint16_t _event_category /* [in]  */,
+                                                    uint32_t _event_id /* [in]  */,
+                                                    uint16_t _num_of_strings /* [in] [range(0,256)] */,
+                                                    uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
+                                                    struct lsa_String *_servername /* [in] [ref] */,
+                                                    struct dom_sid *_user_sid /* [in] [unique] */,
+                                                    struct lsa_String **_strings /* [in] [unique,size_is(num_of_strings)] */,
+                                                    uint8_t *_data /* [in] [unique,size_is(data_size)] */,
+                                                    uint16_t _flags /* [in]  */,
+                                                    uint32_t *_record_number /* [in,out] [unique] */,
+                                                    time_t *_time_written /* [in,out] [unique] */);
+NTSTATUS rpccli_eventlog_ReportEventW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -73,26 +193,97 @@ NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli,
                                      uint16_t flags /* [in]  */,
                                      uint32_t *record_number /* [in,out] [unique] */,
                                      time_t *time_written /* [in,out] [unique] */);
+struct tevent_req *rpccli_eventlog_ClearEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_ClearEventLogA_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_BackupEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_BackupEventLogA_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_OpenEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_OpenEventLogA_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_RegisterEventSourceA_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_RegisterEventSourceA_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result);
 NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_OpenBackupEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_OpenBackupEventLogA_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result);
 NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_ReadEventLogA_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_ReadEventLogA_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_ReportEventA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_ReportEventA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_RegisterClusterSvc_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_RegisterClusterSvc_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result);
 NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_DeregisterClusterSvc_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_DeregisterClusterSvc_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result);
 NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_WriteClusterEvents_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_eventlog_WriteClusterEvents_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result);
 NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_eventlog_GetLogInformation_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _level /* [in]  */,
+                                                         uint8_t *_buffer /* [out] [ref,size_is(buf_size)] */,
+                                                         uint32_t _buf_size /* [in] [range(0,1024)] */,
+                                                         uint32_t *_bytes_needed /* [out] [ref] */);
+NTSTATUS rpccli_eventlog_GetLogInformation_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -100,9 +291,37 @@ NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli,
                                           uint8_t *buffer /* [out] [ref,size_is(buf_size)] */,
                                           uint32_t buf_size /* [in] [range(0,1024)] */,
                                           uint32_t *bytes_needed /* [out] [ref] */);
+struct tevent_req *rpccli_eventlog_FlushEventLog_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_eventlog_FlushEventLog_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */);
+struct tevent_req *rpccli_eventlog_ReportEventAndSourceW_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             time_t _timestamp /* [in]  */,
+                                                             enum eventlogEventTypes _event_type /* [in]  */,
+                                                             uint16_t _event_category /* [in]  */,
+                                                             uint32_t _event_id /* [in]  */,
+                                                             struct lsa_String *_sourcename /* [in] [ref] */,
+                                                             uint16_t _num_of_strings /* [in] [range(0,256)] */,
+                                                             uint32_t _data_size /* [in] [range(0,0x3FFFF)] */,
+                                                             struct lsa_String *_servername /* [in] [ref] */,
+                                                             struct dom_sid *_user_sid /* [in] [unique] */,
+                                                             struct lsa_String **_strings /* [in] [unique,size_is(num_of_strings)] */,
+                                                             uint8_t *_data /* [in] [unique,size_is(data_size)] */,
+                                                             uint16_t _flags /* [in]  */,
+                                                             uint32_t *_record_number /* [in,out] [unique] */,
+                                                             time_t *_time_written /* [in,out] [unique] */);
+NTSTATUS rpccli_eventlog_ReportEventAndSourceW_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_eventlog_ReportEventAndSourceW(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
index 3861e0c3e4637a63f537e3a08d856454ebe91208..b3ed6bb1f385eacc73b54498e870e6270bab3ef1 100644 (file)
@@ -6,6 +6,126 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_initshutdown.h"
 
+struct rpccli_initshutdown_Init_state {
+       struct initshutdown_Init orig;
+       struct initshutdown_Init tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_initshutdown_Init_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_initshutdown_Init_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                uint16_t *_hostname /* [in] [unique] */,
+                                                struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                uint32_t _timeout /* [in]  */,
+                                                uint8_t _force_apps /* [in]  */,
+                                                uint8_t _do_reboot /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_initshutdown_Init_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_initshutdown_Init_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.hostname = _hostname;
+       state->orig.in.message = _message;
+       state->orig.in.timeout = _timeout;
+       state->orig.in.force_apps = _force_apps;
+       state->orig.in.do_reboot = _do_reboot;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(initshutdown_Init, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_initshutdown,
+                                   NDR_INITSHUTDOWN_INIT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_initshutdown_Init_done, req);
+       return req;
+}
+
+static void rpccli_initshutdown_Init_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_initshutdown_Init_state *state = tevent_req_data(
+               req, struct rpccli_initshutdown_Init_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(initshutdown_Init, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_initshutdown_Init_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_initshutdown_Init_state *state = tevent_req_data(
+               req, struct rpccli_initshutdown_Init_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_initshutdown_Init(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  uint16_t *hostname /* [in] [unique] */,
@@ -57,6 +177,118 @@ NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_initshutdown_Abort_state {
+       struct initshutdown_Abort orig;
+       struct initshutdown_Abort tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_initshutdown_Abort_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_initshutdown_Abort_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 uint16_t *_server /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_initshutdown_Abort_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_initshutdown_Abort_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(initshutdown_Abort, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_initshutdown,
+                                   NDR_INITSHUTDOWN_ABORT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_initshutdown_Abort_done, req);
+       return req;
+}
+
+static void rpccli_initshutdown_Abort_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_initshutdown_Abort_state *state = tevent_req_data(
+               req, struct rpccli_initshutdown_Abort_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_initshutdown_Abort_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_initshutdown_Abort_state *state = tevent_req_data(
+               req, struct rpccli_initshutdown_Abort_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_initshutdown_Abort(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   uint16_t *server /* [in] [unique] */,
@@ -100,6 +332,128 @@ NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_initshutdown_InitEx_state {
+       struct initshutdown_InitEx orig;
+       struct initshutdown_InitEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_initshutdown_InitEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_initshutdown_InitEx_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  uint16_t *_hostname /* [in] [unique] */,
+                                                  struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                  uint32_t _timeout /* [in]  */,
+                                                  uint8_t _force_apps /* [in]  */,
+                                                  uint8_t _do_reboot /* [in]  */,
+                                                  uint32_t _reason /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_initshutdown_InitEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_initshutdown_InitEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.hostname = _hostname;
+       state->orig.in.message = _message;
+       state->orig.in.timeout = _timeout;
+       state->orig.in.force_apps = _force_apps;
+       state->orig.in.do_reboot = _do_reboot;
+       state->orig.in.reason = _reason;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_initshutdown,
+                                   NDR_INITSHUTDOWN_INITEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_initshutdown_InitEx_done, req);
+       return req;
+}
+
+static void rpccli_initshutdown_InitEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_initshutdown_InitEx_state *state = tevent_req_data(
+               req, struct rpccli_initshutdown_InitEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_initshutdown_InitEx_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_initshutdown_InitEx_state *state = tevent_req_data(
+               req, struct rpccli_initshutdown_InitEx_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_initshutdown_InitEx(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    uint16_t *hostname /* [in] [unique] */,
index 9a12c5e6fb049b0abb2eeb7dac36445145521867..1162b8aa728c30f3f8900b9c2542f1e31ff85920 100644 (file)
@@ -1,6 +1,17 @@
 #include "../librpc/gen_ndr/ndr_initshutdown.h"
 #ifndef __CLI_INITSHUTDOWN__
 #define __CLI_INITSHUTDOWN__
+struct tevent_req *rpccli_initshutdown_Init_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                uint16_t *_hostname /* [in] [unique] */,
+                                                struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                uint32_t _timeout /* [in]  */,
+                                                uint8_t _force_apps /* [in]  */,
+                                                uint8_t _do_reboot /* [in]  */);
+NTSTATUS rpccli_initshutdown_Init_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  uint16_t *hostname /* [in] [unique] */,
@@ -9,10 +20,29 @@ NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
                                  uint8_t force_apps /* [in]  */,
                                  uint8_t do_reboot /* [in]  */,
                                  WERROR *werror);
+struct tevent_req *rpccli_initshutdown_Abort_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 uint16_t *_server /* [in] [unique] */);
+NTSTATUS rpccli_initshutdown_Abort_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   uint16_t *server /* [in] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_initshutdown_InitEx_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  uint16_t *_hostname /* [in] [unique] */,
+                                                  struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                  uint32_t _timeout /* [in]  */,
+                                                  uint8_t _force_apps /* [in]  */,
+                                                  uint8_t _do_reboot /* [in]  */,
+                                                  uint32_t _reason /* [in]  */);
+NTSTATUS rpccli_initshutdown_InitEx_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    uint16_t *hostname /* [in] [unique] */,
index 04cf38aaf3811d1ec55d3aff3146ac4604ae4a03..bc51b71798b7c035828221cbab968bd980b7a8d7 100644 (file)
@@ -6,6 +6,126 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_lsa.h"
 
+struct rpccli_lsa_Close_state {
+       struct lsa_Close orig;
+       struct lsa_Close tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_Close_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_Close_send(TALLOC_CTX *mem_ctx,
+                                        struct tevent_context *ev,
+                                        struct rpc_pipe_client *cli,
+                                        struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_Close_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_Close_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_Close, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_Close_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_lsarpc,
+                                   NDR_LSA_CLOSE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_Close_done, req);
+       return req;
+}
+
+static void rpccli_lsa_Close_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_Close_state *state = tevent_req_data(
+               req, struct rpccli_lsa_Close_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_Close, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_Close_recv(struct tevent_req *req,
+                              TALLOC_CTX *mem_ctx,
+                              NTSTATUS *result)
+{
+       struct rpccli_lsa_Close_state *state = tevent_req_data(
+               req, struct rpccli_lsa_Close_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_lsa_Close(struct rpc_pipe_client *cli,
                          TALLOC_CTX *mem_ctx,
                          struct policy_handle *handle /* [in,out] [ref] */)
@@ -45,6 +165,118 @@ NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_Delete_state {
+       struct lsa_Delete orig;
+       struct lsa_Delete tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_Delete_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_Delete_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_Delete_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_Delete_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_Delete, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_DELETE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_Delete_done, req);
+       return req;
+}
+
+static void rpccli_lsa_Delete_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_Delete_state *state = tevent_req_data(
+               req, struct rpccli_lsa_Delete_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_Delete, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_Delete_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               NTSTATUS *result)
+{
+       struct rpccli_lsa_Delete_state *state = tevent_req_data(
+               req, struct rpccli_lsa_Delete_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_lsa_Delete(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           struct policy_handle *handle /* [in] [ref] */)
@@ -83,6 +315,133 @@ NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_EnumPrivs_state {
+       struct lsa_EnumPrivs orig;
+       struct lsa_EnumPrivs tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumPrivs_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumPrivs_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_handle /* [in] [ref] */,
+                                            uint32_t *_resume_handle /* [in,out] [ref] */,
+                                            struct lsa_PrivArray *_privs /* [out] [ref] */,
+                                            uint32_t _max_count /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumPrivs_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumPrivs_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.max_count = _max_count;
+
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.privs = _privs;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumPrivs_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_lsarpc,
+                                   NDR_LSA_ENUMPRIVS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumPrivs_done, req);
+       return req;
+}
+
+static void rpccli_lsa_EnumPrivs_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumPrivs_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumPrivs_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.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.privs = *state->tmp.out.privs;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumPrivs_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumPrivs_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumPrivs_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_lsa_EnumPrivs(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *handle /* [in] [ref] */,
@@ -128,6 +487,129 @@ NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_QuerySecurity_state {
+       struct lsa_QuerySecurity orig;
+       struct lsa_QuerySecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QuerySecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QuerySecurity_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                uint32_t _sec_info /* [in]  */,
+                                                struct sec_desc_buf **_sdbuf /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QuerySecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QuerySecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sec_info = _sec_info;
+
+       /* Out parameters */
+       state->orig.out.sdbuf = _sdbuf;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QuerySecurity_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_lsarpc,
+                                   NDR_LSA_QUERYSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QuerySecurity_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QuerySecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QuerySecurity_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QuerySecurity_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.sdbuf = *state->tmp.out.sdbuf;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QuerySecurity_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_lsa_QuerySecurity_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QuerySecurity_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_lsa_QuerySecurity(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
@@ -170,6 +652,122 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_SetSecObj_state {
+       struct lsa_SetSecObj orig;
+       struct lsa_SetSecObj tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetSecObj_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetSecObj_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_handle /* [in] [ref] */,
+                                            uint32_t _sec_info /* [in]  */,
+                                            struct sec_desc_buf *_sdbuf /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetSecObj_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetSecObj_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sec_info = _sec_info;
+       state->orig.in.sdbuf = _sdbuf;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetSecObj, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETSECOBJ,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetSecObj_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetSecObj_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetSecObj_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetSecObj_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetSecObj_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_lsa_SetSecObj_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetSecObj_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_lsa_SetSecObj(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *handle /* [in] [ref] */,
@@ -212,107 +810,132 @@ NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_ChangePassword_state {
+       struct lsa_ChangePassword orig;
+       struct lsa_ChangePassword tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_ChangePassword_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_ChangePassword_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
 {
-       struct lsa_ChangePassword r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_ChangePassword_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_ChangePassword_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &r);
+               NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CHANGEPASSWORD,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CHANGEPASSWORD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_lsa_ChangePassword_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &r);
+static void rpccli_lsa_ChangePassword_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_ChangePassword_state *state = tevent_req_data(
+               req, struct rpccli_lsa_ChangePassword_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       /* Return variables */
+       /* Copy out parameters */
 
-       /* Return result */
-       return r.out.result;
-}
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
 
-NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              uint16_t *system_name /* [in] [unique] */,
-                              struct lsa_ObjectAttribute *attr /* [in] [ref] */,
-                              uint32_t access_mask /* [in]  */,
-                              struct policy_handle *handle /* [out] [ref] */)
-{
-       struct lsa_OpenPolicy r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.system_name = system_name;
-       r.in.attr = attr;
-       r.in.access_mask = access_mask;
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_OPENPOLICY,
-                               &r);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       tevent_req_done(req);
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &r);
-       }
+NTSTATUS rpccli_lsa_ChangePassword_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_lsa_ChangePassword_state *state = tevent_req_data(
+               req, struct rpccli_lsa_ChangePassword_state);
+       NTSTATUS status;
 
-       if (NT_STATUS_IS_ERR(status)) {
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *handle = *r.out.handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *handle /* [in] [ref] */,
-                                   enum lsa_PolicyInfo level /* [in]  */,
-                                   union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */)
+NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx)
 {
-       struct lsa_QueryInfoPolicy r;
+       struct lsa_ChangePassword r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &r);
+               NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_QUERYINFOPOLICY,
+                               NDR_LSA_CHANGEPASSWORD,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -320,7 +943,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -328,70 +951,159 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *handle /* [in] [ref] */,
-                                 enum lsa_PolicyInfo level /* [in]  */,
-                                 union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */)
+struct rpccli_lsa_OpenPolicy_state {
+       struct lsa_OpenPolicy orig;
+       struct lsa_OpenPolicy tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_OpenPolicy_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_OpenPolicy_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t *_system_name /* [in] [unique] */,
+                                             struct lsa_ObjectAttribute *_attr /* [in] [ref] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_handle /* [out] [ref] */)
 {
-       struct lsa_SetInfoPolicy r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_OpenPolicy_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_OpenPolicy_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
-       r.in.info = info;
+       state->orig.in.system_name = _system_name;
+       state->orig.in.attr = _attr;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &r);
+               NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETINFOPOLICY,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_OpenPolicy_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_lsarpc,
+                                   NDR_LSA_OPENPOLICY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_OpenPolicy_done, req);
+       return req;
+}
+
+static void rpccli_lsa_OpenPolicy_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_OpenPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenPolicy_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_OpenPolicy_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_OpenPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenPolicy_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              uint16_t *system_name /* [in] [unique] */,
+                              struct lsa_ObjectAttribute *attr /* [in] [ref] */,
+                              uint32_t access_mask /* [in]  */,
+                              struct policy_handle *handle /* [out] [ref] */)
 {
-       struct lsa_ClearAuditLog r;
+       struct lsa_OpenPolicy r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.system_name = system_name;
+       r.in.attr = attr;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &r);
+               NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_CLEARAUDITLOG,
+                               NDR_LSA_OPENPOLICY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -399,7 +1111,7 @@ NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -407,78 +1119,156 @@ NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *handle = *r.out.handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *handle /* [in] [ref] */,
-                                 struct dom_sid2 *sid /* [in] [ref] */,
-                                 uint32_t access_mask /* [in]  */,
-                                 struct policy_handle *acct_handle /* [out] [ref] */)
+struct rpccli_lsa_QueryInfoPolicy_state {
+       struct lsa_QueryInfoPolicy orig;
+       struct lsa_QueryInfoPolicy tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QueryInfoPolicy_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QueryInfoPolicy_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  enum lsa_PolicyInfo _level /* [in]  */,
+                                                  union lsa_PolicyInformation **_info /* [out] [ref,switch_is(level)] */)
 {
-       struct lsa_CreateAccount r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_QueryInfoPolicy_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QueryInfoPolicy_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.sid = sid;
-       r.in.access_mask = access_mask;
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREATEACCOUNT,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QueryInfoPolicy_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_lsarpc,
+                                   NDR_LSA_QUERYINFOPOLICY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QueryInfoPolicy_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QueryInfoPolicy_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QueryInfoPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryInfoPolicy_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QueryInfoPolicy_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_lsa_QueryInfoPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryInfoPolicy_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *acct_handle = *r.out.acct_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *handle /* [in] [ref] */,
-                                uint32_t *resume_handle /* [in,out] [ref] */,
-                                struct lsa_SidArray *sids /* [out] [ref] */,
-                                uint32_t num_entries /* [in] [range(0,8192)] */)
+NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *handle /* [in] [ref] */,
+                                   enum lsa_PolicyInfo level /* [in]  */,
+                                   union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */)
 {
-       struct lsa_EnumAccounts r;
+       struct lsa_QueryInfoPolicy r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.resume_handle = resume_handle;
-       r.in.num_entries = num_entries;
+       r.in.level = level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &r);
+               NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_ENUMACCOUNTS,
+                               NDR_LSA_QUERYINFOPOLICY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -486,7 +1276,7 @@ NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -494,80 +1284,150 @@ NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *sids = *r.out.sids;
+       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *policy_handle /* [in] [ref] */,
-                                       struct lsa_DomainInfo *info /* [in] [ref] */,
-                                       uint32_t access_mask /* [in]  */,
-                                       struct policy_handle *trustdom_handle /* [out] [ref] */)
+struct rpccli_lsa_SetInfoPolicy_state {
+       struct lsa_SetInfoPolicy orig;
+       struct lsa_SetInfoPolicy tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetInfoPolicy_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetInfoPolicy_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                enum lsa_PolicyInfo _level /* [in]  */,
+                                                union lsa_PolicyInformation *_info /* [in] [ref,switch_is(level)] */)
 {
-       struct lsa_CreateTrustedDomain r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_SetInfoPolicy_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetInfoPolicy_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.policy_handle = policy_handle;
-       r.in.info = info;
-       r.in.access_mask = access_mask;
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &r);
+               NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREATETRUSTEDDOMAIN,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETINFOPOLICY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetInfoPolicy_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetInfoPolicy_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetInfoPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetInfoPolicy_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetInfoPolicy_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_lsa_SetInfoPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetInfoPolicy_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *trustdom_handle = *r.out.trustdom_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *handle /* [in] [ref] */,
-                                uint32_t *resume_handle /* [in,out] [ref] */,
-                                struct lsa_DomainList *domains /* [out] [ref] */,
-                                uint32_t max_size /* [in]  */)
+NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *handle /* [in] [ref] */,
+                                 enum lsa_PolicyInfo level /* [in]  */,
+                                 union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */)
 {
-       struct lsa_EnumTrustDom r;
+       struct lsa_SetInfoPolicy r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.resume_handle = resume_handle;
-       r.in.max_size = max_size;
+       r.in.level = level;
+       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &r);
+               NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_ENUMTRUSTDOM,
+                               NDR_LSA_SETINFOPOLICY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -575,7 +1435,7 @@ NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -583,92 +1443,137 @@ NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *domains = *r.out.domains;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in] [ref] */,
-                               uint32_t num_names /* [in] [range(0,1000)] */,
-                               struct lsa_String *names /* [in] [size_is(num_names)] */,
-                               struct lsa_RefDomainList **domains /* [out] [ref] */,
-                               struct lsa_TransSidArray *sids /* [in,out] [ref] */,
-                               enum lsa_LookupNamesLevel level /* [in]  */,
-                               uint32_t *count /* [in,out] [ref] */)
+struct rpccli_lsa_ClearAuditLog_state {
+       struct lsa_ClearAuditLog orig;
+       struct lsa_ClearAuditLog tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_ClearAuditLog_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_ClearAuditLog_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
 {
-       struct lsa_LookupNames r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_ClearAuditLog_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_ClearAuditLog_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.num_names = num_names;
-       r.in.names = names;
-       r.in.sids = sids;
-       r.in.level = level;
-       r.in.count = count;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupNames, &r);
+               NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPNAMES,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CLEARAUDITLOG,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_ClearAuditLog_done, req);
+       return req;
+}
+
+static void rpccli_lsa_ClearAuditLog_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_ClearAuditLog_state *state = tevent_req_data(
+               req, struct rpccli_lsa_ClearAuditLog_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_ClearAuditLog_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_lsa_ClearAuditLog_state *state = tevent_req_data(
+               req, struct rpccli_lsa_ClearAuditLog_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *domains = *r.out.domains;
-       *sids = *r.out.sids;
-       *count = *r.out.count;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              struct policy_handle *handle /* [in] [ref] */,
-                              struct lsa_SidArray *sids /* [in] [ref] */,
-                              struct lsa_RefDomainList **domains /* [out] [ref] */,
-                              struct lsa_TransNameArray *names /* [in,out] [ref] */,
-                              uint16_t level /* [in]  */,
-                              uint32_t *count /* [in,out] [ref] */)
+NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx)
 {
-       struct lsa_LookupSids r;
+       struct lsa_ClearAuditLog r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.sids = sids;
-       r.in.names = names;
-       r.in.level = level;
-       r.in.count = count;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupSids, &r);
+               NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPSIDS,
+                               NDR_LSA_CLEARAUDITLOG,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -676,7 +1581,7 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -684,66 +1589,144 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *domains = *r.out.domains;
-       *names = *r.out.names;
-       *count = *r.out.count;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *handle /* [in] [ref] */,
-                                struct lsa_String name /* [in]  */,
-                                uint32_t access_mask /* [in]  */,
-                                struct policy_handle *sec_handle /* [out] [ref] */)
+struct rpccli_lsa_CreateAccount_state {
+       struct lsa_CreateAccount orig;
+       struct lsa_CreateAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CreateAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CreateAccount_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                struct dom_sid2 *_sid /* [in] [ref] */,
+                                                uint32_t _access_mask /* [in]  */,
+                                                struct policy_handle *_acct_handle /* [out] [ref] */)
 {
-       struct lsa_CreateSecret r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CreateAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CreateAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
-       r.in.access_mask = access_mask;
+       state->orig.in.handle = _handle;
+       state->orig.in.sid = _sid;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.acct_handle = _acct_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREATESECRET,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_CreateAccount_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_lsarpc,
+                                   NDR_LSA_CREATEACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CreateAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CreateAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CreateAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateAccount_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.acct_handle = *state->tmp.out.acct_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CreateAccount_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_lsa_CreateAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateAccount_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *sec_handle = *r.out.sec_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in] [ref] */,
-                               struct dom_sid2 *sid /* [in] [ref] */,
-                               uint32_t access_mask /* [in]  */,
-                               struct policy_handle *acct_handle /* [out] [ref] */)
+NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *handle /* [in] [ref] */,
+                                 struct dom_sid2 *sid /* [in] [ref] */,
+                                 uint32_t access_mask /* [in]  */,
+                                 struct policy_handle *acct_handle /* [out] [ref] */)
 {
-       struct lsa_OpenAccount r;
+       struct lsa_CreateAccount r;
        NTSTATUS status;
 
        /* In parameters */
@@ -752,13 +1735,13 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
        r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_OPENACCOUNT,
+                               NDR_LSA_CREATEACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -766,7 +1749,7 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -780,108 +1763,156 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *handle /* [in] [ref] */,
-                                    struct lsa_PrivilegeSet **privs /* [out] [ref] */)
+struct rpccli_lsa_EnumAccounts_state {
+       struct lsa_EnumAccounts orig;
+       struct lsa_EnumAccounts tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumAccounts_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumAccounts_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t *_resume_handle /* [in,out] [ref] */,
+                                               struct lsa_SidArray *_sids /* [out] [ref] */,
+                                               uint32_t _num_entries /* [in] [range(0,8192)] */)
 {
-       struct lsa_EnumPrivsAccount r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.handle = handle;
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumAccounts_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumAccounts_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_ENUMPRIVSACCOUNT,
-                               &r);
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.num_entries = _num_entries;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.sids = _sids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumAccounts_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *privs = *r.out.privs;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_ENUMACCOUNTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumAccounts_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *handle /* [in] [ref] */,
-                                          struct lsa_PrivilegeSet *privs /* [in] [ref] */)
+static void rpccli_lsa_EnumAccounts_done(struct tevent_req *subreq)
 {
-       struct lsa_AddPrivilegesToAccount r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumAccounts_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumAccounts_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.handle = handle;
-       r.in.privs = privs;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_ADDPRIVILEGESTOACCOUNT,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       *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);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumAccounts_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumAccounts_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumAccounts_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               struct policy_handle *handle /* [in] [ref] */,
-                                               uint8_t remove_all /* [in]  */,
-                                               struct lsa_PrivilegeSet *privs /* [in] [unique] */)
+NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *handle /* [in] [ref] */,
+                                uint32_t *resume_handle /* [in,out] [ref] */,
+                                struct lsa_SidArray *sids /* [out] [ref] */,
+                                uint32_t num_entries /* [in] [range(0,8192)] */)
 {
-       struct lsa_RemovePrivilegesFromAccount r;
+       struct lsa_EnumAccounts r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.remove_all = remove_all;
-       r.in.privs = privs;
+       r.in.resume_handle = resume_handle;
+       r.in.num_entries = num_entries;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT,
+                               NDR_LSA_ENUMACCOUNTS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -889,7 +1920,7 @@ NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -897,102 +1928,161 @@ NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *resume_handle = *r.out.resume_handle;
+       *sids = *r.out.sids;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_CreateTrustedDomain_state {
+       struct lsa_CreateTrustedDomain orig;
+       struct lsa_CreateTrustedDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CreateTrustedDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CreateTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_policy_handle /* [in] [ref] */,
+                                                      struct lsa_DomainInfo *_info /* [in] [ref] */,
+                                                      uint32_t _access_mask /* [in]  */,
+                                                      struct policy_handle *_trustdom_handle /* [out] [ref] */)
 {
-       struct lsa_GetQuotasForAccount r;
-       NTSTATUS status;
-
-       /* In parameters */
+       struct tevent_req *req;
+       struct rpccli_lsa_CreateTrustedDomain_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CreateTrustedDomain_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_GETQUOTASFORACCOUNT,
-                               &r);
+       /* In parameters */
+       state->orig.in.policy_handle = _policy_handle;
+       state->orig.in.info = _info;
+       state->orig.in.access_mask = _access_mask;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.trustdom_handle = _trustdom_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_CreateTrustedDomain_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREATETRUSTEDDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CreateTrustedDomain_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx)
+static void rpccli_lsa_CreateTrustedDomain_done(struct tevent_req *subreq)
 {
-       struct lsa_SetQuotasForAccount r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CreateTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateTrustedDomain_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETQUOTASFORACCOUNT,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.trustdom_handle = *state->tmp.out.trustdom_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CreateTrustedDomain_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_lsa_CreateTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateTrustedDomain_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *handle /* [in] [ref] */,
-                                          uint32_t *access_mask /* [out] [ref] */)
+NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *policy_handle /* [in] [ref] */,
+                                       struct lsa_DomainInfo *info /* [in] [ref] */,
+                                       uint32_t access_mask /* [in]  */,
+                                       struct policy_handle *trustdom_handle /* [out] [ref] */)
 {
-       struct lsa_GetSystemAccessAccount r;
+       struct lsa_CreateTrustedDomain r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
+       r.in.policy_handle = policy_handle;
+       r.in.info = info;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_GETSYSTEMACCESSACCOUNT,
+                               NDR_LSA_CREATETRUSTEDDOMAIN,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1000,7 +2090,7 @@ NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1008,75 +2098,162 @@ NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *access_mask = *r.out.access_mask;
+       *trustdom_handle = *r.out.trustdom_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *handle /* [in] [ref] */,
-                                          uint32_t access_mask /* [in]  */)
+struct rpccli_lsa_EnumTrustDom_state {
+       struct lsa_EnumTrustDom orig;
+       struct lsa_EnumTrustDom tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumTrustDom_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumTrustDom_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t *_resume_handle /* [in,out] [ref] */,
+                                               struct lsa_DomainList *_domains /* [out] [ref] */,
+                                               uint32_t _max_size /* [in]  */)
 {
-       struct lsa_SetSystemAccessAccount r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumTrustDom_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumTrustDom_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.access_mask = access_mask;
+       state->orig.in.handle = _handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.max_size = _max_size;
+
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.domains = _domains;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &r);
+               NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETSYSTEMACCESSACCOUNT,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumTrustDom_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_lsarpc,
+                                   NDR_LSA_ENUMTRUSTDOM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumTrustDom_done, req);
+       return req;
+}
+
+static void rpccli_lsa_EnumTrustDom_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumTrustDom_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumTrustDom_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.domains = *state->tmp.out.domains;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumTrustDom_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumTrustDom_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumTrustDom_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *handle /* [in] [ref] */,
-                                     struct dom_sid2 *sid /* [in] [ref] */,
-                                     uint32_t access_mask /* [in]  */,
-                                     struct policy_handle *trustdom_handle /* [out] [ref] */)
+NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *handle /* [in] [ref] */,
+                                uint32_t *resume_handle /* [in,out] [ref] */,
+                                struct lsa_DomainList *domains /* [out] [ref] */,
+                                uint32_t max_size /* [in]  */)
 {
-       struct lsa_OpenTrustedDomain r;
+       struct lsa_EnumTrustDom r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.sid = sid;
-       r.in.access_mask = access_mask;
+       r.in.resume_handle = resume_handle;
+       r.in.max_size = max_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &r);
+               NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_OPENTRUSTEDDOMAIN,
+                               NDR_LSA_ENUMTRUSTDOM,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1084,7 +2261,7 @@ NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1092,119 +2269,177 @@ NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *trustdom_handle = *r.out.trustdom_handle;
+       *resume_handle = *r.out.resume_handle;
+       *domains = *r.out.domains;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *trustdom_handle /* [in] [ref] */,
-                                          enum lsa_TrustDomInfoEnum level /* [in]  */,
-                                          union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
+struct rpccli_lsa_LookupNames_state {
+       struct lsa_LookupNames orig;
+       struct lsa_LookupNames tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupNames_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupNames_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              uint32_t _num_names /* [in] [range(0,1000)] */,
+                                              struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                              struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                              struct lsa_TransSidArray *_sids /* [in,out] [ref] */,
+                                              enum lsa_LookupNamesLevel _level /* [in]  */,
+                                              uint32_t *_count /* [in,out] [ref] */)
 {
-       struct lsa_QueryTrustedDomainInfo r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.trustdom_handle = trustdom_handle;
-       r.in.level = level;
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupNames_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupNames_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_QUERYTRUSTEDDOMAININFO,
-                               &r);
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.num_names = _num_names;
+       state->orig.in.names = _names;
+       state->orig.in.sids = _sids;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.sids = _sids;
+       state->orig.out.count = _count;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupNames_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LOOKUPNAMES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupNames_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               struct policy_handle *trustdom_handle /* [in] [ref] */,
-                                               enum lsa_TrustDomInfoEnum level /* [in]  */,
-                                               union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
+static void rpccli_lsa_LookupNames_done(struct tevent_req *subreq)
 {
-       struct lsa_SetInformationTrustedDomain r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupNames_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.trustdom_handle = trustdom_handle;
-       r.in.level = level;
-       r.in.info = info;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.domains = *state->tmp.out.domains;
+       *state->orig.out.sids = *state->tmp.out.sids;
+       *state->orig.out.count = *state->tmp.out.count;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupNames_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupNames_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              struct policy_handle *handle /* [in] [ref] */,
-                              struct lsa_String name /* [in]  */,
-                              uint32_t access_mask /* [in]  */,
-                              struct policy_handle *sec_handle /* [out] [ref] */)
+NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               uint32_t num_names /* [in] [range(0,1000)] */,
+                               struct lsa_String *names /* [in] [size_is(num_names)] */,
+                               struct lsa_RefDomainList **domains /* [out] [ref] */,
+                               struct lsa_TransSidArray *sids /* [in,out] [ref] */,
+                               enum lsa_LookupNamesLevel level /* [in]  */,
+                               uint32_t *count /* [in,out] [ref] */)
 {
-       struct lsa_OpenSecret r;
+       struct lsa_LookupNames r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.name = name;
-       r.in.access_mask = access_mask;
+       r.in.num_names = num_names;
+       r.in.names = names;
+       r.in.sids = sids;
+       r.in.level = level;
+       r.in.count = count;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_OPENSECRET,
+                               NDR_LSA_LOOKUPNAMES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1212,7 +2447,7 @@ NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1220,133 +2455,174 @@ NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *sec_handle = *r.out.sec_handle;
+       *domains = *r.out.domains;
+       *sids = *r.out.sids;
+       *count = *r.out.count;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             struct policy_handle *sec_handle /* [in] [ref] */,
-                             struct lsa_DATA_BUF *new_val /* [in] [unique] */,
-                             struct lsa_DATA_BUF *old_val /* [in] [unique] */)
+struct rpccli_lsa_LookupSids_state {
+       struct lsa_LookupSids orig;
+       struct lsa_LookupSids tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupSids_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupSids_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct lsa_SidArray *_sids /* [in] [ref] */,
+                                             struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                             struct lsa_TransNameArray *_names /* [in,out] [ref] */,
+                                             uint16_t _level /* [in]  */,
+                                             uint32_t *_count /* [in,out] [ref] */)
 {
-       struct lsa_SetSecret r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupSids_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupSids_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.sec_handle = sec_handle;
-       r.in.new_val = new_val;
-       r.in.old_val = old_val;
+       state->orig.in.handle = _handle;
+       state->orig.in.sids = _sids;
+       state->orig.in.names = _names;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
+
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.names = _names;
+       state->orig.out.count = _count;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetSecret, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupSids, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETSECRET,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupSids_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LOOKUPSIDS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupSids_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &r);
+static void rpccli_lsa_LookupSids_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupSids_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupSids_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       /* Return variables */
+       /* Copy out parameters */
+       *state->orig.out.domains = *state->tmp.out.domains;
+       *state->orig.out.names = *state->tmp.out.names;
+       *state->orig.out.count = *state->tmp.out.count;
 
-       /* Return result */
-       return r.out.result;
-}
-
-NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *sec_handle /* [in] [ref] */,
-                               struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */,
-                               NTTIME *new_mtime /* [in,out] [unique] */,
-                               struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */,
-                               NTTIME *old_mtime /* [in,out] [unique] */)
-{
-       struct lsa_QuerySecret r;
-       NTSTATUS status;
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
 
-       /* In parameters */
-       r.in.sec_handle = sec_handle;
-       r.in.new_val = new_val;
-       r.in.new_mtime = new_mtime;
-       r.in.old_val = old_val;
-       r.in.old_mtime = old_mtime;
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_QUERYSECRET,
-                               &r);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       tevent_req_done(req);
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &r);
-       }
+NTSTATUS rpccli_lsa_LookupSids_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupSids_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupSids_state);
+       NTSTATUS status;
 
-       if (NT_STATUS_IS_ERR(status)) {
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       if (new_val && r.out.new_val) {
-               *new_val = *r.out.new_val;
-       }
-       if (new_mtime && r.out.new_mtime) {
-               *new_mtime = *r.out.new_mtime;
-       }
-       if (old_val && r.out.old_val) {
-               *old_val = *r.out.old_val;
-       }
-       if (old_mtime && r.out.old_mtime) {
-               *old_mtime = *r.out.old_mtime;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *handle /* [in] [ref] */,
-                                   struct lsa_String *name /* [in] [ref] */,
-                                   struct lsa_LUID *luid /* [out] [ref] */)
+NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *handle /* [in] [ref] */,
+                              struct lsa_SidArray *sids /* [in] [ref] */,
+                              struct lsa_RefDomainList **domains /* [out] [ref] */,
+                              struct lsa_TransNameArray *names /* [in,out] [ref] */,
+                              uint16_t level /* [in]  */,
+                              uint32_t *count /* [in,out] [ref] */)
 {
-       struct lsa_LookupPrivValue r;
+       struct lsa_LookupSids r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.name = name;
+       r.in.sids = sids;
+       r.in.names = names;
+       r.in.level = level;
+       r.in.count = count;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupSids, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPPRIVVALUE,
+                               NDR_LSA_LOOKUPSIDS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1354,7 +2630,7 @@ NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1362,120 +2638,162 @@ NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *luid = *r.out.luid;
+       *domains = *r.out.domains;
+       *names = *r.out.names;
+       *count = *r.out.count;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct policy_handle *handle /* [in] [ref] */,
-                                  struct lsa_LUID *luid /* [in] [ref] */,
-                                  struct lsa_StringLarge **name /* [out] [ref] */)
+struct rpccli_lsa_CreateSecret_state {
+       struct lsa_CreateSecret orig;
+       struct lsa_CreateSecret tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CreateSecret_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CreateSecret_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               struct lsa_String _name /* [in]  */,
+                                               uint32_t _access_mask /* [in]  */,
+                                               struct policy_handle *_sec_handle /* [out] [ref] */)
 {
-       struct lsa_LookupPrivName r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.handle = handle;
-       r.in.luid = luid;
+       struct tevent_req *req;
+       struct rpccli_lsa_CreateSecret_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CreateSecret_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPPRIVNAME,
-                               &r);
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.access_mask = _access_mask;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.sec_handle = _sec_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_CreateSecret_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *name = *r.out.name;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREATESECRET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CreateSecret_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *handle /* [in] [ref] */,
-                                         struct lsa_String *name /* [in] [ref] */,
-                                         uint16_t language_id /* [in]  */,
-                                         uint16_t language_id_sys /* [in]  */,
-                                         struct lsa_StringLarge **disp_name /* [out] [ref] */,
-                                         uint16_t *returned_language_id /* [out] [ref] */)
+static void rpccli_lsa_CreateSecret_done(struct tevent_req *subreq)
 {
-       struct lsa_LookupPrivDisplayName r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CreateSecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateSecret_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
-       r.in.language_id = language_id;
-       r.in.language_id_sys = language_id_sys;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPPRIVDISPLAYNAME,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.sec_handle = *state->tmp.out.sec_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CreateSecret_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_CreateSecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateSecret_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *disp_name = *r.out.disp_name;
-       *returned_language_id = *r.out.returned_language_id;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
-                                struct policy_handle *handle /* [in,out] [ref] */)
+                                struct policy_handle *handle /* [in] [ref] */,
+                                struct lsa_String name /* [in]  */,
+                                uint32_t access_mask /* [in]  */,
+                                struct policy_handle *sec_handle /* [out] [ref] */)
 {
-       struct lsa_DeleteObject r;
+       struct lsa_CreateSecret r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
+       r.in.name = name;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_DELETEOBJECT,
+                               NDR_LSA_CREATESECRET,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1483,7 +2801,7 @@ NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1491,75 +2809,160 @@ NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
+       *sec_handle = *r.out.sec_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             struct policy_handle *handle /* [in] [ref] */,
-                                             struct lsa_String *name /* [in] [unique] */,
-                                             struct lsa_SidArray *sids /* [out] [ref] */)
+struct rpccli_lsa_OpenAccount_state {
+       struct lsa_OpenAccount orig;
+       struct lsa_OpenAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_OpenAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_OpenAccount_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              struct dom_sid2 *_sid /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_acct_handle /* [out] [ref] */)
 {
-       struct lsa_EnumAccountsWithUserRight r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_OpenAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_OpenAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
+       state->orig.in.handle = _handle;
+       state->orig.in.sid = _sid;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.acct_handle = _acct_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &r);
+               NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_OpenAccount_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_lsarpc,
+                                   NDR_LSA_OPENACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_OpenAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_OpenAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_OpenAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenAccount_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.acct_handle = *state->tmp.out.acct_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_OpenAccount_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_OpenAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenAccount_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *sids = *r.out.sids;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *handle /* [in] [ref] */,
-                                     struct dom_sid2 *sid /* [in] [ref] */,
-                                     struct lsa_RightSet *rights /* [out] [ref] */)
+NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               struct dom_sid2 *sid /* [in] [ref] */,
+                               uint32_t access_mask /* [in]  */,
+                               struct policy_handle *acct_handle /* [out] [ref] */)
 {
-       struct lsa_EnumAccountRights r;
+       struct lsa_OpenAccount r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
        r.in.sid = sid;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &r);
+               NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_ENUMACCOUNTRIGHTS,
+                               NDR_LSA_OPENACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1567,7 +2970,7 @@ NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1575,34 +2978,152 @@ NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *rights = *r.out.rights;
+       *acct_handle = *r.out.acct_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *handle /* [in] [ref] */,
-                                    struct dom_sid2 *sid /* [in] [ref] */,
-                                    struct lsa_RightSet *rights /* [in] [ref] */)
+struct rpccli_lsa_EnumPrivsAccount_state {
+       struct lsa_EnumPrivsAccount orig;
+       struct lsa_EnumPrivsAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumPrivsAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumPrivsAccount_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   struct lsa_PrivilegeSet **_privs /* [out] [ref] */)
 {
-       struct lsa_AddAccountRights r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumPrivsAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumPrivsAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.sid = sid;
-       r.in.rights = rights;
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.privs = _privs;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &r);
+               NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumPrivsAccount_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_lsarpc,
+                                   NDR_LSA_ENUMPRIVSACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumPrivsAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_EnumPrivsAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumPrivsAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumPrivsAccount_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.privs = *state->tmp.out.privs;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumPrivsAccount_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumPrivsAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumPrivsAccount_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_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    struct lsa_PrivilegeSet **privs /* [out] [ref] */)
+{
+       struct lsa_EnumPrivsAccount r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_ADDACCOUNTRIGHTS,
+                               NDR_LSA_ENUMPRIVSACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1610,7 +3131,7 @@ NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1618,35 +3139,146 @@ NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *privs = *r.out.privs;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *handle /* [in] [ref] */,
-                                       struct dom_sid2 *sid /* [in] [ref] */,
-                                       uint8_t remove_all /* [in]  */,
-                                       struct lsa_RightSet *rights /* [in] [ref] */)
+struct rpccli_lsa_AddPrivilegesToAccount_state {
+       struct lsa_AddPrivilegesToAccount orig;
+       struct lsa_AddPrivilegesToAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_AddPrivilegesToAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_AddPrivilegesToAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         struct lsa_PrivilegeSet *_privs /* [in] [ref] */)
 {
-       struct lsa_RemoveAccountRights r;
+       struct tevent_req *req;
+       struct rpccli_lsa_AddPrivilegesToAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_AddPrivilegesToAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.privs = _privs;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_ADDPRIVILEGESTOACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_AddPrivilegesToAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_AddPrivilegesToAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_AddPrivilegesToAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_AddPrivilegesToAccount_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_AddPrivilegesToAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_lsa_AddPrivilegesToAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_AddPrivilegesToAccount_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_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *handle /* [in] [ref] */,
+                                          struct lsa_PrivilegeSet *privs /* [in] [ref] */)
+{
+       struct lsa_AddPrivilegesToAccount r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.sid = sid;
-       r.in.remove_all = remove_all;
-       r.in.rights = rights;
+       r.in.privs = privs;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &r);
+               NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_REMOVEACCOUNTRIGHTS,
+                               NDR_LSA_ADDPRIVILEGESTOACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1654,7 +3286,7 @@ NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1667,29 +3299,144 @@ NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
+struct rpccli_lsa_RemovePrivilegesFromAccount_state {
+       struct lsa_RemovePrivilegesFromAccount orig;
+       struct lsa_RemovePrivilegesFromAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_RemovePrivilegesFromAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_RemovePrivilegesFromAccount_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_handle /* [in] [ref] */,
+                                                              uint8_t _remove_all /* [in]  */,
+                                                              struct lsa_PrivilegeSet *_privs /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_RemovePrivilegesFromAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_RemovePrivilegesFromAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.remove_all = _remove_all;
+       state->orig.in.privs = _privs;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_RemovePrivilegesFromAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_RemovePrivilegesFromAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_RemovePrivilegesFromAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_RemovePrivilegesFromAccount_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_RemovePrivilegesFromAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_RemovePrivilegesFromAccount_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_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *handle /* [in] [ref] */,
-                                               struct dom_sid2 *dom_sid /* [in] [ref] */,
-                                               enum lsa_TrustDomInfoEnum level /* [in]  */,
-                                               union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
+                                               uint8_t remove_all /* [in]  */,
+                                               struct lsa_PrivilegeSet *privs /* [in] [unique] */)
 {
-       struct lsa_QueryTrustedDomainInfoBySid r;
+       struct lsa_RemovePrivilegesFromAccount r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.dom_sid = dom_sid;
-       r.in.level = level;
+       r.in.remove_all = remove_all;
+       r.in.privs = privs;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r);
+               NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID,
+                               NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1697,7 +3444,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1705,36 +3452,137 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        struct dom_sid2 *dom_sid /* [in] [ref] */,
-                                        enum lsa_TrustDomInfoEnum level /* [in]  */,
-                                        union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
+struct rpccli_lsa_GetQuotasForAccount_state {
+       struct lsa_GetQuotasForAccount orig;
+       struct lsa_GetQuotasForAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_GetQuotasForAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_GetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
 {
-       struct lsa_SetTrustedDomainInfo r;
+       struct tevent_req *req;
+       struct rpccli_lsa_GetQuotasForAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_GetQuotasForAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_GETQUOTASFORACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_GetQuotasForAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_GetQuotasForAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_GetQuotasForAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_GetQuotasForAccount_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_GetQuotasForAccount_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_lsa_GetQuotasForAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_GetQuotasForAccount_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_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx)
+{
+       struct lsa_GetQuotasForAccount r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.dom_sid = dom_sid;
-       r.in.level = level;
-       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &r);
+               NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_SETTRUSTEDDOMAININFO,
+                               NDR_LSA_GETQUOTASFORACCOUNT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1742,7 +3590,7 @@ NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1755,68 +3603,6437 @@ NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *handle /* [in] [ref] */,
-                                       struct dom_sid2 *dom_sid /* [in] [ref] */)
+struct rpccli_lsa_SetQuotasForAccount_state {
+       struct lsa_SetQuotasForAccount orig;
+       struct lsa_SetQuotasForAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetQuotasForAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
 {
-       struct lsa_DeleteTrustedDomain r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_SetQuotasForAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetQuotasForAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETQUOTASFORACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetQuotasForAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetQuotasForAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetQuotasForAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetQuotasForAccount_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetQuotasForAccount_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_lsa_SetQuotasForAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetQuotasForAccount_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_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx)
+{
+       struct lsa_SetQuotasForAccount r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETQUOTASFORACCOUNT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_GetSystemAccessAccount_state {
+       struct lsa_GetSystemAccessAccount orig;
+       struct lsa_GetSystemAccessAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_GetSystemAccessAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_GetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t *_access_mask /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_GetSystemAccessAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_GetSystemAccessAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.access_mask = _access_mask;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_GetSystemAccessAccount_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_lsarpc,
+                                   NDR_LSA_GETSYSTEMACCESSACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_GetSystemAccessAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_GetSystemAccessAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_GetSystemAccessAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_GetSystemAccessAccount_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.access_mask = *state->tmp.out.access_mask;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_GetSystemAccessAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_lsa_GetSystemAccessAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_GetSystemAccessAccount_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_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *handle /* [in] [ref] */,
+                                          uint32_t *access_mask /* [out] [ref] */)
+{
+       struct lsa_GetSystemAccessAccount r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_GETSYSTEMACCESSACCOUNT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *access_mask = *r.out.access_mask;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetSystemAccessAccount_state {
+       struct lsa_SetSystemAccessAccount orig;
+       struct lsa_SetSystemAccessAccount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetSystemAccessAccount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _access_mask /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetSystemAccessAccount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetSystemAccessAccount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETSYSTEMACCESSACCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetSystemAccessAccount_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetSystemAccessAccount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetSystemAccessAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetSystemAccessAccount_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetSystemAccessAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_lsa_SetSystemAccessAccount_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetSystemAccessAccount_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_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *handle /* [in] [ref] */,
+                                          uint32_t access_mask /* [in]  */)
+{
+       struct lsa_SetSystemAccessAccount r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETSYSTEMACCESSACCOUNT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_OpenTrustedDomain_state {
+       struct lsa_OpenTrustedDomain orig;
+       struct lsa_OpenTrustedDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_OpenTrustedDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_OpenTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    struct dom_sid2 *_sid /* [in] [ref] */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    struct policy_handle *_trustdom_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_OpenTrustedDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_OpenTrustedDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sid = _sid;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.trustdom_handle = _trustdom_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_OpenTrustedDomain_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_lsarpc,
+                                   NDR_LSA_OPENTRUSTEDDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_OpenTrustedDomain_done, req);
+       return req;
+}
+
+static void rpccli_lsa_OpenTrustedDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_OpenTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenTrustedDomain_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.trustdom_handle = *state->tmp.out.trustdom_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_OpenTrustedDomain_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_lsa_OpenTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenTrustedDomain_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_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *handle /* [in] [ref] */,
+                                     struct dom_sid2 *sid /* [in] [ref] */,
+                                     uint32_t access_mask /* [in]  */,
+                                     struct policy_handle *trustdom_handle /* [out] [ref] */)
+{
+       struct lsa_OpenTrustedDomain r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.sid = sid;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_OPENTRUSTEDDOMAIN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *trustdom_handle = *r.out.trustdom_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_QueryTrustedDomainInfo_state {
+       struct lsa_QueryTrustedDomainInfo orig;
+       struct lsa_QueryTrustedDomainInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QueryTrustedDomainInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QueryTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_trustdom_handle /* [in] [ref] */,
+                                                         enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                         union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QueryTrustedDomainInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QueryTrustedDomainInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.trustdom_handle = _trustdom_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QueryTrustedDomainInfo_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_lsarpc,
+                                   NDR_LSA_QUERYTRUSTEDDOMAININFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QueryTrustedDomainInfo_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QueryTrustedDomainInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QueryTrustedDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryTrustedDomainInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QueryTrustedDomainInfo_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_lsa_QueryTrustedDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryTrustedDomainInfo_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_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *trustdom_handle /* [in] [ref] */,
+                                          enum lsa_TrustDomInfoEnum level /* [in]  */,
+                                          union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct lsa_QueryTrustedDomainInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.trustdom_handle = trustdom_handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_QUERYTRUSTEDDOMAININFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetInformationTrustedDomain_state {
+       struct lsa_SetInformationTrustedDomain orig;
+       struct lsa_SetInformationTrustedDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetInformationTrustedDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetInformationTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_trustdom_handle /* [in] [ref] */,
+                                                              enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                              union lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetInformationTrustedDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetInformationTrustedDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.trustdom_handle = _trustdom_handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetInformationTrustedDomain_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetInformationTrustedDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetInformationTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetInformationTrustedDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetInformationTrustedDomain_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_SetInformationTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetInformationTrustedDomain_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_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *trustdom_handle /* [in] [ref] */,
+                                               enum lsa_TrustDomInfoEnum level /* [in]  */,
+                                               union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
+{
+       struct lsa_SetInformationTrustedDomain r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.trustdom_handle = trustdom_handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_OpenSecret_state {
+       struct lsa_OpenSecret orig;
+       struct lsa_OpenSecret tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_OpenSecret_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_OpenSecret_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct lsa_String _name /* [in]  */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_sec_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_OpenSecret_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_OpenSecret_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.sec_handle = _sec_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_OpenSecret_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_lsarpc,
+                                   NDR_LSA_OPENSECRET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_OpenSecret_done, req);
+       return req;
+}
+
+static void rpccli_lsa_OpenSecret_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_OpenSecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenSecret_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.sec_handle = *state->tmp.out.sec_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_OpenSecret_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_OpenSecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenSecret_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_lsa_OpenSecret(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *handle /* [in] [ref] */,
+                              struct lsa_String name /* [in]  */,
+                              uint32_t access_mask /* [in]  */,
+                              struct policy_handle *sec_handle /* [out] [ref] */)
+{
+       struct lsa_OpenSecret r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_OPENSECRET,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *sec_handle = *r.out.sec_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetSecret_state {
+       struct lsa_SetSecret orig;
+       struct lsa_SetSecret tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetSecret_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetSecret_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_sec_handle /* [in] [ref] */,
+                                            struct lsa_DATA_BUF *_new_val /* [in] [unique] */,
+                                            struct lsa_DATA_BUF *_old_val /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetSecret_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetSecret_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.sec_handle = _sec_handle;
+       state->orig.in.new_val = _new_val;
+       state->orig.in.old_val = _old_val;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetSecret, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETSECRET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetSecret_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetSecret_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetSecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetSecret_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetSecret_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_lsa_SetSecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetSecret_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_lsa_SetSecret(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             struct policy_handle *sec_handle /* [in] [ref] */,
+                             struct lsa_DATA_BUF *new_val /* [in] [unique] */,
+                             struct lsa_DATA_BUF *old_val /* [in] [unique] */)
+{
+       struct lsa_SetSecret r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.sec_handle = sec_handle;
+       r.in.new_val = new_val;
+       r.in.old_val = old_val;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetSecret, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETSECRET,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_QuerySecret_state {
+       struct lsa_QuerySecret orig;
+       struct lsa_QuerySecret tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QuerySecret_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QuerySecret_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_sec_handle /* [in] [ref] */,
+                                              struct lsa_DATA_BUF_PTR *_new_val /* [in,out] [unique] */,
+                                              NTTIME *_new_mtime /* [in,out] [unique] */,
+                                              struct lsa_DATA_BUF_PTR *_old_val /* [in,out] [unique] */,
+                                              NTTIME *_old_mtime /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QuerySecret_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QuerySecret_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.sec_handle = _sec_handle;
+       state->orig.in.new_val = _new_val;
+       state->orig.in.new_mtime = _new_mtime;
+       state->orig.in.old_val = _old_val;
+       state->orig.in.old_mtime = _old_mtime;
+
+       /* Out parameters */
+       state->orig.out.new_val = _new_val;
+       state->orig.out.new_mtime = _new_mtime;
+       state->orig.out.old_val = _old_val;
+       state->orig.out.old_mtime = _old_mtime;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QuerySecret_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_lsarpc,
+                                   NDR_LSA_QUERYSECRET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QuerySecret_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QuerySecret_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QuerySecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QuerySecret_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 */
+       if (state->orig.out.new_val && state->tmp.out.new_val) {
+               *state->orig.out.new_val = *state->tmp.out.new_val;
+       }
+       if (state->orig.out.new_mtime && state->tmp.out.new_mtime) {
+               *state->orig.out.new_mtime = *state->tmp.out.new_mtime;
+       }
+       if (state->orig.out.old_val && state->tmp.out.old_val) {
+               *state->orig.out.old_val = *state->tmp.out.old_val;
+       }
+       if (state->orig.out.old_mtime && state->tmp.out.old_mtime) {
+               *state->orig.out.old_mtime = *state->tmp.out.old_mtime;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QuerySecret_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_QuerySecret_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QuerySecret_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_lsa_QuerySecret(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *sec_handle /* [in] [ref] */,
+                               struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */,
+                               NTTIME *new_mtime /* [in,out] [unique] */,
+                               struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */,
+                               NTTIME *old_mtime /* [in,out] [unique] */)
+{
+       struct lsa_QuerySecret r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.sec_handle = sec_handle;
+       r.in.new_val = new_val;
+       r.in.new_mtime = new_mtime;
+       r.in.old_val = old_val;
+       r.in.old_mtime = old_mtime;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_QUERYSECRET,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (new_val && r.out.new_val) {
+               *new_val = *r.out.new_val;
+       }
+       if (new_mtime && r.out.new_mtime) {
+               *new_mtime = *r.out.new_mtime;
+       }
+       if (old_val && r.out.old_val) {
+               *old_val = *r.out.old_val;
+       }
+       if (old_mtime && r.out.old_mtime) {
+               *old_mtime = *r.out.old_mtime;
+       }
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_LookupPrivValue_state {
+       struct lsa_LookupPrivValue orig;
+       struct lsa_LookupPrivValue tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupPrivValue_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupPrivValue_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  struct lsa_String *_name /* [in] [ref] */,
+                                                  struct lsa_LUID *_luid /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupPrivValue_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupPrivValue_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+
+       /* Out parameters */
+       state->orig.out.luid = _luid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupPrivValue_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_lsarpc,
+                                   NDR_LSA_LOOKUPPRIVVALUE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupPrivValue_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupPrivValue_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupPrivValue_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupPrivValue_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.luid = *state->tmp.out.luid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupPrivValue_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupPrivValue_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupPrivValue_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_lsa_LookupPrivValue(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *handle /* [in] [ref] */,
+                                   struct lsa_String *name /* [in] [ref] */,
+                                   struct lsa_LUID *luid /* [out] [ref] */)
+{
+       struct lsa_LookupPrivValue r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_LOOKUPPRIVVALUE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *luid = *r.out.luid;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_LookupPrivName_state {
+       struct lsa_LookupPrivName orig;
+       struct lsa_LookupPrivName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupPrivName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupPrivName_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 struct lsa_LUID *_luid /* [in] [ref] */,
+                                                 struct lsa_StringLarge **_name /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupPrivName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupPrivName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.luid = _luid;
+
+       /* Out parameters */
+       state->orig.out.name = _name;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupPrivName_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_lsarpc,
+                                   NDR_LSA_LOOKUPPRIVNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupPrivName_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupPrivName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupPrivName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupPrivName_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.name = *state->tmp.out.name;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupPrivName_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupPrivName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupPrivName_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_lsa_LookupPrivName(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *handle /* [in] [ref] */,
+                                  struct lsa_LUID *luid /* [in] [ref] */,
+                                  struct lsa_StringLarge **name /* [out] [ref] */)
+{
+       struct lsa_LookupPrivName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.luid = luid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_LOOKUPPRIVNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *name = *r.out.name;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_LookupPrivDisplayName_state {
+       struct lsa_LookupPrivDisplayName orig;
+       struct lsa_LookupPrivDisplayName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupPrivDisplayName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupPrivDisplayName_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        struct lsa_String *_name /* [in] [ref] */,
+                                                        uint16_t _language_id /* [in]  */,
+                                                        uint16_t _language_id_sys /* [in]  */,
+                                                        struct lsa_StringLarge **_disp_name /* [out] [ref] */,
+                                                        uint16_t *_returned_language_id /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupPrivDisplayName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupPrivDisplayName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.language_id = _language_id;
+       state->orig.in.language_id_sys = _language_id_sys;
+
+       /* Out parameters */
+       state->orig.out.disp_name = _disp_name;
+       state->orig.out.returned_language_id = _returned_language_id;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupPrivDisplayName_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_lsarpc,
+                                   NDR_LSA_LOOKUPPRIVDISPLAYNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupPrivDisplayName_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupPrivDisplayName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupPrivDisplayName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupPrivDisplayName_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.disp_name = *state->tmp.out.disp_name;
+       *state->orig.out.returned_language_id = *state->tmp.out.returned_language_id;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupPrivDisplayName_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupPrivDisplayName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupPrivDisplayName_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_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in] [ref] */,
+                                         struct lsa_String *name /* [in] [ref] */,
+                                         uint16_t language_id /* [in]  */,
+                                         uint16_t language_id_sys /* [in]  */,
+                                         struct lsa_StringLarge **disp_name /* [out] [ref] */,
+                                         uint16_t *returned_language_id /* [out] [ref] */)
+{
+       struct lsa_LookupPrivDisplayName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.language_id = language_id;
+       r.in.language_id_sys = language_id_sys;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_LOOKUPPRIVDISPLAYNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *disp_name = *r.out.disp_name;
+       *returned_language_id = *r.out.returned_language_id;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_DeleteObject_state {
+       struct lsa_DeleteObject orig;
+       struct lsa_DeleteObject tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_DeleteObject_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_DeleteObject_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_DeleteObject_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_DeleteObject_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_DeleteObject_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_lsarpc,
+                                   NDR_LSA_DELETEOBJECT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_DeleteObject_done, req);
+       return req;
+}
+
+static void rpccli_lsa_DeleteObject_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_DeleteObject_state *state = tevent_req_data(
+               req, struct rpccli_lsa_DeleteObject_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_DeleteObject_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_DeleteObject_state *state = tevent_req_data(
+               req, struct rpccli_lsa_DeleteObject_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_lsa_DeleteObject(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *handle /* [in,out] [ref] */)
+{
+       struct lsa_DeleteObject r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_DELETEOBJECT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_EnumAccountsWithUserRight_state {
+       struct lsa_EnumAccountsWithUserRight orig;
+       struct lsa_EnumAccountsWithUserRight tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumAccountsWithUserRight_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumAccountsWithUserRight_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_handle /* [in] [ref] */,
+                                                            struct lsa_String *_name /* [in] [unique] */,
+                                                            struct lsa_SidArray *_sids /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumAccountsWithUserRight_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumAccountsWithUserRight_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+
+       /* Out parameters */
+       state->orig.out.sids = _sids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumAccountsWithUserRight_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_lsarpc,
+                                   NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumAccountsWithUserRight_done, req);
+       return req;
+}
+
+static void rpccli_lsa_EnumAccountsWithUserRight_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumAccountsWithUserRight_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumAccountsWithUserRight_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);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumAccountsWithUserRight_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumAccountsWithUserRight_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumAccountsWithUserRight_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_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct policy_handle *handle /* [in] [ref] */,
+                                             struct lsa_String *name /* [in] [unique] */,
+                                             struct lsa_SidArray *sids /* [out] [ref] */)
+{
+       struct lsa_EnumAccountsWithUserRight r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *sids = *r.out.sids;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_EnumAccountRights_state {
+       struct lsa_EnumAccountRights orig;
+       struct lsa_EnumAccountRights tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumAccountRights_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumAccountRights_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    struct dom_sid2 *_sid /* [in] [ref] */,
+                                                    struct lsa_RightSet *_rights /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumAccountRights_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumAccountRights_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sid = _sid;
+
+       /* Out parameters */
+       state->orig.out.rights = _rights;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumAccountRights_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_lsarpc,
+                                   NDR_LSA_ENUMACCOUNTRIGHTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumAccountRights_done, req);
+       return req;
+}
+
+static void rpccli_lsa_EnumAccountRights_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumAccountRights_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumAccountRights_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.rights = *state->tmp.out.rights;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumAccountRights_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumAccountRights_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumAccountRights_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_lsa_EnumAccountRights(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *handle /* [in] [ref] */,
+                                     struct dom_sid2 *sid /* [in] [ref] */,
+                                     struct lsa_RightSet *rights /* [out] [ref] */)
+{
+       struct lsa_EnumAccountRights r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.sid = sid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_ENUMACCOUNTRIGHTS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *rights = *r.out.rights;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_AddAccountRights_state {
+       struct lsa_AddAccountRights orig;
+       struct lsa_AddAccountRights tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_AddAccountRights_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_AddAccountRights_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   struct dom_sid2 *_sid /* [in] [ref] */,
+                                                   struct lsa_RightSet *_rights /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_AddAccountRights_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_AddAccountRights_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sid = _sid;
+       state->orig.in.rights = _rights;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_ADDACCOUNTRIGHTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_AddAccountRights_done, req);
+       return req;
+}
+
+static void rpccli_lsa_AddAccountRights_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_AddAccountRights_state *state = tevent_req_data(
+               req, struct rpccli_lsa_AddAccountRights_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_AddAccountRights_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_lsa_AddAccountRights_state *state = tevent_req_data(
+               req, struct rpccli_lsa_AddAccountRights_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_lsa_AddAccountRights(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    struct dom_sid2 *sid /* [in] [ref] */,
+                                    struct lsa_RightSet *rights /* [in] [ref] */)
+{
+       struct lsa_AddAccountRights r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.sid = sid;
+       r.in.rights = rights;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_ADDACCOUNTRIGHTS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_RemoveAccountRights_state {
+       struct lsa_RemoveAccountRights orig;
+       struct lsa_RemoveAccountRights tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_RemoveAccountRights_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_RemoveAccountRights_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct dom_sid2 *_sid /* [in] [ref] */,
+                                                      uint8_t _remove_all /* [in]  */,
+                                                      struct lsa_RightSet *_rights /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_RemoveAccountRights_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_RemoveAccountRights_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sid = _sid;
+       state->orig.in.remove_all = _remove_all;
+       state->orig.in.rights = _rights;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_REMOVEACCOUNTRIGHTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_RemoveAccountRights_done, req);
+       return req;
+}
+
+static void rpccli_lsa_RemoveAccountRights_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_RemoveAccountRights_state *state = tevent_req_data(
+               req, struct rpccli_lsa_RemoveAccountRights_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_RemoveAccountRights_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_lsa_RemoveAccountRights_state *state = tevent_req_data(
+               req, struct rpccli_lsa_RemoveAccountRights_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_lsa_RemoveAccountRights(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct dom_sid2 *sid /* [in] [ref] */,
+                                       uint8_t remove_all /* [in]  */,
+                                       struct lsa_RightSet *rights /* [in] [ref] */)
+{
+       struct lsa_RemoveAccountRights r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.sid = sid;
+       r.in.remove_all = remove_all;
+       r.in.rights = rights;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_REMOVEACCOUNTRIGHTS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_QueryTrustedDomainInfoBySid_state {
+       struct lsa_QueryTrustedDomainInfoBySid orig;
+       struct lsa_QueryTrustedDomainInfoBySid tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QueryTrustedDomainInfoBySid_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QueryTrustedDomainInfoBySid_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_handle /* [in] [ref] */,
+                                                              struct dom_sid2 *_dom_sid /* [in] [ref] */,
+                                                              enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                              union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QueryTrustedDomainInfoBySid_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QueryTrustedDomainInfoBySid_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.dom_sid = _dom_sid;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QueryTrustedDomainInfoBySid_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_lsarpc,
+                                   NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QueryTrustedDomainInfoBySid_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QueryTrustedDomainInfoBySid_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QueryTrustedDomainInfoBySid_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryTrustedDomainInfoBySid_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_QueryTrustedDomainInfoBySid_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryTrustedDomainInfoBySid_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_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *handle /* [in] [ref] */,
+                                               struct dom_sid2 *dom_sid /* [in] [ref] */,
+                                               enum lsa_TrustDomInfoEnum level /* [in]  */,
+                                               union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct lsa_QueryTrustedDomainInfoBySid r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.dom_sid = dom_sid;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetTrustedDomainInfo_state {
+       struct lsa_SetTrustedDomainInfo orig;
+       struct lsa_SetTrustedDomainInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetTrustedDomainInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       struct dom_sid2 *_dom_sid /* [in] [ref] */,
+                                                       enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                       union lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetTrustedDomainInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetTrustedDomainInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.dom_sid = _dom_sid;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETTRUSTEDDOMAININFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetTrustedDomainInfo_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetTrustedDomainInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetTrustedDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetTrustedDomainInfo_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetTrustedDomainInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_lsa_SetTrustedDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetTrustedDomainInfo_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_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        struct dom_sid2 *dom_sid /* [in] [ref] */,
+                                        enum lsa_TrustDomInfoEnum level /* [in]  */,
+                                        union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
+{
+       struct lsa_SetTrustedDomainInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.dom_sid = dom_sid;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETTRUSTEDDOMAININFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_DeleteTrustedDomain_state {
+       struct lsa_DeleteTrustedDomain orig;
+       struct lsa_DeleteTrustedDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_DeleteTrustedDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_DeleteTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct dom_sid2 *_dom_sid /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_DeleteTrustedDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_DeleteTrustedDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.dom_sid = _dom_sid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_DELETETRUSTEDDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_DeleteTrustedDomain_done, req);
+       return req;
+}
+
+static void rpccli_lsa_DeleteTrustedDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_DeleteTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_DeleteTrustedDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_DeleteTrustedDomain_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_lsa_DeleteTrustedDomain_state *state = tevent_req_data(
+               req, struct rpccli_lsa_DeleteTrustedDomain_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_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct dom_sid2 *dom_sid /* [in] [ref] */)
+{
+       struct lsa_DeleteTrustedDomain r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.dom_sid = dom_sid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_DELETETRUSTEDDOMAIN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_StorePrivateData_state {
+       struct lsa_StorePrivateData orig;
+       struct lsa_StorePrivateData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_StorePrivateData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_StorePrivateData_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   struct lsa_String *_name /* [in] [ref] */,
+                                                   struct lsa_DATA_BUF *_val /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_StorePrivateData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_StorePrivateData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.val = _val;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_STOREPRIVATEDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_StorePrivateData_done, req);
+       return req;
+}
+
+static void rpccli_lsa_StorePrivateData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_StorePrivateData_state *state = tevent_req_data(
+               req, struct rpccli_lsa_StorePrivateData_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_StorePrivateData_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_lsa_StorePrivateData_state *state = tevent_req_data(
+               req, struct rpccli_lsa_StorePrivateData_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_lsa_StorePrivateData(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    struct lsa_String *name /* [in] [ref] */,
+                                    struct lsa_DATA_BUF *val /* [in] [unique] */)
+{
+       struct lsa_StorePrivateData r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.val = val;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_STOREPRIVATEDATA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_RetrievePrivateData_state {
+       struct lsa_RetrievePrivateData orig;
+       struct lsa_RetrievePrivateData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_RetrievePrivateData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_RetrievePrivateData_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct lsa_String *_name /* [in] [ref] */,
+                                                      struct lsa_DATA_BUF **_val /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_RetrievePrivateData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_RetrievePrivateData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.val = _val;
+
+       /* Out parameters */
+       state->orig.out.val = _val;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_RetrievePrivateData_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_lsarpc,
+                                   NDR_LSA_RETRIEVEPRIVATEDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_RetrievePrivateData_done, req);
+       return req;
+}
+
+static void rpccli_lsa_RetrievePrivateData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_RetrievePrivateData_state *state = tevent_req_data(
+               req, struct rpccli_lsa_RetrievePrivateData_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.val = *state->tmp.out.val;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_RetrievePrivateData_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_lsa_RetrievePrivateData_state *state = tevent_req_data(
+               req, struct rpccli_lsa_RetrievePrivateData_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_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct lsa_String *name /* [in] [ref] */,
+                                       struct lsa_DATA_BUF **val /* [in,out] [ref] */)
+{
+       struct lsa_RetrievePrivateData r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.val = val;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_RETRIEVEPRIVATEDATA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *val = *r.out.val;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_OpenPolicy2_state {
+       struct lsa_OpenPolicy2 orig;
+       struct lsa_OpenPolicy2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_OpenPolicy2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_OpenPolicy2_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                              struct lsa_ObjectAttribute *_attr /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_OpenPolicy2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_OpenPolicy2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.attr = _attr;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_OpenPolicy2_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_lsarpc,
+                                   NDR_LSA_OPENPOLICY2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_OpenPolicy2_done, req);
+       return req;
+}
+
+static void rpccli_lsa_OpenPolicy2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_OpenPolicy2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenPolicy2_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_OpenPolicy2_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_OpenPolicy2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenPolicy2_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_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               const char *system_name /* [in] [unique,charset(UTF16)] */,
+                               struct lsa_ObjectAttribute *attr /* [in] [ref] */,
+                               uint32_t access_mask /* [in]  */,
+                               struct policy_handle *handle /* [out] [ref] */)
+{
+       struct lsa_OpenPolicy2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.system_name = system_name;
+       r.in.attr = attr;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_OPENPOLICY2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_GetUserName_state {
+       struct lsa_GetUserName orig;
+       struct lsa_GetUserName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_GetUserName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_GetUserName_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                              struct lsa_String **_account_name /* [in,out] [ref] */,
+                                              struct lsa_String **_authority_name /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_GetUserName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_GetUserName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.authority_name = _authority_name;
+
+       /* Out parameters */
+       state->orig.out.account_name = _account_name;
+       state->orig.out.authority_name = _authority_name;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_GetUserName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_GetUserName_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_lsarpc,
+                                   NDR_LSA_GETUSERNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_GetUserName_done, req);
+       return req;
+}
+
+static void rpccli_lsa_GetUserName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_GetUserName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_GetUserName_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.account_name = *state->tmp.out.account_name;
+       if (state->orig.out.authority_name && state->tmp.out.authority_name) {
+               *state->orig.out.authority_name = *state->tmp.out.authority_name;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_GetUserName_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_GetUserName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_GetUserName_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_lsa_GetUserName(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               const char *system_name /* [in] [unique,charset(UTF16)] */,
+                               struct lsa_String **account_name /* [in,out] [ref] */,
+                               struct lsa_String **authority_name /* [in,out] [unique] */)
+{
+       struct lsa_GetUserName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.system_name = system_name;
+       r.in.account_name = account_name;
+       r.in.authority_name = authority_name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_GetUserName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_GETUSERNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *account_name = *r.out.account_name;
+       if (authority_name && r.out.authority_name) {
+               *authority_name = *r.out.authority_name;
+       }
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_QueryInfoPolicy2_state {
+       struct lsa_QueryInfoPolicy2 orig;
+       struct lsa_QueryInfoPolicy2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QueryInfoPolicy2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QueryInfoPolicy2_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   enum lsa_PolicyInfo _level /* [in]  */,
+                                                   union lsa_PolicyInformation **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QueryInfoPolicy2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QueryInfoPolicy2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QueryInfoPolicy2_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_lsarpc,
+                                   NDR_LSA_QUERYINFOPOLICY2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QueryInfoPolicy2_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QueryInfoPolicy2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QueryInfoPolicy2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryInfoPolicy2_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QueryInfoPolicy2_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_lsa_QueryInfoPolicy2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryInfoPolicy2_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_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    enum lsa_PolicyInfo level /* [in]  */,
+                                    union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */)
+{
+       struct lsa_QueryInfoPolicy2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_QUERYINFOPOLICY2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetInfoPolicy2_state {
+       struct lsa_SetInfoPolicy2 orig;
+       struct lsa_SetInfoPolicy2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetInfoPolicy2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetInfoPolicy2_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 enum lsa_PolicyInfo _level /* [in]  */,
+                                                 union lsa_PolicyInformation *_info /* [in] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetInfoPolicy2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetInfoPolicy2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETINFOPOLICY2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetInfoPolicy2_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetInfoPolicy2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetInfoPolicy2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetInfoPolicy2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetInfoPolicy2_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_lsa_SetInfoPolicy2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetInfoPolicy2_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_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *handle /* [in] [ref] */,
+                                  enum lsa_PolicyInfo level /* [in]  */,
+                                  union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */)
+{
+       struct lsa_SetInfoPolicy2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETINFOPOLICY2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_QueryTrustedDomainInfoByName_state {
+       struct lsa_QueryTrustedDomainInfoByName orig;
+       struct lsa_QueryTrustedDomainInfoByName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QueryTrustedDomainInfoByName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QueryTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               struct policy_handle *_handle /* [in] [ref] */,
+                                                               struct lsa_String *_trusted_domain /* [in] [ref] */,
+                                                               enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                               union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QueryTrustedDomainInfoByName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QueryTrustedDomainInfoByName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.trusted_domain = _trusted_domain;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QueryTrustedDomainInfoByName_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_lsarpc,
+                                   NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QueryTrustedDomainInfoByName_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QueryTrustedDomainInfoByName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QueryTrustedDomainInfoByName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryTrustedDomainInfoByName_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_QueryTrustedDomainInfoByName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryTrustedDomainInfoByName_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_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                struct policy_handle *handle /* [in] [ref] */,
+                                                struct lsa_String *trusted_domain /* [in] [ref] */,
+                                                enum lsa_TrustDomInfoEnum level /* [in]  */,
+                                                union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct lsa_QueryTrustedDomainInfoByName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.trusted_domain = trusted_domain;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetTrustedDomainInfoByName_state {
+       struct lsa_SetTrustedDomainInfoByName orig;
+       struct lsa_SetTrustedDomainInfoByName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetTrustedDomainInfoByName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             struct lsa_String _trusted_domain /* [in]  */,
+                                                             enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                             union lsa_TrustedDomainInfo *_info /* [in] [unique,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetTrustedDomainInfoByName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetTrustedDomainInfoByName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.trusted_domain = _trusted_domain;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETTRUSTEDDOMAININFOBYNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetTrustedDomainInfoByName_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetTrustedDomainInfoByName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetTrustedDomainInfoByName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetTrustedDomainInfoByName_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_SetTrustedDomainInfoByName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetTrustedDomainInfoByName_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_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *handle /* [in] [ref] */,
+                                              struct lsa_String trusted_domain /* [in]  */,
+                                              enum lsa_TrustDomInfoEnum level /* [in]  */,
+                                              union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */)
+{
+       struct lsa_SetTrustedDomainInfoByName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.trusted_domain = trusted_domain;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETTRUSTEDDOMAININFOBYNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_EnumTrustedDomainsEx_state {
+       struct lsa_EnumTrustedDomainsEx orig;
+       struct lsa_EnumTrustedDomainsEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_EnumTrustedDomainsEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_EnumTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                       struct lsa_DomainListEx *_domains /* [out] [ref] */,
+                                                       uint32_t _max_size /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_EnumTrustedDomainsEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_EnumTrustedDomainsEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.max_size = _max_size;
+
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.domains = _domains;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_EnumTrustedDomainsEx_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_lsarpc,
+                                   NDR_LSA_ENUMTRUSTEDDOMAINSEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_EnumTrustedDomainsEx_done, req);
+       return req;
+}
+
+static void rpccli_lsa_EnumTrustedDomainsEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_EnumTrustedDomainsEx_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumTrustedDomainsEx_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.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.domains = *state->tmp.out.domains;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_EnumTrustedDomainsEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_lsa_EnumTrustedDomainsEx_state *state = tevent_req_data(
+               req, struct rpccli_lsa_EnumTrustedDomainsEx_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_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        uint32_t *resume_handle /* [in,out] [ref] */,
+                                        struct lsa_DomainListEx *domains /* [out] [ref] */,
+                                        uint32_t max_size /* [in]  */)
+{
+       struct lsa_EnumTrustedDomainsEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.resume_handle = resume_handle;
+       r.in.max_size = max_size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_ENUMTRUSTEDDOMAINSEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *resume_handle = *r.out.resume_handle;
+       *domains = *r.out.domains;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_CreateTrustedDomainEx_state {
+       struct lsa_CreateTrustedDomainEx orig;
+       struct lsa_CreateTrustedDomainEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CreateTrustedDomainEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CreateTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_policy_handle /* [in] [ref] */,
+                                                        struct lsa_TrustDomainInfoInfoEx *_info /* [in] [ref] */,
+                                                        struct lsa_TrustDomainInfoAuthInfoInternal *_auth_info /* [in] [ref] */,
+                                                        uint32_t _access_mask /* [in]  */,
+                                                        struct policy_handle *_trustdom_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_CreateTrustedDomainEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CreateTrustedDomainEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.policy_handle = _policy_handle;
+       state->orig.in.info = _info;
+       state->orig.in.auth_info = _auth_info;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.trustdom_handle = _trustdom_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_CreateTrustedDomainEx_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_lsarpc,
+                                   NDR_LSA_CREATETRUSTEDDOMAINEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CreateTrustedDomainEx_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CreateTrustedDomainEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CreateTrustedDomainEx_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateTrustedDomainEx_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.trustdom_handle = *state->tmp.out.trustdom_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CreateTrustedDomainEx_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result)
+{
+       struct rpccli_lsa_CreateTrustedDomainEx_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateTrustedDomainEx_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_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *policy_handle /* [in] [ref] */,
+                                         struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
+                                         struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
+                                         uint32_t access_mask /* [in]  */,
+                                         struct policy_handle *trustdom_handle /* [out] [ref] */)
+{
+       struct lsa_CreateTrustedDomainEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.policy_handle = policy_handle;
+       r.in.info = info;
+       r.in.auth_info = auth_info;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_CREATETRUSTEDDOMAINEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *trustdom_handle = *r.out.trustdom_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_CloseTrustedDomainEx_state {
+       struct lsa_CloseTrustedDomainEx orig;
+       struct lsa_CloseTrustedDomainEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CloseTrustedDomainEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CloseTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_CloseTrustedDomainEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CloseTrustedDomainEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_CloseTrustedDomainEx_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_lsarpc,
+                                   NDR_LSA_CLOSETRUSTEDDOMAINEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CloseTrustedDomainEx_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CloseTrustedDomainEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CloseTrustedDomainEx_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CloseTrustedDomainEx_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CloseTrustedDomainEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_lsa_CloseTrustedDomainEx_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CloseTrustedDomainEx_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_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in,out] [ref] */)
+{
+       struct lsa_CloseTrustedDomainEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_CLOSETRUSTEDDOMAINEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_QueryDomainInformationPolicy_state {
+       struct lsa_QueryDomainInformationPolicy orig;
+       struct lsa_QueryDomainInformationPolicy tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_QueryDomainInformationPolicy_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_QueryDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               struct policy_handle *_handle /* [in] [ref] */,
+                                                               uint16_t _level /* [in]  */,
+                                                               union lsa_DomainInformationPolicy **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_QueryDomainInformationPolicy_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_QueryDomainInformationPolicy_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_QueryDomainInformationPolicy_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_lsarpc,
+                                   NDR_LSA_QUERYDOMAININFORMATIONPOLICY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_QueryDomainInformationPolicy_done, req);
+       return req;
+}
+
+static void rpccli_lsa_QueryDomainInformationPolicy_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_QueryDomainInformationPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryDomainInformationPolicy_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_QueryDomainInformationPolicy_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_QueryDomainInformationPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_QueryDomainInformationPolicy_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_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                struct policy_handle *handle /* [in] [ref] */,
+                                                uint16_t level /* [in]  */,
+                                                union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */)
+{
+       struct lsa_QueryDomainInformationPolicy r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_QUERYDOMAININFORMATIONPOLICY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_SetDomainInformationPolicy_state {
+       struct lsa_SetDomainInformationPolicy orig;
+       struct lsa_SetDomainInformationPolicy tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_SetDomainInformationPolicy_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_SetDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             uint16_t _level /* [in]  */,
+                                                             union lsa_DomainInformationPolicy *_info /* [in] [unique,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_SetDomainInformationPolicy_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_SetDomainInformationPolicy_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_SETDOMAININFORMATIONPOLICY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_SetDomainInformationPolicy_done, req);
+       return req;
+}
+
+static void rpccli_lsa_SetDomainInformationPolicy_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_SetDomainInformationPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetDomainInformationPolicy_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_SetDomainInformationPolicy_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_SetDomainInformationPolicy_state *state = tevent_req_data(
+               req, struct rpccli_lsa_SetDomainInformationPolicy_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_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *handle /* [in] [ref] */,
+                                              uint16_t level /* [in]  */,
+                                              union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */)
+{
+       struct lsa_SetDomainInformationPolicy r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_SETDOMAININFORMATIONPOLICY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_OpenTrustedDomainByName_state {
+       struct lsa_OpenTrustedDomainByName orig;
+       struct lsa_OpenTrustedDomainByName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_OpenTrustedDomainByName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_OpenTrustedDomainByName_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          struct lsa_String _name /* [in]  */,
+                                                          uint32_t _access_mask /* [in]  */,
+                                                          struct policy_handle *_trustdom_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_OpenTrustedDomainByName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_OpenTrustedDomainByName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.trustdom_handle = _trustdom_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_OpenTrustedDomainByName_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_lsarpc,
+                                   NDR_LSA_OPENTRUSTEDDOMAINBYNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_OpenTrustedDomainByName_done, req);
+       return req;
+}
+
+static void rpccli_lsa_OpenTrustedDomainByName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_OpenTrustedDomainByName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenTrustedDomainByName_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.trustdom_handle = *state->tmp.out.trustdom_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_OpenTrustedDomainByName_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result)
+{
+       struct rpccli_lsa_OpenTrustedDomainByName_state *state = tevent_req_data(
+               req, struct rpccli_lsa_OpenTrustedDomainByName_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_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           struct policy_handle *handle /* [in] [ref] */,
+                                           struct lsa_String name /* [in]  */,
+                                           uint32_t access_mask /* [in]  */,
+                                           struct policy_handle *trustdom_handle /* [out] [ref] */)
+{
+       struct lsa_OpenTrustedDomainByName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_OPENTRUSTEDDOMAINBYNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *trustdom_handle = *r.out.trustdom_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_TestCall_state {
+       struct lsa_TestCall orig;
+       struct lsa_TestCall tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_TestCall_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_TestCall_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_TestCall_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_TestCall_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_TestCall, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_TESTCALL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_TestCall_done, req);
+       return req;
+}
+
+static void rpccli_lsa_TestCall_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_TestCall_state *state = tevent_req_data(
+               req, struct rpccli_lsa_TestCall_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_TestCall, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_TestCall_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 NTSTATUS *result)
+{
+       struct rpccli_lsa_TestCall_state *state = tevent_req_data(
+               req, struct rpccli_lsa_TestCall_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_lsa_TestCall(struct rpc_pipe_client *cli,
+                            TALLOC_CTX *mem_ctx)
+{
+       struct lsa_TestCall r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_TestCall, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_TESTCALL,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_TestCall, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_LookupSids2_state {
+       struct lsa_LookupSids2 orig;
+       struct lsa_LookupSids2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupSids2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupSids2_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              struct lsa_SidArray *_sids /* [in] [ref] */,
+                                              struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                              struct lsa_TransNameArray2 *_names /* [in,out] [ref] */,
+                                              uint16_t _level /* [in]  */,
+                                              uint32_t *_count /* [in,out] [ref] */,
+                                              uint32_t _unknown1 /* [in]  */,
+                                              uint32_t _unknown2 /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupSids2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupSids2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sids = _sids;
+       state->orig.in.names = _names;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
+       state->orig.in.unknown1 = _unknown1;
+       state->orig.in.unknown2 = _unknown2;
+
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.names = _names;
+       state->orig.out.count = _count;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupSids2_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_lsarpc,
+                                   NDR_LSA_LOOKUPSIDS2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupSids2_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupSids2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupSids2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupSids2_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.domains = *state->tmp.out.domains;
+       *state->orig.out.names = *state->tmp.out.names;
+       *state->orig.out.count = *state->tmp.out.count;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupSids2_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupSids2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupSids2_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_lsa_LookupSids2(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               struct lsa_SidArray *sids /* [in] [ref] */,
+                               struct lsa_RefDomainList **domains /* [out] [ref] */,
+                               struct lsa_TransNameArray2 *names /* [in,out] [ref] */,
+                               uint16_t level /* [in]  */,
+                               uint32_t *count /* [in,out] [ref] */,
+                               uint32_t unknown1 /* [in]  */,
+                               uint32_t unknown2 /* [in]  */)
+{
+       struct lsa_LookupSids2 r;
+       NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.dom_sid = dom_sid;
+       r.in.sids = sids;
+       r.in.names = names;
+       r.in.level = level;
+       r.in.count = count;
+       r.in.unknown1 = unknown1;
+       r.in.unknown2 = unknown2;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_LOOKUPSIDS2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *domains = *r.out.domains;
+       *names = *r.out.names;
+       *count = *r.out.count;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_LookupNames2_state {
+       struct lsa_LookupNames2 orig;
+       struct lsa_LookupNames2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupNames2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupNames2_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                               struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                               struct lsa_TransSidArray2 *_sids /* [in,out] [ref] */,
+                                               enum lsa_LookupNamesLevel _level /* [in]  */,
+                                               uint32_t *_count /* [in,out] [ref] */,
+                                               uint32_t _lookup_options /* [in]  */,
+                                               uint32_t _client_revision /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupNames2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupNames2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.num_names = _num_names;
+       state->orig.in.names = _names;
+       state->orig.in.sids = _sids;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
+       state->orig.in.lookup_options = _lookup_options;
+       state->orig.in.client_revision = _client_revision;
+
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.sids = _sids;
+       state->orig.out.count = _count;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupNames2_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_lsarpc,
+                                   NDR_LSA_LOOKUPNAMES2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupNames2_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupNames2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupNames2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames2_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.domains = *state->tmp.out.domains;
+       *state->orig.out.sids = *state->tmp.out.sids;
+       *state->orig.out.count = *state->tmp.out.count;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupNames2_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupNames2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames2_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_lsa_LookupNames2(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *handle /* [in] [ref] */,
+                                uint32_t num_names /* [in] [range(0,1000)] */,
+                                struct lsa_String *names /* [in] [size_is(num_names)] */,
+                                struct lsa_RefDomainList **domains /* [out] [ref] */,
+                                struct lsa_TransSidArray2 *sids /* [in,out] [ref] */,
+                                enum lsa_LookupNamesLevel level /* [in]  */,
+                                uint32_t *count /* [in,out] [ref] */,
+                                uint32_t lookup_options /* [in]  */,
+                                uint32_t client_revision /* [in]  */)
+{
+       struct lsa_LookupNames2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.num_names = num_names;
+       r.in.names = names;
+       r.in.sids = sids;
+       r.in.level = level;
+       r.in.count = count;
+       r.in.lookup_options = lookup_options;
+       r.in.client_revision = client_revision;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_LOOKUPNAMES2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *domains = *r.out.domains;
+       *sids = *r.out.sids;
+       *count = *r.out.count;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_CreateTrustedDomainEx2_state {
+       struct lsa_CreateTrustedDomainEx2 orig;
+       struct lsa_CreateTrustedDomainEx2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CreateTrustedDomainEx2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CreateTrustedDomainEx2_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_policy_handle /* [in] [ref] */,
+                                                         struct lsa_TrustDomainInfoInfoEx *_info /* [in] [ref] */,
+                                                         struct lsa_TrustDomainInfoAuthInfoInternal *_auth_info /* [in] [ref] */,
+                                                         uint32_t _access_mask /* [in]  */,
+                                                         struct policy_handle *_trustdom_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_CreateTrustedDomainEx2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CreateTrustedDomainEx2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.policy_handle = _policy_handle;
+       state->orig.in.info = _info;
+       state->orig.in.auth_info = _auth_info;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.trustdom_handle = _trustdom_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_CreateTrustedDomainEx2_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_lsarpc,
+                                   NDR_LSA_CREATETRUSTEDDOMAINEX2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CreateTrustedDomainEx2_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CreateTrustedDomainEx2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CreateTrustedDomainEx2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateTrustedDomainEx2_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.trustdom_handle = *state->tmp.out.trustdom_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CreateTrustedDomainEx2_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_lsa_CreateTrustedDomainEx2_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CreateTrustedDomainEx2_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_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *policy_handle /* [in] [ref] */,
+                                          struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
+                                          struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
+                                          uint32_t access_mask /* [in]  */,
+                                          struct policy_handle *trustdom_handle /* [out] [ref] */)
+{
+       struct lsa_CreateTrustedDomainEx2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.policy_handle = policy_handle;
+       r.in.info = info;
+       r.in.auth_info = auth_info;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_lsarpc,
+                               NDR_LSA_CREATETRUSTEDDOMAINEX2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *trustdom_handle = *r.out.trustdom_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_lsa_CREDRWRITE_state {
+       struct lsa_CREDRWRITE orig;
+       struct lsa_CREDRWRITE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRWRITE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRWRITE_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRWRITE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRWRITE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRWRITE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRWRITE_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRWRITE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRWRITE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRWRITE_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_DELETETRUSTEDDOMAIN,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRWRITE_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRWRITE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRWRITE_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *handle /* [in] [ref] */,
-                                    struct lsa_String *name /* [in] [ref] */,
-                                    struct lsa_DATA_BUF *val /* [in] [unique] */)
+NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx)
 {
-       struct lsa_StorePrivateData r;
+       struct lsa_CREDRWRITE r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
-       r.in.val = val;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_STOREPRIVATEDATA,
+                               NDR_LSA_CREDRWRITE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1824,7 +10041,7 @@ NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1837,72 +10054,132 @@ NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *handle /* [in] [ref] */,
-                                       struct lsa_String *name /* [in] [ref] */,
-                                       struct lsa_DATA_BUF **val /* [in,out] [ref] */)
+struct rpccli_lsa_CREDRREAD_state {
+       struct lsa_CREDRREAD orig;
+       struct lsa_CREDRREAD tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRREAD_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRREAD_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli)
 {
-       struct lsa_RetrievePrivateData r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRREAD_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRREAD_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
-       r.in.val = val;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_RETRIEVEPRIVATEDATA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRREAD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRREAD_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRREAD_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRREAD_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRREAD_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRREAD_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRREAD_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRREAD_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *val = *r.out.val;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               const char *system_name /* [in] [unique,charset(UTF16)] */,
-                               struct lsa_ObjectAttribute *attr /* [in] [ref] */,
-                               uint32_t access_mask /* [in]  */,
-                               struct policy_handle *handle /* [out] [ref] */)
+NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx)
 {
-       struct lsa_OpenPolicy2 r;
+       struct lsa_CREDRREAD r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.system_name = system_name;
-       r.in.attr = attr;
-       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_OPENPOLICY2,
+                               NDR_LSA_CREDRREAD,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1910,7 +10187,7 @@ NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1918,79 +10195,137 @@ NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               const char *system_name /* [in] [unique,charset(UTF16)] */,
-                               struct lsa_String **account_name /* [in,out] [ref] */,
-                               struct lsa_String **authority_name /* [in,out] [unique] */)
+struct rpccli_lsa_CREDRENUMERATE_state {
+       struct lsa_CREDRENUMERATE orig;
+       struct lsa_CREDRENUMERATE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRENUMERATE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRENUMERATE_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
 {
-       struct lsa_GetUserName r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRENUMERATE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRENUMERATE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.system_name = system_name;
-       r.in.account_name = account_name;
-       r.in.authority_name = authority_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_GetUserName, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_GETUSERNAME,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRENUMERATE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRENUMERATE_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRENUMERATE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRENUMERATE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRENUMERATE_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRENUMERATE_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRENUMERATE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRENUMERATE_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *account_name = *r.out.account_name;
-       if (authority_name && r.out.authority_name) {
-               *authority_name = *r.out.authority_name;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *handle /* [in] [ref] */,
-                                    enum lsa_PolicyInfo level /* [in]  */,
-                                    union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */)
+NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx)
 {
-       struct lsa_QueryInfoPolicy2 r;
+       struct lsa_CREDRENUMERATE r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_QUERYINFOPOLICY2,
+                               NDR_LSA_CREDRENUMERATE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1998,7 +10333,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2006,77 +10341,137 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct policy_handle *handle /* [in] [ref] */,
-                                  enum lsa_PolicyInfo level /* [in]  */,
-                                  union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */)
+struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state {
+       struct lsa_CREDRWRITEDOMAINCREDENTIALS orig;
+       struct lsa_CREDRWRITEDOMAINCREDENTIALS tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli)
 {
-       struct lsa_SetInfoPolicy2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
-       r.in.info = info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETINFOPOLICY2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRWRITEDOMAINCREDENTIALS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_done, req);
+       return req;
+}
 
+static void rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli,
-                                                TALLOC_CTX *mem_ctx,
-                                                struct policy_handle *handle /* [in] [ref] */,
-                                                struct lsa_String *trusted_domain /* [in] [ref] */,
-                                                enum lsa_TrustDomInfoEnum level /* [in]  */,
-                                                union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
+NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx)
 {
-       struct lsa_QueryTrustedDomainInfoByName r;
+       struct lsa_CREDRWRITEDOMAINCREDENTIALS r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.trusted_domain = trusted_domain;
-       r.in.level = level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME,
+                               NDR_LSA_CREDRWRITEDOMAINCREDENTIALS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2084,7 +10479,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2092,79 +10487,137 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              struct policy_handle *handle /* [in] [ref] */,
-                                              struct lsa_String trusted_domain /* [in]  */,
-                                              enum lsa_TrustDomInfoEnum level /* [in]  */,
-                                              union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */)
+struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state {
+       struct lsa_CREDRREADDOMAINCREDENTIALS orig;
+       struct lsa_CREDRREADDOMAINCREDENTIALS tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRREADDOMAINCREDENTIALS_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRREADDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli)
 {
-       struct lsa_SetTrustedDomainInfoByName r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state *state;
+       struct tevent_req *subreq;
 
-       /* In parameters */
-       r.in.handle = handle;
-       r.in.trusted_domain = trusted_domain;
-       r.in.level = level;
-       r.in.info = info;
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_SETTRUSTEDDOMAININFOBYNAME,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRREADDOMAINCREDENTIALS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRREADDOMAINCREDENTIALS_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRREADDOMAINCREDENTIALS_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        uint32_t *resume_handle /* [in,out] [ref] */,
-                                        struct lsa_DomainListEx *domains /* [out] [ref] */,
-                                        uint32_t max_size /* [in]  */)
+NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx)
 {
-       struct lsa_EnumTrustedDomainsEx r;
+       struct lsa_CREDRREADDOMAINCREDENTIALS r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.resume_handle = resume_handle;
-       r.in.max_size = max_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_ENUMTRUSTEDDOMAINSEX,
+                               NDR_LSA_CREDRREADDOMAINCREDENTIALS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2172,7 +10625,7 @@ NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2180,77 +10633,137 @@ NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *domains = *r.out.domains;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *policy_handle /* [in] [ref] */,
-                                         struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
-                                         struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
-                                         uint32_t access_mask /* [in]  */,
-                                         struct policy_handle *trustdom_handle /* [out] [ref] */)
+struct rpccli_lsa_CREDRDELETE_state {
+       struct lsa_CREDRDELETE orig;
+       struct lsa_CREDRDELETE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRDELETE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRDELETE_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli)
 {
-       struct lsa_CreateTrustedDomainEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRDELETE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRDELETE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.policy_handle = policy_handle;
-       r.in.info = info;
-       r.in.auth_info = auth_info;
-       r.in.access_mask = access_mask;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREATETRUSTEDDOMAINEX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRDELETE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRDELETE_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRDELETE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRDELETE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRDELETE_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRDELETE_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRDELETE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRDELETE_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *trustdom_handle = *r.out.trustdom_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in,out] [ref] */)
+NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx)
 {
-       struct lsa_CloseTrustedDomainEx r;
+       struct lsa_CREDRDELETE r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_CLOSETRUSTEDDOMAINEX,
+                               NDR_LSA_CREDRDELETE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2258,7 +10771,7 @@ NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2266,76 +10779,137 @@ NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli,
-                                                TALLOC_CTX *mem_ctx,
-                                                struct policy_handle *handle /* [in] [ref] */,
-                                                uint16_t level /* [in]  */,
-                                                union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */)
+struct rpccli_lsa_CREDRGETTARGETINFO_state {
+       struct lsa_CREDRGETTARGETINFO orig;
+       struct lsa_CREDRGETTARGETINFO tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRGETTARGETINFO_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRGETTARGETINFO_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
 {
-       struct lsa_QueryDomainInformationPolicy r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRGETTARGETINFO_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRGETTARGETINFO_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_QUERYDOMAININFORMATIONPOLICY,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRGETTARGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRGETTARGETINFO_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRGETTARGETINFO_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRGETTARGETINFO_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRGETTARGETINFO_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRGETTARGETINFO_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRGETTARGETINFO_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRGETTARGETINFO_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              struct policy_handle *handle /* [in] [ref] */,
-                                              uint16_t level /* [in]  */,
-                                              union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */)
+NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx)
 {
-       struct lsa_SetDomainInformationPolicy r;
+       struct lsa_CREDRGETTARGETINFO r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
-       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_SETDOMAININFORMATIONPOLICY,
+                               NDR_LSA_CREDRGETTARGETINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2343,7 +10917,7 @@ NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2356,66 +10930,132 @@ NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           struct policy_handle *handle /* [in] [ref] */,
-                                           struct lsa_String name /* [in]  */,
-                                           uint32_t access_mask /* [in]  */,
-                                           struct policy_handle *trustdom_handle /* [out] [ref] */)
+struct rpccli_lsa_CREDRPROFILELOADED_state {
+       struct lsa_CREDRPROFILELOADED orig;
+       struct lsa_CREDRPROFILELOADED tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRPROFILELOADED_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRPROFILELOADED_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
 {
-       struct lsa_OpenTrustedDomainByName r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRPROFILELOADED_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRPROFILELOADED_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
-       r.in.access_mask = access_mask;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_OPENTRUSTEDDOMAINBYNAME,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRPROFILELOADED,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRPROFILELOADED_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRPROFILELOADED_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRPROFILELOADED_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRPROFILELOADED_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRPROFILELOADED_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRPROFILELOADED_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRPROFILELOADED_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *trustdom_handle = *r.out.trustdom_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli,
-                            TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx)
 {
-       struct lsa_TestCall r;
+       struct lsa_CREDRPROFILELOADED r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_TestCall, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_TESTCALL,
+                               NDR_LSA_CREDRPROFILELOADED,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2423,7 +11063,7 @@ NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_TestCall, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2436,73 +11076,158 @@ NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in] [ref] */,
-                               struct lsa_SidArray *sids /* [in] [ref] */,
-                               struct lsa_RefDomainList **domains /* [out] [ref] */,
-                               struct lsa_TransNameArray2 *names /* [in,out] [ref] */,
-                               uint16_t level /* [in]  */,
-                               uint32_t *count /* [in,out] [ref] */,
-                               uint32_t unknown1 /* [in]  */,
-                               uint32_t unknown2 /* [in]  */)
+struct rpccli_lsa_LookupNames3_state {
+       struct lsa_LookupNames3 orig;
+       struct lsa_LookupNames3 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupNames3_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupNames3_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                               struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                               struct lsa_TransSidArray3 *_sids /* [in,out] [ref] */,
+                                               enum lsa_LookupNamesLevel _level /* [in]  */,
+                                               uint32_t *_count /* [in,out] [ref] */,
+                                               uint32_t _lookup_options /* [in]  */,
+                                               uint32_t _client_revision /* [in]  */)
 {
-       struct lsa_LookupSids2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupNames3_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupNames3_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.num_names = _num_names;
+       state->orig.in.names = _names;
+       state->orig.in.sids = _sids;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
+       state->orig.in.lookup_options = _lookup_options;
+       state->orig.in.client_revision = _client_revision;
+
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.sids = _sids;
+       state->orig.out.count = _count;
 
-       /* In parameters */
-       r.in.handle = handle;
-       r.in.sids = sids;
-       r.in.names = names;
-       r.in.level = level;
-       r.in.count = count;
-       r.in.unknown1 = unknown1;
-       r.in.unknown2 = unknown2;
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPSIDS2,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupNames3_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_lsarpc,
+                                   NDR_LSA_LOOKUPNAMES3,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupNames3_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupNames3_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupNames3_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames3_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.domains = *state->tmp.out.domains;
+       *state->orig.out.sids = *state->tmp.out.sids;
+       *state->orig.out.count = *state->tmp.out.count;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupNames3_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupNames3_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames3_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *domains = *r.out.domains;
-       *names = *r.out.names;
-       *count = *r.out.count;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 uint32_t num_names /* [in] [range(0,1000)] */,
                                 struct lsa_String *names /* [in] [size_is(num_names)] */,
                                 struct lsa_RefDomainList **domains /* [out] [ref] */,
-                                struct lsa_TransSidArray2 *sids /* [in,out] [ref] */,
+                                struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
                                 enum lsa_LookupNamesLevel level /* [in]  */,
                                 uint32_t *count /* [in,out] [ref] */,
                                 uint32_t lookup_options /* [in]  */,
                                 uint32_t client_revision /* [in]  */)
 {
-       struct lsa_LookupNames2 r;
+       struct lsa_LookupNames3 r;
        NTSTATUS status;
 
        /* In parameters */
@@ -2516,13 +11241,13 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
        r.in.client_revision = client_revision;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPNAMES2,
+                               NDR_LSA_LOOKUPNAMES3,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2530,7 +11255,7 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2546,68 +11271,132 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *policy_handle /* [in] [ref] */,
-                                          struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
-                                          struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
-                                          uint32_t access_mask /* [in]  */,
-                                          struct policy_handle *trustdom_handle /* [out] [ref] */)
+struct rpccli_lsa_CREDRGETSESSIONTYPES_state {
+       struct lsa_CREDRGETSESSIONTYPES orig;
+       struct lsa_CREDRGETSESSIONTYPES tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRGETSESSIONTYPES_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRGETSESSIONTYPES_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
 {
-       struct lsa_CreateTrustedDomainEx2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRGETSESSIONTYPES_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRGETSESSIONTYPES_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.policy_handle = policy_handle;
-       r.in.info = info;
-       r.in.auth_info = auth_info;
-       r.in.access_mask = access_mask;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREATETRUSTEDDOMAINEX2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRGETSESSIONTYPES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRGETSESSIONTYPES_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRGETSESSIONTYPES_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRGETSESSIONTYPES_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRGETSESSIONTYPES_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRGETSESSIONTYPES_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRGETSESSIONTYPES_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *trustdom_handle = *r.out.trustdom_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx)
 {
-       struct lsa_CREDRWRITE r;
+       struct lsa_CREDRGETSESSIONTYPES r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_CREDRWRITE,
+                               NDR_LSA_CREDRGETSESSIONTYPES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2615,7 +11404,7 @@ NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2628,58 +11417,132 @@ NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_LSARREGISTERAUDITEVENT_state {
+       struct lsa_LSARREGISTERAUDITEVENT orig;
+       struct lsa_LSARREGISTERAUDITEVENT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSARREGISTERAUDITEVENT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSARREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli)
 {
-       struct lsa_CREDRREAD r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARREGISTERAUDITEVENT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARREGISTERAUDITEVENT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREDRREAD,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARREGISTERAUDITEVENT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARREGISTERAUDITEVENT_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSARREGISTERAUDITEVENT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARREGISTERAUDITEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARREGISTERAUDITEVENT_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARREGISTERAUDITEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARREGISTERAUDITEVENT_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx)
 {
-       struct lsa_CREDRENUMERATE r;
+       struct lsa_LSARREGISTERAUDITEVENT r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_CREDRENUMERATE,
+                               NDR_LSA_LSARREGISTERAUDITEVENT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2687,7 +11550,7 @@ NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2700,22 +11563,132 @@ NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_LSARGENAUDITEVENT_state {
+       struct lsa_LSARGENAUDITEVENT orig;
+       struct lsa_LSARGENAUDITEVENT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSARGENAUDITEVENT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSARGENAUDITEVENT_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
 {
-       struct lsa_CREDRWRITEDOMAINCREDENTIALS r;
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARGENAUDITEVENT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARGENAUDITEVENT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARGENAUDITEVENT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARGENAUDITEVENT_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSARGENAUDITEVENT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARGENAUDITEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARGENAUDITEVENT_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARGENAUDITEVENT_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARGENAUDITEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARGENAUDITEVENT_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_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx)
+{
+       struct lsa_LSARGENAUDITEVENT r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_CREDRWRITEDOMAINCREDENTIALS,
+                               NDR_LSA_LSARGENAUDITEVENT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2723,7 +11696,7 @@ NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2736,58 +11709,132 @@ NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state {
+       struct lsa_LSARUNREGISTERAUDITEVENT orig;
+       struct lsa_LSARUNREGISTERAUDITEVENT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSARUNREGISTERAUDITEVENT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSARUNREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
 {
-       struct lsa_CREDRREADDOMAINCREDENTIALS r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREDRREADDOMAINCREDENTIALS,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARUNREGISTERAUDITEVENT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARUNREGISTERAUDITEVENT_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSARUNREGISTERAUDITEVENT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx)
 {
-       struct lsa_CREDRDELETE r;
+       struct lsa_LSARUNREGISTERAUDITEVENT r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_CREDRDELETE,
+                               NDR_LSA_LSARUNREGISTERAUDITEVENT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2795,7 +11842,7 @@ NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2808,111 +11855,154 @@ NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_lsaRQueryForestTrustInformation_state {
+       struct lsa_lsaRQueryForestTrustInformation orig;
+       struct lsa_lsaRQueryForestTrustInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_lsaRQueryForestTrustInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_lsaRQueryForestTrustInformation_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                                  struct lsa_String *_trusted_domain_name /* [in] [ref] */,
+                                                                  uint16_t _unknown /* [in]  */,
+                                                                  struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */)
 {
-       struct lsa_CREDRGETTARGETINFO r;
-       NTSTATUS status;
-
-       /* In parameters */
+       struct tevent_req *req;
+       struct rpccli_lsa_lsaRQueryForestTrustInformation_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_lsaRQueryForestTrustInformation_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREDRGETTARGETINFO,
-                               &r);
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.trusted_domain_name = _trusted_domain_name;
+       state->orig.in.unknown = _unknown;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.forest_trust_info = _forest_trust_info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &r);
+               NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_lsaRQueryForestTrustInformation_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_lsaRQueryForestTrustInformation_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx)
+static void rpccli_lsa_lsaRQueryForestTrustInformation_done(struct tevent_req *subreq)
 {
-       struct lsa_CREDRPROFILELOADED r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_lsaRQueryForestTrustInformation_state *state = tevent_req_data(
+               req, struct rpccli_lsa_lsaRQueryForestTrustInformation_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREDRPROFILELOADED,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.forest_trust_info = *state->tmp.out.forest_trust_info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        NTSTATUS *result)
+{
+       struct rpccli_lsa_lsaRQueryForestTrustInformation_state *state = tevent_req_data(
+               req, struct rpccli_lsa_lsaRQueryForestTrustInformation_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *handle /* [in] [ref] */,
-                                uint32_t num_names /* [in] [range(0,1000)] */,
-                                struct lsa_String *names /* [in] [size_is(num_names)] */,
-                                struct lsa_RefDomainList **domains /* [out] [ref] */,
-                                struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
-                                enum lsa_LookupNamesLevel level /* [in]  */,
-                                uint32_t *count /* [in,out] [ref] */,
-                                uint32_t lookup_options /* [in]  */,
-                                uint32_t client_revision /* [in]  */)
+NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   struct policy_handle *handle /* [in] [ref] */,
+                                                   struct lsa_String *trusted_domain_name /* [in] [ref] */,
+                                                   uint16_t unknown /* [in]  */,
+                                                   struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */)
 {
-       struct lsa_LookupNames3 r;
+       struct lsa_lsaRQueryForestTrustInformation r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.num_names = num_names;
-       r.in.names = names;
-       r.in.sids = sids;
-       r.in.level = level;
-       r.in.count = count;
-       r.in.lookup_options = lookup_options;
-       r.in.client_revision = client_revision;
+       r.in.trusted_domain_name = trusted_domain_name;
+       r.in.unknown = unknown;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &r);
+               NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_LOOKUPNAMES3,
+                               NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2920,7 +12010,7 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2928,102 +12018,138 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *domains = *r.out.domains;
-       *sids = *r.out.sids;
-       *count = *r.out.count;
+       *forest_trust_info = *r.out.forest_trust_info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx)
-{
-       struct lsa_CREDRGETSESSIONTYPES r;
-       NTSTATUS status;
+struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state {
+       struct lsa_LSARSETFORESTTRUSTINFORMATION orig;
+       struct lsa_LSARSETFORESTTRUSTINFORMATION tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
 
-       /* In parameters */
+static void rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_done(struct tevent_req *subreq);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &r);
+struct tevent_req *rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREDRGETSESSIONTYPES,
-                               &r);
+       /* In parameters */
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &r);
-       }
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &state->orig);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARSETFORESTTRUSTINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx)
+static void rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_done(struct tevent_req *subreq)
 {
-       struct lsa_LSARREGISTERAUDITEVENT r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LSARREGISTERAUDITEVENT,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx)
+NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli,
+                                                 TALLOC_CTX *mem_ctx)
 {
-       struct lsa_LSARGENAUDITEVENT r;
+       struct lsa_LSARSETFORESTTRUSTINFORMATION r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_LSARGENAUDITEVENT,
+                               NDR_LSA_LSARSETFORESTTRUSTINFORMATION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3031,7 +12157,7 @@ NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3044,65 +12170,132 @@ NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_CREDRRENAME_state {
+       struct lsa_CREDRRENAME orig;
+       struct lsa_CREDRRENAME tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_CREDRRENAME_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_CREDRRENAME_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli)
 {
-       struct lsa_LSARUNREGISTERAUDITEVENT r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_lsa_CREDRRENAME_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_CREDRRENAME_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LSARUNREGISTERAUDITEVENT,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_CREDRRENAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_CREDRRENAME_done, req);
+       return req;
+}
+
+static void rpccli_lsa_CREDRRENAME_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_CREDRRENAME_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRRENAME_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_CREDRRENAME_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_CREDRRENAME_state *state = tevent_req_data(
+               req, struct rpccli_lsa_CREDRRENAME_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli,
-                                                   TALLOC_CTX *mem_ctx,
-                                                   struct policy_handle *handle /* [in] [ref] */,
-                                                   struct lsa_String *trusted_domain_name /* [in] [ref] */,
-                                                   uint16_t unknown /* [in]  */,
-                                                   struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */)
+NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx)
 {
-       struct lsa_lsaRQueryForestTrustInformation r;
+       struct lsa_CREDRRENAME r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.trusted_domain_name = trusted_domain_name;
-       r.in.unknown = unknown;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &r);
+               NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_lsarpc,
-                               NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION,
+                               NDR_LSA_CREDRRENAME,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3110,7 +12303,7 @@ NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3118,82 +12311,144 @@ NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *forest_trust_info = *r.out.forest_trust_info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli,
-                                                 TALLOC_CTX *mem_ctx)
+struct rpccli_lsa_LookupSids3_state {
+       struct lsa_LookupSids3 orig;
+       struct lsa_LookupSids3 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupSids3_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupSids3_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct lsa_SidArray *_sids /* [in] [ref] */,
+                                              struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                              struct lsa_TransNameArray2 *_names /* [in,out] [ref] */,
+                                              uint16_t _level /* [in]  */,
+                                              uint32_t *_count /* [in,out] [ref] */,
+                                              uint32_t _unknown1 /* [in]  */,
+                                              uint32_t _unknown2 /* [in]  */)
 {
-       struct lsa_LSARSETFORESTTRUSTINFORMATION r;
-       NTSTATUS status;
-
-       /* In parameters */
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupSids3_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupSids3_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_LSARSETFORESTTRUSTINFORMATION,
-                               &r);
+       /* In parameters */
+       state->orig.in.sids = _sids;
+       state->orig.in.names = _names;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
+       state->orig.in.unknown1 = _unknown1;
+       state->orig.in.unknown2 = _unknown2;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.names = _names;
+       state->orig.out.count = _count;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r);
+               NDR_PRINT_IN_DEBUG(lsa_LookupSids3, &state->orig);
        }
-
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupSids3_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LOOKUPSIDS3,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupSids3_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx)
+static void rpccli_lsa_LookupSids3_done(struct tevent_req *subreq)
 {
-       struct lsa_CREDRRENAME r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupSids3_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupSids3_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_lsarpc,
-                               NDR_LSA_CREDRRENAME,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.domains = *state->tmp.out.domains;
+       *state->orig.out.names = *state->tmp.out.names;
+       *state->orig.out.count = *state->tmp.out.count;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &r);
+               NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupSids3_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupSids3_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupSids3_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli,
@@ -3248,6 +12503,143 @@ NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_LookupNames4_state {
+       struct lsa_LookupNames4 orig;
+       struct lsa_LookupNames4 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LookupNames4_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LookupNames4_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                               struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                               struct lsa_TransSidArray3 *_sids /* [in,out] [ref] */,
+                                               enum lsa_LookupNamesLevel _level /* [in]  */,
+                                               uint32_t *_count /* [in,out] [ref] */,
+                                               uint32_t _lookup_options /* [in]  */,
+                                               uint32_t _client_revision /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LookupNames4_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LookupNames4_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.num_names = _num_names;
+       state->orig.in.names = _names;
+       state->orig.in.sids = _sids;
+       state->orig.in.level = _level;
+       state->orig.in.count = _count;
+       state->orig.in.lookup_options = _lookup_options;
+       state->orig.in.client_revision = _client_revision;
+
+       /* Out parameters */
+       state->orig.out.domains = _domains;
+       state->orig.out.sids = _sids;
+       state->orig.out.count = _count;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LookupNames4, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_lsa_LookupNames4_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_lsarpc,
+                                   NDR_LSA_LOOKUPNAMES4,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LookupNames4_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LookupNames4_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LookupNames4_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames4_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.domains = *state->tmp.out.domains;
+       *state->orig.out.sids = *state->tmp.out.sids;
+       *state->orig.out.count = *state->tmp.out.count;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LookupNames4_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_lsa_LookupNames4_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LookupNames4_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_lsa_LookupNames4(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 uint32_t num_names /* [in] [range(0,1000)] */,
@@ -3302,6 +12694,116 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_LSAROPENPOLICYSCE_state {
+       struct lsa_LSAROPENPOLICYSCE orig;
+       struct lsa_LSAROPENPOLICYSCE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSAROPENPOLICYSCE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSAROPENPOLICYSCE_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LSAROPENPOLICYSCE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSAROPENPOLICYSCE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSAROPENPOLICYSCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSAROPENPOLICYSCE_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSAROPENPOLICYSCE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSAROPENPOLICYSCE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSAROPENPOLICYSCE_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_lsa_LSAROPENPOLICYSCE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSAROPENPOLICYSCE_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_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx)
 {
@@ -3338,6 +12840,116 @@ NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state {
+       struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE orig;
+       struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
+                                                                     struct tevent_context *ev,
+                                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req,
+                                                           TALLOC_CTX *mem_ctx,
+                                                           NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_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_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
                                                       TALLOC_CTX *mem_ctx)
 {
@@ -3374,6 +12986,116 @@ NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *c
        return r.out.result;
 }
 
+struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state {
+       struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE orig;
+       struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
+                                                                       struct tevent_context *ev,
+                                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req,
+                                                             TALLOC_CTX *mem_ctx,
+                                                             NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_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_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
                                                         TALLOC_CTX *mem_ctx)
 {
@@ -3410,6 +13132,116 @@ NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client
        return r.out.result;
 }
 
+struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state {
+       struct lsa_LSARADTREPORTSECURITYEVENT orig;
+       struct lsa_LSARADTREPORTSECURITYEVENT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_lsa_LSARADTREPORTSECURITYEVENT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_lsa_LSARADTREPORTSECURITYEVENT_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_lsarpc,
+                                   NDR_LSA_LSARADTREPORTSECURITYEVENT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_lsa_LSARADTREPORTSECURITYEVENT_done, req);
+       return req;
+}
+
+static void rpccli_lsa_LSARADTREPORTSECURITYEVENT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state *state = tevent_req_data(
+               req, struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_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_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx)
 {
index 10c408528f8d7c5d934fc3ef0df1ff4a21b5c495..d9a73626206b48d8bee9c49f3adfc5d5372e01ea 100644 (file)
 #include "../librpc/gen_ndr/ndr_lsa.h"
 #ifndef __CLI_LSARPC__
 #define __CLI_LSARPC__
+struct tevent_req *rpccli_lsa_Close_send(TALLOC_CTX *mem_ctx,
+                                        struct tevent_context *ev,
+                                        struct rpc_pipe_client *cli,
+                                        struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_lsa_Close_recv(struct tevent_req *req,
+                              TALLOC_CTX *mem_ctx,
+                              NTSTATUS *result);
 NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli,
                          TALLOC_CTX *mem_ctx,
                          struct policy_handle *handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_lsa_Delete_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_lsa_Delete_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           struct policy_handle *handle /* [in] [ref] */);
+struct tevent_req *rpccli_lsa_EnumPrivs_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_handle /* [in] [ref] */,
+                                            uint32_t *_resume_handle /* [in,out] [ref] */,
+                                            struct lsa_PrivArray *_privs /* [out] [ref] */,
+                                            uint32_t _max_count /* [in]  */);
+NTSTATUS rpccli_lsa_EnumPrivs_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *handle /* [in] [ref] */,
                              uint32_t *resume_handle /* [in,out] [ref] */,
                              struct lsa_PrivArray *privs /* [out] [ref] */,
                              uint32_t max_count /* [in]  */);
+struct tevent_req *rpccli_lsa_QuerySecurity_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                uint32_t _sec_info /* [in]  */,
+                                                struct sec_desc_buf **_sdbuf /* [out] [ref] */);
+NTSTATUS rpccli_lsa_QuerySecurity_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
                                  uint32_t sec_info /* [in]  */,
                                  struct sec_desc_buf **sdbuf /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_SetSecObj_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_handle /* [in] [ref] */,
+                                            uint32_t _sec_info /* [in]  */,
+                                            struct sec_desc_buf *_sdbuf /* [in] [ref] */);
+NTSTATUS rpccli_lsa_SetSecObj_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *handle /* [in] [ref] */,
                              uint32_t sec_info /* [in]  */,
                              struct sec_desc_buf *sdbuf /* [in] [ref] */);
+struct tevent_req *rpccli_lsa_ChangePassword_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_ChangePassword_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_OpenPolicy_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t *_system_name /* [in] [unique] */,
+                                             struct lsa_ObjectAttribute *_attr /* [in] [ref] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_OpenPolicy_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint16_t *system_name /* [in] [unique] */,
                               struct lsa_ObjectAttribute *attr /* [in] [ref] */,
                               uint32_t access_mask /* [in]  */,
                               struct policy_handle *handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_QueryInfoPolicy_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  enum lsa_PolicyInfo _level /* [in]  */,
+                                                  union lsa_PolicyInformation **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_QueryInfoPolicy_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
                                    enum lsa_PolicyInfo level /* [in]  */,
                                    union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_SetInfoPolicy_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                enum lsa_PolicyInfo _level /* [in]  */,
+                                                union lsa_PolicyInformation *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_SetInfoPolicy_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
                                  enum lsa_PolicyInfo level /* [in]  */,
                                  union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_ClearAuditLog_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_ClearAuditLog_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CreateAccount_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                struct dom_sid2 *_sid /* [in] [ref] */,
+                                                uint32_t _access_mask /* [in]  */,
+                                                struct policy_handle *_acct_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_CreateAccount_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
                                  struct dom_sid2 *sid /* [in] [ref] */,
                                  uint32_t access_mask /* [in]  */,
                                  struct policy_handle *acct_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_EnumAccounts_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t *_resume_handle /* [in,out] [ref] */,
+                                               struct lsa_SidArray *_sids /* [out] [ref] */,
+                                               uint32_t _num_entries /* [in] [range(0,8192)] */);
+NTSTATUS rpccli_lsa_EnumAccounts_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 uint32_t *resume_handle /* [in,out] [ref] */,
                                 struct lsa_SidArray *sids /* [out] [ref] */,
                                 uint32_t num_entries /* [in] [range(0,8192)] */);
+struct tevent_req *rpccli_lsa_CreateTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_policy_handle /* [in] [ref] */,
+                                                      struct lsa_DomainInfo *_info /* [in] [ref] */,
+                                                      uint32_t _access_mask /* [in]  */,
+                                                      struct policy_handle *_trustdom_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_CreateTrustedDomain_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *policy_handle /* [in] [ref] */,
                                        struct lsa_DomainInfo *info /* [in] [ref] */,
                                        uint32_t access_mask /* [in]  */,
                                        struct policy_handle *trustdom_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_EnumTrustDom_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t *_resume_handle /* [in,out] [ref] */,
+                                               struct lsa_DomainList *_domains /* [out] [ref] */,
+                                               uint32_t _max_size /* [in]  */);
+NTSTATUS rpccli_lsa_EnumTrustDom_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 uint32_t *resume_handle /* [in,out] [ref] */,
                                 struct lsa_DomainList *domains /* [out] [ref] */,
                                 uint32_t max_size /* [in]  */);
+struct tevent_req *rpccli_lsa_LookupNames_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              uint32_t _num_names /* [in] [range(0,1000)] */,
+                                              struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                              struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                              struct lsa_TransSidArray *_sids /* [in,out] [ref] */,
+                                              enum lsa_LookupNamesLevel _level /* [in]  */,
+                                              uint32_t *_count /* [in,out] [ref] */);
+NTSTATUS rpccli_lsa_LookupNames_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -76,6 +211,18 @@ NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli,
                                struct lsa_TransSidArray *sids /* [in,out] [ref] */,
                                enum lsa_LookupNamesLevel level /* [in]  */,
                                uint32_t *count /* [in,out] [ref] */);
+struct tevent_req *rpccli_lsa_LookupSids_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct lsa_SidArray *_sids /* [in] [ref] */,
+                                             struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                             struct lsa_TransNameArray *_names /* [in,out] [ref] */,
+                                             uint16_t _level /* [in]  */,
+                                             uint32_t *_count /* [in,out] [ref] */);
+NTSTATUS rpccli_lsa_LookupSids_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -84,70 +231,201 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
                               struct lsa_TransNameArray *names /* [in,out] [ref] */,
                               uint16_t level /* [in]  */,
                               uint32_t *count /* [in,out] [ref] */);
+struct tevent_req *rpccli_lsa_CreateSecret_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               struct lsa_String _name /* [in]  */,
+                                               uint32_t _access_mask /* [in]  */,
+                                               struct policy_handle *_sec_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_CreateSecret_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 struct lsa_String name /* [in]  */,
                                 uint32_t access_mask /* [in]  */,
                                 struct policy_handle *sec_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_OpenAccount_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              struct dom_sid2 *_sid /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_acct_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_OpenAccount_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
                                struct dom_sid2 *sid /* [in] [ref] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *acct_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_EnumPrivsAccount_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   struct lsa_PrivilegeSet **_privs /* [out] [ref] */);
+NTSTATUS rpccli_lsa_EnumPrivsAccount_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     struct lsa_PrivilegeSet **privs /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_AddPrivilegesToAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         struct lsa_PrivilegeSet *_privs /* [in] [ref] */);
+NTSTATUS rpccli_lsa_AddPrivilegesToAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
                                           struct lsa_PrivilegeSet *privs /* [in] [ref] */);
+struct tevent_req *rpccli_lsa_RemovePrivilegesFromAccount_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_handle /* [in] [ref] */,
+                                                              uint8_t _remove_all /* [in]  */,
+                                                              struct lsa_PrivilegeSet *_privs /* [in] [unique] */);
+NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *handle /* [in] [ref] */,
                                                uint8_t remove_all /* [in]  */,
                                                struct lsa_PrivilegeSet *privs /* [in] [unique] */);
+struct tevent_req *rpccli_lsa_GetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_GetQuotasForAccount_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_SetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_SetQuotasForAccount_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_GetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t *_access_mask /* [out] [ref] */);
+NTSTATUS rpccli_lsa_GetSystemAccessAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
                                           uint32_t *access_mask /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_SetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _access_mask /* [in]  */);
+NTSTATUS rpccli_lsa_SetSystemAccessAccount_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
                                           uint32_t access_mask /* [in]  */);
+struct tevent_req *rpccli_lsa_OpenTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    struct dom_sid2 *_sid /* [in] [ref] */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    struct policy_handle *_trustdom_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_OpenTrustedDomain_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      struct dom_sid2 *sid /* [in] [ref] */,
                                      uint32_t access_mask /* [in]  */,
                                      struct policy_handle *trustdom_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_QueryTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_trustdom_handle /* [in] [ref] */,
+                                                         enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                         union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_QueryTrustedDomainInfo_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *trustdom_handle /* [in] [ref] */,
                                           enum lsa_TrustDomInfoEnum level /* [in]  */,
                                           union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_SetInformationTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_trustdom_handle /* [in] [ref] */,
+                                                              enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                              union lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_SetInformationTrustedDomain_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *trustdom_handle /* [in] [ref] */,
                                                enum lsa_TrustDomInfoEnum level /* [in]  */,
                                                union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_OpenSecret_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct lsa_String _name /* [in]  */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_sec_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_OpenSecret_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
                               struct lsa_String name /* [in]  */,
                               uint32_t access_mask /* [in]  */,
                               struct policy_handle *sec_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_SetSecret_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_sec_handle /* [in] [ref] */,
+                                            struct lsa_DATA_BUF *_new_val /* [in] [unique] */,
+                                            struct lsa_DATA_BUF *_old_val /* [in] [unique] */);
+NTSTATUS rpccli_lsa_SetSecret_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *sec_handle /* [in] [ref] */,
                              struct lsa_DATA_BUF *new_val /* [in] [unique] */,
                              struct lsa_DATA_BUF *old_val /* [in] [unique] */);
+struct tevent_req *rpccli_lsa_QuerySecret_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_sec_handle /* [in] [ref] */,
+                                              struct lsa_DATA_BUF_PTR *_new_val /* [in,out] [unique] */,
+                                              NTTIME *_new_mtime /* [in,out] [unique] */,
+                                              struct lsa_DATA_BUF_PTR *_old_val /* [in,out] [unique] */,
+                                              NTTIME *_old_mtime /* [in,out] [unique] */);
+NTSTATUS rpccli_lsa_QuerySecret_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *sec_handle /* [in] [ref] */,
@@ -155,16 +433,46 @@ NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli,
                                NTTIME *new_mtime /* [in,out] [unique] */,
                                struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */,
                                NTTIME *old_mtime /* [in,out] [unique] */);
+struct tevent_req *rpccli_lsa_LookupPrivValue_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  struct lsa_String *_name /* [in] [ref] */,
+                                                  struct lsa_LUID *_luid /* [out] [ref] */);
+NTSTATUS rpccli_lsa_LookupPrivValue_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
                                    struct lsa_String *name /* [in] [ref] */,
                                    struct lsa_LUID *luid /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_LookupPrivName_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 struct lsa_LUID *_luid /* [in] [ref] */,
+                                                 struct lsa_StringLarge **_name /* [out] [ref] */);
+NTSTATUS rpccli_lsa_LookupPrivName_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
                                   struct lsa_LUID *luid /* [in] [ref] */,
                                   struct lsa_StringLarge **name /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_LookupPrivDisplayName_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        struct lsa_String *_name /* [in] [ref] */,
+                                                        uint16_t _language_id /* [in]  */,
+                                                        uint16_t _language_id_sys /* [in]  */,
+                                                        struct lsa_StringLarge **_disp_name /* [out] [ref] */,
+                                                        uint16_t *_returned_language_id /* [out] [ref] */);
+NTSTATUS rpccli_lsa_LookupPrivDisplayName_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -173,95 +481,263 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
                                          uint16_t language_id_sys /* [in]  */,
                                          struct lsa_StringLarge **disp_name /* [out] [ref] */,
                                          uint16_t *returned_language_id /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_DeleteObject_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_lsa_DeleteObject_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_lsa_EnumAccountsWithUserRight_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_handle /* [in] [ref] */,
+                                                            struct lsa_String *_name /* [in] [unique] */,
+                                                            struct lsa_SidArray *_sids /* [out] [ref] */);
+NTSTATUS rpccli_lsa_EnumAccountsWithUserRight_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *handle /* [in] [ref] */,
                                              struct lsa_String *name /* [in] [unique] */,
                                              struct lsa_SidArray *sids /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_EnumAccountRights_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    struct dom_sid2 *_sid /* [in] [ref] */,
+                                                    struct lsa_RightSet *_rights /* [out] [ref] */);
+NTSTATUS rpccli_lsa_EnumAccountRights_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      struct dom_sid2 *sid /* [in] [ref] */,
                                      struct lsa_RightSet *rights /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_AddAccountRights_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   struct dom_sid2 *_sid /* [in] [ref] */,
+                                                   struct lsa_RightSet *_rights /* [in] [ref] */);
+NTSTATUS rpccli_lsa_AddAccountRights_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     struct dom_sid2 *sid /* [in] [ref] */,
                                     struct lsa_RightSet *rights /* [in] [ref] */);
+struct tevent_req *rpccli_lsa_RemoveAccountRights_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct dom_sid2 *_sid /* [in] [ref] */,
+                                                      uint8_t _remove_all /* [in]  */,
+                                                      struct lsa_RightSet *_rights /* [in] [ref] */);
+NTSTATUS rpccli_lsa_RemoveAccountRights_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        struct dom_sid2 *sid /* [in] [ref] */,
                                        uint8_t remove_all /* [in]  */,
                                        struct lsa_RightSet *rights /* [in] [ref] */);
+struct tevent_req *rpccli_lsa_QueryTrustedDomainInfoBySid_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_handle /* [in] [ref] */,
+                                                              struct dom_sid2 *_dom_sid /* [in] [ref] */,
+                                                              enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                              union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *handle /* [in] [ref] */,
                                                struct dom_sid2 *dom_sid /* [in] [ref] */,
                                                enum lsa_TrustDomInfoEnum level /* [in]  */,
                                                union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_SetTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       struct dom_sid2 *_dom_sid /* [in] [ref] */,
+                                                       enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                       union lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_SetTrustedDomainInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         struct dom_sid2 *dom_sid /* [in] [ref] */,
                                         enum lsa_TrustDomInfoEnum level /* [in]  */,
                                         union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_DeleteTrustedDomain_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct dom_sid2 *_dom_sid /* [in] [ref] */);
+NTSTATUS rpccli_lsa_DeleteTrustedDomain_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        struct dom_sid2 *dom_sid /* [in] [ref] */);
+struct tevent_req *rpccli_lsa_StorePrivateData_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   struct lsa_String *_name /* [in] [ref] */,
+                                                   struct lsa_DATA_BUF *_val /* [in] [unique] */);
+NTSTATUS rpccli_lsa_StorePrivateData_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     struct lsa_String *name /* [in] [ref] */,
                                     struct lsa_DATA_BUF *val /* [in] [unique] */);
+struct tevent_req *rpccli_lsa_RetrievePrivateData_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct lsa_String *_name /* [in] [ref] */,
+                                                      struct lsa_DATA_BUF **_val /* [in,out] [ref] */);
+NTSTATUS rpccli_lsa_RetrievePrivateData_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        struct lsa_String *name /* [in] [ref] */,
                                        struct lsa_DATA_BUF **val /* [in,out] [ref] */);
+struct tevent_req *rpccli_lsa_OpenPolicy2_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                              struct lsa_ObjectAttribute *_attr /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_OpenPolicy2_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                const char *system_name /* [in] [unique,charset(UTF16)] */,
                                struct lsa_ObjectAttribute *attr /* [in] [ref] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_GetUserName_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                              struct lsa_String **_account_name /* [in,out] [ref] */,
+                                              struct lsa_String **_authority_name /* [in,out] [unique] */);
+NTSTATUS rpccli_lsa_GetUserName_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                const char *system_name /* [in] [unique,charset(UTF16)] */,
                                struct lsa_String **account_name /* [in,out] [ref] */,
                                struct lsa_String **authority_name /* [in,out] [unique] */);
+struct tevent_req *rpccli_lsa_QueryInfoPolicy2_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   enum lsa_PolicyInfo _level /* [in]  */,
+                                                   union lsa_PolicyInformation **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_QueryInfoPolicy2_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     enum lsa_PolicyInfo level /* [in]  */,
                                     union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_SetInfoPolicy2_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 enum lsa_PolicyInfo _level /* [in]  */,
+                                                 union lsa_PolicyInformation *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_SetInfoPolicy2_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
                                   enum lsa_PolicyInfo level /* [in]  */,
                                   union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_QueryTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               struct policy_handle *_handle /* [in] [ref] */,
+                                                               struct lsa_String *_trusted_domain /* [in] [ref] */,
+                                                               enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                               union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 struct policy_handle *handle /* [in] [ref] */,
                                                 struct lsa_String *trusted_domain /* [in] [ref] */,
                                                 enum lsa_TrustDomInfoEnum level /* [in]  */,
                                                 union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_SetTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             struct lsa_String _trusted_domain /* [in]  */,
+                                                             enum lsa_TrustDomInfoEnum _level /* [in]  */,
+                                                             union lsa_TrustedDomainInfo *_info /* [in] [unique,switch_is(level)] */);
+NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
                                               struct lsa_String trusted_domain /* [in]  */,
                                               enum lsa_TrustDomInfoEnum level /* [in]  */,
                                               union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_EnumTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                       struct lsa_DomainListEx *_domains /* [out] [ref] */,
+                                                       uint32_t _max_size /* [in]  */);
+NTSTATUS rpccli_lsa_EnumTrustedDomainsEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         uint32_t *resume_handle /* [in,out] [ref] */,
                                         struct lsa_DomainListEx *domains /* [out] [ref] */,
                                         uint32_t max_size /* [in]  */);
+struct tevent_req *rpccli_lsa_CreateTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_policy_handle /* [in] [ref] */,
+                                                        struct lsa_TrustDomainInfoInfoEx *_info /* [in] [ref] */,
+                                                        struct lsa_TrustDomainInfoAuthInfoInternal *_auth_info /* [in] [ref] */,
+                                                        uint32_t _access_mask /* [in]  */,
+                                                        struct policy_handle *_trustdom_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_CreateTrustedDomainEx_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result);
 NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *policy_handle /* [in] [ref] */,
@@ -269,27 +745,82 @@ NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
                                          struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
                                          uint32_t access_mask /* [in]  */,
                                          struct policy_handle *trustdom_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_CloseTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_lsa_CloseTrustedDomainEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_lsa_QueryDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               struct policy_handle *_handle /* [in] [ref] */,
+                                                               uint16_t _level /* [in]  */,
+                                                               union lsa_DomainInformationPolicy **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_lsa_QueryDomainInformationPolicy_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 struct policy_handle *handle /* [in] [ref] */,
                                                 uint16_t level /* [in]  */,
                                                 union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_SetDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             uint16_t _level /* [in]  */,
+                                                             union lsa_DomainInformationPolicy *_info /* [in] [unique,switch_is(level)] */);
+NTSTATUS rpccli_lsa_SetDomainInformationPolicy_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
                                               uint16_t level /* [in]  */,
                                               union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */);
+struct tevent_req *rpccli_lsa_OpenTrustedDomainByName_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          struct lsa_String _name /* [in]  */,
+                                                          uint32_t _access_mask /* [in]  */,
+                                                          struct policy_handle *_trustdom_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_OpenTrustedDomainByName_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result);
 NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
                                            struct lsa_String name /* [in]  */,
                                            uint32_t access_mask /* [in]  */,
                                            struct policy_handle *trustdom_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_TestCall_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_TestCall_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 NTSTATUS *result);
 NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli,
                             TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LookupSids2_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              struct lsa_SidArray *_sids /* [in] [ref] */,
+                                              struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                              struct lsa_TransNameArray2 *_names /* [in,out] [ref] */,
+                                              uint16_t _level /* [in]  */,
+                                              uint32_t *_count /* [in,out] [ref] */,
+                                              uint32_t _unknown1 /* [in]  */,
+                                              uint32_t _unknown2 /* [in]  */);
+NTSTATUS rpccli_lsa_LookupSids2_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -300,6 +831,21 @@ NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli,
                                uint32_t *count /* [in,out] [ref] */,
                                uint32_t unknown1 /* [in]  */,
                                uint32_t unknown2 /* [in]  */);
+struct tevent_req *rpccli_lsa_LookupNames2_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                               struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                               struct lsa_TransSidArray2 *_sids /* [in,out] [ref] */,
+                                               enum lsa_LookupNamesLevel _level /* [in]  */,
+                                               uint32_t *_count /* [in,out] [ref] */,
+                                               uint32_t _lookup_options /* [in]  */,
+                                               uint32_t _client_revision /* [in]  */);
+NTSTATUS rpccli_lsa_LookupNames2_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -311,6 +857,17 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
                                 uint32_t *count /* [in,out] [ref] */,
                                 uint32_t lookup_options /* [in]  */,
                                 uint32_t client_revision /* [in]  */);
+struct tevent_req *rpccli_lsa_CreateTrustedDomainEx2_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_policy_handle /* [in] [ref] */,
+                                                         struct lsa_TrustDomainInfoInfoEx *_info /* [in] [ref] */,
+                                                         struct lsa_TrustDomainInfoAuthInfoInternal *_auth_info /* [in] [ref] */,
+                                                         uint32_t _access_mask /* [in]  */,
+                                                         struct policy_handle *_trustdom_handle /* [out] [ref] */);
+NTSTATUS rpccli_lsa_CreateTrustedDomainEx2_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *policy_handle /* [in] [ref] */,
@@ -318,22 +875,85 @@ NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
                                           struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
                                           uint32_t access_mask /* [in]  */,
                                           struct policy_handle *trustdom_handle /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_CREDRWRITE_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRWRITE_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRREAD_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRREAD_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRENUMERATE_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRENUMERATE_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRREADDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRDELETE_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRDELETE_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRGETTARGETINFO_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRGETTARGETINFO_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRPROFILELOADED_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRPROFILELOADED_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LookupNames3_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                               struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                               struct lsa_TransSidArray3 *_sids /* [in,out] [ref] */,
+                                               enum lsa_LookupNamesLevel _level /* [in]  */,
+                                               uint32_t *_count /* [in,out] [ref] */,
+                                               uint32_t _lookup_options /* [in]  */,
+                                               uint32_t _client_revision /* [in]  */);
+NTSTATUS rpccli_lsa_LookupNames3_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -345,24 +965,83 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
                                 uint32_t *count /* [in,out] [ref] */,
                                 uint32_t lookup_options /* [in]  */,
                                 uint32_t client_revision /* [in]  */);
+struct tevent_req *rpccli_lsa_CREDRGETSESSIONTYPES_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LSARREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LSARGENAUDITEVENT_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARGENAUDITEVENT_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LSARUNREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_lsaRQueryForestTrustInformation_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                                  struct lsa_String *_trusted_domain_name /* [in] [ref] */,
+                                                                  uint16_t _unknown /* [in]  */,
+                                                                  struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */);
+NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        NTSTATUS *result);
 NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    struct policy_handle *handle /* [in] [ref] */,
                                                    struct lsa_String *trusted_domain_name /* [in] [ref] */,
                                                    uint16_t unknown /* [in]  */,
                                                    struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */);
+struct tevent_req *rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_CREDRRENAME_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_CREDRRENAME_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LookupSids3_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct lsa_SidArray *_sids /* [in] [ref] */,
+                                              struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                              struct lsa_TransNameArray2 *_names /* [in,out] [ref] */,
+                                              uint16_t _level /* [in]  */,
+                                              uint32_t *_count /* [in,out] [ref] */,
+                                              uint32_t _unknown1 /* [in]  */,
+                                              uint32_t _unknown2 /* [in]  */);
+NTSTATUS rpccli_lsa_LookupSids3_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct lsa_SidArray *sids /* [in] [ref] */,
@@ -372,6 +1051,20 @@ NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli,
                                uint32_t *count /* [in,out] [ref] */,
                                uint32_t unknown1 /* [in]  */,
                                uint32_t unknown2 /* [in]  */);
+struct tevent_req *rpccli_lsa_LookupNames4_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [size_is(num_names)] */,
+                                               struct lsa_RefDomainList **_domains /* [out] [ref] */,
+                                               struct lsa_TransSidArray3 *_sids /* [in,out] [ref] */,
+                                               enum lsa_LookupNamesLevel _level /* [in]  */,
+                                               uint32_t *_count /* [in,out] [ref] */,
+                                               uint32_t _lookup_options /* [in]  */,
+                                               uint32_t _client_revision /* [in]  */);
+NTSTATUS rpccli_lsa_LookupNames4_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 uint32_t num_names /* [in] [range(0,1000)] */,
@@ -382,12 +1075,36 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
                                 uint32_t *count /* [in,out] [ref] */,
                                 uint32_t lookup_options /* [in]  */,
                                 uint32_t client_revision /* [in]  */);
+struct tevent_req *rpccli_lsa_LSAROPENPOLICYSCE_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
+                                                                     struct tevent_context *ev,
+                                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req,
+                                                           TALLOC_CTX *mem_ctx,
+                                                           NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
                                                       TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
+                                                                       struct tevent_context *ev,
+                                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req,
+                                                             TALLOC_CTX *mem_ctx,
+                                                             NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
                                                         TALLOC_CTX *mem_ctx);
+struct tevent_req *rpccli_lsa_LSARADTREPORTSECURITYEVENT_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx);
 #endif /* __CLI_LSARPC__ */
index d3efab6780b6c6009ae4d641805d76b598a93cb3..6d454ce9f2e02316fb4854c3547722939eed6273 100644 (file)
@@ -6,6 +6,131 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_netlogon.h"
 
+struct rpccli_netr_LogonUasLogon_state {
+       struct netr_LogonUasLogon orig;
+       struct netr_LogonUasLogon tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonUasLogon_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonUasLogon_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_account_name /* [in] [charset(UTF16)] */,
+                                                 const char *_workstation /* [in] [charset(UTF16)] */,
+                                                 struct netr_UasInfo **_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonUasLogon_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonUasLogon_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.workstation = _workstation;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonUasLogon_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_netlogon,
+                                   NDR_NETR_LOGONUASLOGON,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonUasLogon_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonUasLogon_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonUasLogon_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonUasLogon_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonUasLogon_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_netr_LogonUasLogon_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonUasLogon_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_netr_LogonUasLogon(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -55,6 +180,131 @@ NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_LogonUasLogoff_state {
+       struct netr_LogonUasLogoff orig;
+       struct netr_LogonUasLogoff tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonUasLogoff_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonUasLogoff_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_account_name /* [in] [charset(UTF16)] */,
+                                                  const char *_workstation /* [in] [charset(UTF16)] */,
+                                                  struct netr_UasLogoffInfo *_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonUasLogoff_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonUasLogoff_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.workstation = _workstation;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonUasLogoff_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_netlogon,
+                                   NDR_NETR_LOGONUASLOGOFF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonUasLogoff_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonUasLogoff_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonUasLogoff_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonUasLogoff_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonUasLogoff_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_netr_LogonUasLogoff_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonUasLogoff_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_netr_LogonUasLogoff(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -104,6 +354,146 @@ NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_LogonSamLogon_state {
+       struct netr_LogonSamLogon orig;
+       struct netr_LogonSamLogon tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonSamLogon_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonSamLogon_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                 struct netr_Authenticator *_credential /* [in] [unique] */,
+                                                 struct netr_Authenticator *_return_authenticator /* [in,out] [unique] */,
+                                                 enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                 union netr_LogonLevel *_logon /* [in] [ref,switch_is(logon_level)] */,
+                                                 uint16_t _validation_level /* [in]  */,
+                                                 union netr_Validation *_validation /* [out] [ref,switch_is(validation_level)] */,
+                                                 uint8_t *_authoritative /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonSamLogon_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonSamLogon_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.logon_level = _logon_level;
+       state->orig.in.logon = _logon;
+       state->orig.in.validation_level = _validation_level;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.validation = _validation;
+       state->orig.out.authoritative = _authoritative;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonSamLogon_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_netlogon,
+                                   NDR_NETR_LOGONSAMLOGON,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonSamLogon_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonSamLogon_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonSamLogon_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogon_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 */
+       if (state->orig.out.return_authenticator && state->tmp.out.return_authenticator) {
+               *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
+       }
+       *state->orig.out.validation = *state->tmp.out.validation;
+       *state->orig.out.authoritative = *state->tmp.out.authoritative;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonSamLogon_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_netr_LogonSamLogon_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogon_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_netr_LogonSamLogon(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -161,6 +551,138 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_netr_LogonSamLogoff_state {
+       struct netr_LogonSamLogoff orig;
+       struct netr_LogonSamLogoff tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonSamLogoff_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonSamLogoff_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                  struct netr_Authenticator *_credential /* [in] [unique] */,
+                                                  struct netr_Authenticator *_return_authenticator /* [in,out] [unique] */,
+                                                  enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                  union netr_LogonLevel _logon /* [in] [switch_is(logon_level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonSamLogoff_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonSamLogoff_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.logon_level = _logon_level;
+       state->orig.in.logon = _logon;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonSamLogoff_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_netlogon,
+                                   NDR_NETR_LOGONSAMLOGOFF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonSamLogoff_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonSamLogoff_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonSamLogoff_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogoff_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 */
+       if (state->orig.out.return_authenticator && state->tmp.out.return_authenticator) {
+               *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonSamLogoff_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_netr_LogonSamLogoff_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogoff_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_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -212,77 +734,154 @@ NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                       const char *computer_name /* [in] [charset(UTF16)] */,
-                                       struct netr_Credential *credentials /* [in] [ref] */,
-                                       struct netr_Credential *return_credentials /* [out] [ref] */)
+struct rpccli_netr_ServerReqChallenge_state {
+       struct netr_ServerReqChallenge orig;
+       struct netr_ServerReqChallenge tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerReqChallenge_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerReqChallenge_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                      struct netr_Credential *_credentials /* [in] [ref] */,
+                                                      struct netr_Credential *_return_credentials /* [out] [ref] */)
 {
-       struct netr_ServerReqChallenge r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_ServerReqChallenge_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerReqChallenge_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.computer_name = computer_name;
-       r.in.credentials = credentials;
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credentials = _credentials;
+
+       /* Out parameters */
+       state->orig.out.return_credentials = _return_credentials;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r);
+               NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_SERVERREQCHALLENGE,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerReqChallenge_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_netlogon,
+                                   NDR_NETR_SERVERREQCHALLENGE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerReqChallenge_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerReqChallenge_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerReqChallenge_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerReqChallenge_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.return_credentials = *state->tmp.out.return_credentials;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r);
+               NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerReqChallenge_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_netr_ServerReqChallenge_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerReqChallenge_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_credentials = *r.out.return_credentials;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                       const char *account_name /* [in] [charset(UTF16)] */,
-                                       enum netr_SchannelType secure_channel_type /* [in]  */,
                                        const char *computer_name /* [in] [charset(UTF16)] */,
                                        struct netr_Credential *credentials /* [in] [ref] */,
                                        struct netr_Credential *return_credentials /* [out] [ref] */)
 {
-       struct netr_ServerAuthenticate r;
+       struct netr_ServerReqChallenge r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_name = server_name;
-       r.in.account_name = account_name;
-       r.in.secure_channel_type = secure_channel_type;
        r.in.computer_name = computer_name;
        r.in.credentials = credentials;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r);
+               NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_SERVERAUTHENTICATE,
+                               NDR_NETR_SERVERREQCHALLENGE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -290,7 +889,7 @@ NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r);
+               NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -304,35 +903,2211 @@ NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                      const char *account_name /* [in] [charset(UTF16)] */,
-                                      enum netr_SchannelType secure_channel_type /* [in]  */,
-                                      const char *computer_name /* [in] [charset(UTF16)] */,
-                                      struct netr_Authenticator *credential /* [in] [ref] */,
-                                      struct netr_Authenticator *return_authenticator /* [out] [ref] */,
-                                      struct samr_Password *new_password /* [in] [ref] */)
+struct rpccli_netr_ServerAuthenticate_state {
+       struct netr_ServerAuthenticate orig;
+       struct netr_ServerAuthenticate tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerAuthenticate_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerAuthenticate_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_account_name /* [in] [charset(UTF16)] */,
+                                                      enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                      const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                      struct netr_Credential *_credentials /* [in] [ref] */,
+                                                      struct netr_Credential *_return_credentials /* [out] [ref] */)
 {
-       struct netr_ServerPasswordSet r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_ServerAuthenticate_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerAuthenticate_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.account_name = account_name;
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credentials = _credentials;
+
+       /* Out parameters */
+       state->orig.out.return_credentials = _return_credentials;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerAuthenticate_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_netlogon,
+                                   NDR_NETR_SERVERAUTHENTICATE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerAuthenticate_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerAuthenticate_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerAuthenticate_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerAuthenticate_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.return_credentials = *state->tmp.out.return_credentials;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerAuthenticate_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_netr_ServerAuthenticate_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerAuthenticate_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_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                       const char *account_name /* [in] [charset(UTF16)] */,
+                                       enum netr_SchannelType secure_channel_type /* [in]  */,
+                                       const char *computer_name /* [in] [charset(UTF16)] */,
+                                       struct netr_Credential *credentials /* [in] [ref] */,
+                                       struct netr_Credential *return_credentials /* [out] [ref] */)
+{
+       struct netr_ServerAuthenticate r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.account_name = account_name;
+       r.in.secure_channel_type = secure_channel_type;
+       r.in.computer_name = computer_name;
+       r.in.credentials = credentials;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_SERVERAUTHENTICATE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_credentials = *r.out.return_credentials;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_ServerPasswordSet_state {
+       struct netr_ServerPasswordSet orig;
+       struct netr_ServerPasswordSet tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerPasswordSet_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerPasswordSet_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_account_name /* [in] [charset(UTF16)] */,
+                                                     enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                     const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                     struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                     struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                     struct samr_Password *_new_password /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerPasswordSet_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerPasswordSet_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.new_password = _new_password;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerPasswordSet_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_netlogon,
+                                   NDR_NETR_SERVERPASSWORDSET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerPasswordSet_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerPasswordSet_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerPasswordSet_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerPasswordSet_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.return_authenticator = *state->tmp.out.return_authenticator;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerPasswordSet_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_netr_ServerPasswordSet_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerPasswordSet_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_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                      const char *account_name /* [in] [charset(UTF16)] */,
+                                      enum netr_SchannelType secure_channel_type /* [in]  */,
+                                      const char *computer_name /* [in] [charset(UTF16)] */,
+                                      struct netr_Authenticator *credential /* [in] [ref] */,
+                                      struct netr_Authenticator *return_authenticator /* [out] [ref] */,
+                                      struct samr_Password *new_password /* [in] [ref] */)
+{
+       struct netr_ServerPasswordSet r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.account_name = account_name;
+       r.in.secure_channel_type = secure_channel_type;
+       r.in.computer_name = computer_name;
+       r.in.credential = credential;
+       r.in.new_password = new_password;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_SERVERPASSWORDSET,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_DatabaseDeltas_state {
+       struct netr_DatabaseDeltas orig;
+       struct netr_DatabaseDeltas tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DatabaseDeltas_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DatabaseDeltas_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                  const char *_computername /* [in] [charset(UTF16)] */,
+                                                  struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                  struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                  enum netr_SamDatabaseID _database_id /* [in]  */,
+                                                  uint64_t *_sequence_num /* [in,out] [ref] */,
+                                                  struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */,
+                                                  uint32_t _preferredmaximumlength /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DatabaseDeltas_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DatabaseDeltas_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.computername = _computername;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.database_id = _database_id;
+       state->orig.in.sequence_num = _sequence_num;
+       state->orig.in.preferredmaximumlength = _preferredmaximumlength;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.sequence_num = _sequence_num;
+       state->orig.out.delta_enum_array = _delta_enum_array;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DatabaseDeltas_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_netlogon,
+                                   NDR_NETR_DATABASEDELTAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DatabaseDeltas_done, req);
+       return req;
+}
+
+static void rpccli_netr_DatabaseDeltas_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DatabaseDeltas_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseDeltas_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.sequence_num = *state->tmp.out.sequence_num;
+       *state->orig.out.delta_enum_array = *state->tmp.out.delta_enum_array;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DatabaseDeltas_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_netr_DatabaseDeltas_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseDeltas_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_netr_DatabaseDeltas(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   const char *logon_server /* [in] [charset(UTF16)] */,
+                                   const char *computername /* [in] [charset(UTF16)] */,
+                                   struct netr_Authenticator *credential /* [in] [ref] */,
+                                   struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
+                                   enum netr_SamDatabaseID database_id /* [in]  */,
+                                   uint64_t *sequence_num /* [in,out] [ref] */,
+                                   struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
+                                   uint32_t preferredmaximumlength /* [in]  */)
+{
+       struct netr_DatabaseDeltas r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.computername = computername;
+       r.in.credential = credential;
+       r.in.return_authenticator = return_authenticator;
+       r.in.database_id = database_id;
+       r.in.sequence_num = sequence_num;
+       r.in.preferredmaximumlength = preferredmaximumlength;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_DATABASEDELTAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+       *sequence_num = *r.out.sequence_num;
+       *delta_enum_array = *r.out.delta_enum_array;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_DatabaseSync_state {
+       struct netr_DatabaseSync orig;
+       struct netr_DatabaseSync tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DatabaseSync_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DatabaseSync_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                const char *_computername /* [in] [charset(UTF16)] */,
+                                                struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                enum netr_SamDatabaseID _database_id /* [in]  */,
+                                                uint32_t *_sync_context /* [in,out] [ref] */,
+                                                struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */,
+                                                uint32_t _preferredmaximumlength /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DatabaseSync_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DatabaseSync_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.computername = _computername;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.database_id = _database_id;
+       state->orig.in.sync_context = _sync_context;
+       state->orig.in.preferredmaximumlength = _preferredmaximumlength;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.sync_context = _sync_context;
+       state->orig.out.delta_enum_array = _delta_enum_array;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DatabaseSync_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_netlogon,
+                                   NDR_NETR_DATABASESYNC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DatabaseSync_done, req);
+       return req;
+}
+
+static void rpccli_netr_DatabaseSync_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DatabaseSync_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseSync_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.sync_context = *state->tmp.out.sync_context;
+       *state->orig.out.delta_enum_array = *state->tmp.out.delta_enum_array;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DatabaseSync_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_netr_DatabaseSync_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseSync_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_netr_DatabaseSync(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *logon_server /* [in] [charset(UTF16)] */,
+                                 const char *computername /* [in] [charset(UTF16)] */,
+                                 struct netr_Authenticator *credential /* [in] [ref] */,
+                                 struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
+                                 enum netr_SamDatabaseID database_id /* [in]  */,
+                                 uint32_t *sync_context /* [in,out] [ref] */,
+                                 struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
+                                 uint32_t preferredmaximumlength /* [in]  */)
+{
+       struct netr_DatabaseSync r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.computername = computername;
+       r.in.credential = credential;
+       r.in.return_authenticator = return_authenticator;
+       r.in.database_id = database_id;
+       r.in.sync_context = sync_context;
+       r.in.preferredmaximumlength = preferredmaximumlength;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_DATABASESYNC,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+       *sync_context = *r.out.sync_context;
+       *delta_enum_array = *r.out.delta_enum_array;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_AccountDeltas_state {
+       struct netr_AccountDeltas orig;
+       struct netr_AccountDeltas tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_AccountDeltas_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_AccountDeltas_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_computername /* [in] [charset(UTF16)] */,
+                                                 struct netr_Authenticator _credential /* [in]  */,
+                                                 struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                 struct netr_UAS_INFO_0 _uas /* [in]  */,
+                                                 uint32_t _count /* [in]  */,
+                                                 uint32_t _level /* [in]  */,
+                                                 uint32_t _buffersize /* [in]  */,
+                                                 struct netr_AccountBuffer *_buffer /* [out] [ref,subcontext(4)] */,
+                                                 uint32_t *_count_returned /* [out] [ref] */,
+                                                 uint32_t *_total_entries /* [out] [ref] */,
+                                                 struct netr_UAS_INFO_0 *_recordid /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_AccountDeltas_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_AccountDeltas_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.computername = _computername;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.uas = _uas;
+       state->orig.in.count = _count;
+       state->orig.in.level = _level;
+       state->orig.in.buffersize = _buffersize;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.buffer = _buffer;
+       state->orig.out.count_returned = _count_returned;
+       state->orig.out.total_entries = _total_entries;
+       state->orig.out.recordid = _recordid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_AccountDeltas_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_netlogon,
+                                   NDR_NETR_ACCOUNTDELTAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_AccountDeltas_done, req);
+       return req;
+}
+
+static void rpccli_netr_AccountDeltas_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_AccountDeltas_state *state = tevent_req_data(
+               req, struct rpccli_netr_AccountDeltas_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.buffer = *state->tmp.out.buffer;
+       *state->orig.out.count_returned = *state->tmp.out.count_returned;
+       *state->orig.out.total_entries = *state->tmp.out.total_entries;
+       *state->orig.out.recordid = *state->tmp.out.recordid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_AccountDeltas_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_netr_AccountDeltas_state *state = tevent_req_data(
+               req, struct rpccli_netr_AccountDeltas_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_netr_AccountDeltas(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
+                                  const char *computername /* [in] [charset(UTF16)] */,
+                                  struct netr_Authenticator credential /* [in]  */,
+                                  struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
+                                  struct netr_UAS_INFO_0 uas /* [in]  */,
+                                  uint32_t count /* [in]  */,
+                                  uint32_t level /* [in]  */,
+                                  uint32_t buffersize /* [in]  */,
+                                  struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */,
+                                  uint32_t *count_returned /* [out] [ref] */,
+                                  uint32_t *total_entries /* [out] [ref] */,
+                                  struct netr_UAS_INFO_0 *recordid /* [out] [ref] */)
+{
+       struct netr_AccountDeltas r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.computername = computername;
+       r.in.credential = credential;
+       r.in.return_authenticator = return_authenticator;
+       r.in.uas = uas;
+       r.in.count = count;
+       r.in.level = level;
+       r.in.buffersize = buffersize;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_ACCOUNTDELTAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+       *buffer = *r.out.buffer;
+       *count_returned = *r.out.count_returned;
+       *total_entries = *r.out.total_entries;
+       *recordid = *r.out.recordid;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_AccountSync_state {
+       struct netr_AccountSync orig;
+       struct netr_AccountSync tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_AccountSync_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_AccountSync_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                               const char *_computername /* [in] [charset(UTF16)] */,
+                                               struct netr_Authenticator _credential /* [in]  */,
+                                               struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                               uint32_t _reference /* [in]  */,
+                                               uint32_t _level /* [in]  */,
+                                               uint32_t _buffersize /* [in]  */,
+                                               struct netr_AccountBuffer *_buffer /* [out] [ref,subcontext(4)] */,
+                                               uint32_t *_count_returned /* [out] [ref] */,
+                                               uint32_t *_total_entries /* [out] [ref] */,
+                                               uint32_t *_next_reference /* [out] [ref] */,
+                                               struct netr_UAS_INFO_0 *_recordid /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_AccountSync_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_AccountSync_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.computername = _computername;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.reference = _reference;
+       state->orig.in.level = _level;
+       state->orig.in.buffersize = _buffersize;
+       state->orig.in.recordid = _recordid;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.buffer = _buffer;
+       state->orig.out.count_returned = _count_returned;
+       state->orig.out.total_entries = _total_entries;
+       state->orig.out.next_reference = _next_reference;
+       state->orig.out.recordid = _recordid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_AccountSync, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_AccountSync_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_netlogon,
+                                   NDR_NETR_ACCOUNTSYNC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_AccountSync_done, req);
+       return req;
+}
+
+static void rpccli_netr_AccountSync_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_AccountSync_state *state = tevent_req_data(
+               req, struct rpccli_netr_AccountSync_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.buffer = *state->tmp.out.buffer;
+       *state->orig.out.count_returned = *state->tmp.out.count_returned;
+       *state->orig.out.total_entries = *state->tmp.out.total_entries;
+       *state->orig.out.next_reference = *state->tmp.out.next_reference;
+       *state->orig.out.recordid = *state->tmp.out.recordid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_AccountSync, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_AccountSync_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_netr_AccountSync_state *state = tevent_req_data(
+               req, struct rpccli_netr_AccountSync_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_netr_AccountSync(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                const char *logon_server /* [in] [unique,charset(UTF16)] */,
+                                const char *computername /* [in] [charset(UTF16)] */,
+                                struct netr_Authenticator credential /* [in]  */,
+                                struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
+                                uint32_t reference /* [in]  */,
+                                uint32_t level /* [in]  */,
+                                uint32_t buffersize /* [in]  */,
+                                struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */,
+                                uint32_t *count_returned /* [out] [ref] */,
+                                uint32_t *total_entries /* [out] [ref] */,
+                                uint32_t *next_reference /* [out] [ref] */,
+                                struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */)
+{
+       struct netr_AccountSync r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.computername = computername;
+       r.in.credential = credential;
+       r.in.return_authenticator = return_authenticator;
+       r.in.reference = reference;
+       r.in.level = level;
+       r.in.buffersize = buffersize;
+       r.in.recordid = recordid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_AccountSync, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_ACCOUNTSYNC,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+       *buffer = *r.out.buffer;
+       *count_returned = *r.out.count_returned;
+       *total_entries = *r.out.total_entries;
+       *next_reference = *r.out.next_reference;
+       *recordid = *r.out.recordid;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_GetDcName_state {
+       struct netr_GetDcName orig;
+       struct netr_GetDcName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_GetDcName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_GetDcName_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             const char *_logon_server /* [in] [charset(UTF16)] */,
+                                             const char *_domainname /* [in] [unique,charset(UTF16)] */,
+                                             const char **_dcname /* [out] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_GetDcName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_GetDcName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.domainname = _domainname;
+
+       /* Out parameters */
+       state->orig.out.dcname = _dcname;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_GetDcName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_GetDcName_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_netlogon,
+                                   NDR_NETR_GETDCNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_GetDcName_done, req);
+       return req;
+}
+
+static void rpccli_netr_GetDcName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_GetDcName_state *state = tevent_req_data(
+               req, struct rpccli_netr_GetDcName_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.dcname = *state->tmp.out.dcname;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_GetDcName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_GetDcName_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_netr_GetDcName_state *state = tevent_req_data(
+               req, struct rpccli_netr_GetDcName_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_netr_GetDcName(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              const char *logon_server /* [in] [charset(UTF16)] */,
+                              const char *domainname /* [in] [unique,charset(UTF16)] */,
+                              const char **dcname /* [out] [ref,charset(UTF16)] */,
+                              WERROR *werror)
+{
+       struct netr_GetDcName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.domainname = domainname;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_GetDcName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_GETDCNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *dcname = *r.out.dcname;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_LogonControl_state {
+       struct netr_LogonControl orig;
+       struct netr_LogonControl tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonControl_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonControl_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                enum netr_LogonControlCode _function_code /* [in]  */,
+                                                uint32_t _level /* [in]  */,
+                                                union netr_CONTROL_QUERY_INFORMATION *_query /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonControl_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonControl_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.function_code = _function_code;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.query = _query;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonControl, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonControl_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_netlogon,
+                                   NDR_NETR_LOGONCONTROL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonControl_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonControl_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonControl_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonControl_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.query = *state->tmp.out.query;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonControl, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonControl_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_netr_LogonControl_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonControl_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_netr_LogonControl(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *logon_server /* [in] [unique,charset(UTF16)] */,
+                                 enum netr_LogonControlCode function_code /* [in]  */,
+                                 uint32_t level /* [in]  */,
+                                 union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
+                                 WERROR *werror)
+{
+       struct netr_LogonControl r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.function_code = function_code;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonControl, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_LOGONCONTROL,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *query = *r.out.query;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_GetAnyDCName_state {
+       struct netr_GetAnyDCName orig;
+       struct netr_GetAnyDCName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_GetAnyDCName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_GetAnyDCName_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                const char *_domainname /* [in] [unique,charset(UTF16)] */,
+                                                const char **_dcname /* [out] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_GetAnyDCName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_GetAnyDCName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.domainname = _domainname;
+
+       /* Out parameters */
+       state->orig.out.dcname = _dcname;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_GetAnyDCName_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_netlogon,
+                                   NDR_NETR_GETANYDCNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_GetAnyDCName_done, req);
+       return req;
+}
+
+static void rpccli_netr_GetAnyDCName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_GetAnyDCName_state *state = tevent_req_data(
+               req, struct rpccli_netr_GetAnyDCName_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.dcname = *state->tmp.out.dcname;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_GetAnyDCName_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_netr_GetAnyDCName_state *state = tevent_req_data(
+               req, struct rpccli_netr_GetAnyDCName_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_netr_GetAnyDCName(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *logon_server /* [in] [unique,charset(UTF16)] */,
+                                 const char *domainname /* [in] [unique,charset(UTF16)] */,
+                                 const char **dcname /* [out] [ref,charset(UTF16)] */,
+                                 WERROR *werror)
+{
+       struct netr_GetAnyDCName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.domainname = domainname;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_GETANYDCNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *dcname = *r.out.dcname;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_LogonControl2_state {
+       struct netr_LogonControl2 orig;
+       struct netr_LogonControl2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonControl2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonControl2_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                 enum netr_LogonControlCode _function_code /* [in]  */,
+                                                 uint32_t _level /* [in]  */,
+                                                 union netr_CONTROL_DATA_INFORMATION *_data /* [in] [ref,switch_is(function_code)] */,
+                                                 union netr_CONTROL_QUERY_INFORMATION *_query /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonControl2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonControl2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.function_code = _function_code;
+       state->orig.in.level = _level;
+       state->orig.in.data = _data;
+
+       /* Out parameters */
+       state->orig.out.query = _query;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonControl2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonControl2_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_netlogon,
+                                   NDR_NETR_LOGONCONTROL2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonControl2_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonControl2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonControl2_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonControl2_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.query = *state->tmp.out.query;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonControl2_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_netr_LogonControl2_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonControl2_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_netr_LogonControl2(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
+                                  enum netr_LogonControlCode function_code /* [in]  */,
+                                  uint32_t level /* [in]  */,
+                                  union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
+                                  union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
+                                  WERROR *werror)
+{
+       struct netr_LogonControl2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.function_code = function_code;
+       r.in.level = level;
+       r.in.data = data;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_LOGONCONTROL2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *query = *r.out.query;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_ServerAuthenticate2_state {
+       struct netr_ServerAuthenticate2 orig;
+       struct netr_ServerAuthenticate2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerAuthenticate2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerAuthenticate2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_account_name /* [in] [charset(UTF16)] */,
+                                                       enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                       const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                       struct netr_Credential *_credentials /* [in] [ref] */,
+                                                       struct netr_Credential *_return_credentials /* [out] [ref] */,
+                                                       uint32_t *_negotiate_flags /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerAuthenticate2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerAuthenticate2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credentials = _credentials;
+       state->orig.in.negotiate_flags = _negotiate_flags;
+
+       /* Out parameters */
+       state->orig.out.return_credentials = _return_credentials;
+       state->orig.out.negotiate_flags = _negotiate_flags;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerAuthenticate2_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_netlogon,
+                                   NDR_NETR_SERVERAUTHENTICATE2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerAuthenticate2_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerAuthenticate2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerAuthenticate2_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerAuthenticate2_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.return_credentials = *state->tmp.out.return_credentials;
+       *state->orig.out.negotiate_flags = *state->tmp.out.negotiate_flags;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerAuthenticate2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_netr_ServerAuthenticate2_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerAuthenticate2_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_netr_ServerAuthenticate2(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                        const char *account_name /* [in] [charset(UTF16)] */,
+                                        enum netr_SchannelType secure_channel_type /* [in]  */,
+                                        const char *computer_name /* [in] [charset(UTF16)] */,
+                                        struct netr_Credential *credentials /* [in] [ref] */,
+                                        struct netr_Credential *return_credentials /* [out] [ref] */,
+                                        uint32_t *negotiate_flags /* [in,out] [ref] */)
+{
+       struct netr_ServerAuthenticate2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.account_name = account_name;
        r.in.secure_channel_type = secure_channel_type;
        r.in.computer_name = computer_name;
+       r.in.credentials = credentials;
+       r.in.negotiate_flags = negotiate_flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_SERVERAUTHENTICATE2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_credentials = *r.out.return_credentials;
+       *negotiate_flags = *r.out.negotiate_flags;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_DatabaseSync2_state {
+       struct netr_DatabaseSync2 orig;
+       struct netr_DatabaseSync2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DatabaseSync2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DatabaseSync2_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                 const char *_computername /* [in] [charset(UTF16)] */,
+                                                 struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                 struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                 enum netr_SamDatabaseID _database_id /* [in]  */,
+                                                 enum SyncStateEnum _restart_state /* [in]  */,
+                                                 uint32_t *_sync_context /* [in,out] [ref] */,
+                                                 struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */,
+                                                 uint32_t _preferredmaximumlength /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DatabaseSync2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DatabaseSync2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.computername = _computername;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.database_id = _database_id;
+       state->orig.in.restart_state = _restart_state;
+       state->orig.in.sync_context = _sync_context;
+       state->orig.in.preferredmaximumlength = _preferredmaximumlength;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.sync_context = _sync_context;
+       state->orig.out.delta_enum_array = _delta_enum_array;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DatabaseSync2_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_netlogon,
+                                   NDR_NETR_DATABASESYNC2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DatabaseSync2_done, req);
+       return req;
+}
+
+static void rpccli_netr_DatabaseSync2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DatabaseSync2_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseSync2_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.sync_context = *state->tmp.out.sync_context;
+       *state->orig.out.delta_enum_array = *state->tmp.out.delta_enum_array;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DatabaseSync2_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_netr_DatabaseSync2_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseSync2_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_netr_DatabaseSync2(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *logon_server /* [in] [charset(UTF16)] */,
+                                  const char *computername /* [in] [charset(UTF16)] */,
+                                  struct netr_Authenticator *credential /* [in] [ref] */,
+                                  struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
+                                  enum netr_SamDatabaseID database_id /* [in]  */,
+                                  enum SyncStateEnum restart_state /* [in]  */,
+                                  uint32_t *sync_context /* [in,out] [ref] */,
+                                  struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
+                                  uint32_t preferredmaximumlength /* [in]  */)
+{
+       struct netr_DatabaseSync2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.logon_server = logon_server;
+       r.in.computername = computername;
        r.in.credential = credential;
-       r.in.new_password = new_password;
+       r.in.return_authenticator = return_authenticator;
+       r.in.database_id = database_id;
+       r.in.restart_state = restart_state;
+       r.in.sync_context = sync_context;
+       r.in.preferredmaximumlength = preferredmaximumlength;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r);
+               NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_SERVERPASSWORDSET,
+                               NDR_NETR_DATABASESYNC2,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -340,7 +3115,7 @@ NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r);
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -349,77 +3124,157 @@ NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
 
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
+       *sync_context = *r.out.sync_context;
+       *delta_enum_array = *r.out.delta_enum_array;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   const char *logon_server /* [in] [charset(UTF16)] */,
-                                   const char *computername /* [in] [charset(UTF16)] */,
-                                   struct netr_Authenticator *credential /* [in] [ref] */,
-                                   struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                   enum netr_SamDatabaseID database_id /* [in]  */,
-                                   uint64_t *sequence_num /* [in,out] [ref] */,
-                                   struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
-                                   uint32_t preferredmaximumlength /* [in]  */)
+struct rpccli_netr_DatabaseRedo_state {
+       struct netr_DatabaseRedo orig;
+       struct netr_DatabaseRedo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DatabaseRedo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DatabaseRedo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                const char *_computername /* [in] [charset(UTF16)] */,
+                                                struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                struct netr_ChangeLogEntry _change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
+                                                uint32_t _change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
+                                                struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */)
 {
-       struct netr_DatabaseDeltas r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_DatabaseRedo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DatabaseRedo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.computername = computername;
-       r.in.credential = credential;
-       r.in.return_authenticator = return_authenticator;
-       r.in.database_id = database_id;
-       r.in.sequence_num = sequence_num;
-       r.in.preferredmaximumlength = preferredmaximumlength;
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.computername = _computername;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.change_log_entry = _change_log_entry;
+       state->orig.in.change_log_entry_size = _change_log_entry_size;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.delta_enum_array = _delta_enum_array;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r);
+               NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_DATABASEDELTAS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DatabaseRedo_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_netlogon,
+                                   NDR_NETR_DATABASEREDO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DatabaseRedo_done, req);
+       return req;
+}
 
+static void rpccli_netr_DatabaseRedo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DatabaseRedo_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseRedo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.delta_enum_array = *state->tmp.out.delta_enum_array;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r);
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DatabaseRedo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_netr_DatabaseRedo_state *state = tevent_req_data(
+               req, struct rpccli_netr_DatabaseRedo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_authenticator = *r.out.return_authenticator;
-       *sequence_num = *r.out.sequence_num;
-       *delta_enum_array = *r.out.delta_enum_array;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *logon_server /* [in] [charset(UTF16)] */,
                                  const char *computername /* [in] [charset(UTF16)] */,
                                  struct netr_Authenticator *credential /* [in] [ref] */,
                                  struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                 enum netr_SamDatabaseID database_id /* [in]  */,
-                                 uint32_t *sync_context /* [in,out] [ref] */,
-                                 struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
-                                 uint32_t preferredmaximumlength /* [in]  */)
+                                 struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
+                                 uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
+                                 struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */)
 {
-       struct netr_DatabaseSync r;
+       struct netr_DatabaseRedo r;
        NTSTATUS status;
 
        /* In parameters */
@@ -427,18 +3282,17 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
        r.in.computername = computername;
        r.in.credential = credential;
        r.in.return_authenticator = return_authenticator;
-       r.in.database_id = database_id;
-       r.in.sync_context = sync_context;
-       r.in.preferredmaximumlength = preferredmaximumlength;
+       r.in.change_log_entry = change_log_entry;
+       r.in.change_log_entry_size = change_log_entry_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r);
+               NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_DATABASESYNC,
+                               NDR_NETR_DATABASEREDO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -446,7 +3300,7 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r);
+               NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -455,110 +3309,165 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
 
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
-       *sync_context = *r.out.sync_context;
        *delta_enum_array = *r.out.delta_enum_array;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
-                                  const char *computername /* [in] [charset(UTF16)] */,
-                                  struct netr_Authenticator credential /* [in]  */,
-                                  struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                  struct netr_UAS_INFO_0 uas /* [in]  */,
-                                  uint32_t count /* [in]  */,
-                                  uint32_t level /* [in]  */,
-                                  uint32_t buffersize /* [in]  */,
-                                  struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */,
-                                  uint32_t *count_returned /* [out] [ref] */,
-                                  uint32_t *total_entries /* [out] [ref] */,
-                                  struct netr_UAS_INFO_0 *recordid /* [out] [ref] */)
+struct rpccli_netr_LogonControl2Ex_state {
+       struct netr_LogonControl2Ex orig;
+       struct netr_LogonControl2Ex tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonControl2Ex_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonControl2Ex_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                   enum netr_LogonControlCode _function_code /* [in]  */,
+                                                   uint32_t _level /* [in]  */,
+                                                   union netr_CONTROL_DATA_INFORMATION *_data /* [in] [ref,switch_is(function_code)] */,
+                                                   union netr_CONTROL_QUERY_INFORMATION *_query /* [out] [ref,switch_is(level)] */)
 {
-       struct netr_AccountDeltas r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_LogonControl2Ex_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonControl2Ex_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.computername = computername;
-       r.in.credential = credential;
-       r.in.return_authenticator = return_authenticator;
-       r.in.uas = uas;
-       r.in.count = count;
-       r.in.level = level;
-       r.in.buffersize = buffersize;
+       state->orig.in.logon_server = _logon_server;
+       state->orig.in.function_code = _function_code;
+       state->orig.in.level = _level;
+       state->orig.in.data = _data;
+
+       /* Out parameters */
+       state->orig.out.query = _query;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r);
+               NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_ACCOUNTDELTAS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonControl2Ex_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_netlogon,
+                                   NDR_NETR_LOGONCONTROL2EX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonControl2Ex_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonControl2Ex_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonControl2Ex_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonControl2Ex_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.query = *state->tmp.out.query;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r);
+               NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonControl2Ex_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_netr_LogonControl2Ex_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonControl2Ex_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_authenticator = *r.out.return_authenticator;
-       *buffer = *r.out.buffer;
-       *count_returned = *r.out.count_returned;
-       *total_entries = *r.out.total_entries;
-       *recordid = *r.out.recordid;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                const char *logon_server /* [in] [unique,charset(UTF16)] */,
-                                const char *computername /* [in] [charset(UTF16)] */,
-                                struct netr_Authenticator credential /* [in]  */,
-                                struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                uint32_t reference /* [in]  */,
-                                uint32_t level /* [in]  */,
-                                uint32_t buffersize /* [in]  */,
-                                struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */,
-                                uint32_t *count_returned /* [out] [ref] */,
-                                uint32_t *total_entries /* [out] [ref] */,
-                                uint32_t *next_reference /* [out] [ref] */,
-                                struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */)
+NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *logon_server /* [in] [unique,charset(UTF16)] */,
+                                    enum netr_LogonControlCode function_code /* [in]  */,
+                                    uint32_t level /* [in]  */,
+                                    union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
+                                    union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
+                                    WERROR *werror)
 {
-       struct netr_AccountSync r;
+       struct netr_LogonControl2Ex r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.logon_server = logon_server;
-       r.in.computername = computername;
-       r.in.credential = credential;
-       r.in.return_authenticator = return_authenticator;
-       r.in.reference = reference;
+       r.in.function_code = function_code;
        r.in.level = level;
-       r.in.buffersize = buffersize;
-       r.in.recordid = recordid;
+       r.in.data = data;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_AccountSync, &r);
+               NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_ACCOUNTSYNC,
+                               NDR_NETR_LOGONCONTROL2EX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -566,7 +3475,7 @@ NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r);
+               NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -574,88 +3483,157 @@ NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *return_authenticator = *r.out.return_authenticator;
-       *buffer = *r.out.buffer;
-       *count_returned = *r.out.count_returned;
-       *total_entries = *r.out.total_entries;
-       *next_reference = *r.out.next_reference;
-       *recordid = *r.out.recordid;
+       *query = *r.out.query;
 
        /* Return result */
-       return r.out.result;
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              const char *logon_server /* [in] [charset(UTF16)] */,
-                              const char *domainname /* [in] [unique,charset(UTF16)] */,
-                              const char **dcname /* [out] [ref,charset(UTF16)] */,
-                              WERROR *werror)
+struct rpccli_netr_NetrEnumerateTrustedDomains_state {
+       struct netr_NetrEnumerateTrustedDomains orig;
+       struct netr_NetrEnumerateTrustedDomains tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NetrEnumerateTrustedDomains_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NetrEnumerateTrustedDomains_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                               struct netr_Blob *_trusted_domains_blob /* [out] [ref] */)
 {
-       struct netr_GetDcName r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_NetrEnumerateTrustedDomains_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NetrEnumerateTrustedDomains_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.domainname = domainname;
+       state->orig.in.server_name = _server_name;
+
+       /* Out parameters */
+       state->orig.out.trusted_domains_blob = _trusted_domains_blob;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_GetDcName, &r);
+               NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_GETDCNAME,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_NetrEnumerateTrustedDomains_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_netlogon,
+                                   NDR_NETR_NETRENUMERATETRUSTEDDOMAINS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NetrEnumerateTrustedDomains_done, req);
+       return req;
+}
+
+static void rpccli_netr_NetrEnumerateTrustedDomains_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NetrEnumerateTrustedDomains_state *state = tevent_req_data(
+               req, struct rpccli_netr_NetrEnumerateTrustedDomains_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.trusted_domains_blob = *state->tmp.out.trusted_domains_blob;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result)
+{
+       struct rpccli_netr_NetrEnumerateTrustedDomains_state *state = tevent_req_data(
+               req, struct rpccli_netr_NetrEnumerateTrustedDomains_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *dcname = *r.out.dcname;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *logon_server /* [in] [unique,charset(UTF16)] */,
-                                 enum netr_LogonControlCode function_code /* [in]  */,
-                                 uint32_t level /* [in]  */,
-                                 union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
-                                 WERROR *werror)
+NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                                struct netr_Blob *trusted_domains_blob /* [out] [ref] */,
+                                                WERROR *werror)
 {
-       struct netr_LogonControl r;
+       struct netr_NetrEnumerateTrustedDomains r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.function_code = function_code;
-       r.in.level = level;
+       r.in.server_name = server_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_LogonControl, &r);
+               NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_LOGONCONTROL,
+                               NDR_NETR_NETRENUMERATETRUSTEDDOMAINS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -663,7 +3641,7 @@ NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -671,7 +3649,7 @@ NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *query = *r.out.query;
+       *trusted_domains_blob = *r.out.trusted_domains_blob;
 
        /* Return result */
        if (werror) {
@@ -681,79 +3659,163 @@ NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *logon_server /* [in] [unique,charset(UTF16)] */,
-                                 const char *domainname /* [in] [unique,charset(UTF16)] */,
-                                 const char **dcname /* [out] [ref,charset(UTF16)] */,
-                                 WERROR *werror)
+struct rpccli_netr_DsRGetDCName_state {
+       struct netr_DsRGetDCName orig;
+       struct netr_DsRGetDCName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRGetDCName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRGetDCName_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                struct GUID *_domain_guid /* [in] [unique] */,
+                                                struct GUID *_site_guid /* [in] [unique] */,
+                                                uint32_t _flags /* [in]  */,
+                                                struct netr_DsRGetDCNameInfo **_info /* [out] [ref] */)
 {
-       struct netr_GetAnyDCName r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_DsRGetDCName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRGetDCName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.domainname = domainname;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.domain_name = _domain_name;
+       state->orig.in.domain_guid = _domain_guid;
+       state->orig.in.site_guid = _site_guid;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r);
+               NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_GETANYDCNAME,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRGetDCName_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_netlogon,
+                                   NDR_NETR_DSRGETDCNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRGetDCName_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRGetDCName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRGetDCName_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetDCName_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r);
+               NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRGetDCName_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_netr_DsRGetDCName_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetDCName_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *dcname = *r.out.dcname;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
-                                  enum netr_LogonControlCode function_code /* [in]  */,
-                                  uint32_t level /* [in]  */,
-                                  union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
-                                  union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
-                                  WERROR *werror)
+NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                 const char *domain_name /* [in] [unique,charset(UTF16)] */,
+                                 struct GUID *domain_guid /* [in] [unique] */,
+                                 struct GUID *site_guid /* [in] [unique] */,
+                                 uint32_t flags /* [in]  */,
+                                 struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
+                                 WERROR *werror)
 {
-       struct netr_LogonControl2 r;
+       struct netr_DsRGetDCName r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.function_code = function_code;
-       r.in.level = level;
-       r.in.data = data;
+       r.in.server_unc = server_unc;
+       r.in.domain_name = domain_name;
+       r.in.domain_guid = domain_guid;
+       r.in.site_guid = site_guid;
+       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r);
+               NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_LOGONCONTROL2,
+                               NDR_NETR_DSRGETDCNAME,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -761,7 +3823,7 @@ NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r);
+               NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -769,7 +3831,7 @@ NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *query = *r.out.query;
+       *info = *r.out.info;
 
        /* Return result */
        if (werror) {
@@ -779,90 +3841,164 @@ NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                        const char *account_name /* [in] [charset(UTF16)] */,
-                                        enum netr_SchannelType secure_channel_type /* [in]  */,
-                                        const char *computer_name /* [in] [charset(UTF16)] */,
-                                        struct netr_Credential *credentials /* [in] [ref] */,
-                                        struct netr_Credential *return_credentials /* [out] [ref] */,
-                                        uint32_t *negotiate_flags /* [in,out] [ref] */)
+struct rpccli_netr_LogonGetCapabilities_state {
+       struct netr_LogonGetCapabilities orig;
+       struct netr_LogonGetCapabilities tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonGetCapabilities_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonGetCapabilities_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_name /* [in] [charset(UTF16)] */,
+                                                        const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                        struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                        struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                        uint32_t _query_level /* [in]  */,
+                                                        union netr_Capabilities *_capabilities /* [out] [ref,switch_is(query_level)] */)
 {
-       struct netr_ServerAuthenticate2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_LogonGetCapabilities_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonGetCapabilities_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.account_name = account_name;
-       r.in.secure_channel_type = secure_channel_type;
-       r.in.computer_name = computer_name;
-       r.in.credentials = credentials;
-       r.in.negotiate_flags = negotiate_flags;
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.query_level = _query_level;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.capabilities = _capabilities;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r);
+               NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_SERVERAUTHENTICATE2,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonGetCapabilities_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_netlogon,
+                                   NDR_NETR_LOGONGETCAPABILITIES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonGetCapabilities_done, req);
+       return req;
+}
 
+static void rpccli_netr_LogonGetCapabilities_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonGetCapabilities_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonGetCapabilities_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.capabilities = *state->tmp.out.capabilities;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r);
+               NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonGetCapabilities_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result)
+{
+       struct rpccli_netr_LogonGetCapabilities_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonGetCapabilities_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_credentials = *r.out.return_credentials;
-       *negotiate_flags = *r.out.negotiate_flags;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *logon_server /* [in] [charset(UTF16)] */,
-                                  const char *computername /* [in] [charset(UTF16)] */,
-                                  struct netr_Authenticator *credential /* [in] [ref] */,
-                                  struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                  enum netr_SamDatabaseID database_id /* [in]  */,
-                                  enum SyncStateEnum restart_state /* [in]  */,
-                                  uint32_t *sync_context /* [in,out] [ref] */,
-                                  struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
-                                  uint32_t preferredmaximumlength /* [in]  */)
+NTSTATUS rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         const char *server_name /* [in] [charset(UTF16)] */,
+                                         const char *computer_name /* [in] [unique,charset(UTF16)] */,
+                                         struct netr_Authenticator *credential /* [in] [ref] */,
+                                         struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
+                                         uint32_t query_level /* [in]  */,
+                                         union netr_Capabilities *capabilities /* [out] [ref,switch_is(query_level)] */)
 {
-       struct netr_DatabaseSync2 r;
+       struct netr_LogonGetCapabilities r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.computername = computername;
+       r.in.server_name = server_name;
+       r.in.computer_name = computer_name;
        r.in.credential = credential;
        r.in.return_authenticator = return_authenticator;
-       r.in.database_id = database_id;
-       r.in.restart_state = restart_state;
-       r.in.sync_context = sync_context;
-       r.in.preferredmaximumlength = preferredmaximumlength;
+       r.in.query_level = query_level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r);
+               NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_DATABASESYNC2,
+                               NDR_NETR_LOGONGETCAPABILITIES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -870,7 +4006,7 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r);
+               NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -879,90 +4015,139 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli,
 
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
-       *sync_context = *r.out.sync_context;
-       *delta_enum_array = *r.out.delta_enum_array;
+       *capabilities = *r.out.capabilities;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *logon_server /* [in] [charset(UTF16)] */,
-                                 const char *computername /* [in] [charset(UTF16)] */,
-                                 struct netr_Authenticator *credential /* [in] [ref] */,
-                                 struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                 struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
-                                 uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
-                                 struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */)
+struct rpccli_netr_NETRLOGONSETSERVICEBITS_state {
+       struct netr_NETRLOGONSETSERVICEBITS orig;
+       struct netr_NETRLOGONSETSERVICEBITS tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NETRLOGONSETSERVICEBITS_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NETRLOGONSETSERVICEBITS_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
 {
-       struct netr_DatabaseRedo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_NETRLOGONSETSERVICEBITS_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NETRLOGONSETSERVICEBITS_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.computername = computername;
-       r.in.credential = credential;
-       r.in.return_authenticator = return_authenticator;
-       r.in.change_log_entry = change_log_entry;
-       r.in.change_log_entry_size = change_log_entry_size;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r);
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_DATABASEREDO,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netlogon,
+                                   NDR_NETR_NETRLOGONSETSERVICEBITS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NETRLOGONSETSERVICEBITS_done, req);
+       return req;
+}
+
+static void rpccli_netr_NETRLOGONSETSERVICEBITS_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NETRLOGONSETSERVICEBITS_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONSETSERVICEBITS_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_netr_NETRLOGONSETSERVICEBITS_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONSETSERVICEBITS_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_authenticator = *r.out.return_authenticator;
-       *delta_enum_array = *r.out.delta_enum_array;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    const char *logon_server /* [in] [unique,charset(UTF16)] */,
-                                    enum netr_LogonControlCode function_code /* [in]  */,
-                                    uint32_t level /* [in]  */,
-                                    union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
-                                    union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
-                                    WERROR *werror)
+NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
 {
-       struct netr_LogonControl2Ex r;
+       struct netr_NETRLOGONSETSERVICEBITS r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.logon_server = logon_server;
-       r.in.function_code = function_code;
-       r.in.level = level;
-       r.in.data = data;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r);
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_LOGONCONTROL2EX,
+                               NDR_NETR_NETRLOGONSETSERVICEBITS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -970,7 +4155,7 @@ NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -978,7 +4163,6 @@ NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *query = *r.out.query;
 
        /* Return result */
        if (werror) {
@@ -988,79 +4172,151 @@ NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli,
-                                                TALLOC_CTX *mem_ctx,
-                                                const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                                struct netr_Blob *trusted_domains_blob /* [out] [ref] */,
-                                                WERROR *werror)
+struct rpccli_netr_LogonGetTrustRid_state {
+       struct netr_LogonGetTrustRid orig;
+       struct netr_LogonGetTrustRid tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonGetTrustRid_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonGetTrustRid_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_rid /* [out] [ref] */)
 {
-       struct netr_NetrEnumerateTrustedDomains r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_LogonGetTrustRid_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonGetTrustRid_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
+       state->orig.in.server_name = _server_name;
+       state->orig.in.domain_name = _domain_name;
+
+       /* Out parameters */
+       state->orig.out.rid = _rid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
+               NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_NETRENUMERATETRUSTEDDOMAINS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonGetTrustRid_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_netlogon,
+                                   NDR_NETR_LOGONGETTRUSTRID,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonGetTrustRid_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonGetTrustRid_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonGetTrustRid_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonGetTrustRid_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.rid = *state->tmp.out.rid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
+               NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonGetTrustRid_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_netr_LogonGetTrustRid_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonGetTrustRid_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *trusted_domains_blob = *r.out.trusted_domains_blob;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                 const char *domain_name /* [in] [unique,charset(UTF16)] */,
-                                 struct GUID *domain_guid /* [in] [unique] */,
-                                 struct GUID *site_guid /* [in] [unique] */,
-                                 uint32_t flags /* [in]  */,
-                                 struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
-                                 WERROR *werror)
+NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                     const char *domain_name /* [in] [unique,charset(UTF16)] */,
+                                     uint32_t *rid /* [out] [ref] */,
+                                     WERROR *werror)
 {
-       struct netr_DsRGetDCName r;
+       struct netr_LogonGetTrustRid r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
+       r.in.server_name = server_name;
        r.in.domain_name = domain_name;
-       r.in.domain_guid = domain_guid;
-       r.in.site_guid = site_guid;
-       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r);
+               NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_DSRGETDCNAME,
+                               NDR_NETR_LOGONGETTRUSTRID,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1068,7 +4324,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r);
+               NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1076,7 +4332,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
+       *rid = *r.out.rid;
 
        /* Return result */
        if (werror) {
@@ -1086,72 +4342,133 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         const char *server_name /* [in] [charset(UTF16)] */,
-                                         const char *computer_name /* [in] [unique,charset(UTF16)] */,
-                                         struct netr_Authenticator *credential /* [in] [ref] */,
-                                         struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
-                                         uint32_t query_level /* [in]  */,
-                                         union netr_Capabilities *capabilities /* [out] [ref,switch_is(query_level)] */)
+struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state {
+       struct netr_NETRLOGONCOMPUTESERVERDIGEST orig;
+       struct netr_NETRLOGONCOMPUTESERVERDIGEST tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli)
 {
-       struct netr_LogonGetCapabilities r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.computer_name = computer_name;
-       r.in.credential = credential;
-       r.in.return_authenticator = return_authenticator;
-       r.in.query_level = query_level;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities, &r);
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_LOGONGETCAPABILITIES,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netlogon,
+                                   NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done, req);
+       return req;
+}
+
+static void rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_authenticator = *r.out.return_authenticator;
-       *capabilities = *r.out.capabilities;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            WERROR *werror)
+NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *werror)
 {
-       struct netr_NETRLOGONSETSERVICEBITS r;
+       struct netr_NETRLOGONCOMPUTESERVERDIGEST r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_NETRLOGONSETSERVICEBITS,
+                               NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1159,7 +4476,7 @@ NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1176,70 +4493,133 @@ NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                     const char *domain_name /* [in] [unique,charset(UTF16)] */,
-                                     uint32_t *rid /* [out] [ref] */,
-                                     WERROR *werror)
+struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state {
+       struct netr_NETRLOGONCOMPUTECLIENTDIGEST orig;
+       struct netr_NETRLOGONCOMPUTECLIENTDIGEST tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli)
 {
-       struct netr_LogonGetTrustRid r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.domain_name = domain_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &r);
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_LOGONGETTRUSTRID,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netlogon,
+                                   NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done, req);
+       return req;
+}
+
+static void rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *rid = *r.out.rid;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  WERROR *werror)
 {
-       struct netr_NETRLOGONCOMPUTESERVERDIGEST r;
+       struct netr_NETRLOGONCOMPUTECLIENTDIGEST r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST,
+                               NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1247,7 +4627,7 @@ NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1261,48 +4641,143 @@ NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli,
                *werror = r.out.result;
        }
 
-       return werror_to_ntstatus(r.out.result);
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_ServerAuthenticate3_state {
+       struct netr_ServerAuthenticate3 orig;
+       struct netr_ServerAuthenticate3 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerAuthenticate3_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerAuthenticate3_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_account_name /* [in] [charset(UTF16)] */,
+                                                       enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                       const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                       struct netr_Credential *_credentials /* [in] [ref] */,
+                                                       struct netr_Credential *_return_credentials /* [out] [ref] */,
+                                                       uint32_t *_negotiate_flags /* [in,out] [ref] */,
+                                                       uint32_t *_rid /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerAuthenticate3_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerAuthenticate3_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credentials = _credentials;
+       state->orig.in.negotiate_flags = _negotiate_flags;
+
+       /* Out parameters */
+       state->orig.out.return_credentials = _return_credentials;
+       state->orig.out.negotiate_flags = _negotiate_flags;
+       state->orig.out.rid = _rid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerAuthenticate3_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_netlogon,
+                                   NDR_NETR_SERVERAUTHENTICATE3,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerAuthenticate3_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli,
-                                                 TALLOC_CTX *mem_ctx,
-                                                 WERROR *werror)
+static void rpccli_netr_ServerAuthenticate3_done(struct tevent_req *subreq)
 {
-       struct netr_NETRLOGONCOMPUTECLIENTDIGEST r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerAuthenticate3_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerAuthenticate3_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.return_credentials = *state->tmp.out.return_credentials;
+       *state->orig.out.negotiate_flags = *state->tmp.out.negotiate_flags;
+       *state->orig.out.rid = *state->tmp.out.rid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
+               NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerAuthenticate3_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_netr_ServerAuthenticate3_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerAuthenticate3_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli,
@@ -1358,6 +4833,135 @@ NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_netr_DsRGetDCNameEx_state {
+       struct netr_DsRGetDCNameEx orig;
+       struct netr_DsRGetDCNameEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRGetDCNameEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRGetDCNameEx_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                  struct GUID *_domain_guid /* [in] [unique] */,
+                                                  const char *_site_name /* [in] [unique,charset(UTF16)] */,
+                                                  uint32_t _flags /* [in]  */,
+                                                  struct netr_DsRGetDCNameInfo **_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsRGetDCNameEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRGetDCNameEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       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.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRGetDCNameEx_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_netlogon,
+                                   NDR_NETR_DSRGETDCNAMEEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRGetDCNameEx_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRGetDCNameEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRGetDCNameEx_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetDCNameEx_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRGetDCNameEx_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_netr_DsRGetDCNameEx_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetDCNameEx_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_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -1411,6 +5015,127 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_DsRGetSiteName_state {
+       struct netr_DsRGetSiteName orig;
+       struct netr_DsRGetSiteName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRGetSiteName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRGetSiteName_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                  const char **_site /* [out] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsRGetSiteName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRGetSiteName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.computer_name = _computer_name;
+
+       /* Out parameters */
+       state->orig.out.site = _site;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRGetSiteName_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_netlogon,
+                                   NDR_NETR_DSRGETSITENAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRGetSiteName_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRGetSiteName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRGetSiteName_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetSiteName_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.site = *state->tmp.out.site;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRGetSiteName_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_netr_DsRGetSiteName_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetSiteName_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_netr_DsRGetSiteName(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *computer_name /* [in] [unique,charset(UTF16)] */,
@@ -1456,6 +5181,139 @@ NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_LogonGetDomainInfo_state {
+       struct netr_LogonGetDomainInfo orig;
+       struct netr_LogonGetDomainInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonGetDomainInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonGetDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [charset(UTF16)] */,
+                                                      const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                      struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                      struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                      uint32_t _level /* [in]  */,
+                                                      union netr_DomainQuery _query /* [in] [switch_is(level)] */,
+                                                      union netr_DomainInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonGetDomainInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonGetDomainInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.level = _level;
+       state->orig.in.query = _query;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonGetDomainInfo_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_netlogon,
+                                   NDR_NETR_LOGONGETDOMAININFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonGetDomainInfo_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonGetDomainInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonGetDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonGetDomainInfo_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonGetDomainInfo_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_netr_LogonGetDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonGetDomainInfo_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_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [charset(UTF16)] */,
@@ -1507,6 +5365,137 @@ NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_netr_ServerPasswordSet2_state {
+       struct netr_ServerPasswordSet2 orig;
+       struct netr_ServerPasswordSet2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerPasswordSet2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerPasswordSet2_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_account_name /* [in] [charset(UTF16)] */,
+                                                      enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                      const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                      struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                      struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                      struct netr_CryptPassword *_new_password /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerPasswordSet2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerPasswordSet2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.new_password = _new_password;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerPasswordSet2_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_netlogon,
+                                   NDR_NETR_SERVERPASSWORDSET2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerPasswordSet2_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerPasswordSet2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerPasswordSet2_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerPasswordSet2_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.return_authenticator = *state->tmp.out.return_authenticator;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerPasswordSet2_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_netr_ServerPasswordSet2_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerPasswordSet2_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_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1539,22 +5528,154 @@ NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_netr_ServerPasswordGet_state {
+       struct netr_ServerPasswordGet orig;
+       struct netr_ServerPasswordGet tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerPasswordGet_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerPasswordGet_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_account_name /* [in] [charset(UTF16)] */,
+                                                     enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                     const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                     struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                     struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                     struct samr_Password *_password /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerPasswordGet_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerPasswordGet_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.password = _password;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerPasswordGet_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_netlogon,
+                                   NDR_NETR_SERVERPASSWORDGET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerPasswordGet_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerPasswordGet_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerPasswordGet_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerPasswordGet_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.password = *state->tmp.out.password;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r);
+               NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerPasswordGet_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_netr_ServerPasswordGet_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerPasswordGet_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *return_authenticator = *r.out.return_authenticator;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli,
@@ -1612,6 +5733,116 @@ NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_NETRLOGONSENDTOSAM_state {
+       struct netr_NETRLOGONSENDTOSAM orig;
+       struct netr_NETRLOGONSENDTOSAM tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NETRLOGONSENDTOSAM_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NETRLOGONSENDTOSAM_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_NETRLOGONSENDTOSAM_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NETRLOGONSENDTOSAM_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netlogon,
+                                   NDR_NETR_NETRLOGONSENDTOSAM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NETRLOGONSENDTOSAM_done, req);
+       return req;
+}
+
+static void rpccli_netr_NETRLOGONSENDTOSAM_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NETRLOGONSENDTOSAM_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONSENDTOSAM_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_netr_NETRLOGONSENDTOSAM_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONSENDTOSAM_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_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror)
@@ -1653,6 +5884,131 @@ NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_DsRAddressToSitenamesW_state {
+       struct netr_DsRAddressToSitenamesW orig;
+       struct netr_DsRAddressToSitenamesW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRAddressToSitenamesW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRAddressToSitenamesW_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _count /* [in] [range(0,32000)] */,
+                                                          struct netr_DsRAddress *_addresses /* [in] [ref,size_is(count)] */,
+                                                          struct netr_DsRAddressToSitenamesWCtr **_ctr /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsRAddressToSitenamesW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRAddressToSitenamesW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.count = _count;
+       state->orig.in.addresses = _addresses;
+
+       /* Out parameters */
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRAddressToSitenamesW_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_netlogon,
+                                   NDR_NETR_DSRADDRESSTOSITENAMESW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRAddressToSitenamesW_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRAddressToSitenamesW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRAddressToSitenamesW_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRAddressToSitenamesW_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.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRAddressToSitenamesW_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_netr_DsRAddressToSitenamesW_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRAddressToSitenamesW_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_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1702,6 +6058,139 @@ NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_DsRGetDCNameEx2_state {
+       struct netr_DsRGetDCNameEx2 orig;
+       struct netr_DsRGetDCNameEx2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRGetDCNameEx2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRGetDCNameEx2_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   const char *_client_account /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _mask /* [in]  */,
+                                                   const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                   struct GUID *_domain_guid /* [in] [unique] */,
+                                                   const char *_site_name /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _flags /* [in]  */,
+                                                   struct netr_DsRGetDCNameInfo **_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsRGetDCNameEx2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRGetDCNameEx2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.client_account = _client_account;
+       state->orig.in.mask = _mask;
+       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.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRGetDCNameEx2_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_netlogon,
+                                   NDR_NETR_DSRGETDCNAMEEX2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRGetDCNameEx2_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRGetDCNameEx2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRGetDCNameEx2_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetDCNameEx2_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRGetDCNameEx2_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_netr_DsRGetDCNameEx2_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetDCNameEx2_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_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -1759,45 +6248,276 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli,
-                                                        TALLOC_CTX *mem_ctx,
-                                                        WERROR *werror)
+struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state {
+       struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN orig;
+       struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_send(TALLOC_CTX *mem_ctx,
+                                                                       struct tevent_context *ev,
+                                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netlogon,
+                                   NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done, req);
+       return req;
+}
+
+static void rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_recv(struct tevent_req *req,
+                                                             TALLOC_CTX *mem_ctx,
+                                                             WERROR *result)
+{
+       struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state *state = tevent_req_data(
+               req, struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_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_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *werror)
+{
+       struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state {
+       struct netr_NetrEnumerateTrustedDomainsEx orig;
+       struct netr_NetrEnumerateTrustedDomainsEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_NetrEnumerateTrustedDomainsEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_NetrEnumerateTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli,
+                                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                 struct netr_DomainTrustList *_dom_trust_list /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+
+       /* Out parameters */
+       state->orig.out.dom_trust_list = _dom_trust_list;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_NetrEnumerateTrustedDomainsEx_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_netlogon,
+                                   NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_NetrEnumerateTrustedDomainsEx_done, req);
+       return req;
+}
+
+static void rpccli_netr_NetrEnumerateTrustedDomainsEx_done(struct tevent_req *subreq)
 {
-       struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state *state = tevent_req_data(
+               req, struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.dom_trust_list = *state->tmp.out.dom_trust_list;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
+               NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result)
+{
+       struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state *state = tevent_req_data(
+               req, struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli,
@@ -1845,6 +6565,131 @@ NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_DsRAddressToSitenamesExW_state {
+       struct netr_DsRAddressToSitenamesExW orig;
+       struct netr_DsRAddressToSitenamesExW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRAddressToSitenamesExW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRAddressToSitenamesExW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t _count /* [in] [range(0,32000)] */,
+                                                            struct netr_DsRAddress *_addresses /* [in] [ref,size_is(count)] */,
+                                                            struct netr_DsRAddressToSitenamesExWCtr **_ctr /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsRAddressToSitenamesExW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRAddressToSitenamesExW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.count = _count;
+       state->orig.in.addresses = _addresses;
+
+       /* Out parameters */
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRAddressToSitenamesExW_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_netlogon,
+                                   NDR_NETR_DSRADDRESSTOSITENAMESEXW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRAddressToSitenamesExW_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRAddressToSitenamesExW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRAddressToSitenamesExW_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRAddressToSitenamesExW_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.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRAddressToSitenamesExW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_netr_DsRAddressToSitenamesExW_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRAddressToSitenamesExW_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_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1894,6 +6739,127 @@ NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_DsrGetDcSiteCoverageW_state {
+       struct netr_DsrGetDcSiteCoverageW orig;
+       struct netr_DsrGetDcSiteCoverageW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsrGetDcSiteCoverageW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsrGetDcSiteCoverageW_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                         struct DcSitesCtr **_ctr /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsrGetDcSiteCoverageW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsrGetDcSiteCoverageW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+
+       /* Out parameters */
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsrGetDcSiteCoverageW_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_netlogon,
+                                   NDR_NETR_DSRGETDCSITECOVERAGEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsrGetDcSiteCoverageW_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsrGetDcSiteCoverageW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsrGetDcSiteCoverageW_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsrGetDcSiteCoverageW_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.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_netr_DsrGetDcSiteCoverageW_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsrGetDcSiteCoverageW_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_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1939,6 +6905,142 @@ NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_LogonSamLogonEx_state {
+       struct netr_LogonSamLogonEx orig;
+       struct netr_LogonSamLogonEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonSamLogonEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonSamLogonEx_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                   const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                   enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                   union netr_LogonLevel *_logon /* [in] [ref,switch_is(logon_level)] */,
+                                                   uint16_t _validation_level /* [in]  */,
+                                                   union netr_Validation *_validation /* [out] [ref,switch_is(validation_level)] */,
+                                                   uint8_t *_authoritative /* [out] [ref] */,
+                                                   uint32_t *_flags /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonSamLogonEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonSamLogonEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.logon_level = _logon_level;
+       state->orig.in.logon = _logon;
+       state->orig.in.validation_level = _validation_level;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.validation = _validation;
+       state->orig.out.authoritative = _authoritative;
+       state->orig.out.flags = _flags;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonSamLogonEx_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_netlogon,
+                                   NDR_NETR_LOGONSAMLOGONEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonSamLogonEx_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonSamLogonEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonSamLogonEx_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogonEx_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.validation = *state->tmp.out.validation;
+       *state->orig.out.authoritative = *state->tmp.out.authoritative;
+       *state->orig.out.flags = *state->tmp.out.flags;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonSamLogonEx_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_netr_LogonSamLogonEx_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogonEx_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_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1992,6 +7094,129 @@ NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_netr_DsrEnumerateDomainTrusts_state {
+       struct netr_DsrEnumerateDomainTrusts orig;
+       struct netr_DsrEnumerateDomainTrusts tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsrEnumerateDomainTrusts_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsrEnumerateDomainTrusts_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t _trust_flags /* [in]  */,
+                                                            struct netr_DomainTrustList *_trusts /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsrEnumerateDomainTrusts_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsrEnumerateDomainTrusts_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.trust_flags = _trust_flags;
+
+       /* Out parameters */
+       state->orig.out.trusts = _trusts;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsrEnumerateDomainTrusts_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_netlogon,
+                                   NDR_NETR_DSRENUMERATEDOMAINTRUSTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsrEnumerateDomainTrusts_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsrEnumerateDomainTrusts_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsrEnumerateDomainTrusts_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsrEnumerateDomainTrusts_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.trusts = *state->tmp.out.trusts;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_netr_DsrEnumerateDomainTrusts_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsrEnumerateDomainTrusts_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_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -2002,41 +7227,161 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli,
        struct netr_DsrEnumerateDomainTrusts r;
        NTSTATUS status;
 
-       /* In parameters */
-       r.in.server_name = server_name;
-       r.in.trust_flags = trust_flags;
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.trust_flags = trust_flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_netlogon,
+                               NDR_NETR_DSRENUMERATEDOMAINTRUSTS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *trusts = *r.out.trusts;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_netr_DsrDeregisterDNSHostRecords_state {
+       struct netr_DsrDeregisterDNSHostRecords orig;
+       struct netr_DsrDeregisterDNSHostRecords tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsrDeregisterDNSHostRecords_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsrDeregisterDNSHostRecords_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_domain /* [in] [unique,charset(UTF16)] */,
+                                                               struct GUID *_domain_guid /* [in] [unique] */,
+                                                               struct GUID *_dsa_guid /* [in] [unique] */,
+                                                               const char *_dns_host /* [in] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsrDeregisterDNSHostRecords_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsrDeregisterDNSHostRecords_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.domain = _domain;
+       state->orig.in.domain_guid = _domain_guid;
+       state->orig.in.dsa_guid = _dsa_guid;
+       state->orig.in.dns_host = _dns_host;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
+               NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_netlogon,
-                               NDR_NETR_DSRENUMERATEDOMAINTRUSTS,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_netlogon,
+                                   NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsrDeregisterDNSHostRecords_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsrDeregisterDNSHostRecords_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsrDeregisterDNSHostRecords_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsrDeregisterDNSHostRecords_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
+               NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result)
+{
+       struct rpccli_netr_DsrDeregisterDNSHostRecords_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsrDeregisterDNSHostRecords_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *trusts = *r.out.trusts;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli,
@@ -2090,6 +7435,141 @@ NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_ServerTrustPasswordsGet_state {
+       struct netr_ServerTrustPasswordsGet orig;
+       struct netr_ServerTrustPasswordsGet tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerTrustPasswordsGet_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerTrustPasswordsGet_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           const char *_account_name /* [in] [charset(UTF16)] */,
+                                                           enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                           const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                           struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                           struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                           struct samr_Password *_password /* [out] [ref] */,
+                                                           struct samr_Password *_password2 /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerTrustPasswordsGet_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerTrustPasswordsGet_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.password = _password;
+       state->orig.out.password2 = _password2;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerTrustPasswordsGet_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_netlogon,
+                                   NDR_NETR_SERVERTRUSTPASSWORDSGET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerTrustPasswordsGet_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerTrustPasswordsGet_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerTrustPasswordsGet_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerTrustPasswordsGet_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.password = *state->tmp.out.password;
+       *state->orig.out.password2 = *state->tmp.out.password2;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerTrustPasswordsGet_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result)
+{
+       struct rpccli_netr_ServerTrustPasswordsGet_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerTrustPasswordsGet_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_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -2142,6 +7622,131 @@ NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_netr_DsRGetForestTrustInformation_state {
+       struct netr_DsRGetForestTrustInformation orig;
+       struct netr_DsRGetForestTrustInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_DsRGetForestTrustInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_DsRGetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_trusted_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                                uint32_t _flags /* [in]  */,
+                                                                struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_DsRGetForestTrustInformation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_DsRGetForestTrustInformation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.trusted_domain_name = _trusted_domain_name;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.forest_trust_info = _forest_trust_info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_DsRGetForestTrustInformation_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_netlogon,
+                                   NDR_NETR_DSRGETFORESTTRUSTINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_DsRGetForestTrustInformation_done, req);
+       return req;
+}
+
+static void rpccli_netr_DsRGetForestTrustInformation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_DsRGetForestTrustInformation_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetForestTrustInformation_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.forest_trust_info = *state->tmp.out.forest_trust_info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_DsRGetForestTrustInformation_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_netr_DsRGetForestTrustInformation_state *state = tevent_req_data(
+               req, struct rpccli_netr_DsRGetForestTrustInformation_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_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -2191,6 +7796,136 @@ NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_GetForestTrustInformation_state {
+       struct netr_GetForestTrustInformation orig;
+       struct netr_GetForestTrustInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_GetForestTrustInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_GetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                             const char *_trusted_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                             struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                             struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                             uint32_t _flags /* [in]  */,
+                                                             struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_GetForestTrustInformation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_GetForestTrustInformation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.trusted_domain_name = _trusted_domain_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.forest_trust_info = _forest_trust_info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_GetForestTrustInformation_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_netlogon,
+                                   NDR_NETR_GETFORESTTRUSTINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_GetForestTrustInformation_done, req);
+       return req;
+}
+
+static void rpccli_netr_GetForestTrustInformation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_GetForestTrustInformation_state *state = tevent_req_data(
+               req, struct rpccli_netr_GetForestTrustInformation_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.forest_trust_info = *state->tmp.out.forest_trust_info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_GetForestTrustInformation_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_netr_GetForestTrustInformation_state *state = tevent_req_data(
+               req, struct rpccli_netr_GetForestTrustInformation_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_netr_GetForestTrustInformation(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -2244,6 +7979,150 @@ NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_netr_LogonSamLogonWithFlags_state {
+       struct netr_LogonSamLogonWithFlags orig;
+       struct netr_LogonSamLogonWithFlags tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_LogonSamLogonWithFlags_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_LogonSamLogonWithFlags_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                          struct netr_Authenticator *_credential /* [in] [unique] */,
+                                                          struct netr_Authenticator *_return_authenticator /* [in,out] [unique] */,
+                                                          enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                          union netr_LogonLevel *_logon /* [in] [ref,switch_is(logon_level)] */,
+                                                          uint16_t _validation_level /* [in]  */,
+                                                          union netr_Validation *_validation /* [out] [ref,switch_is(validation_level)] */,
+                                                          uint8_t *_authoritative /* [out] [ref] */,
+                                                          uint32_t *_flags /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_LogonSamLogonWithFlags_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_LogonSamLogonWithFlags_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+       state->orig.in.return_authenticator = _return_authenticator;
+       state->orig.in.logon_level = _logon_level;
+       state->orig.in.logon = _logon;
+       state->orig.in.validation_level = _validation_level;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.validation = _validation;
+       state->orig.out.authoritative = _authoritative;
+       state->orig.out.flags = _flags;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_LogonSamLogonWithFlags_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_netlogon,
+                                   NDR_NETR_LOGONSAMLOGONWITHFLAGS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_LogonSamLogonWithFlags_done, req);
+       return req;
+}
+
+static void rpccli_netr_LogonSamLogonWithFlags_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_LogonSamLogonWithFlags_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogonWithFlags_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 */
+       if (state->orig.out.return_authenticator && state->tmp.out.return_authenticator) {
+               *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
+       }
+       *state->orig.out.validation = *state->tmp.out.validation;
+       *state->orig.out.authoritative = *state->tmp.out.authoritative;
+       *state->orig.out.flags = *state->tmp.out.flags;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_LogonSamLogonWithFlags_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result)
+{
+       struct rpccli_netr_LogonSamLogonWithFlags_state *state = tevent_req_data(
+               req, struct rpccli_netr_LogonSamLogonWithFlags_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_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -2304,6 +8183,144 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_netr_ServerGetTrustInfo_state {
+       struct netr_ServerGetTrustInfo orig;
+       struct netr_ServerGetTrustInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_netr_ServerGetTrustInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_netr_ServerGetTrustInfo_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_account_name /* [in] [ref,charset(UTF16)] */,
+                                                      enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                      const char *_computer_name /* [in] [ref,charset(UTF16)] */,
+                                                      struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                      struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                      struct samr_Password *_new_owf_password /* [out] [ref] */,
+                                                      struct samr_Password *_old_owf_password /* [out] [ref] */,
+                                                      struct netr_TrustInfo **_trust_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_netr_ServerGetTrustInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_netr_ServerGetTrustInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.secure_channel_type = _secure_channel_type;
+       state->orig.in.computer_name = _computer_name;
+       state->orig.in.credential = _credential;
+
+       /* Out parameters */
+       state->orig.out.return_authenticator = _return_authenticator;
+       state->orig.out.new_owf_password = _new_owf_password;
+       state->orig.out.old_owf_password = _old_owf_password;
+       state->orig.out.trust_info = _trust_info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_netr_ServerGetTrustInfo_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_netlogon,
+                                   NDR_NETR_SERVERGETTRUSTINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_netr_ServerGetTrustInfo_done, req);
+       return req;
+}
+
+static void rpccli_netr_ServerGetTrustInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_netr_ServerGetTrustInfo_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerGetTrustInfo_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.return_authenticator = *state->tmp.out.return_authenticator;
+       *state->orig.out.new_owf_password = *state->tmp.out.new_owf_password;
+       *state->orig.out.old_owf_password = *state->tmp.out.old_owf_password;
+       *state->orig.out.trust_info = *state->tmp.out.trust_info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_netr_ServerGetTrustInfo_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_netr_ServerGetTrustInfo_state *state = tevent_req_data(
+               req, struct rpccli_netr_ServerGetTrustInfo_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_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
index ffb877e21b571dd1d4aad8aa15cdef2939162d9c..eb6b1933274c6973a87d951e5b6cacc9f042b496 100644 (file)
@@ -1,6 +1,16 @@
 #include "../librpc/gen_ndr/ndr_netlogon.h"
 #ifndef __CLI_NETLOGON__
 #define __CLI_NETLOGON__
+struct tevent_req *rpccli_netr_LogonUasLogon_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_account_name /* [in] [charset(UTF16)] */,
+                                                 const char *_workstation /* [in] [charset(UTF16)] */,
+                                                 struct netr_UasInfo **_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_LogonUasLogon_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -8,6 +18,16 @@ NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli,
                                   const char *workstation /* [in] [charset(UTF16)] */,
                                   struct netr_UasInfo **info /* [out] [ref] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_netr_LogonUasLogoff_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_account_name /* [in] [charset(UTF16)] */,
+                                                  const char *_workstation /* [in] [charset(UTF16)] */,
+                                                  struct netr_UasLogoffInfo *_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_LogonUasLogoff_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -15,6 +35,21 @@ NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli,
                                    const char *workstation /* [in] [charset(UTF16)] */,
                                    struct netr_UasLogoffInfo *info /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_netr_LogonSamLogon_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                 struct netr_Authenticator *_credential /* [in] [unique] */,
+                                                 struct netr_Authenticator *_return_authenticator /* [in,out] [unique] */,
+                                                 enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                 union netr_LogonLevel *_logon /* [in] [ref,switch_is(logon_level)] */,
+                                                 uint16_t _validation_level /* [in]  */,
+                                                 union netr_Validation *_validation /* [out] [ref,switch_is(validation_level)] */,
+                                                 uint8_t *_authoritative /* [out] [ref] */);
+NTSTATUS rpccli_netr_LogonSamLogon_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -26,6 +61,18 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
                                   uint16_t validation_level /* [in]  */,
                                   union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
                                   uint8_t *authoritative /* [out] [ref] */);
+struct tevent_req *rpccli_netr_LogonSamLogoff_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                  struct netr_Authenticator *_credential /* [in] [unique] */,
+                                                  struct netr_Authenticator *_return_authenticator /* [in,out] [unique] */,
+                                                  enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                  union netr_LogonLevel _logon /* [in] [switch_is(logon_level)] */);
+NTSTATUS rpccli_netr_LogonSamLogoff_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -34,12 +81,34 @@ NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
                                    struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
                                    enum netr_LogonInfoClass logon_level /* [in]  */,
                                    union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */);
+struct tevent_req *rpccli_netr_ServerReqChallenge_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                      struct netr_Credential *_credentials /* [in] [ref] */,
+                                                      struct netr_Credential *_return_credentials /* [out] [ref] */);
+NTSTATUS rpccli_netr_ServerReqChallenge_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
                                        const char *computer_name /* [in] [charset(UTF16)] */,
                                        struct netr_Credential *credentials /* [in] [ref] */,
                                        struct netr_Credential *return_credentials /* [out] [ref] */);
+struct tevent_req *rpccli_netr_ServerAuthenticate_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_account_name /* [in] [charset(UTF16)] */,
+                                                      enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                      const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                      struct netr_Credential *_credentials /* [in] [ref] */,
+                                                      struct netr_Credential *_return_credentials /* [out] [ref] */);
+NTSTATUS rpccli_netr_ServerAuthenticate_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -48,6 +117,19 @@ NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
                                        const char *computer_name /* [in] [charset(UTF16)] */,
                                        struct netr_Credential *credentials /* [in] [ref] */,
                                        struct netr_Credential *return_credentials /* [out] [ref] */);
+struct tevent_req *rpccli_netr_ServerPasswordSet_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_account_name /* [in] [charset(UTF16)] */,
+                                                     enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                     const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                     struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                     struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                     struct samr_Password *_new_password /* [in] [ref] */);
+NTSTATUS rpccli_netr_ServerPasswordSet_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -57,6 +139,20 @@ NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
                                       struct netr_Authenticator *credential /* [in] [ref] */,
                                       struct netr_Authenticator *return_authenticator /* [out] [ref] */,
                                       struct samr_Password *new_password /* [in] [ref] */);
+struct tevent_req *rpccli_netr_DatabaseDeltas_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                  const char *_computername /* [in] [charset(UTF16)] */,
+                                                  struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                  struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                  enum netr_SamDatabaseID _database_id /* [in]  */,
+                                                  uint64_t *_sequence_num /* [in,out] [ref] */,
+                                                  struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */,
+                                                  uint32_t _preferredmaximumlength /* [in]  */);
+NTSTATUS rpccli_netr_DatabaseDeltas_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *logon_server /* [in] [charset(UTF16)] */,
@@ -67,6 +163,20 @@ NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli,
                                    uint64_t *sequence_num /* [in,out] [ref] */,
                                    struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
                                    uint32_t preferredmaximumlength /* [in]  */);
+struct tevent_req *rpccli_netr_DatabaseSync_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                const char *_computername /* [in] [charset(UTF16)] */,
+                                                struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                enum netr_SamDatabaseID _database_id /* [in]  */,
+                                                uint32_t *_sync_context /* [in,out] [ref] */,
+                                                struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */,
+                                                uint32_t _preferredmaximumlength /* [in]  */);
+NTSTATUS rpccli_netr_DatabaseSync_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *logon_server /* [in] [charset(UTF16)] */,
@@ -77,6 +187,24 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
                                  uint32_t *sync_context /* [in,out] [ref] */,
                                  struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
                                  uint32_t preferredmaximumlength /* [in]  */);
+struct tevent_req *rpccli_netr_AccountDeltas_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_computername /* [in] [charset(UTF16)] */,
+                                                 struct netr_Authenticator _credential /* [in]  */,
+                                                 struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                 struct netr_UAS_INFO_0 _uas /* [in]  */,
+                                                 uint32_t _count /* [in]  */,
+                                                 uint32_t _level /* [in]  */,
+                                                 uint32_t _buffersize /* [in]  */,
+                                                 struct netr_AccountBuffer *_buffer /* [out] [ref,subcontext(4)] */,
+                                                 uint32_t *_count_returned /* [out] [ref] */,
+                                                 uint32_t *_total_entries /* [out] [ref] */,
+                                                 struct netr_UAS_INFO_0 *_recordid /* [out] [ref] */);
+NTSTATUS rpccli_netr_AccountDeltas_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *logon_server /* [in] [unique,charset(UTF16)] */,
@@ -91,6 +219,24 @@ NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli,
                                   uint32_t *count_returned /* [out] [ref] */,
                                   uint32_t *total_entries /* [out] [ref] */,
                                   struct netr_UAS_INFO_0 *recordid /* [out] [ref] */);
+struct tevent_req *rpccli_netr_AccountSync_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                               const char *_computername /* [in] [charset(UTF16)] */,
+                                               struct netr_Authenticator _credential /* [in]  */,
+                                               struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                               uint32_t _reference /* [in]  */,
+                                               uint32_t _level /* [in]  */,
+                                               uint32_t _buffersize /* [in]  */,
+                                               struct netr_AccountBuffer *_buffer /* [out] [ref,subcontext(4)] */,
+                                               uint32_t *_count_returned /* [out] [ref] */,
+                                               uint32_t *_total_entries /* [out] [ref] */,
+                                               uint32_t *_next_reference /* [out] [ref] */,
+                                               struct netr_UAS_INFO_0 *_recordid /* [in,out] [ref] */);
+NTSTATUS rpccli_netr_AccountSync_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 const char *logon_server /* [in] [unique,charset(UTF16)] */,
@@ -105,12 +251,31 @@ NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli,
                                 uint32_t *total_entries /* [out] [ref] */,
                                 uint32_t *next_reference /* [out] [ref] */,
                                 struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */);
+struct tevent_req *rpccli_netr_GetDcName_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             const char *_logon_server /* [in] [charset(UTF16)] */,
+                                             const char *_domainname /* [in] [unique,charset(UTF16)] */,
+                                             const char **_dcname /* [out] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_netr_GetDcName_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               const char *logon_server /* [in] [charset(UTF16)] */,
                               const char *domainname /* [in] [unique,charset(UTF16)] */,
                               const char **dcname /* [out] [ref,charset(UTF16)] */,
                               WERROR *werror);
+struct tevent_req *rpccli_netr_LogonControl_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                enum netr_LogonControlCode _function_code /* [in]  */,
+                                                uint32_t _level /* [in]  */,
+                                                union netr_CONTROL_QUERY_INFORMATION *_query /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_netr_LogonControl_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
@@ -118,12 +283,32 @@ NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
                                  uint32_t level /* [in]  */,
                                  union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_netr_GetAnyDCName_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                const char *_domainname /* [in] [unique,charset(UTF16)] */,
+                                                const char **_dcname /* [out] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_netr_GetAnyDCName_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
                                  const char *domainname /* [in] [unique,charset(UTF16)] */,
                                  const char **dcname /* [out] [ref,charset(UTF16)] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_netr_LogonControl2_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                 enum netr_LogonControlCode _function_code /* [in]  */,
+                                                 uint32_t _level /* [in]  */,
+                                                 union netr_CONTROL_DATA_INFORMATION *_data /* [in] [ref,switch_is(function_code)] */,
+                                                 union netr_CONTROL_QUERY_INFORMATION *_query /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_netr_LogonControl2_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *logon_server /* [in] [unique,charset(UTF16)] */,
@@ -132,6 +317,19 @@ NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
                                   union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
                                   union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_netr_ServerAuthenticate2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_account_name /* [in] [charset(UTF16)] */,
+                                                       enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                       const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                       struct netr_Credential *_credentials /* [in] [ref] */,
+                                                       struct netr_Credential *_return_credentials /* [out] [ref] */,
+                                                       uint32_t *_negotiate_flags /* [in,out] [ref] */);
+NTSTATUS rpccli_netr_ServerAuthenticate2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -141,6 +339,21 @@ NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli,
                                         struct netr_Credential *credentials /* [in] [ref] */,
                                         struct netr_Credential *return_credentials /* [out] [ref] */,
                                         uint32_t *negotiate_flags /* [in,out] [ref] */);
+struct tevent_req *rpccli_netr_DatabaseSync2_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                 const char *_computername /* [in] [charset(UTF16)] */,
+                                                 struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                 struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                 enum netr_SamDatabaseID _database_id /* [in]  */,
+                                                 enum SyncStateEnum _restart_state /* [in]  */,
+                                                 uint32_t *_sync_context /* [in,out] [ref] */,
+                                                 struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */,
+                                                 uint32_t _preferredmaximumlength /* [in]  */);
+NTSTATUS rpccli_netr_DatabaseSync2_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *logon_server /* [in] [charset(UTF16)] */,
@@ -152,6 +365,19 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli,
                                   uint32_t *sync_context /* [in,out] [ref] */,
                                   struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
                                   uint32_t preferredmaximumlength /* [in]  */);
+struct tevent_req *rpccli_netr_DatabaseRedo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_logon_server /* [in] [charset(UTF16)] */,
+                                                const char *_computername /* [in] [charset(UTF16)] */,
+                                                struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                struct netr_ChangeLogEntry _change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
+                                                uint32_t _change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
+                                                struct netr_DELTA_ENUM_ARRAY **_delta_enum_array /* [out] [ref] */);
+NTSTATUS rpccli_netr_DatabaseRedo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *logon_server /* [in] [charset(UTF16)] */,
@@ -161,6 +387,17 @@ NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli,
                                  struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
                                  uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
                                  struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */);
+struct tevent_req *rpccli_netr_LogonControl2Ex_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_logon_server /* [in] [unique,charset(UTF16)] */,
+                                                   enum netr_LogonControlCode _function_code /* [in]  */,
+                                                   uint32_t _level /* [in]  */,
+                                                   union netr_CONTROL_DATA_INFORMATION *_data /* [in] [ref,switch_is(function_code)] */,
+                                                   union netr_CONTROL_QUERY_INFORMATION *_query /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_netr_LogonControl2Ex_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *logon_server /* [in] [unique,charset(UTF16)] */,
@@ -169,11 +406,31 @@ NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
                                     union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
                                     union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_netr_NetrEnumerateTrustedDomains_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                               struct netr_Blob *_trusted_domains_blob /* [out] [ref] */);
+NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result);
 NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
                                                 struct netr_Blob *trusted_domains_blob /* [out] [ref] */,
                                                 WERROR *werror);
+struct tevent_req *rpccli_netr_DsRGetDCName_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                struct GUID *_domain_guid /* [in] [unique] */,
+                                                struct GUID *_site_guid /* [in] [unique] */,
+                                                uint32_t _flags /* [in]  */,
+                                                struct netr_DsRGetDCNameInfo **_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsRGetDCName_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -183,6 +440,18 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
                                  uint32_t flags /* [in]  */,
                                  struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_netr_LogonGetCapabilities_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_name /* [in] [charset(UTF16)] */,
+                                                        const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                        struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                        struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                        uint32_t _query_level /* [in]  */,
+                                                        union netr_Capabilities *_capabilities /* [out] [ref,switch_is(query_level)] */);
+NTSTATUS rpccli_netr_LogonGetCapabilities_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              NTSTATUS *result);
 NTSTATUS rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_name /* [in] [charset(UTF16)] */,
@@ -191,21 +460,62 @@ NTSTATUS rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client *cli,
                                          struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
                                          uint32_t query_level /* [in]  */,
                                          union netr_Capabilities *capabilities /* [out] [ref,switch_is(query_level)] */);
+struct tevent_req *rpccli_netr_NETRLOGONSETSERVICEBITS_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_netr_LogonGetTrustRid_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_rid /* [out] [ref] */);
+NTSTATUS rpccli_netr_LogonGetTrustRid_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
                                      const char *domain_name /* [in] [unique,charset(UTF16)] */,
                                      uint32_t *rid /* [out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  WERROR *werror);
+struct tevent_req *rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  WERROR *werror);
+struct tevent_req *rpccli_netr_ServerAuthenticate3_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_account_name /* [in] [charset(UTF16)] */,
+                                                       enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                       const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                       struct netr_Credential *_credentials /* [in] [ref] */,
+                                                       struct netr_Credential *_return_credentials /* [out] [ref] */,
+                                                       uint32_t *_negotiate_flags /* [in,out] [ref] */,
+                                                       uint32_t *_rid /* [out] [ref] */);
+NTSTATUS rpccli_netr_ServerAuthenticate3_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -216,6 +526,18 @@ NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli,
                                         struct netr_Credential *return_credentials /* [out] [ref] */,
                                         uint32_t *negotiate_flags /* [in,out] [ref] */,
                                         uint32_t *rid /* [out] [ref] */);
+struct tevent_req *rpccli_netr_DsRGetDCNameEx_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                  struct GUID *_domain_guid /* [in] [unique] */,
+                                                  const char *_site_name /* [in] [unique,charset(UTF16)] */,
+                                                  uint32_t _flags /* [in]  */,
+                                                  struct netr_DsRGetDCNameInfo **_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsRGetDCNameEx_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -225,11 +547,32 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli,
                                    uint32_t flags /* [in]  */,
                                    struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_netr_DsRGetSiteName_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                  const char **_site /* [out] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_netr_DsRGetSiteName_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *computer_name /* [in] [unique,charset(UTF16)] */,
                                    const char **site /* [out] [ref,charset(UTF16)] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_netr_LogonGetDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [charset(UTF16)] */,
+                                                      const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                      struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                      struct netr_Authenticator *_return_authenticator /* [in,out] [ref] */,
+                                                      uint32_t _level /* [in]  */,
+                                                      union netr_DomainQuery _query /* [in] [switch_is(level)] */,
+                                                      union netr_DomainInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_netr_LogonGetDomainInfo_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [charset(UTF16)] */,
@@ -239,6 +582,19 @@ NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli,
                                        uint32_t level /* [in]  */,
                                        union netr_DomainQuery query /* [in] [switch_is(level)] */,
                                        union netr_DomainInfo *info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_netr_ServerPasswordSet2_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_account_name /* [in] [charset(UTF16)] */,
+                                                      enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                      const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                      struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                      struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                      struct netr_CryptPassword *_new_password /* [in] [ref] */);
+NTSTATUS rpccli_netr_ServerPasswordSet2_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -248,6 +604,19 @@ NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
                                        struct netr_Authenticator *credential /* [in] [ref] */,
                                        struct netr_Authenticator *return_authenticator /* [out] [ref] */,
                                        struct netr_CryptPassword *new_password /* [in] [ref] */);
+struct tevent_req *rpccli_netr_ServerPasswordGet_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_account_name /* [in] [charset(UTF16)] */,
+                                                     enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                     const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                     struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                     struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                     struct samr_Password *_password /* [out] [ref] */);
+NTSTATUS rpccli_netr_ServerPasswordGet_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -258,9 +627,25 @@ NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli,
                                       struct netr_Authenticator *return_authenticator /* [out] [ref] */,
                                       struct samr_Password *password /* [out] [ref] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_netr_NETRLOGONSENDTOSAM_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror);
+struct tevent_req *rpccli_netr_DsRAddressToSitenamesW_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _count /* [in] [range(0,32000)] */,
+                                                          struct netr_DsRAddress *_addresses /* [in] [ref,size_is(count)] */,
+                                                          struct netr_DsRAddressToSitenamesWCtr **_ctr /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsRAddressToSitenamesW_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -268,6 +653,20 @@ NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli,
                                            struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */,
                                            struct netr_DsRAddressToSitenamesWCtr **ctr /* [out] [ref] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_netr_DsRGetDCNameEx2_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   const char *_client_account /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _mask /* [in]  */,
+                                                   const char *_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                   struct GUID *_domain_guid /* [in] [unique] */,
+                                                   const char *_site_name /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _flags /* [in]  */,
+                                                   struct netr_DsRGetDCNameInfo **_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsRGetDCNameEx2_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -279,14 +678,38 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli,
                                     uint32_t flags /* [in]  */,
                                     struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_send(TALLOC_CTX *mem_ctx,
+                                                                       struct tevent_context *ev,
+                                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_recv(struct tevent_req *req,
+                                                             TALLOC_CTX *mem_ctx,
+                                                             WERROR *result);
 NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli,
                                                         TALLOC_CTX *mem_ctx,
                                                         WERROR *werror);
+struct tevent_req *rpccli_netr_NetrEnumerateTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli,
+                                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                 struct netr_DomainTrustList *_dom_trust_list /* [out] [ref] */);
+NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result);
 NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
                                                   struct netr_DomainTrustList *dom_trust_list /* [out] [ref] */,
                                                   WERROR *werror);
+struct tevent_req *rpccli_netr_DsRAddressToSitenamesExW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t _count /* [in] [range(0,32000)] */,
+                                                            struct netr_DsRAddress *_addresses /* [in] [ref,size_is(count)] */,
+                                                            struct netr_DsRAddressToSitenamesExWCtr **_ctr /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsRAddressToSitenamesExW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -294,11 +717,33 @@ NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli,
                                              struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */,
                                              struct netr_DsRAddressToSitenamesExWCtr **ctr /* [out] [ref] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_netr_DsrGetDcSiteCoverageW_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                         struct DcSitesCtr **_ctr /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *server_name /* [in] [unique,charset(UTF16)] */,
                                           struct DcSitesCtr **ctr /* [out] [ref] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_netr_LogonSamLogonEx_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                   const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                   enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                   union netr_LogonLevel *_logon /* [in] [ref,switch_is(logon_level)] */,
+                                                   uint16_t _validation_level /* [in]  */,
+                                                   union netr_Validation *_validation /* [out] [ref,switch_is(validation_level)] */,
+                                                   uint8_t *_authoritative /* [out] [ref] */,
+                                                   uint32_t *_flags /* [in,out] [ref] */);
+NTSTATUS rpccli_netr_LogonSamLogonEx_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -309,12 +754,32 @@ NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
                                     union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
                                     uint8_t *authoritative /* [out] [ref] */,
                                     uint32_t *flags /* [in,out] [ref] */);
+struct tevent_req *rpccli_netr_DsrEnumerateDomainTrusts_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t _trust_flags /* [in]  */,
+                                                            struct netr_DomainTrustList *_trusts /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
                                              uint32_t trust_flags /* [in]  */,
                                              struct netr_DomainTrustList *trusts /* [out] [ref] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_netr_DsrDeregisterDNSHostRecords_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_domain /* [in] [unique,charset(UTF16)] */,
+                                                               struct GUID *_domain_guid /* [in] [unique] */,
+                                                               struct GUID *_dsa_guid /* [in] [unique] */,
+                                                               const char *_dns_host /* [in] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result);
 NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -323,6 +788,20 @@ NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli,
                                                 struct GUID *dsa_guid /* [in] [unique] */,
                                                 const char *dns_host /* [in] [ref,charset(UTF16)] */,
                                                 WERROR *werror);
+struct tevent_req *rpccli_netr_ServerTrustPasswordsGet_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           const char *_account_name /* [in] [charset(UTF16)] */,
+                                                           enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                           const char *_computer_name /* [in] [charset(UTF16)] */,
+                                                           struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                           struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                           struct samr_Password *_password /* [out] [ref] */,
+                                                           struct samr_Password *_password2 /* [out] [ref] */);
+NTSTATUS rpccli_netr_ServerTrustPasswordsGet_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -333,6 +812,16 @@ NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli,
                                             struct netr_Authenticator *return_authenticator /* [out] [ref] */,
                                             struct samr_Password *password /* [out] [ref] */,
                                             struct samr_Password *password2 /* [out] [ref] */);
+struct tevent_req *rpccli_netr_DsRGetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_trusted_domain_name /* [in] [unique,charset(UTF16)] */,
+                                                                uint32_t _flags /* [in]  */,
+                                                                struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_DsRGetForestTrustInformation_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -340,6 +829,18 @@ NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli,
                                                  uint32_t flags /* [in]  */,
                                                  struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */,
                                                  WERROR *werror);
+struct tevent_req *rpccli_netr_GetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                             const char *_trusted_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                             struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                             struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                             uint32_t _flags /* [in]  */,
+                                                             struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_GetForestTrustInformation_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -349,6 +850,22 @@ NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli,
                                               uint32_t flags /* [in]  */,
                                               struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */,
                                               WERROR *werror);
+struct tevent_req *rpccli_netr_LogonSamLogonWithFlags_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_computer_name /* [in] [unique,charset(UTF16)] */,
+                                                          struct netr_Authenticator *_credential /* [in] [unique] */,
+                                                          struct netr_Authenticator *_return_authenticator /* [in,out] [unique] */,
+                                                          enum netr_LogonInfoClass _logon_level /* [in]  */,
+                                                          union netr_LogonLevel *_logon /* [in] [ref,switch_is(logon_level)] */,
+                                                          uint16_t _validation_level /* [in]  */,
+                                                          union netr_Validation *_validation /* [out] [ref,switch_is(validation_level)] */,
+                                                          uint8_t *_authoritative /* [out] [ref] */,
+                                                          uint32_t *_flags /* [in,out] [ref] */);
+NTSTATUS rpccli_netr_LogonSamLogonWithFlags_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result);
 NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -361,6 +878,21 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
                                            union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
                                            uint8_t *authoritative /* [out] [ref] */,
                                            uint32_t *flags /* [in,out] [ref] */);
+struct tevent_req *rpccli_netr_ServerGetTrustInfo_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_account_name /* [in] [ref,charset(UTF16)] */,
+                                                      enum netr_SchannelType _secure_channel_type /* [in]  */,
+                                                      const char *_computer_name /* [in] [ref,charset(UTF16)] */,
+                                                      struct netr_Authenticator *_credential /* [in] [ref] */,
+                                                      struct netr_Authenticator *_return_authenticator /* [out] [ref] */,
+                                                      struct samr_Password *_new_owf_password /* [out] [ref] */,
+                                                      struct samr_Password *_old_owf_password /* [out] [ref] */,
+                                                      struct netr_TrustInfo **_trust_info /* [out] [ref] */);
+NTSTATUS rpccli_netr_ServerGetTrustInfo_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
index 179368de14a454644948faefe663fb51e7ec7c3e..5096be955951b697f5b2466a564eba7227443d9c 100644 (file)
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_ntsvcs.h"
 
-NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              WERROR *werror)
+struct rpccli_PNP_Disconnect_state {
+       struct PNP_Disconnect orig;
+       struct PNP_Disconnect tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_Disconnect_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_Disconnect_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli)
 {
-       struct PNP_Disconnect r;
-       NTSTATUS status;
-
-       /* In parameters */
+       struct tevent_req *req;
+       struct rpccli_PNP_Disconnect_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_Disconnect, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_Disconnect_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_DISCONNECT,
-                               &r);
+       /* In parameters */
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &r);
-       }
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_Disconnect, &state->orig);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_DISCONNECT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
-
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_set_callback(subreq, rpccli_PNP_Disconnect_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli,
-                           TALLOC_CTX *mem_ctx,
-                           WERROR *werror)
+static void rpccli_PNP_Disconnect_done(struct tevent_req *subreq)
 {
-       struct PNP_Connect r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_Disconnect_state *state = tevent_req_data(
+               req, struct rpccli_PNP_Disconnect_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_Connect, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_CONNECT,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_Connect, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_Disconnect_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_PNP_Disconnect_state *state = tevent_req_data(
+               req, struct rpccli_PNP_Disconnect_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
-                              uint16_t *version /* [out] [ref] */,
                               WERROR *werror)
 {
-       struct PNP_GetVersion r;
+       struct PNP_Disconnect r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetVersion, &r);
+               NDR_PRINT_IN_DEBUG(PNP_Disconnect, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETVERSION,
+                               NDR_PNP_DISCONNECT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -113,7 +140,7 @@ NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -121,7 +148,6 @@ NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *version = *r.out.version;
 
        /* Return result */
        if (werror) {
@@ -131,64 +157,133 @@ NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+struct rpccli_PNP_Connect_state {
+       struct PNP_Connect orig;
+       struct PNP_Connect tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_Connect_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_Connect_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli)
 {
-       struct PNP_GetGlobalState r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_Connect_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_Connect_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &r);
+               NDR_PRINT_IN_DEBUG(PNP_Connect, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETGLOBALSTATE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_CONNECT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_Connect_done, req);
+       return req;
+}
+
+static void rpccli_PNP_Connect_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_Connect_state *state = tevent_req_data(
+               req, struct rpccli_PNP_Connect_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_Connect, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_Connect_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result)
+{
+       struct rpccli_PNP_Connect_state *state = tevent_req_data(
+               req, struct rpccli_PNP_Connect_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 WERROR *werror)
+NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli,
+                           TALLOC_CTX *mem_ctx,
+                           WERROR *werror)
 {
-       struct PNP_InitDetection r;
+       struct PNP_Connect r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_InitDetection, &r);
+               NDR_PRINT_IN_DEBUG(PNP_Connect, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_INITDETECTION,
+                               NDR_PNP_CONNECT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -196,7 +291,7 @@ NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_Connect, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -213,68 +308,143 @@ NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               WERROR *werror)
+struct rpccli_PNP_GetVersion_state {
+       struct PNP_GetVersion orig;
+       struct PNP_GetVersion tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetVersion_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetVersion_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t *_version /* [out] [ref] */)
 {
-       struct PNP_ReportLogOn r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetVersion_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetVersion_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+       state->orig.out.version = _version;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetVersion, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_REPORTLOGON,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_PNP_GetVersion_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_ntsvcs,
+                                   NDR_PNP_GETVERSION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetVersion_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetVersion_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetVersion_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetVersion_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.version = *state->tmp.out.version;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetVersion_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_PNP_GetVersion_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetVersion_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          const char *devicepath /* [in] [ref,charset(UTF16)] */,
-                                          uint32_t flags /* [in]  */,
-                                          WERROR *werror)
+NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              uint16_t *version /* [out] [ref] */,
+                              WERROR *werror)
 {
-       struct PNP_ValidateDeviceInstance r;
+       struct PNP_GetVersion r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.devicepath = devicepath;
-       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetVersion, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_VALIDATEDEVICEINSTANCE,
+                               NDR_PNP_GETVERSION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -282,7 +452,7 @@ NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -290,6 +460,7 @@ NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *version = *r.out.version;
 
        /* Return result */
        if (werror) {
@@ -299,64 +470,133 @@ NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         WERROR *werror)
+struct rpccli_PNP_GetGlobalState_state {
+       struct PNP_GetGlobalState orig;
+       struct PNP_GetGlobalState tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetGlobalState_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetGlobalState_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
 {
-       struct PNP_GetRootDeviceInstance r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetGlobalState_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetGlobalState_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETROOTDEVICEINSTANCE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETGLOBALSTATE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetGlobalState_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetGlobalState_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetGlobalState_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetGlobalState_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetGlobalState_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_PNP_GetGlobalState_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetGlobalState_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            WERROR *werror)
+NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
 {
-       struct PNP_GetRelatedDeviceInstance r;
+       struct PNP_GetGlobalState r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETRELATEDDEVICEINSTANCE,
+                               NDR_PNP_GETGLOBALSTATE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -364,7 +604,7 @@ NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -381,71 +621,133 @@ NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
-{
-       struct PNP_EnumerateSubKeys r;
-       NTSTATUS status;
+struct rpccli_PNP_InitDetection_state {
+       struct PNP_InitDetection orig;
+       struct PNP_InitDetection tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
 
-       /* In parameters */
+static void rpccli_PNP_InitDetection_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_InitDetection_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_InitDetection_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_InitDetection_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &r);
+               NDR_PRINT_IN_DEBUG(PNP_InitDetection, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_ENUMERATESUBKEYS,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_INITDETECTION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_InitDetection_done, req);
+       return req;
+}
+
+static void rpccli_PNP_InitDetection_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_InitDetection_state *state = tevent_req_data(
+               req, struct rpccli_PNP_InitDetection_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_InitDetection_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_InitDetection_state *state = tevent_req_data(
+               req, struct rpccli_PNP_InitDetection_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
-                                 const char *filter /* [in] [unique,charset(UTF16)] */,
-                                 uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
-                                 uint32_t *length /* [in,out] [ref] */,
-                                 uint32_t flags /* [in]  */,
                                  WERROR *werror)
 {
-       struct PNP_GetDeviceList r;
+       struct PNP_InitDetection r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.filter = filter;
-       r.in.length = length;
-       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r);
+               NDR_PRINT_IN_DEBUG(PNP_InitDetection, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETDEVICELIST,
+                               NDR_PNP_INITDETECTION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -453,7 +755,7 @@ NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -461,8 +763,6 @@ NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer));
-       *length = *r.out.length;
 
        /* Return result */
        if (werror) {
@@ -472,70 +772,133 @@ NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     const char *devicename /* [in] [unique,charset(UTF16)] */,
-                                     uint32_t *size /* [out] [ref] */,
-                                     uint32_t flags /* [in]  */,
-                                     WERROR *werror)
+struct rpccli_PNP_ReportLogOn_state {
+       struct PNP_ReportLogOn orig;
+       struct PNP_ReportLogOn tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_ReportLogOn_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_ReportLogOn_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli)
 {
-       struct PNP_GetDeviceListSize r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_ReportLogOn_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_ReportLogOn_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.devicename = devicename;
-       r.in.flags = flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &r);
+               NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETDEVICELISTSIZE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_REPORTLOGON,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_ReportLogOn_done, req);
+       return req;
+}
+
+static void rpccli_PNP_ReportLogOn_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_ReportLogOn_state *state = tevent_req_data(
+               req, struct rpccli_PNP_ReportLogOn_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_ReportLogOn_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_PNP_ReportLogOn_state *state = tevent_req_data(
+               req, struct rpccli_PNP_ReportLogOn_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *size = *r.out.size;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli,
-                            TALLOC_CTX *mem_ctx,
-                            WERROR *werror)
+NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *werror)
 {
-       struct PNP_GetDepth r;
+       struct PNP_ReportLogOn r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetDepth, &r);
+               NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETDEPTH,
+                               NDR_PNP_REPORTLOGON,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -543,7 +906,7 @@ NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -560,81 +923,141 @@ NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    const char *devicepath /* [in] [ref,charset(UTF16)] */,
-                                    uint32_t property /* [in]  */,
-                                    enum winreg_Type *reg_data_type /* [in,out] [ref] */,
-                                    uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
-                                    uint32_t *buffer_size /* [in,out] [ref] */,
-                                    uint32_t *needed /* [in,out] [ref] */,
-                                    uint32_t flags /* [in]  */,
-                                    WERROR *werror)
+struct rpccli_PNP_ValidateDeviceInstance_state {
+       struct PNP_ValidateDeviceInstance orig;
+       struct PNP_ValidateDeviceInstance tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_ValidateDeviceInstance_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_devicepath /* [in] [ref,charset(UTF16)] */,
+                                                         uint32_t _flags /* [in]  */)
 {
-       struct PNP_GetDeviceRegProp r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_ValidateDeviceInstance_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_ValidateDeviceInstance_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.devicepath = devicepath;
-       r.in.property = property;
-       r.in.reg_data_type = reg_data_type;
-       r.in.buffer_size = buffer_size;
-       r.in.needed = needed;
-       r.in.flags = flags;
+       state->orig.in.devicepath = _devicepath;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r);
+               NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETDEVICEREGPROP,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_VALIDATEDEVICEINSTANCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_ValidateDeviceInstance_done, req);
+       return req;
+}
+
+static void rpccli_PNP_ValidateDeviceInstance_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_ValidateDeviceInstance_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_ValidateDeviceInstance_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_PNP_ValidateDeviceInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_ValidateDeviceInstance_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *reg_data_type = *r.out.reg_data_type;
-       memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
-       *buffer_size = *r.out.buffer_size;
-       *needed = *r.out.needed;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
+NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          const char *devicepath /* [in] [ref,charset(UTF16)] */,
+                                          uint32_t flags /* [in]  */,
+                                          WERROR *werror)
 {
-       struct PNP_SetDeviceRegProp r;
+       struct PNP_ValidateDeviceInstance r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.devicepath = devicepath;
+       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &r);
+               NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_SETDEVICEREGPROP,
+                               NDR_PNP_VALIDATEDEVICEINSTANCE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -642,7 +1065,7 @@ NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -659,64 +1082,133 @@ NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
+struct rpccli_PNP_GetRootDeviceInstance_state {
+       struct PNP_GetRootDeviceInstance orig;
+       struct PNP_GetRootDeviceInstance tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetRootDeviceInstance_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetRootDeviceInstance_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli)
 {
-       struct PNP_GetClassInstance r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetRootDeviceInstance_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetRootDeviceInstance_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETCLASSINSTANCE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETROOTDEVICEINSTANCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetRootDeviceInstance_done, req);
+       return req;
+}
 
+static void rpccli_PNP_GetRootDeviceInstance_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetRootDeviceInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetRootDeviceInstance_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetRootDeviceInstance_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_PNP_GetRootDeviceInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetRootDeviceInstance_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             WERROR *werror)
+NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *werror)
 {
-       struct PNP_CreateKey r;
+       struct PNP_GetRootDeviceInstance r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_CreateKey, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_CREATEKEY,
+                               NDR_PNP_GETROOTDEVICEINSTANCE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -724,7 +1216,7 @@ NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -741,23 +1233,4903 @@ NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     WERROR *werror)
-{
+struct rpccli_PNP_GetRelatedDeviceInstance_state {
+       struct PNP_GetRelatedDeviceInstance orig;
+       struct PNP_GetRelatedDeviceInstance tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetRelatedDeviceInstance_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetRelatedDeviceInstance_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetRelatedDeviceInstance_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetRelatedDeviceInstance_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETRELATEDDEVICEINSTANCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetRelatedDeviceInstance_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetRelatedDeviceInstance_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetRelatedDeviceInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetRelatedDeviceInstance_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetRelatedDeviceInstance_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_PNP_GetRelatedDeviceInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetRelatedDeviceInstance_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_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
+{
+       struct PNP_GetRelatedDeviceInstance r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETRELATEDDEVICEINSTANCE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_EnumerateSubKeys_state {
+       struct PNP_EnumerateSubKeys orig;
+       struct PNP_EnumerateSubKeys tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_EnumerateSubKeys_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_EnumerateSubKeys_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_EnumerateSubKeys_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_EnumerateSubKeys_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_ENUMERATESUBKEYS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_EnumerateSubKeys_done, req);
+       return req;
+}
+
+static void rpccli_PNP_EnumerateSubKeys_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_EnumerateSubKeys_state *state = tevent_req_data(
+               req, struct rpccli_PNP_EnumerateSubKeys_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_EnumerateSubKeys_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_EnumerateSubKeys_state *state = tevent_req_data(
+               req, struct rpccli_PNP_EnumerateSubKeys_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_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
+{
+       struct PNP_EnumerateSubKeys r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_ENUMERATESUBKEYS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetDeviceList_state {
+       struct PNP_GetDeviceList orig;
+       struct PNP_GetDeviceList tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetDeviceList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetDeviceList_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_filter /* [in] [unique,charset(UTF16)] */,
+                                                uint16_t *_buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
+                                                uint32_t *_length /* [in,out] [ref] */,
+                                                uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetDeviceList_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetDeviceList_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.filter = _filter;
+       state->orig.in.length = _length;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.length = _length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_PNP_GetDeviceList_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_ntsvcs,
+                                   NDR_PNP_GETDEVICELIST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceList_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetDeviceList_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetDeviceList_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceList_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 */
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.length * sizeof(*state->orig.out.buffer));
+       *state->orig.out.length = *state->tmp.out.length;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetDeviceList_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_GetDeviceList_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceList_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_PNP_GetDeviceList(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *filter /* [in] [unique,charset(UTF16)] */,
+                                 uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
+                                 uint32_t *length /* [in,out] [ref] */,
+                                 uint32_t flags /* [in]  */,
+                                 WERROR *werror)
+{
+       struct PNP_GetDeviceList r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.filter = filter;
+       r.in.length = length;
+       r.in.flags = flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETDEVICELIST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer));
+       *length = *r.out.length;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetDeviceListSize_state {
+       struct PNP_GetDeviceListSize orig;
+       struct PNP_GetDeviceListSize tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetDeviceListSize_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetDeviceListSize_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_devicename /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_size /* [out] [ref] */,
+                                                    uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetDeviceListSize_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetDeviceListSize_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.devicename = _devicename;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.size = _size;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_PNP_GetDeviceListSize_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_ntsvcs,
+                                   NDR_PNP_GETDEVICELISTSIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceListSize_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetDeviceListSize_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetDeviceListSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceListSize_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.size = *state->tmp.out.size;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetDeviceListSize_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_PNP_GetDeviceListSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceListSize_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_PNP_GetDeviceListSize(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *devicename /* [in] [unique,charset(UTF16)] */,
+                                     uint32_t *size /* [out] [ref] */,
+                                     uint32_t flags /* [in]  */,
+                                     WERROR *werror)
+{
+       struct PNP_GetDeviceListSize r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.devicename = devicename;
+       r.in.flags = flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETDEVICELISTSIZE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *size = *r.out.size;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetDepth_state {
+       struct PNP_GetDepth orig;
+       struct PNP_GetDepth tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetDepth_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetDepth_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetDepth_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetDepth_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDepth, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETDEPTH,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetDepth_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetDepth_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetDepth_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDepth_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetDepth_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *result)
+{
+       struct rpccli_PNP_GetDepth_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDepth_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_PNP_GetDepth(struct rpc_pipe_client *cli,
+                            TALLOC_CTX *mem_ctx,
+                            WERROR *werror)
+{
+       struct PNP_GetDepth r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDepth, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETDEPTH,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetDeviceRegProp_state {
+       struct PNP_GetDeviceRegProp orig;
+       struct PNP_GetDeviceRegProp tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetDeviceRegProp_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_devicepath /* [in] [ref,charset(UTF16)] */,
+                                                   uint32_t _property /* [in]  */,
+                                                   enum winreg_Type *_reg_data_type /* [in,out] [ref] */,
+                                                   uint8_t *_buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
+                                                   uint32_t *_buffer_size /* [in,out] [ref] */,
+                                                   uint32_t *_needed /* [in,out] [ref] */,
+                                                   uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetDeviceRegProp_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetDeviceRegProp_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.devicepath = _devicepath;
+       state->orig.in.property = _property;
+       state->orig.in.reg_data_type = _reg_data_type;
+       state->orig.in.buffer_size = _buffer_size;
+       state->orig.in.needed = _needed;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.reg_data_type = _reg_data_type;
+       state->orig.out.buffer = _buffer;
+       state->orig.out.buffer_size = _buffer_size;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_PNP_GetDeviceRegProp_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_ntsvcs,
+                                   NDR_PNP_GETDEVICEREGPROP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceRegProp_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetDeviceRegProp_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetDeviceRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceRegProp_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.reg_data_type = *state->tmp.out.reg_data_type;
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.buffer_size * sizeof(*state->orig.out.buffer));
+       *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetDeviceRegProp_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_GetDeviceRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceRegProp_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_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *devicepath /* [in] [ref,charset(UTF16)] */,
+                                    uint32_t property /* [in]  */,
+                                    enum winreg_Type *reg_data_type /* [in,out] [ref] */,
+                                    uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
+                                    uint32_t *buffer_size /* [in,out] [ref] */,
+                                    uint32_t *needed /* [in,out] [ref] */,
+                                    uint32_t flags /* [in]  */,
+                                    WERROR *werror)
+{
+       struct PNP_GetDeviceRegProp r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.devicepath = devicepath;
+       r.in.property = property;
+       r.in.reg_data_type = reg_data_type;
+       r.in.buffer_size = buffer_size;
+       r.in.needed = needed;
+       r.in.flags = flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETDEVICEREGPROP,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *reg_data_type = *r.out.reg_data_type;
+       memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
+       *buffer_size = *r.out.buffer_size;
+       *needed = *r.out.needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_SetDeviceRegProp_state {
+       struct PNP_SetDeviceRegProp orig;
+       struct PNP_SetDeviceRegProp tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_SetDeviceRegProp_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_SetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_SetDeviceRegProp_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_SetDeviceRegProp_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_SETDEVICEREGPROP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_SetDeviceRegProp_done, req);
+       return req;
+}
+
+static void rpccli_PNP_SetDeviceRegProp_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_SetDeviceRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetDeviceRegProp_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_SetDeviceRegProp_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_SetDeviceRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetDeviceRegProp_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_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
+{
+       struct PNP_SetDeviceRegProp r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_SETDEVICEREGPROP,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetClassInstance_state {
+       struct PNP_GetClassInstance orig;
+       struct PNP_GetClassInstance tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetClassInstance_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetClassInstance_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetClassInstance_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetClassInstance_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETCLASSINSTANCE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetClassInstance_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetClassInstance_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetClassInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassInstance_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetClassInstance_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_GetClassInstance_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassInstance_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_PNP_GetClassInstance(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
+{
+       struct PNP_GetClassInstance r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETCLASSINSTANCE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_CreateKey_state {
+       struct PNP_CreateKey orig;
+       struct PNP_CreateKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_CreateKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_CreateKey_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_CreateKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_CreateKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_CreateKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_CREATEKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_CreateKey_done, req);
+       return req;
+}
+
+static void rpccli_PNP_CreateKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_CreateKey_state *state = tevent_req_data(
+               req, struct rpccli_PNP_CreateKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_CreateKey_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result)
+{
+       struct rpccli_PNP_CreateKey_state *state = tevent_req_data(
+               req, struct rpccli_PNP_CreateKey_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_PNP_CreateKey(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *werror)
+{
+       struct PNP_CreateKey r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_CreateKey, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_CREATEKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_DeleteRegistryKey_state {
+       struct PNP_DeleteRegistryKey orig;
+       struct PNP_DeleteRegistryKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_DeleteRegistryKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_DeleteRegistryKey_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_DeleteRegistryKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_DeleteRegistryKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_DELETEREGISTRYKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_DeleteRegistryKey_done, req);
+       return req;
+}
+
+static void rpccli_PNP_DeleteRegistryKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_DeleteRegistryKey_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DeleteRegistryKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_DeleteRegistryKey_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_PNP_DeleteRegistryKey_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DeleteRegistryKey_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_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *werror)
+{
        struct PNP_DeleteRegistryKey r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &r);
+               NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_DELETEREGISTRYKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetClassCount_state {
+       struct PNP_GetClassCount orig;
+       struct PNP_GetClassCount tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetClassCount_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetClassCount_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetClassCount_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetClassCount_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETCLASSCOUNT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetClassCount_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetClassCount_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetClassCount_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassCount_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetClassCount_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_GetClassCount_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassCount_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_PNP_GetClassCount(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *werror)
+{
+       struct PNP_GetClassCount r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETCLASSCOUNT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetClassName_state {
+       struct PNP_GetClassName orig;
+       struct PNP_GetClassName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetClassName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetClassName_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetClassName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetClassName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassName, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETCLASSNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetClassName_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetClassName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetClassName_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassName_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetClassName_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_PNP_GetClassName_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassName_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_PNP_GetClassName(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *werror)
+{
+       struct PNP_GetClassName r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETCLASSNAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_DeleteClassKey_state {
+       struct PNP_DeleteClassKey orig;
+       struct PNP_DeleteClassKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_DeleteClassKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_DeleteClassKey_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_DeleteClassKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_DeleteClassKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_DELETECLASSKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_DeleteClassKey_done, req);
+       return req;
+}
+
+static void rpccli_PNP_DeleteClassKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_DeleteClassKey_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DeleteClassKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_DeleteClassKey_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_PNP_DeleteClassKey_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DeleteClassKey_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_PNP_DeleteClassKey(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct PNP_DeleteClassKey r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_DELETECLASSKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetInterfaceDeviceAlias_state {
+       struct PNP_GetInterfaceDeviceAlias orig;
+       struct PNP_GetInterfaceDeviceAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetInterfaceDeviceAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetInterfaceDeviceAlias_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetInterfaceDeviceAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetInterfaceDeviceAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETINTERFACEDEVICEALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceAlias_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetInterfaceDeviceAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetInterfaceDeviceAlias_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetInterfaceDeviceAlias_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_PNP_GetInterfaceDeviceAlias_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetInterfaceDeviceAlias_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_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *werror)
+{
+       struct PNP_GetInterfaceDeviceAlias r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETINTERFACEDEVICEALIAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetInterfaceDeviceList_state {
+       struct PNP_GetInterfaceDeviceList orig;
+       struct PNP_GetInterfaceDeviceList tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetInterfaceDeviceList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetInterfaceDeviceList_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetInterfaceDeviceList_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetInterfaceDeviceList_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETINTERFACEDEVICELIST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceList_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetInterfaceDeviceList_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetInterfaceDeviceList_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetInterfaceDeviceList_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetInterfaceDeviceList_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_PNP_GetInterfaceDeviceList_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetInterfaceDeviceList_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_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *werror)
+{
+       struct PNP_GetInterfaceDeviceList r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETINTERFACEDEVICELIST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetInterfaceDeviceListSize_state {
+       struct PNP_GetInterfaceDeviceListSize orig;
+       struct PNP_GetInterfaceDeviceListSize tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetInterfaceDeviceListSize_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetInterfaceDeviceListSize_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetInterfaceDeviceListSize_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetInterfaceDeviceListSize_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETINTERFACEDEVICELISTSIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetInterfaceDeviceListSize_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetInterfaceDeviceListSize_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetInterfaceDeviceListSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetInterfaceDeviceListSize_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_PNP_GetInterfaceDeviceListSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetInterfaceDeviceListSize_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_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *werror)
+{
+       struct PNP_GetInterfaceDeviceListSize r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETINTERFACEDEVICELISTSIZE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_RegisterDeviceClassAssociation_state {
+       struct PNP_RegisterDeviceClassAssociation orig;
+       struct PNP_RegisterDeviceClassAssociation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_RegisterDeviceClassAssociation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_RegisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_RegisterDeviceClassAssociation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_RegisterDeviceClassAssociation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_RegisterDeviceClassAssociation_done, req);
+       return req;
+}
+
+static void rpccli_PNP_RegisterDeviceClassAssociation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_RegisterDeviceClassAssociation_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RegisterDeviceClassAssociation_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result)
+{
+       struct rpccli_PNP_RegisterDeviceClassAssociation_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RegisterDeviceClassAssociation_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_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *werror)
+{
+       struct PNP_RegisterDeviceClassAssociation r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_UnregisterDeviceClassAssociation_state {
+       struct PNP_UnregisterDeviceClassAssociation orig;
+       struct PNP_UnregisterDeviceClassAssociation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_UnregisterDeviceClassAssociation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_UnregisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
+                                                                   struct tevent_context *ev,
+                                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_UnregisterDeviceClassAssociation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_UnregisterDeviceClassAssociation_done, req);
+       return req;
+}
+
+static void rpccli_PNP_UnregisterDeviceClassAssociation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state = tevent_req_data(
+               req, struct rpccli_PNP_UnregisterDeviceClassAssociation_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation_recv(struct tevent_req *req,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *result)
+{
+       struct rpccli_PNP_UnregisterDeviceClassAssociation_state *state = tevent_req_data(
+               req, struct rpccli_PNP_UnregisterDeviceClassAssociation_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_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *werror)
+{
+       struct PNP_UnregisterDeviceClassAssociation r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetClassRegProp_state {
+       struct PNP_GetClassRegProp orig;
+       struct PNP_GetClassRegProp tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetClassRegProp_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetClassRegProp_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetClassRegProp_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetClassRegProp_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETCLASSREGPROP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetClassRegProp_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetClassRegProp_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetClassRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassRegProp_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetClassRegProp_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_PNP_GetClassRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetClassRegProp_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_PNP_GetClassRegProp(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct PNP_GetClassRegProp r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETCLASSREGPROP,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_SetClassRegProp_state {
+       struct PNP_SetClassRegProp orig;
+       struct PNP_SetClassRegProp tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_SetClassRegProp_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_SetClassRegProp_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_SetClassRegProp_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_SetClassRegProp_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_SETCLASSREGPROP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_SetClassRegProp_done, req);
+       return req;
+}
+
+static void rpccli_PNP_SetClassRegProp_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_SetClassRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetClassRegProp_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_SetClassRegProp_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_PNP_SetClassRegProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetClassRegProp_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_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct PNP_SetClassRegProp r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_SETCLASSREGPROP,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_CreateDevInst_state {
+       struct PNP_CreateDevInst orig;
+       struct PNP_CreateDevInst tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_CreateDevInst_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_CreateDevInst_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_CreateDevInst_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_CreateDevInst_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_CREATEDEVINST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_CreateDevInst_done, req);
+       return req;
+}
+
+static void rpccli_PNP_CreateDevInst_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_CreateDevInst_state *state = tevent_req_data(
+               req, struct rpccli_PNP_CreateDevInst_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_CreateDevInst_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_CreateDevInst_state *state = tevent_req_data(
+               req, struct rpccli_PNP_CreateDevInst_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_PNP_CreateDevInst(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *werror)
+{
+       struct PNP_CreateDevInst r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_CREATEDEVINST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_DeviceInstanceAction_state {
+       struct PNP_DeviceInstanceAction orig;
+       struct PNP_DeviceInstanceAction tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_DeviceInstanceAction_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_DeviceInstanceAction_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_DeviceInstanceAction_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_DeviceInstanceAction_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_DEVICEINSTANCEACTION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_DeviceInstanceAction_done, req);
+       return req;
+}
+
+static void rpccli_PNP_DeviceInstanceAction_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_DeviceInstanceAction_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DeviceInstanceAction_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_DeviceInstanceAction_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_PNP_DeviceInstanceAction_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DeviceInstanceAction_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_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
+{
+       struct PNP_DeviceInstanceAction r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_DEVICEINSTANCEACTION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetDeviceStatus_state {
+       struct PNP_GetDeviceStatus orig;
+       struct PNP_GetDeviceStatus tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetDeviceStatus_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetDeviceStatus_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetDeviceStatus_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetDeviceStatus_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETDEVICESTATUS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetDeviceStatus_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetDeviceStatus_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetDeviceStatus_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceStatus_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetDeviceStatus_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_PNP_GetDeviceStatus_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetDeviceStatus_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_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct PNP_GetDeviceStatus r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_GETDEVICESTATUS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_SetDeviceProblem_state {
+       struct PNP_SetDeviceProblem orig;
+       struct PNP_SetDeviceProblem tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_SetDeviceProblem_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_SetDeviceProblem_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_SetDeviceProblem_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_SetDeviceProblem_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_SETDEVICEPROBLEM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_SetDeviceProblem_done, req);
+       return req;
+}
+
+static void rpccli_PNP_SetDeviceProblem_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_SetDeviceProblem_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetDeviceProblem_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_SetDeviceProblem_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_SetDeviceProblem_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetDeviceProblem_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_PNP_SetDeviceProblem(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
+{
+       struct PNP_SetDeviceProblem r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_SETDEVICEPROBLEM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_DisableDevInst_state {
+       struct PNP_DisableDevInst orig;
+       struct PNP_DisableDevInst tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_DisableDevInst_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_DisableDevInst_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_DisableDevInst_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_DisableDevInst_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_DISABLEDEVINST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_DisableDevInst_done, req);
+       return req;
+}
+
+static void rpccli_PNP_DisableDevInst_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_DisableDevInst_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DisableDevInst_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_DisableDevInst_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_PNP_DisableDevInst_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DisableDevInst_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_PNP_DisableDevInst(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct PNP_DisableDevInst r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_DISABLEDEVINST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_UninstallDevInst_state {
+       struct PNP_UninstallDevInst orig;
+       struct PNP_UninstallDevInst tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_UninstallDevInst_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_UninstallDevInst_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_UninstallDevInst_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_UninstallDevInst_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_UNINSTALLDEVINST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_UninstallDevInst_done, req);
+       return req;
+}
+
+static void rpccli_PNP_UninstallDevInst_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_UninstallDevInst_state *state = tevent_req_data(
+               req, struct rpccli_PNP_UninstallDevInst_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_UninstallDevInst_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_UninstallDevInst_state *state = tevent_req_data(
+               req, struct rpccli_PNP_UninstallDevInst_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_PNP_UninstallDevInst(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
+{
+       struct PNP_UninstallDevInst r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_UNINSTALLDEVINST,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_AddID_state {
+       struct PNP_AddID orig;
+       struct PNP_AddID tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_AddID_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_AddID_send(TALLOC_CTX *mem_ctx,
+                                        struct tevent_context *ev,
+                                        struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_AddID_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_AddID_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_AddID, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_ADDID,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_AddID_done, req);
+       return req;
+}
+
+static void rpccli_PNP_AddID_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_AddID_state *state = tevent_req_data(
+               req, struct rpccli_PNP_AddID_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_AddID, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_AddID_recv(struct tevent_req *req,
+                              TALLOC_CTX *mem_ctx,
+                              WERROR *result)
+{
+       struct rpccli_PNP_AddID_state *state = tevent_req_data(
+               req, struct rpccli_PNP_AddID_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_PNP_AddID(struct rpc_pipe_client *cli,
+                         TALLOC_CTX *mem_ctx,
+                         WERROR *werror)
+{
+       struct PNP_AddID r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_AddID, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_ADDID,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_AddID, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_RegisterDriver_state {
+       struct PNP_RegisterDriver orig;
+       struct PNP_RegisterDriver tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_RegisterDriver_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_RegisterDriver_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_RegisterDriver_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_RegisterDriver_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_REGISTERDRIVER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_RegisterDriver_done, req);
+       return req;
+}
+
+static void rpccli_PNP_RegisterDriver_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_RegisterDriver_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RegisterDriver_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_RegisterDriver_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_PNP_RegisterDriver_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RegisterDriver_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_PNP_RegisterDriver(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct PNP_RegisterDriver r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_REGISTERDRIVER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_QueryRemove_state {
+       struct PNP_QueryRemove orig;
+       struct PNP_QueryRemove tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_QueryRemove_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_QueryRemove_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_QueryRemove_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_QueryRemove_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_QUERYREMOVE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_QueryRemove_done, req);
+       return req;
+}
+
+static void rpccli_PNP_QueryRemove_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_QueryRemove_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryRemove_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_QueryRemove_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_PNP_QueryRemove_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryRemove_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_PNP_QueryRemove(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *werror)
+{
+       struct PNP_QueryRemove r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_QUERYREMOVE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_RequestDeviceEject_state {
+       struct PNP_RequestDeviceEject orig;
+       struct PNP_RequestDeviceEject tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_RequestDeviceEject_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_RequestDeviceEject_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_RequestDeviceEject_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_RequestDeviceEject_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_REQUESTDEVICEEJECT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_RequestDeviceEject_done, req);
+       return req;
+}
+
+static void rpccli_PNP_RequestDeviceEject_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_RequestDeviceEject_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RequestDeviceEject_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_RequestDeviceEject_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_PNP_RequestDeviceEject_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RequestDeviceEject_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_PNP_RequestDeviceEject(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *werror)
+{
+       struct PNP_RequestDeviceEject r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_REQUESTDEVICEEJECT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_IsDockStationPresent_state {
+       struct PNP_IsDockStationPresent orig;
+       struct PNP_IsDockStationPresent tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_IsDockStationPresent_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_IsDockStationPresent_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_IsDockStationPresent_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_IsDockStationPresent_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_ISDOCKSTATIONPRESENT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_IsDockStationPresent_done, req);
+       return req;
+}
+
+static void rpccli_PNP_IsDockStationPresent_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_IsDockStationPresent_state *state = tevent_req_data(
+               req, struct rpccli_PNP_IsDockStationPresent_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_IsDockStationPresent_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_PNP_IsDockStationPresent_state *state = tevent_req_data(
+               req, struct rpccli_PNP_IsDockStationPresent_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_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
+{
+       struct PNP_IsDockStationPresent r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_ISDOCKSTATIONPRESENT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_RequestEjectPC_state {
+       struct PNP_RequestEjectPC orig;
+       struct PNP_RequestEjectPC tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_RequestEjectPC_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_RequestEjectPC_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_RequestEjectPC_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_RequestEjectPC_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_REQUESTEJECTPC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_RequestEjectPC_done, req);
+       return req;
+}
+
+static void rpccli_PNP_RequestEjectPC_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_RequestEjectPC_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RequestEjectPC_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_RequestEjectPC_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_PNP_RequestEjectPC_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RequestEjectPC_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_PNP_RequestEjectPC(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
+{
+       struct PNP_RequestEjectPC r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_DELETEREGISTRYKEY,
+                               NDR_PNP_REQUESTEJECTPC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -765,7 +6137,7 @@ NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -782,23 +6154,365 @@ NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
+struct rpccli_PNP_HwProfFlags_state {
+       struct PNP_HwProfFlags orig;
+       struct PNP_HwProfFlags tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_HwProfFlags_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_HwProfFlags_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint32_t _action /* [in]  */,
+                                              const char *_devicepath /* [in] [ref,charset(UTF16)] */,
+                                              uint32_t _config /* [in]  */,
+                                              uint32_t *_profile_flags /* [in,out] [ref] */,
+                                              uint16_t *_veto_type /* [in,out] [unique] */,
+                                              const char *_unknown5 /* [in] [unique,charset(UTF16)] */,
+                                              const char **_unknown5a /* [out] [unique,charset(UTF16)] */,
+                                              uint32_t _name_length /* [in]  */,
+                                              uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_HwProfFlags_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_HwProfFlags_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.action = _action;
+       state->orig.in.devicepath = _devicepath;
+       state->orig.in.config = _config;
+       state->orig.in.profile_flags = _profile_flags;
+       state->orig.in.veto_type = _veto_type;
+       state->orig.in.unknown5 = _unknown5;
+       state->orig.in.name_length = _name_length;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.profile_flags = _profile_flags;
+       state->orig.out.veto_type = _veto_type;
+       state->orig.out.unknown5a = _unknown5a;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_PNP_HwProfFlags_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_ntsvcs,
+                                   NDR_PNP_HWPROFFLAGS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_HwProfFlags_done, req);
+       return req;
+}
+
+static void rpccli_PNP_HwProfFlags_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_HwProfFlags_state *state = tevent_req_data(
+               req, struct rpccli_PNP_HwProfFlags_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.profile_flags = *state->tmp.out.profile_flags;
+       if (state->orig.out.veto_type && state->tmp.out.veto_type) {
+               *state->orig.out.veto_type = *state->tmp.out.veto_type;
+       }
+       if (state->orig.out.unknown5a && state->tmp.out.unknown5a) {
+               *state->orig.out.unknown5a = *state->tmp.out.unknown5a;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_HwProfFlags_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_PNP_HwProfFlags_state *state = tevent_req_data(
+               req, struct rpccli_PNP_HwProfFlags_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_PNP_HwProfFlags(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               uint32_t action /* [in]  */,
+                               const char *devicepath /* [in] [ref,charset(UTF16)] */,
+                               uint32_t config /* [in]  */,
+                               uint32_t *profile_flags /* [in,out] [ref] */,
+                               uint16_t *veto_type /* [in,out] [unique] */,
+                               const char *unknown5 /* [in] [unique,charset(UTF16)] */,
+                               const char **unknown5a /* [out] [unique,charset(UTF16)] */,
+                               uint32_t name_length /* [in]  */,
+                               uint32_t flags /* [in]  */,
+                               WERROR *werror)
+{
+       struct PNP_HwProfFlags r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.action = action;
+       r.in.devicepath = devicepath;
+       r.in.config = config;
+       r.in.profile_flags = profile_flags;
+       r.in.veto_type = veto_type;
+       r.in.unknown5 = unknown5;
+       r.in.name_length = name_length;
+       r.in.flags = flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_ntsvcs,
+                               NDR_PNP_HWPROFFLAGS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *profile_flags = *r.out.profile_flags;
+       if (veto_type && r.out.veto_type) {
+               *veto_type = *r.out.veto_type;
+       }
+       if (unknown5a && r.out.unknown5a) {
+               *unknown5a = *r.out.unknown5a;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_PNP_GetHwProfInfo_state {
+       struct PNP_GetHwProfInfo orig;
+       struct PNP_GetHwProfInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetHwProfInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetHwProfInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                uint32_t _idx /* [in]  */,
+                                                struct PNP_HwProfInfo *_info /* [in,out] [ref] */,
+                                                uint32_t _size /* [in]  */,
+                                                uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetHwProfInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetHwProfInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.idx = _idx;
+       state->orig.in.info = _info;
+       state->orig.in.size = _size;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_PNP_GetHwProfInfo_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_ntsvcs,
+                                   NDR_PNP_GETHWPROFINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetHwProfInfo_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetHwProfInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetHwProfInfo_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetHwProfInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetHwProfInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_GetHwProfInfo_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetHwProfInfo_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_PNP_GetHwProfInfo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
+                                 uint32_t idx /* [in]  */,
+                                 struct PNP_HwProfInfo *info /* [in,out] [ref] */,
+                                 uint32_t size /* [in]  */,
+                                 uint32_t flags /* [in]  */,
                                  WERROR *werror)
 {
-       struct PNP_GetClassCount r;
+       struct PNP_GetHwProfInfo r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.idx = idx;
+       r.in.info = info;
+       r.in.size = size;
+       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETCLASSCOUNT,
+                               NDR_PNP_GETHWPROFINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -806,7 +6520,7 @@ NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -814,6 +6528,7 @@ NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *info = *r.out.info;
 
        /* Return result */
        if (werror) {
@@ -823,23 +6538,133 @@ NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                WERROR *werror)
+struct rpccli_PNP_AddEmptyLogConf_state {
+       struct PNP_AddEmptyLogConf orig;
+       struct PNP_AddEmptyLogConf tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_AddEmptyLogConf_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_AddEmptyLogConf_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
 {
-       struct PNP_GetClassName r;
+       struct tevent_req *req;
+       struct rpccli_PNP_AddEmptyLogConf_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_AddEmptyLogConf_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_ADDEMPTYLOGCONF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_AddEmptyLogConf_done, req);
+       return req;
+}
+
+static void rpccli_PNP_AddEmptyLogConf_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_AddEmptyLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_AddEmptyLogConf_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_AddEmptyLogConf_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_PNP_AddEmptyLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_AddEmptyLogConf_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_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct PNP_AddEmptyLogConf r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetClassName, &r);
+               NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETCLASSNAME,
+                               NDR_PNP_ADDEMPTYLOGCONF,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -847,7 +6672,7 @@ NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -864,64 +6689,133 @@ NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+struct rpccli_PNP_FreeLogConf_state {
+       struct PNP_FreeLogConf orig;
+       struct PNP_FreeLogConf tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_FreeLogConf_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_FreeLogConf_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli)
 {
-       struct PNP_DeleteClassKey r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_FreeLogConf_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_FreeLogConf_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &r);
+               NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_DELETECLASSKEY,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_FREELOGCONF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_FreeLogConf_done, req);
+       return req;
+}
+
+static void rpccli_PNP_FreeLogConf_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_FreeLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_FreeLogConf_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_FreeLogConf_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_PNP_FreeLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_FreeLogConf_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror)
+NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *werror)
 {
-       struct PNP_GetInterfaceDeviceAlias r;
+       struct PNP_FreeLogConf r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &r);
+               NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETINTERFACEDEVICEALIAS,
+                               NDR_PNP_FREELOGCONF,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -929,7 +6823,7 @@ NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -946,64 +6840,133 @@ NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          WERROR *werror)
+struct rpccli_PNP_GetFirstLogConf_state {
+       struct PNP_GetFirstLogConf orig;
+       struct PNP_GetFirstLogConf tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetFirstLogConf_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetFirstLogConf_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
 {
-       struct PNP_GetInterfaceDeviceList r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetFirstLogConf_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetFirstLogConf_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETINTERFACEDEVICELIST,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETFIRSTLOGCONF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetFirstLogConf_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetFirstLogConf_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetFirstLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetFirstLogConf_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetFirstLogConf_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_PNP_GetFirstLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetFirstLogConf_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              WERROR *werror)
+NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
 {
-       struct PNP_GetInterfaceDeviceListSize r;
+       struct PNP_GetFirstLogConf r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETINTERFACEDEVICELISTSIZE,
+                               NDR_PNP_GETFIRSTLOGCONF,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1011,7 +6974,7 @@ NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1028,64 +6991,133 @@ NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli,
-                                                  TALLOC_CTX *mem_ctx,
-                                                  WERROR *werror)
+struct rpccli_PNP_GetNextLogConf_state {
+       struct PNP_GetNextLogConf orig;
+       struct PNP_GetNextLogConf tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetNextLogConf_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetNextLogConf_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
 {
-       struct PNP_RegisterDeviceClassAssociation r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetNextLogConf_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetNextLogConf_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_REGISTERDEVICECLASSASSOCIATION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETNEXTLOGCONF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetNextLogConf_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetNextLogConf_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetNextLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetNextLogConf_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetNextLogConf_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_PNP_GetNextLogConf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetNextLogConf_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli,
-                                                    TALLOC_CTX *mem_ctx,
-                                                    WERROR *werror)
+NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
 {
-       struct PNP_UnregisterDeviceClassAssociation r;
+       struct PNP_GetNextLogConf r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION,
+                               NDR_PNP_GETNEXTLOGCONF,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1093,7 +7125,7 @@ NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1110,64 +7142,133 @@ NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+struct rpccli_PNP_GetLogConfPriority_state {
+       struct PNP_GetLogConfPriority orig;
+       struct PNP_GetLogConfPriority tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetLogConfPriority_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetLogConfPriority_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
 {
-       struct PNP_GetClassRegProp r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetLogConfPriority_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetLogConfPriority_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETCLASSREGPROP,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETLOGCONFPRIORITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetLogConfPriority_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetLogConfPriority_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetLogConfPriority_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetLogConfPriority_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetLogConfPriority_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_PNP_GetLogConfPriority_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetLogConfPriority_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *werror)
 {
-       struct PNP_SetClassRegProp r;
+       struct PNP_GetLogConfPriority r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_SETCLASSREGPROP,
+                               NDR_PNP_GETLOGCONFPRIORITY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1175,7 +7276,7 @@ NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1192,105 +7293,133 @@ NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 WERROR *werror)
-{
-       struct PNP_CreateDevInst r;
-       NTSTATUS status;
+struct rpccli_PNP_AddResDes_state {
+       struct PNP_AddResDes orig;
+       struct PNP_AddResDes tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
 
-       /* In parameters */
+static void rpccli_PNP_AddResDes_done(struct tevent_req *subreq);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &r);
+struct tevent_req *rpccli_PNP_AddResDes_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_AddResDes_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_AddResDes_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_CREATEDEVINST,
-                               &r);
+       /* In parameters */
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &r);
-       }
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_AddResDes, &state->orig);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_ADDRESDES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
-
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_set_callback(subreq, rpccli_PNP_AddResDes_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+static void rpccli_PNP_AddResDes_done(struct tevent_req *subreq)
 {
-       struct PNP_DeviceInstanceAction r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_AddResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_AddResDes_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_DEVICEINSTANCEACTION,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_AddResDes_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result)
+{
+       struct rpccli_PNP_AddResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_AddResDes_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             WERROR *werror)
 {
-       struct PNP_GetDeviceStatus r;
+       struct PNP_AddResDes r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &r);
+               NDR_PRINT_IN_DEBUG(PNP_AddResDes, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETDEVICESTATUS,
+                               NDR_PNP_ADDRESDES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1298,7 +7427,7 @@ NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1315,64 +7444,133 @@ NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
+struct rpccli_PNP_FreeResDes_state {
+       struct PNP_FreeResDes orig;
+       struct PNP_FreeResDes tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_FreeResDes_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_FreeResDes_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli)
 {
-       struct PNP_SetDeviceProblem r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_FreeResDes_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_FreeResDes_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &r);
+               NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_SETDEVICEPROBLEM,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_FREERESDES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_FreeResDes_done, req);
+       return req;
+}
+
+static void rpccli_PNP_FreeResDes_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_FreeResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_FreeResDes_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_FreeResDes_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_PNP_FreeResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_FreeResDes_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              WERROR *werror)
 {
-       struct PNP_DisableDevInst r;
+       struct PNP_FreeResDes r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &r);
+               NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_DISABLEDEVINST,
+                               NDR_PNP_FREERESDES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1380,7 +7578,7 @@ NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1397,64 +7595,133 @@ NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
+struct rpccli_PNP_GetNextResDes_state {
+       struct PNP_GetNextResDes orig;
+       struct PNP_GetNextResDes tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetNextResDes_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetNextResDes_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
 {
-       struct PNP_UninstallDevInst r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetNextResDes_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetNextResDes_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_UNINSTALLDEVINST,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETNEXTRESDES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetNextResDes_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetNextResDes_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetNextResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetNextResDes_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetNextResDes_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_GetNextResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetNextResDes_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli,
-                         TALLOC_CTX *mem_ctx,
-                         WERROR *werror)
+NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *werror)
 {
-       struct PNP_AddID r;
+       struct PNP_GetNextResDes r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_AddID, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_ADDID,
+                               NDR_PNP_GETNEXTRESDES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1462,7 +7729,7 @@ NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_AddID, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1479,64 +7746,133 @@ NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+struct rpccli_PNP_GetResDesData_state {
+       struct PNP_GetResDesData orig;
+       struct PNP_GetResDesData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetResDesData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetResDesData_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
 {
-       struct PNP_RegisterDriver r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetResDesData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetResDesData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_REGISTERDRIVER,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETRESDESDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetResDesData_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetResDesData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetResDesData_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetResDesData_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetResDesData_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_PNP_GetResDesData_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetResDesData_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               WERROR *werror)
+NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *werror)
 {
-       struct PNP_QueryRemove r;
+       struct PNP_GetResDesData r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_QUERYREMOVE,
+                               NDR_PNP_GETRESDESDATA,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1544,7 +7880,7 @@ NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1561,64 +7897,133 @@ NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      WERROR *werror)
+struct rpccli_PNP_GetResDesDataSize_state {
+       struct PNP_GetResDesDataSize orig;
+       struct PNP_GetResDesDataSize tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetResDesDataSize_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetResDesDataSize_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
 {
-       struct PNP_RequestDeviceEject r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetResDesDataSize_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetResDesDataSize_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_REQUESTDEVICEEJECT,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETRESDESDATASIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetResDesDataSize_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetResDesDataSize_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetResDesDataSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetResDesDataSize_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetResDesDataSize_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_PNP_GetResDesDataSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetResDesDataSize_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *werror)
 {
-       struct PNP_IsDockStationPresent r;
+       struct PNP_GetResDesDataSize r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_ISDOCKSTATIONPRESENT,
+                               NDR_PNP_GETRESDESDATASIZE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1626,7 +8031,7 @@ NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1643,81 +8048,133 @@ NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+struct rpccli_PNP_ModifyResDes_state {
+       struct PNP_ModifyResDes orig;
+       struct PNP_ModifyResDes tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_ModifyResDes_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_ModifyResDes_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli)
 {
-       struct PNP_RequestEjectPC r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_ModifyResDes_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_ModifyResDes_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &r);
+               NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_REQUESTEJECTPC,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_MODIFYRESDES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_ModifyResDes_done, req);
+       return req;
+}
+
+static void rpccli_PNP_ModifyResDes_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_ModifyResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_ModifyResDes_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_ModifyResDes_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_PNP_ModifyResDes_state *state = tevent_req_data(
+               req, struct rpccli_PNP_ModifyResDes_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               uint32_t action /* [in]  */,
-                               const char *devicepath /* [in] [ref,charset(UTF16)] */,
-                               uint32_t config /* [in]  */,
-                               uint32_t *profile_flags /* [in,out] [ref] */,
-                               uint16_t *veto_type /* [in,out] [unique] */,
-                               const char *unknown5 /* [in] [unique,charset(UTF16)] */,
-                               const char **unknown5a /* [out] [unique,charset(UTF16)] */,
-                               uint32_t name_length /* [in]  */,
-                               uint32_t flags /* [in]  */,
-                               WERROR *werror)
+NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *werror)
 {
-       struct PNP_HwProfFlags r;
+       struct PNP_ModifyResDes r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.action = action;
-       r.in.devicepath = devicepath;
-       r.in.config = config;
-       r.in.profile_flags = profile_flags;
-       r.in.veto_type = veto_type;
-       r.in.unknown5 = unknown5;
-       r.in.name_length = name_length;
-       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &r);
+               NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_HWPROFFLAGS,
+                               NDR_PNP_MODIFYRESDES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1725,7 +8182,7 @@ NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1733,13 +8190,6 @@ NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *profile_flags = *r.out.profile_flags;
-       if (veto_type && r.out.veto_type) {
-               *veto_type = *r.out.veto_type;
-       }
-       if (unknown5a && r.out.unknown5a) {
-               *unknown5a = *r.out.unknown5a;
-       }
 
        /* Return result */
        if (werror) {
@@ -1749,73 +8199,133 @@ NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 uint32_t idx /* [in]  */,
-                                 struct PNP_HwProfInfo *info /* [in,out] [ref] */,
-                                 uint32_t size /* [in]  */,
-                                 uint32_t flags /* [in]  */,
-                                 WERROR *werror)
+struct rpccli_PNP_DetectResourceLimit_state {
+       struct PNP_DetectResourceLimit orig;
+       struct PNP_DetectResourceLimit tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_DetectResourceLimit_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_DetectResourceLimit_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
 {
-       struct PNP_GetHwProfInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_DetectResourceLimit_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_DetectResourceLimit_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.idx = idx;
-       r.in.info = info;
-       r.in.size = size;
-       r.in.flags = flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &r);
+               NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETHWPROFINFO,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_DETECTRESOURCELIMIT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_DetectResourceLimit_done, req);
+       return req;
+}
+
+static void rpccli_PNP_DetectResourceLimit_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_DetectResourceLimit_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DetectResourceLimit_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_DetectResourceLimit_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_PNP_DetectResourceLimit_state *state = tevent_req_data(
+               req, struct rpccli_PNP_DetectResourceLimit_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *werror)
 {
-       struct PNP_AddEmptyLogConf r;
+       struct PNP_DetectResourceLimit r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &r);
+               NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_ADDEMPTYLOGCONF,
+                               NDR_PNP_DETECTRESOURCELIMIT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1823,7 +8333,7 @@ NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1840,64 +8350,133 @@ NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               WERROR *werror)
+struct rpccli_PNP_QueryResConfList_state {
+       struct PNP_QueryResConfList orig;
+       struct PNP_QueryResConfList tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_QueryResConfList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_QueryResConfList_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
 {
-       struct PNP_FreeLogConf r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_QueryResConfList_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_QueryResConfList_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &r);
+               NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_FREELOGCONF,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_QUERYRESCONFLIST,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_QueryResConfList_done, req);
+       return req;
+}
 
+static void rpccli_PNP_QueryResConfList_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_QueryResConfList_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryResConfList_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_QueryResConfList_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_QueryResConfList_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryResConfList_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
 {
-       struct PNP_GetFirstLogConf r;
+       struct PNP_QueryResConfList r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &r);
+               NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETFIRSTLOGCONF,
+                               NDR_PNP_QUERYRESCONFLIST,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1905,7 +8484,7 @@ NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1922,105 +8501,133 @@ NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
-{
-       struct PNP_GetNextLogConf r;
-       NTSTATUS status;
+struct rpccli_PNP_SetHwProf_state {
+       struct PNP_SetHwProf orig;
+       struct PNP_SetHwProf tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
 
-       /* In parameters */
+static void rpccli_PNP_SetHwProf_done(struct tevent_req *subreq);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &r);
+struct tevent_req *rpccli_PNP_SetHwProf_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_SetHwProf_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_SetHwProf_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETNEXTLOGCONF,
-                               &r);
+       /* In parameters */
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &r);
-       }
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &state->orig);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_SETHWPROF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
-
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_set_callback(subreq, rpccli_PNP_SetHwProf_done, req);
+       return req;
 }
-
-NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      WERROR *werror)
+
+static void rpccli_PNP_SetHwProf_done(struct tevent_req *subreq)
 {
-       struct PNP_GetLogConfPriority r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_SetHwProf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetHwProf_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETLOGCONFPRIORITY,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_SetHwProf_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result)
+{
+       struct rpccli_PNP_SetHwProf_state *state = tevent_req_data(
+               req, struct rpccli_PNP_SetHwProf_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              WERROR *werror)
 {
-       struct PNP_AddResDes r;
+       struct PNP_SetHwProf r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_AddResDes, &r);
+               NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_ADDRESDES,
+                               NDR_PNP_SETHWPROF,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2028,7 +8635,7 @@ NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2045,64 +8652,133 @@ NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              WERROR *werror)
+struct rpccli_PNP_QueryArbitratorFreeData_state {
+       struct PNP_QueryArbitratorFreeData orig;
+       struct PNP_QueryArbitratorFreeData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_QueryArbitratorFreeData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_QueryArbitratorFreeData_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
 {
-       struct PNP_FreeResDes r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_QueryArbitratorFreeData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_QueryArbitratorFreeData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &r);
+               NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_FREERESDES,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_QUERYARBITRATORFREEDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_QueryArbitratorFreeData_done, req);
+       return req;
+}
+
+static void rpccli_PNP_QueryArbitratorFreeData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_QueryArbitratorFreeData_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryArbitratorFreeData_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_QueryArbitratorFreeData_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_PNP_QueryArbitratorFreeData_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryArbitratorFreeData_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 WERROR *werror)
+NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *werror)
 {
-       struct PNP_GetNextResDes r;
+       struct PNP_QueryArbitratorFreeData r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &r);
+               NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETNEXTRESDES,
+                               NDR_PNP_QUERYARBITRATORFREEDATA,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2110,7 +8786,7 @@ NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2127,64 +8803,133 @@ NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 WERROR *werror)
+struct rpccli_PNP_QueryArbitratorFreeSize_state {
+       struct PNP_QueryArbitratorFreeSize orig;
+       struct PNP_QueryArbitratorFreeSize tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_QueryArbitratorFreeSize_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_QueryArbitratorFreeSize_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
 {
-       struct PNP_GetResDesData r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_QueryArbitratorFreeSize_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_QueryArbitratorFreeSize_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &r);
+               NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETRESDESDATA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_QUERYARBITRATORFREESIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_QueryArbitratorFreeSize_done, req);
+       return req;
+}
+
+static void rpccli_PNP_QueryArbitratorFreeSize_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_QueryArbitratorFreeSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryArbitratorFreeSize_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_QueryArbitratorFreeSize_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_PNP_QueryArbitratorFreeSize_state *state = tevent_req_data(
+               req, struct rpccli_PNP_QueryArbitratorFreeSize_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     WERROR *werror)
+NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *werror)
 {
-       struct PNP_GetResDesDataSize r;
+       struct PNP_QueryArbitratorFreeSize r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &r);
+               NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETRESDESDATASIZE,
+                               NDR_PNP_QUERYARBITRATORFREESIZE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2192,7 +8937,7 @@ NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2209,64 +8954,133 @@ NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                WERROR *werror)
+struct rpccli_PNP_RunDetection_state {
+       struct PNP_RunDetection orig;
+       struct PNP_RunDetection tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_RunDetection_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_RunDetection_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli)
 {
-       struct PNP_ModifyResDes r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_RunDetection_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_RunDetection_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &r);
+               NDR_PRINT_IN_DEBUG(PNP_RunDetection, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_MODIFYRESDES,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_RUNDETECTION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_RunDetection_done, req);
+       return req;
+}
+
+static void rpccli_PNP_RunDetection_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_RunDetection_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RunDetection_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_RunDetection_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_PNP_RunDetection_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RunDetection_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       WERROR *werror)
+NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *werror)
 {
-       struct PNP_DetectResourceLimit r;
+       struct PNP_RunDetection r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &r);
+               NDR_PRINT_IN_DEBUG(PNP_RunDetection, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_DETECTRESOURCELIMIT,
+                               NDR_PNP_RUNDETECTION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2274,7 +9088,7 @@ NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2291,64 +9105,133 @@ NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
+struct rpccli_PNP_RegisterNotification_state {
+       struct PNP_RegisterNotification orig;
+       struct PNP_RegisterNotification tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_RegisterNotification_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_RegisterNotification_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
 {
-       struct PNP_QueryResConfList r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_RegisterNotification_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_RegisterNotification_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &r);
+               NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_QUERYRESCONFLIST,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_REGISTERNOTIFICATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_RegisterNotification_done, req);
+       return req;
+}
+
+static void rpccli_PNP_RegisterNotification_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_RegisterNotification_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RegisterNotification_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_RegisterNotification_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_PNP_RegisterNotification_state *state = tevent_req_data(
+               req, struct rpccli_PNP_RegisterNotification_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             WERROR *werror)
+NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
 {
-       struct PNP_SetHwProf r;
+       struct PNP_RegisterNotification r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &r);
+               NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_SETHWPROF,
+                               NDR_PNP_REGISTERNOTIFICATION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2356,7 +9239,7 @@ NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2373,64 +9256,133 @@ NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror)
+struct rpccli_PNP_UnregisterNotification_state {
+       struct PNP_UnregisterNotification orig;
+       struct PNP_UnregisterNotification tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_UnregisterNotification_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_UnregisterNotification_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli)
 {
-       struct PNP_QueryArbitratorFreeData r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_UnregisterNotification_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_UnregisterNotification_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &r);
+               NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_QUERYARBITRATORFREEDATA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_UNREGISTERNOTIFICATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_UnregisterNotification_done, req);
+       return req;
+}
 
+static void rpccli_PNP_UnregisterNotification_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_UnregisterNotification_state *state = tevent_req_data(
+               req, struct rpccli_PNP_UnregisterNotification_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_UnregisterNotification_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_PNP_UnregisterNotification_state *state = tevent_req_data(
+               req, struct rpccli_PNP_UnregisterNotification_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror)
+NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *werror)
 {
-       struct PNP_QueryArbitratorFreeSize r;
+       struct PNP_UnregisterNotification r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &r);
+               NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_QUERYARBITRATORFREESIZE,
+                               NDR_PNP_UNREGISTERNOTIFICATION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2438,7 +9390,7 @@ NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2455,64 +9407,133 @@ NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                WERROR *werror)
+struct rpccli_PNP_GetCustomDevProp_state {
+       struct PNP_GetCustomDevProp orig;
+       struct PNP_GetCustomDevProp tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetCustomDevProp_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetCustomDevProp_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli)
 {
-       struct PNP_RunDetection r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetCustomDevProp_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetCustomDevProp_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_RunDetection, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_RUNDETECTION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETCUSTOMDEVPROP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetCustomDevProp_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetCustomDevProp_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetCustomDevProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetCustomDevProp_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetCustomDevProp_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_PNP_GetCustomDevProp_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetCustomDevProp_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *werror)
 {
-       struct PNP_RegisterNotification r;
+       struct PNP_GetCustomDevProp r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_REGISTERNOTIFICATION,
+                               NDR_PNP_GETCUSTOMDEVPROP,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2520,7 +9541,7 @@ NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2537,64 +9558,133 @@ NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          WERROR *werror)
+struct rpccli_PNP_GetVersionInternal_state {
+       struct PNP_GetVersionInternal orig;
+       struct PNP_GetVersionInternal tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetVersionInternal_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetVersionInternal_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
 {
-       struct PNP_UnregisterNotification r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetVersionInternal_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetVersionInternal_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_UNREGISTERNOTIFICATION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETVERSIONINTERNAL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetVersionInternal_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetVersionInternal_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetVersionInternal_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetVersionInternal_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetVersionInternal_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_PNP_GetVersionInternal_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetVersionInternal_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    WERROR *werror)
+NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *werror)
 {
-       struct PNP_GetCustomDevProp r;
+       struct PNP_GetVersionInternal r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_ntsvcs,
-                               NDR_PNP_GETCUSTOMDEVPROP,
+                               NDR_PNP_GETVERSIONINTERNAL,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2602,7 +9692,7 @@ NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2619,45 +9709,114 @@ NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      WERROR *werror)
+struct rpccli_PNP_GetBlockedDriverInfo_state {
+       struct PNP_GetBlockedDriverInfo orig;
+       struct PNP_GetBlockedDriverInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetBlockedDriverInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetBlockedDriverInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
 {
-       struct PNP_GetVersionInternal r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_PNP_GetBlockedDriverInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetBlockedDriverInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &r);
+               NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_ntsvcs,
-                               NDR_PNP_GETVERSIONINTERNAL,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETBLOCKEDDRIVERINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetBlockedDriverInfo_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetBlockedDriverInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetBlockedDriverInfo_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetBlockedDriverInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &r);
+               NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetBlockedDriverInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_PNP_GetBlockedDriverInfo_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetBlockedDriverInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli,
@@ -2701,6 +9860,116 @@ NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_PNP_GetServerSideDeviceInstallFlags_state {
+       struct PNP_GetServerSideDeviceInstallFlags orig;
+       struct PNP_GetServerSideDeviceInstallFlags tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_PNP_GetServerSideDeviceInstallFlags_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_PNP_GetServerSideDeviceInstallFlags_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_PNP_GetServerSideDeviceInstallFlags_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_ntsvcs,
+                                   NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_PNP_GetServerSideDeviceInstallFlags_done, req);
+       return req;
+}
+
+static void rpccli_PNP_GetServerSideDeviceInstallFlags_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetServerSideDeviceInstallFlags_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result)
+{
+       struct rpccli_PNP_GetServerSideDeviceInstallFlags_state *state = tevent_req_data(
+               req, struct rpccli_PNP_GetServerSideDeviceInstallFlags_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_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    WERROR *werror)
index c97ced8bf91b979017eaa6bdaba115e9869bb28c..90a037d79d51e6d6e15fc0f52fd90c39ac543719 100644 (file)
 #include "../librpc/gen_ndr/ndr_ntsvcs.h"
 #ifndef __CLI_NTSVCS__
 #define __CLI_NTSVCS__
+struct tevent_req *rpccli_PNP_Disconnect_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_Disconnect_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               WERROR *werror);
+struct tevent_req *rpccli_PNP_Connect_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_Connect_recv(struct tevent_req *req,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *result);
 NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli,
                            TALLOC_CTX *mem_ctx,
                            WERROR *werror);
+struct tevent_req *rpccli_PNP_GetVersion_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t *_version /* [out] [ref] */);
+NTSTATUS rpccli_PNP_GetVersion_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint16_t *version /* [out] [ref] */,
                               WERROR *werror);
+struct tevent_req *rpccli_PNP_GetGlobalState_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetGlobalState_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_InitDetection_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_InitDetection_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_ReportLogOn_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_ReportLogOn_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                WERROR *werror);
+struct tevent_req *rpccli_PNP_ValidateDeviceInstance_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_devicepath /* [in] [ref,charset(UTF16)] */,
+                                                         uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_PNP_ValidateDeviceInstance_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *devicepath /* [in] [ref,charset(UTF16)] */,
                                           uint32_t flags /* [in]  */,
                                           WERROR *werror);
+struct tevent_req *rpccli_PNP_GetRootDeviceInstance_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetRootDeviceInstance_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          WERROR *werror);
+struct tevent_req *rpccli_PNP_GetRelatedDeviceInstance_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetRelatedDeviceInstance_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_PNP_EnumerateSubKeys_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_EnumerateSubKeys_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_GetDeviceList_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_filter /* [in] [unique,charset(UTF16)] */,
+                                                uint16_t *_buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
+                                                uint32_t *_length /* [in,out] [ref] */,
+                                                uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_PNP_GetDeviceList_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *filter /* [in] [unique,charset(UTF16)] */,
@@ -41,15 +114,43 @@ NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
                                  uint32_t *length /* [in,out] [ref] */,
                                  uint32_t flags /* [in]  */,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_GetDeviceListSize_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_devicename /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_size /* [out] [ref] */,
+                                                    uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_PNP_GetDeviceListSize_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *devicename /* [in] [unique,charset(UTF16)] */,
                                      uint32_t *size /* [out] [ref] */,
                                      uint32_t flags /* [in]  */,
                                      WERROR *werror);
+struct tevent_req *rpccli_PNP_GetDepth_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetDepth_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *result);
 NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli,
                             TALLOC_CTX *mem_ctx,
                             WERROR *werror);
+struct tevent_req *rpccli_PNP_GetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_devicepath /* [in] [ref,charset(UTF16)] */,
+                                                   uint32_t _property /* [in]  */,
+                                                   enum winreg_Type *_reg_data_type /* [in,out] [ref] */,
+                                                   uint8_t *_buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
+                                                   uint32_t *_buffer_size /* [in,out] [ref] */,
+                                                   uint32_t *_needed /* [in,out] [ref] */,
+                                                   uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_PNP_GetDeviceRegProp_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *devicepath /* [in] [ref,charset(UTF16)] */,
@@ -60,84 +161,255 @@ NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
                                     uint32_t *needed /* [in,out] [ref] */,
                                     uint32_t flags /* [in]  */,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_SetDeviceRegProp_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_SetDeviceRegProp_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_GetClassInstance_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetClassInstance_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_CreateKey_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_CreateKey_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result);
 NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              WERROR *werror);
+struct tevent_req *rpccli_PNP_DeleteRegistryKey_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_DeleteRegistryKey_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      WERROR *werror);
+struct tevent_req *rpccli_PNP_GetClassCount_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetClassCount_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_GetClassName_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetClassName_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 WERROR *werror);
+struct tevent_req *rpccli_PNP_DeleteClassKey_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_DeleteClassKey_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_GetInterfaceDeviceAlias_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror);
+struct tevent_req *rpccli_PNP_GetInterfaceDeviceList_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetInterfaceDeviceList_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           WERROR *werror);
+struct tevent_req *rpccli_PNP_GetInterfaceDeviceListSize_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               WERROR *werror);
+struct tevent_req *rpccli_PNP_RegisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result);
 NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_UnregisterDeviceClassAssociation_send(TALLOC_CTX *mem_ctx,
+                                                                   struct tevent_context *ev,
+                                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation_recv(struct tevent_req *req,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *result);
 NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli,
                                                     TALLOC_CTX *mem_ctx,
                                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_GetClassRegProp_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetClassRegProp_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_PNP_SetClassRegProp_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_SetClassRegProp_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_PNP_CreateDevInst_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_CreateDevInst_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_DeviceInstanceAction_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_DeviceInstanceAction_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_PNP_GetDeviceStatus_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetDeviceStatus_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_PNP_SetDeviceProblem_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_SetDeviceProblem_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_DisableDevInst_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_DisableDevInst_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_UninstallDevInst_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_UninstallDevInst_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_AddID_send(TALLOC_CTX *mem_ctx,
+                                        struct tevent_context *ev,
+                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_AddID_recv(struct tevent_req *req,
+                              TALLOC_CTX *mem_ctx,
+                              WERROR *result);
 NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli,
                          TALLOC_CTX *mem_ctx,
                          WERROR *werror);
+struct tevent_req *rpccli_PNP_RegisterDriver_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_RegisterDriver_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_QueryRemove_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_QueryRemove_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                WERROR *werror);
+struct tevent_req *rpccli_PNP_RequestDeviceEject_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_RequestDeviceEject_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
+struct tevent_req *rpccli_PNP_IsDockStationPresent_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_IsDockStationPresent_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_PNP_RequestEjectPC_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_RequestEjectPC_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_HwProfFlags_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint32_t _action /* [in]  */,
+                                              const char *_devicepath /* [in] [ref,charset(UTF16)] */,
+                                              uint32_t _config /* [in]  */,
+                                              uint32_t *_profile_flags /* [in,out] [ref] */,
+                                              uint16_t *_veto_type /* [in,out] [unique] */,
+                                              const char *_unknown5 /* [in] [unique,charset(UTF16)] */,
+                                              const char **_unknown5a /* [out] [unique,charset(UTF16)] */,
+                                              uint32_t _name_length /* [in]  */,
+                                              uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_PNP_HwProfFlags_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint32_t action /* [in]  */,
@@ -150,6 +422,16 @@ NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli,
                                uint32_t name_length /* [in]  */,
                                uint32_t flags /* [in]  */,
                                WERROR *werror);
+struct tevent_req *rpccli_PNP_GetHwProfInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                uint32_t _idx /* [in]  */,
+                                                struct PNP_HwProfInfo *_info /* [in,out] [ref] */,
+                                                uint32_t _size /* [in]  */,
+                                                uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_PNP_GetHwProfInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  uint32_t idx /* [in]  */,
@@ -157,72 +439,210 @@ NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli,
                                  uint32_t size /* [in]  */,
                                  uint32_t flags /* [in]  */,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_AddEmptyLogConf_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_AddEmptyLogConf_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_PNP_FreeLogConf_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_FreeLogConf_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                WERROR *werror);
+struct tevent_req *rpccli_PNP_GetFirstLogConf_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetFirstLogConf_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_PNP_GetNextLogConf_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetNextLogConf_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_PNP_GetLogConfPriority_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetLogConfPriority_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
+struct tevent_req *rpccli_PNP_AddResDes_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_AddResDes_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result);
 NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              WERROR *werror);
+struct tevent_req *rpccli_PNP_FreeResDes_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_FreeResDes_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               WERROR *werror);
+struct tevent_req *rpccli_PNP_GetNextResDes_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetNextResDes_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_GetResDesData_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetResDesData_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_PNP_GetResDesDataSize_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetResDesDataSize_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      WERROR *werror);
+struct tevent_req *rpccli_PNP_ModifyResDes_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_ModifyResDes_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 WERROR *werror);
+struct tevent_req *rpccli_PNP_DetectResourceLimit_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_DetectResourceLimit_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror);
+struct tevent_req *rpccli_PNP_QueryResConfList_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_QueryResConfList_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_SetHwProf_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_SetHwProf_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *result);
 NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              WERROR *werror);
+struct tevent_req *rpccli_PNP_QueryArbitratorFreeData_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_QueryArbitratorFreeData_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror);
+struct tevent_req *rpccli_PNP_QueryArbitratorFreeSize_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_QueryArbitratorFreeSize_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror);
+struct tevent_req *rpccli_PNP_RunDetection_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_RunDetection_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 WERROR *werror);
+struct tevent_req *rpccli_PNP_RegisterNotification_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_RegisterNotification_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_PNP_UnregisterNotification_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_UnregisterNotification_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           WERROR *werror);
+struct tevent_req *rpccli_PNP_GetCustomDevProp_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetCustomDevProp_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     WERROR *werror);
+struct tevent_req *rpccli_PNP_GetVersionInternal_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetVersionInternal_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
+struct tevent_req *rpccli_PNP_GetBlockedDriverInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetBlockedDriverInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_PNP_GetServerSideDeviceInstallFlags_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result);
 NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    WERROR *werror);
index 4f1ca3651d54cf2eb0be8cf3dcd1f01fb5fc39e6..27119e53cc32c7bc79794869badf5637375c3f6e 100644 (file)
@@ -6,6 +6,129 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_samr.h"
 
+struct rpccli_samr_Connect_state {
+       struct samr_Connect orig;
+       struct samr_Connect tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Connect_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Connect_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli,
+                                           uint16_t *_system_name /* [in] [unique] */,
+                                           uint32_t _access_mask /* [in]  */,
+                                           struct policy_handle *_connect_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_Connect_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Connect_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.connect_handle = _connect_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_Connect, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_Connect_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_samr,
+                                   NDR_SAMR_CONNECT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Connect_done, req);
+       return req;
+}
+
+static void rpccli_samr_Connect_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Connect_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect_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.connect_handle = *state->tmp.out.connect_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_Connect, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Connect_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 NTSTATUS *result)
+{
+       struct rpccli_samr_Connect_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect_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_samr_Connect(struct rpc_pipe_client *cli,
                             TALLOC_CTX *mem_ctx,
                             uint16_t *system_name /* [in] [unique] */,
@@ -48,6 +171,126 @@ NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_Close_state {
+       struct samr_Close orig;
+       struct samr_Close tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Close_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Close_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_Close_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Close_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_Close, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_Close_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_samr,
+                                   NDR_SAMR_CLOSE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Close_done, req);
+       return req;
+}
+
+static void rpccli_samr_Close_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Close_state *state = tevent_req_data(
+               req, struct rpccli_samr_Close_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_Close, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Close_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               NTSTATUS *result)
+{
+       struct rpccli_samr_Close_state *state = tevent_req_data(
+               req, struct rpccli_samr_Close_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_samr_Close(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           struct policy_handle *handle /* [in,out] [ref] */)
@@ -87,6 +330,122 @@ NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_SetSecurity_state {
+       struct samr_SetSecurity orig;
+       struct samr_SetSecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetSecurity_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _sec_info /* [in]  */,
+                                               struct sec_desc_buf *_sdbuf /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_SetSecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetSecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sec_info = _sec_info;
+       state->orig.in.sdbuf = _sdbuf;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetSecurity, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetSecurity_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetSecurity_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetSecurity_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetSecurity_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_samr_SetSecurity(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -129,6 +488,129 @@ NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_QuerySecurity_state {
+       struct samr_QuerySecurity orig;
+       struct samr_QuerySecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QuerySecurity_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 uint32_t _sec_info /* [in]  */,
+                                                 struct sec_desc_buf **_sdbuf /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QuerySecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QuerySecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sec_info = _sec_info;
+
+       /* Out parameters */
+       state->orig.out.sdbuf = _sdbuf;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QuerySecurity_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_samr,
+                                   NDR_SAMR_QUERYSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QuerySecurity_done, req);
+       return req;
+}
+
+static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
+               req, struct rpccli_samr_QuerySecurity_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.sdbuf = *state->tmp.out.sdbuf;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QuerySecurity_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
+               req, struct rpccli_samr_QuerySecurity_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_samr_QuerySecurity(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -171,65 +653,136 @@ NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             struct policy_handle *connect_handle /* [in] [ref] */)
+struct rpccli_samr_Shutdown_state {
+       struct samr_Shutdown orig;
+       struct samr_Shutdown tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Shutdown_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Shutdown_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_connect_handle /* [in] [ref] */)
 {
-       struct samr_Shutdown r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_Shutdown_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Shutdown_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.connect_handle = connect_handle;
+       state->orig.in.connect_handle = _connect_handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_Shutdown, &r);
+               NDR_PRINT_IN_DEBUG(samr_Shutdown, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SHUTDOWN,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SHUTDOWN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Shutdown_done, req);
+       return req;
+}
+
+static void rpccli_samr_Shutdown_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Shutdown_state *state = tevent_req_data(
+               req, struct rpccli_samr_Shutdown_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Shutdown, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Shutdown_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_Shutdown_state *state = tevent_req_data(
+               req, struct rpccli_samr_Shutdown_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *connect_handle /* [in] [ref] */,
-                                 struct lsa_String *domain_name /* [in] [ref] */,
-                                 struct dom_sid2 **sid /* [out] [ref] */)
+NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             struct policy_handle *connect_handle /* [in] [ref] */)
 {
-       struct samr_LookupDomain r;
+       struct samr_Shutdown r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.connect_handle = connect_handle;
-       r.in.domain_name = domain_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r);
+               NDR_PRINT_IN_DEBUG(samr_Shutdown, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_LOOKUPDOMAIN,
+                               NDR_SAMR_SHUTDOWN,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -237,7 +790,7 @@ NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -245,82 +798,155 @@ NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *sid = *r.out.sid;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *connect_handle /* [in] [ref] */,
-                                uint32_t *resume_handle /* [in,out] [ref] */,
-                                struct samr_SamArray **sam /* [out] [ref] */,
-                                uint32_t buf_size /* [in]  */,
-                                uint32_t *num_entries /* [out] [ref] */)
+struct rpccli_samr_LookupDomain_state {
+       struct samr_LookupDomain orig;
+       struct samr_LookupDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_LookupDomain_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_connect_handle /* [in] [ref] */,
+                                                struct lsa_String *_domain_name /* [in] [ref] */,
+                                                struct dom_sid2 **_sid /* [out] [ref] */)
 {
-       struct samr_EnumDomains r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_LookupDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_LookupDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.connect_handle = connect_handle;
-       r.in.resume_handle = resume_handle;
-       r.in.buf_size = buf_size;
+       state->orig.in.connect_handle = _connect_handle;
+       state->orig.in.domain_name = _domain_name;
+
+       /* Out parameters */
+       state->orig.out.sid = _sid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r);
+               NDR_PRINT_IN_DEBUG(samr_LookupDomain, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_ENUMDOMAINS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_LookupDomain_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_samr,
+                                   NDR_SAMR_LOOKUPDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_LookupDomain_done, req);
+       return req;
+}
+
+static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_LookupDomain_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.sid = *state->tmp.out.sid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r);
+               NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_LookupDomain_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_LookupDomain_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *sam = *r.out.sam;
-       *num_entries = *r.out.num_entries;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *connect_handle /* [in] [ref] */,
-                               uint32_t access_mask /* [in]  */,
-                               struct dom_sid2 *sid /* [in] [ref] */,
-                               struct policy_handle *domain_handle /* [out] [ref] */)
+NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *connect_handle /* [in] [ref] */,
+                                 struct lsa_String *domain_name /* [in] [ref] */,
+                                 struct dom_sid2 **sid /* [out] [ref] */)
 {
-       struct samr_OpenDomain r;
+       struct samr_LookupDomain r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.connect_handle = connect_handle;
-       r.in.access_mask = access_mask;
-       r.in.sid = sid;
+       r.in.domain_name = domain_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r);
+               NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_OPENDOMAIN,
+                               NDR_SAMR_LOOKUPDOMAIN,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -328,7 +954,7 @@ NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r);
+               NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -336,120 +962,166 @@ NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *domain_handle = *r.out.domain_handle;
+       *sid = *r.out.sid;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *domain_handle /* [in] [ref] */,
-                                    enum samr_DomainInfoClass level /* [in]  */,
-                                    union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
+struct rpccli_samr_EnumDomains_state {
+       struct samr_EnumDomains orig;
+       struct samr_EnumDomains tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_EnumDomains_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_connect_handle /* [in] [ref] */,
+                                               uint32_t *_resume_handle /* [in,out] [ref] */,
+                                               struct samr_SamArray **_sam /* [out] [ref] */,
+                                               uint32_t _buf_size /* [in]  */,
+                                               uint32_t *_num_entries /* [out] [ref] */)
 {
-       struct samr_QueryDomainInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_EnumDomains_state *state;
+       struct tevent_req *subreq;
 
-       /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_EnumDomains_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_QUERYDOMAININFO,
-                               &r);
+       /* In parameters */
+       state->orig.in.connect_handle = _connect_handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.buf_size = _buf_size;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.sam = _sam;
+       state->orig.out.num_entries = _num_entries;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomains, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_EnumDomains_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_ENUMDOMAINS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_EnumDomains_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct policy_handle *domain_handle /* [in] [ref] */,
-                                  enum samr_DomainInfoClass level /* [in]  */,
-                                  union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */)
+static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq)
 {
-       struct samr_SetDomainInfo r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomains_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
-       r.in.info = info;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SETDOMAININFO,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.sam = *state->tmp.out.sam;
+       *state->orig.out.num_entries = *state->tmp.out.num_entries;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_EnumDomains_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomains_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *domain_handle /* [in] [ref] */,
-                                      struct lsa_String *name /* [in] [ref] */,
-                                      uint32_t access_mask /* [in]  */,
-                                      struct policy_handle *group_handle /* [out] [ref] */,
-                                      uint32_t *rid /* [out] [ref] */)
+NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *connect_handle /* [in] [ref] */,
+                                uint32_t *resume_handle /* [in,out] [ref] */,
+                                struct samr_SamArray **sam /* [out] [ref] */,
+                                uint32_t buf_size /* [in]  */,
+                                uint32_t *num_entries /* [out] [ref] */)
 {
-       struct samr_CreateDomainGroup r;
+       struct samr_EnumDomains r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.name = name;
-       r.in.access_mask = access_mask;
+       r.in.connect_handle = connect_handle;
+       r.in.resume_handle = resume_handle;
+       r.in.buf_size = buf_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_CREATEDOMAINGROUP,
+                               NDR_SAMR_ENUMDOMAINS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -457,7 +1129,7 @@ NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -465,84 +1137,162 @@ NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *group_handle = *r.out.group_handle;
-       *rid = *r.out.rid;
+       *resume_handle = *r.out.resume_handle;
+       *sam = *r.out.sam;
+       *num_entries = *r.out.num_entries;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *domain_handle /* [in] [ref] */,
-                                     uint32_t *resume_handle /* [in,out] [ref] */,
-                                     struct samr_SamArray **sam /* [out] [ref] */,
-                                     uint32_t max_size /* [in]  */,
-                                     uint32_t *num_entries /* [out] [ref] */)
+struct rpccli_samr_OpenDomain_state {
+       struct samr_OpenDomain orig;
+       struct samr_OpenDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_OpenDomain_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_connect_handle /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct dom_sid2 *_sid /* [in] [ref] */,
+                                              struct policy_handle *_domain_handle /* [out] [ref] */)
 {
-       struct samr_EnumDomainGroups r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_OpenDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_OpenDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.resume_handle = resume_handle;
-       r.in.max_size = max_size;
+       state->orig.in.connect_handle = _connect_handle;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.sid = _sid;
+
+       /* Out parameters */
+       state->orig.out.domain_handle = _domain_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r);
+               NDR_PRINT_IN_DEBUG(samr_OpenDomain, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_ENUMDOMAINGROUPS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_OpenDomain_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_samr,
+                                   NDR_SAMR_OPENDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_OpenDomain_done, req);
+       return req;
+}
+
+static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenDomain_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.domain_handle = *state->tmp.out.domain_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r);
+               NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_OpenDomain_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenDomain_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *sam = *r.out.sam;
-       *num_entries = *r.out.num_entries;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
-                               struct policy_handle *domain_handle /* [in] [ref] */,
-                               struct lsa_String *account_name /* [in] [ref] */,
+                               struct policy_handle *connect_handle /* [in] [ref] */,
                                uint32_t access_mask /* [in]  */,
-                               struct policy_handle *user_handle /* [out] [ref] */,
-                               uint32_t *rid /* [out] [ref] */)
+                               struct dom_sid2 *sid /* [in] [ref] */,
+                               struct policy_handle *domain_handle /* [out] [ref] */)
 {
-       struct samr_CreateUser r;
+       struct samr_OpenDomain r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.account_name = account_name;
+       r.in.connect_handle = connect_handle;
        r.in.access_mask = access_mask;
+       r.in.sid = sid;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_CreateUser, &r);
+               NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_CREATEUSER,
+                               NDR_SAMR_OPENDOMAIN,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -550,7 +1300,7 @@ NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r);
+               NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -558,132 +1308,156 @@ NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *user_handle = *r.out.user_handle;
-       *rid = *r.out.rid;
+       *domain_handle = *r.out.domain_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *domain_handle /* [in] [ref] */,
-                                    uint32_t *resume_handle /* [in,out] [ref] */,
-                                    uint32_t acct_flags /* [in]  */,
-                                    struct samr_SamArray **sam /* [out] [ref] */,
-                                    uint32_t max_size /* [in]  */,
-                                    uint32_t *num_entries /* [out] [ref] */)
+struct rpccli_samr_QueryDomainInfo_state {
+       struct samr_QueryDomainInfo orig;
+       struct samr_QueryDomainInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                   enum samr_DomainInfoClass _level /* [in]  */,
+                                                   union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
 {
-       struct samr_EnumDomainUsers r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_QueryDomainInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryDomainInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.resume_handle = resume_handle;
-       r.in.acct_flags = acct_flags;
-       r.in.max_size = max_size;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r);
+               NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_ENUMDOMAINUSERS,
-                               &r);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryDomainInfo_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r);
-       }
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_QUERYDOMAININFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
-
-       /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *sam = *r.out.sam;
-       *num_entries = *r.out.num_entries;
-
-       /* Return result */
-       return r.out.result;
+       tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *domain_handle /* [in] [ref] */,
-                                   struct lsa_String *alias_name /* [in] [ref] */,
-                                   uint32_t access_mask /* [in]  */,
-                                   struct policy_handle *alias_handle /* [out] [ref] */,
-                                   uint32_t *rid /* [out] [ref] */)
+static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq)
 {
-       struct samr_CreateDomAlias r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDomainInfo_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.alias_name = alias_name;
-       r.in.access_mask = access_mask;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_CREATEDOMALIAS,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r);
+               NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryDomainInfo_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDomainInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *alias_handle = *r.out.alias_handle;
-       *rid = *r.out.rid;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *domain_handle /* [in] [ref] */,
-                                      uint32_t *resume_handle /* [in,out] [ref] */,
-                                      struct samr_SamArray **sam /* [out] [ref] */,
-                                      uint32_t max_size /* [in]  */,
-                                      uint32_t *num_entries /* [out] [ref] */)
+NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *domain_handle /* [in] [ref] */,
+                                    enum samr_DomainInfoClass level /* [in]  */,
+                                    union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
 {
-       struct samr_EnumDomainAliases r;
+       struct samr_QueryDomainInfo r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.domain_handle = domain_handle;
-       r.in.resume_handle = resume_handle;
-       r.in.max_size = max_size;
+       r.in.level = level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r);
+               NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_ENUMDOMAINALIASES,
+                               NDR_SAMR_QUERYDOMAININFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -691,7 +1465,7 @@ NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r);
+               NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -699,80 +1473,150 @@ NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *resume_handle = *r.out.resume_handle;
-       *sam = *r.out.sam;
-       *num_entries = *r.out.num_entries;
+       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *domain_handle /* [in] [ref] */,
-                                       struct lsa_SidArray *sids /* [in] [ref] */,
-                                       struct samr_Ids *rids /* [out] [ref] */)
+struct rpccli_samr_SetDomainInfo_state {
+       struct samr_SetDomainInfo orig;
+       struct samr_SetDomainInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                 enum samr_DomainInfoClass _level /* [in]  */,
+                                                 union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */)
 {
-       struct samr_GetAliasMembership r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_SetDomainInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetDomainInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.sids = sids;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_GETALIASMEMBERSHIP,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETDOMAININFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetDomainInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetDomainInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetDomainInfo_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetDomainInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *rids = *r.out.rids;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *domain_handle /* [in] [ref] */,
-                                uint32_t num_names /* [in] [range(0,1000)] */,
-                                struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
-                                struct samr_Ids *rids /* [out] [ref] */,
-                                struct samr_Ids *types /* [out] [ref] */)
+NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *domain_handle /* [in] [ref] */,
+                                  enum samr_DomainInfoClass level /* [in]  */,
+                                  union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */)
 {
-       struct samr_LookupNames r;
+       struct samr_SetDomainInfo r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.domain_handle = domain_handle;
-       r.in.num_names = num_names;
-       r.in.names = names;
+       r.in.level = level;
+       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_LookupNames, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_LOOKUPNAMES,
+                               NDR_SAMR_SETDOMAININFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -780,7 +1624,7 @@ NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -788,82 +1632,163 @@ NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *rids = *r.out.rids;
-       *types = *r.out.types;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *domain_handle /* [in] [ref] */,
-                               uint32_t num_rids /* [in] [range(0,1000)] */,
-                               uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
-                               struct lsa_Strings *names /* [out] [ref] */,
-                               struct samr_Ids *types /* [out] [ref] */)
+struct rpccli_samr_CreateDomainGroup_state {
+       struct samr_CreateDomainGroup orig;
+       struct samr_CreateDomainGroup tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_CreateDomainGroup_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     struct lsa_String *_name /* [in] [ref] */,
+                                                     uint32_t _access_mask /* [in]  */,
+                                                     struct policy_handle *_group_handle /* [out] [ref] */,
+                                                     uint32_t *_rid /* [out] [ref] */)
 {
-       struct samr_LookupRids r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_CreateDomainGroup_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_CreateDomainGroup_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.num_rids = num_rids;
-       r.in.rids = rids;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.name = _name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.group_handle = _group_handle;
+       state->orig.out.rid = _rid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_LookupRids, &r);
+               NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_LOOKUPRIDS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_CreateDomainGroup_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_samr,
+                                   NDR_SAMR_CREATEDOMAINGROUP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_CreateDomainGroup_done, req);
+       return req;
+}
+
+static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateDomainGroup_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.group_handle = *state->tmp.out.group_handle;
+       *state->orig.out.rid = *state->tmp.out.rid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r);
+               NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_CreateDomainGroup_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateDomainGroup_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *names = *r.out.names;
-       *types = *r.out.types;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              struct policy_handle *domain_handle /* [in] [ref] */,
-                              uint32_t access_mask /* [in]  */,
-                              uint32_t rid /* [in]  */,
-                              struct policy_handle *group_handle /* [out] [ref] */)
+NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *domain_handle /* [in] [ref] */,
+                                      struct lsa_String *name /* [in] [ref] */,
+                                      uint32_t access_mask /* [in]  */,
+                                      struct policy_handle *group_handle /* [out] [ref] */,
+                                      uint32_t *rid /* [out] [ref] */)
 {
-       struct samr_OpenGroup r;
+       struct samr_CreateDomainGroup r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.domain_handle = domain_handle;
+       r.in.name = name;
        r.in.access_mask = access_mask;
-       r.in.rid = rid;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r);
+               NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_OPENGROUP,
+                               NDR_SAMR_CREATEDOMAINGROUP,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -871,7 +1796,7 @@ NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r);
+               NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -880,117 +1805,166 @@ NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
 
        /* Return variables */
        *group_handle = *r.out.group_handle;
+       *rid = *r.out.rid;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *group_handle /* [in] [ref] */,
-                                   enum samr_GroupInfoEnum level /* [in]  */,
-                                   union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */)
+struct rpccli_samr_EnumDomainGroups_state {
+       struct samr_EnumDomainGroups orig;
+       struct samr_EnumDomainGroups tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_EnumDomainGroups_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                    uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                    struct samr_SamArray **_sam /* [out] [ref] */,
+                                                    uint32_t _max_size /* [in]  */,
+                                                    uint32_t *_num_entries /* [out] [ref] */)
 {
-       struct samr_QueryGroupInfo r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.group_handle = group_handle;
-       r.in.level = level;
+       struct tevent_req *req;
+       struct rpccli_samr_EnumDomainGroups_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_EnumDomainGroups_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_QUERYGROUPINFO,
-                               &r);
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.max_size = _max_size;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.sam = _sam;
+       state->orig.out.num_entries = _num_entries;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_EnumDomainGroups_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_ENUMDOMAINGROUPS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_EnumDomainGroups_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *group_handle /* [in] [ref] */,
-                                 enum samr_GroupInfoEnum level /* [in]  */,
-                                 union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */)
+static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq)
 {
-       struct samr_SetGroupInfo r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomainGroups_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.group_handle = group_handle;
-       r.in.level = level;
-       r.in.info = info;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SETGROUPINFO,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.sam = *state->tmp.out.sam;
+       *state->orig.out.num_entries = *state->tmp.out.num_entries;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_EnumDomainGroups_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomainGroups_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *group_handle /* [in] [ref] */,
-                                   uint32_t rid /* [in]  */,
-                                   uint32_t flags /* [in]  */)
+NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *domain_handle /* [in] [ref] */,
+                                     uint32_t *resume_handle /* [in,out] [ref] */,
+                                     struct samr_SamArray **sam /* [out] [ref] */,
+                                     uint32_t max_size /* [in]  */,
+                                     uint32_t *num_entries /* [out] [ref] */)
 {
-       struct samr_AddGroupMember r;
+       struct samr_EnumDomainGroups r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.group_handle = group_handle;
-       r.in.rid = rid;
-       r.in.flags = flags;
+       r.in.domain_handle = domain_handle;
+       r.in.resume_handle = resume_handle;
+       r.in.max_size = max_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_ADDGROUPMEMBER,
+                               NDR_SAMR_ENUMDOMAINGROUPS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -998,7 +1972,7 @@ NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1006,109 +1980,166 @@ NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *resume_handle = *r.out.resume_handle;
+       *sam = *r.out.sam;
+       *num_entries = *r.out.num_entries;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *group_handle /* [in,out] [ref] */)
+struct rpccli_samr_CreateUser_state {
+       struct samr_CreateUser orig;
+       struct samr_CreateUser tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_CreateUser_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_CreateUser_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_domain_handle /* [in] [ref] */,
+                                              struct lsa_String *_account_name /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_user_handle /* [out] [ref] */,
+                                              uint32_t *_rid /* [out] [ref] */)
 {
-       struct samr_DeleteDomainGroup r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.group_handle = group_handle;
+       struct tevent_req *req;
+       struct rpccli_samr_CreateUser_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_CreateUser_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_DELETEDOMAINGROUP,
-                               &r);
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.access_mask = _access_mask;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.user_handle = _user_handle;
+       state->orig.out.rid = _rid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r);
+               NDR_PRINT_IN_DEBUG(samr_CreateUser, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_CreateUser_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *group_handle = *r.out.group_handle;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_CREATEUSER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_CreateUser_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *group_handle /* [in] [ref] */,
-                                      uint32_t rid /* [in]  */)
+static void rpccli_samr_CreateUser_done(struct tevent_req *subreq)
 {
-       struct samr_DeleteGroupMember r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_CreateUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateUser_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.group_handle = group_handle;
-       r.in.rid = rid;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_DELETEGROUPMEMBER,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.user_handle = *state->tmp.out.user_handle;
+       *state->orig.out.rid = *state->tmp.out.rid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r);
+               NDR_PRINT_OUT_DEBUG(samr_CreateUser, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_CreateUser_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_samr_CreateUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateUser_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *group_handle /* [in] [ref] */,
-                                     struct samr_RidTypeArray **rids /* [out] [ref] */)
+NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *domain_handle /* [in] [ref] */,
+                               struct lsa_String *account_name /* [in] [ref] */,
+                               uint32_t access_mask /* [in]  */,
+                               struct policy_handle *user_handle /* [out] [ref] */,
+                               uint32_t *rid /* [out] [ref] */)
 {
-       struct samr_QueryGroupMember r;
+       struct samr_CreateUser r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.group_handle = group_handle;
+       r.in.domain_handle = domain_handle;
+       r.in.account_name = account_name;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r);
+               NDR_PRINT_IN_DEBUG(samr_CreateUser, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_QUERYGROUPMEMBER,
+                               NDR_SAMR_CREATEUSER,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1116,7 +2147,7 @@ NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r);
+               NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1124,119 +2155,171 @@ NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *rids = *r.out.rids;
+       *user_handle = *r.out.user_handle;
+       *rid = *r.out.rid;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               struct policy_handle *group_handle /* [in] [ref] */,
-                                               uint32_t unknown1 /* [in]  */,
-                                               uint32_t unknown2 /* [in]  */)
+struct rpccli_samr_EnumDomainUsers_state {
+       struct samr_EnumDomainUsers orig;
+       struct samr_EnumDomainUsers tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_EnumDomainUsers_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                   uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                   uint32_t _acct_flags /* [in]  */,
+                                                   struct samr_SamArray **_sam /* [out] [ref] */,
+                                                   uint32_t _max_size /* [in]  */,
+                                                   uint32_t *_num_entries /* [out] [ref] */)
 {
-       struct samr_SetMemberAttributesOfGroup r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.group_handle = group_handle;
-       r.in.unknown1 = unknown1;
-       r.in.unknown2 = unknown2;
+       struct tevent_req *req;
+       struct rpccli_samr_EnumDomainUsers_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_EnumDomainUsers_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
-                               &r);
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.acct_flags = _acct_flags;
+       state->orig.in.max_size = _max_size;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.sam = _sam;
+       state->orig.out.num_entries = _num_entries;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_EnumDomainUsers_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_ENUMDOMAINUSERS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_EnumDomainUsers_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              struct policy_handle *domain_handle /* [in] [ref] */,
-                              uint32_t access_mask /* [in]  */,
-                              uint32_t rid /* [in]  */,
-                              struct policy_handle *alias_handle /* [out] [ref] */)
+static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq)
 {
-       struct samr_OpenAlias r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomainUsers_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.access_mask = access_mask;
-       r.in.rid = rid;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_OPENALIAS,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.sam = *state->tmp.out.sam;
+       *state->orig.out.num_entries = *state->tmp.out.num_entries;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_EnumDomainUsers_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomainUsers_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *alias_handle = *r.out.alias_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *alias_handle /* [in] [ref] */,
-                                   enum samr_AliasInfoEnum level /* [in]  */,
-                                   union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */)
+NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *domain_handle /* [in] [ref] */,
+                                    uint32_t *resume_handle /* [in,out] [ref] */,
+                                    uint32_t acct_flags /* [in]  */,
+                                    struct samr_SamArray **sam /* [out] [ref] */,
+                                    uint32_t max_size /* [in]  */,
+                                    uint32_t *num_entries /* [out] [ref] */)
 {
-       struct samr_QueryAliasInfo r;
+       struct samr_EnumDomainUsers r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
-       r.in.level = level;
+       r.in.domain_handle = domain_handle;
+       r.in.resume_handle = resume_handle;
+       r.in.acct_flags = acct_flags;
+       r.in.max_size = max_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_QUERYALIASINFO,
+                               NDR_SAMR_ENUMDOMAINUSERS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1244,7 +2327,7 @@ NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1252,72 +2335,166 @@ NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
+       *resume_handle = *r.out.resume_handle;
+       *sam = *r.out.sam;
+       *num_entries = *r.out.num_entries;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *alias_handle /* [in] [ref] */,
-                                 enum samr_AliasInfoEnum level /* [in]  */,
-                                 union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */)
+struct rpccli_samr_CreateDomAlias_state {
+       struct samr_CreateDomAlias orig;
+       struct samr_CreateDomAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_CreateDomAlias_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                  struct lsa_String *_alias_name /* [in] [ref] */,
+                                                  uint32_t _access_mask /* [in]  */,
+                                                  struct policy_handle *_alias_handle /* [out] [ref] */,
+                                                  uint32_t *_rid /* [out] [ref] */)
 {
-       struct samr_SetAliasInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_CreateDomAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_CreateDomAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
-       r.in.level = level;
-       r.in.info = info;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.alias_name = _alias_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.alias_handle = _alias_handle;
+       state->orig.out.rid = _rid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SETALIASINFO,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_CreateDomAlias_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_samr,
+                                   NDR_SAMR_CREATEDOMALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_CreateDomAlias_done, req);
+       return req;
+}
+
+static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateDomAlias_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
+       *state->orig.out.rid = *state->tmp.out.rid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_CreateDomAlias_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateDomAlias_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *alias_handle /* [in,out] [ref] */)
+                                   struct policy_handle *domain_handle /* [in] [ref] */,
+                                   struct lsa_String *alias_name /* [in] [ref] */,
+                                   uint32_t access_mask /* [in]  */,
+                                   struct policy_handle *alias_handle /* [out] [ref] */,
+                                   uint32_t *rid /* [out] [ref] */)
 {
-       struct samr_DeleteDomAlias r;
+       struct samr_CreateDomAlias r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
+       r.in.domain_handle = domain_handle;
+       r.in.alias_name = alias_name;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r);
+               NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_DELETEDOMALIAS,
+                               NDR_SAMR_CREATEDOMALIAS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1325,7 +2502,7 @@ NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r);
+               NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1334,71 +2511,166 @@ NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
 
        /* Return variables */
        *alias_handle = *r.out.alias_handle;
+       *rid = *r.out.rid;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *alias_handle /* [in] [ref] */,
-                                   struct dom_sid2 *sid /* [in] [ref] */)
+struct rpccli_samr_EnumDomainAliases_state {
+       struct samr_EnumDomainAliases orig;
+       struct samr_EnumDomainAliases tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_EnumDomainAliases_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                     struct samr_SamArray **_sam /* [out] [ref] */,
+                                                     uint32_t _max_size /* [in]  */,
+                                                     uint32_t *_num_entries /* [out] [ref] */)
 {
-       struct samr_AddAliasMember r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_EnumDomainAliases_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_EnumDomainAliases_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
-       r.in.sid = sid;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.max_size = _max_size;
+
+       /* Out parameters */
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.sam = _sam;
+       state->orig.out.num_entries = _num_entries;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_ADDALIASMEMBER,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_EnumDomainAliases_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_samr,
+                                   NDR_SAMR_ENUMDOMAINALIASES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_EnumDomainAliases_done, req);
+       return req;
+}
+
+static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomainAliases_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       *state->orig.out.sam = *state->tmp.out.sam;
+       *state->orig.out.num_entries = *state->tmp.out.num_entries;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_EnumDomainAliases_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
+               req, struct rpccli_samr_EnumDomainAliases_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *alias_handle /* [in] [ref] */,
-                                      struct dom_sid2 *sid /* [in] [ref] */)
+                                      struct policy_handle *domain_handle /* [in] [ref] */,
+                                      uint32_t *resume_handle /* [in,out] [ref] */,
+                                      struct samr_SamArray **sam /* [out] [ref] */,
+                                      uint32_t max_size /* [in]  */,
+                                      uint32_t *num_entries /* [out] [ref] */)
 {
-       struct samr_DeleteAliasMember r;
+       struct samr_EnumDomainAliases r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
-       r.in.sid = sid;
+       r.in.domain_handle = domain_handle;
+       r.in.resume_handle = resume_handle;
+       r.in.max_size = max_size;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r);
+               NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_DELETEALIASMEMBER,
+                               NDR_SAMR_ENUMDOMAINALIASES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1406,7 +2678,7 @@ NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r);
+               NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1414,74 +2686,158 @@ NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *resume_handle = *r.out.resume_handle;
+       *sam = *r.out.sam;
+       *num_entries = *r.out.num_entries;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *alias_handle /* [in] [ref] */,
-                                      struct lsa_SidArray *sids /* [out] [ref] */)
+struct rpccli_samr_GetAliasMembership_state {
+       struct samr_GetAliasMembership orig;
+       struct samr_GetAliasMembership tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetAliasMembership_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                      struct lsa_SidArray *_sids /* [in] [ref] */,
+                                                      struct samr_Ids *_rids /* [out] [ref] */)
 {
-       struct samr_GetMembersInAlias r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_GetAliasMembership_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetAliasMembership_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.sids = _sids;
+
+       /* Out parameters */
+       state->orig.out.rids = _rids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r);
+               NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_GETMEMBERSINALIAS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetAliasMembership_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_samr,
+                                   NDR_SAMR_GETALIASMEMBERSHIP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetAliasMembership_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetAliasMembership_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.rids = *state->tmp.out.rids;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r);
+               NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetAliasMembership_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetAliasMembership_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *sids = *r.out.sids;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             struct policy_handle *domain_handle /* [in] [ref] */,
-                             uint32_t access_mask /* [in]  */,
-                             uint32_t rid /* [in]  */,
-                             struct policy_handle *user_handle /* [out] [ref] */)
+NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *domain_handle /* [in] [ref] */,
+                                       struct lsa_SidArray *sids /* [in] [ref] */,
+                                       struct samr_Ids *rids /* [out] [ref] */)
 {
-       struct samr_OpenUser r;
+       struct samr_GetAliasMembership r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.domain_handle = domain_handle;
-       r.in.access_mask = access_mask;
-       r.in.rid = rid;
+       r.in.sids = sids;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_OpenUser, &r);
+               NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_OPENUSER,
+                               NDR_SAMR_GETALIASMEMBERSHIP,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1489,7 +2845,7 @@ NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r);
+               NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1497,72 +2853,164 @@ NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *user_handle = *r.out.user_handle;
+       *rids = *r.out.rids;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *user_handle /* [in,out] [ref] */)
+struct rpccli_samr_LookupNames_state {
+       struct samr_LookupNames orig;
+       struct samr_LookupNames tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_LookupNames_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_LookupNames_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_domain_handle /* [in] [ref] */,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
+                                               struct samr_Ids *_rids /* [out] [ref] */,
+                                               struct samr_Ids *_types /* [out] [ref] */)
 {
-       struct samr_DeleteUser r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_LookupNames_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_LookupNames_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.num_names = _num_names;
+       state->orig.in.names = _names;
+
+       /* Out parameters */
+       state->orig.out.rids = _rids;
+       state->orig.out.types = _types;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r);
+               NDR_PRINT_IN_DEBUG(samr_LookupNames, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_DELETEUSER,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_LookupNames_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_samr,
+                                   NDR_SAMR_LOOKUPNAMES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_LookupNames_done, req);
+       return req;
+}
+
+static void rpccli_samr_LookupNames_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_LookupNames_state *state = tevent_req_data(
+               req, struct rpccli_samr_LookupNames_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.rids = *state->tmp.out.rids;
+       *state->orig.out.types = *state->tmp.out.types;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r);
+               NDR_PRINT_OUT_DEBUG(samr_LookupNames, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_LookupNames_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_samr_LookupNames_state *state = tevent_req_data(
+               req, struct rpccli_samr_LookupNames_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *user_handle = *r.out.user_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct policy_handle *user_handle /* [in] [ref] */,
-                                  enum samr_UserInfoLevel level /* [in]  */,
-                                  union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
+NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *domain_handle /* [in] [ref] */,
+                                uint32_t num_names /* [in] [range(0,1000)] */,
+                                struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
+                                struct samr_Ids *rids /* [out] [ref] */,
+                                struct samr_Ids *types /* [out] [ref] */)
 {
-       struct samr_QueryUserInfo r;
+       struct samr_LookupNames r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
-       r.in.level = level;
+       r.in.domain_handle = domain_handle;
+       r.in.num_names = num_names;
+       r.in.names = names;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_LookupNames, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_QUERYUSERINFO,
+                               NDR_SAMR_LOOKUPNAMES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1570,7 +3018,7 @@ NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1578,131 +3026,165 @@ NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
+       *rids = *r.out.rids;
+       *types = *r.out.types;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *user_handle /* [in] [ref] */,
-                                enum samr_UserInfoLevel level /* [in]  */,
-                                union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
+struct rpccli_samr_LookupRids_state {
+       struct samr_LookupRids orig;
+       struct samr_LookupRids tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_LookupRids_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_LookupRids_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_domain_handle /* [in] [ref] */,
+                                              uint32_t _num_rids /* [in] [range(0,1000)] */,
+                                              uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
+                                              struct lsa_Strings *_names /* [out] [ref] */,
+                                              struct samr_Ids *_types /* [out] [ref] */)
 {
-       struct samr_SetUserInfo r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.user_handle = user_handle;
-       r.in.level = level;
-       r.in.info = info;
+       struct tevent_req *req;
+       struct rpccli_samr_LookupRids_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_LookupRids_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SETUSERINFO,
-                               &r);
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.num_rids = _num_rids;
+       state->orig.in.rids = _rids;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.names = _names;
+       state->orig.out.types = _types;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_LookupRids, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_LookupRids_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       return r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_LOOKUPRIDS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_LookupRids_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *user_handle /* [in] [ref] */,
-                                       uint8_t lm_present /* [in]  */,
-                                       struct samr_Password *old_lm_crypted /* [in] [unique] */,
-                                       struct samr_Password *new_lm_crypted /* [in] [unique] */,
-                                       uint8_t nt_present /* [in]  */,
-                                       struct samr_Password *old_nt_crypted /* [in] [unique] */,
-                                       struct samr_Password *new_nt_crypted /* [in] [unique] */,
-                                       uint8_t cross1_present /* [in]  */,
-                                       struct samr_Password *nt_cross /* [in] [unique] */,
-                                       uint8_t cross2_present /* [in]  */,
-                                       struct samr_Password *lm_cross /* [in] [unique] */)
+static void rpccli_samr_LookupRids_done(struct tevent_req *subreq)
 {
-       struct samr_ChangePasswordUser r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_LookupRids_state *state = tevent_req_data(
+               req, struct rpccli_samr_LookupRids_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.user_handle = user_handle;
-       r.in.lm_present = lm_present;
-       r.in.old_lm_crypted = old_lm_crypted;
-       r.in.new_lm_crypted = new_lm_crypted;
-       r.in.nt_present = nt_present;
-       r.in.old_nt_crypted = old_nt_crypted;
-       r.in.new_nt_crypted = new_nt_crypted;
-       r.in.cross1_present = cross1_present;
-       r.in.nt_cross = nt_cross;
-       r.in.cross2_present = cross2_present;
-       r.in.lm_cross = lm_cross;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_CHANGEPASSWORDUSER,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.names = *state->tmp.out.names;
+       *state->orig.out.types = *state->tmp.out.types;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r);
+               NDR_PRINT_OUT_DEBUG(samr_LookupRids, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_LookupRids_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_samr_LookupRids_state *state = tevent_req_data(
+               req, struct rpccli_samr_LookupRids_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *user_handle /* [in] [ref] */,
-                                     struct samr_RidWithAttributeArray **rids /* [out] [ref] */)
+NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *domain_handle /* [in] [ref] */,
+                               uint32_t num_rids /* [in] [range(0,1000)] */,
+                               uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
+                               struct lsa_Strings *names /* [out] [ref] */,
+                               struct samr_Ids *types /* [out] [ref] */)
 {
-       struct samr_GetGroupsForUser r;
+       struct samr_LookupRids r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
+       r.in.domain_handle = domain_handle;
+       r.in.num_rids = num_rids;
+       r.in.rids = rids;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r);
+               NDR_PRINT_IN_DEBUG(samr_LookupRids, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_GETGROUPSFORUSER,
+                               NDR_SAMR_LOOKUPRIDS,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1710,7 +3192,7 @@ NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r);
+               NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1718,87 +3200,161 @@ NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *rids = *r.out.rids;
+       *names = *r.out.names;
+       *types = *r.out.types;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *domain_handle /* [in] [ref] */,
-                                     uint16_t level /* [in]  */,
-                                     uint32_t start_idx /* [in]  */,
-                                     uint32_t max_entries /* [in]  */,
-                                     uint32_t buf_size /* [in]  */,
-                                     uint32_t *total_size /* [out] [ref] */,
-                                     uint32_t *returned_size /* [out] [ref] */,
-                                     union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
+struct rpccli_samr_OpenGroup_state {
+       struct samr_OpenGroup orig;
+       struct samr_OpenGroup tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_OpenGroup_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_domain_handle /* [in] [ref] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             uint32_t _rid /* [in]  */,
+                                             struct policy_handle *_group_handle /* [out] [ref] */)
 {
-       struct samr_QueryDisplayInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_OpenGroup_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_OpenGroup_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
-       r.in.start_idx = start_idx;
-       r.in.max_entries = max_entries;
-       r.in.buf_size = buf_size;
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.rid = _rid;
+
+       /* Out parameters */
+       state->orig.out.group_handle = _group_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_OpenGroup, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_QUERYDISPLAYINFO,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_OpenGroup_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_samr,
+                                   NDR_SAMR_OPENGROUP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_OpenGroup_done, req);
+       return req;
+}
+
+static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenGroup_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.group_handle = *state->tmp.out.group_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_OpenGroup_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenGroup_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *total_size = *r.out.total_size;
-       *returned_size = *r.out.returned_size;
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               struct policy_handle *domain_handle /* [in] [ref] */,
-                                               uint16_t level /* [in]  */,
-                                               struct lsa_String *name /* [in] [ref] */,
-                                               uint32_t *idx /* [out] [ref] */)
+NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *domain_handle /* [in] [ref] */,
+                              uint32_t access_mask /* [in]  */,
+                              uint32_t rid /* [in]  */,
+                              struct policy_handle *group_handle /* [out] [ref] */)
 {
-       struct samr_GetDisplayEnumerationIndex r;
+       struct samr_OpenGroup r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.domain_handle = domain_handle;
-       r.in.level = level;
-       r.in.name = name;
+       r.in.access_mask = access_mask;
+       r.in.rid = rid;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r);
+               NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
+                               NDR_SAMR_OPENGROUP,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1806,7 +3362,7 @@ NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r);
+               NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1814,68 +3370,156 @@ NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *idx = *r.out.idx;
+       *group_handle = *r.out.group_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               struct policy_handle *domain_handle /* [in] [ref] */)
+struct rpccli_samr_QueryGroupInfo_state {
+       struct samr_QueryGroupInfo orig;
+       struct samr_QueryGroupInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryGroupInfo_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_group_handle /* [in] [ref] */,
+                                                  enum samr_GroupInfoEnum _level /* [in]  */,
+                                                  union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */)
 {
-       struct samr_TestPrivateFunctionsDomain r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_QueryGroupInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryGroupInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
+       state->orig.in.group_handle = _group_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r);
+               NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryGroupInfo_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_samr,
+                                   NDR_SAMR_QUERYGROUPINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryGroupInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryGroupInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r);
+               NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryGroupInfo_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryGroupInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             struct policy_handle *user_handle /* [in] [ref] */)
+NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *group_handle /* [in] [ref] */,
+                                   enum samr_GroupInfoEnum level /* [in]  */,
+                                   union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */)
 {
-       struct samr_TestPrivateFunctionsUser r;
+       struct samr_QueryGroupInfo r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
+       r.in.group_handle = group_handle;
+       r.in.level = level;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r);
+               NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
+                               NDR_SAMR_QUERYGROUPINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1883,7 +3527,7 @@ NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r);
+               NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1891,71 +3535,150 @@ NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct policy_handle *user_handle /* [in] [ref] */,
-                                  struct samr_PwInfo *info /* [out] [ref] */)
+struct rpccli_samr_SetGroupInfo_state {
+       struct samr_SetGroupInfo orig;
+       struct samr_SetGroupInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetGroupInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_group_handle /* [in] [ref] */,
+                                                enum samr_GroupInfoEnum _level /* [in]  */,
+                                                union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */)
 {
-       struct samr_GetUserPwInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_SetGroupInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetGroupInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
+       state->orig.in.group_handle = _group_handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_GETUSERPWINFO,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETGROUPINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetGroupInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetGroupInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetGroupInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetGroupInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
-                                                  TALLOC_CTX *mem_ctx,
-                                                  struct policy_handle *domain_handle /* [in] [ref] */,
-                                                  struct dom_sid2 *sid /* [in] [ref] */)
+NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *group_handle /* [in] [ref] */,
+                                 enum samr_GroupInfoEnum level /* [in]  */,
+                                 union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */)
 {
-       struct samr_RemoveMemberFromForeignDomain r;
+       struct samr_SetGroupInfo r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.sid = sid;
+       r.in.group_handle = group_handle;
+       r.in.level = level;
+       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
+                               NDR_SAMR_SETGROUPINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1963,7 +3686,7 @@ NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1976,69 +3699,144 @@ NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *domain_handle /* [in] [ref] */,
-                                     enum samr_DomainInfoClass level /* [in]  */,
-                                     union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
+struct rpccli_samr_AddGroupMember_state {
+       struct samr_AddGroupMember orig;
+       struct samr_AddGroupMember tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_AddGroupMember_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_group_handle /* [in] [ref] */,
+                                                  uint32_t _rid /* [in]  */,
+                                                  uint32_t _flags /* [in]  */)
 {
-       struct samr_QueryDomainInfo2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_AddGroupMember_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_AddGroupMember_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
+       state->orig.in.group_handle = _group_handle;
+       state->orig.in.rid = _rid;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r);
+               NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_QUERYDOMAININFO2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_ADDGROUPMEMBER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_AddGroupMember_done, req);
+       return req;
+}
+
+static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_AddGroupMember_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_AddGroupMember_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_AddGroupMember_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *user_handle /* [in] [ref] */,
-                                   enum samr_UserInfoLevel level /* [in]  */,
-                                   union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
+                                   struct policy_handle *group_handle /* [in] [ref] */,
+                                   uint32_t rid /* [in]  */,
+                                   uint32_t flags /* [in]  */)
 {
-       struct samr_QueryUserInfo2 r;
+       struct samr_AddGroupMember r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
-       r.in.level = level;
+       r.in.group_handle = group_handle;
+       r.in.rid = rid;
+       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r);
+               NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_QUERYUSERINFO2,
+                               NDR_SAMR_ADDGROUPMEMBER,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2046,7 +3844,7 @@ NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2054,87 +3852,149 @@ NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *domain_handle /* [in] [ref] */,
-                                      uint16_t level /* [in]  */,
-                                      uint32_t start_idx /* [in]  */,
-                                      uint32_t max_entries /* [in]  */,
-                                      uint32_t buf_size /* [in]  */,
-                                      uint32_t *total_size /* [out] [ref] */,
-                                      uint32_t *returned_size /* [out] [ref] */,
-                                      union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
+struct rpccli_samr_DeleteDomainGroup_state {
+       struct samr_DeleteDomainGroup orig;
+       struct samr_DeleteDomainGroup tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_DeleteDomainGroup_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_group_handle /* [in,out] [ref] */)
 {
-       struct samr_QueryDisplayInfo2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_DeleteDomainGroup_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_DeleteDomainGroup_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
-       r.in.start_idx = start_idx;
-       r.in.max_entries = max_entries;
-       r.in.buf_size = buf_size;
+       state->orig.in.group_handle = _group_handle;
+
+       /* Out parameters */
+       state->orig.out.group_handle = _group_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r);
+               NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_QUERYDISPLAYINFO2,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_DeleteDomainGroup_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_samr,
+                                   NDR_SAMR_DELETEDOMAINGROUP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_DeleteDomainGroup_done, req);
+       return req;
+}
+
+static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteDomainGroup_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.group_handle = *state->tmp.out.group_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_DeleteDomainGroup_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteDomainGroup_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *total_size = *r.out.total_size;
-       *returned_size = *r.out.returned_size;
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
-                                                TALLOC_CTX *mem_ctx,
-                                                struct policy_handle *domain_handle /* [in] [ref] */,
-                                                uint16_t level /* [in]  */,
-                                                struct lsa_String *name /* [in] [ref] */,
-                                                uint32_t *idx /* [out] [ref] */)
+NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *group_handle /* [in,out] [ref] */)
 {
-       struct samr_GetDisplayEnumerationIndex2 r;
+       struct samr_DeleteDomainGroup r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
-       r.in.name = name;
+       r.in.group_handle = group_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
+               NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
+                               NDR_SAMR_DELETEDOMAINGROUP,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2142,7 +4002,7 @@ NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2150,66 +4010,4586 @@ NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *idx = *r.out.idx;
+       *group_handle = *r.out.group_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                struct policy_handle *domain_handle /* [in] [ref] */,
-                                struct lsa_String *account_name /* [in] [ref] */,
-                                uint32_t acct_flags /* [in]  */,
-                                uint32_t access_mask /* [in]  */,
-                                struct policy_handle *user_handle /* [out] [ref] */,
-                                uint32_t *access_granted /* [out] [ref] */,
-                                uint32_t *rid /* [out] [ref] */)
+struct rpccli_samr_DeleteGroupMember_state {
+       struct samr_DeleteGroupMember orig;
+       struct samr_DeleteGroupMember tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_DeleteGroupMember_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_group_handle /* [in] [ref] */,
+                                                     uint32_t _rid /* [in]  */)
 {
-       struct samr_CreateUser2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_DeleteGroupMember_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_DeleteGroupMember_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.account_name = account_name;
-       r.in.acct_flags = acct_flags;
-       r.in.access_mask = access_mask;
+       state->orig.in.group_handle = _group_handle;
+       state->orig.in.rid = _rid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r);
+               NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_CREATEUSER2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_DELETEGROUPMEMBER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_DeleteGroupMember_done, req);
+       return req;
+}
+
+static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteGroupMember_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_DeleteGroupMember_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteGroupMember_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *user_handle = *r.out.user_handle;
-       *access_granted = *r.out.access_granted;
-       *rid = *r.out.rid;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *domain_handle /* [in] [ref] */,
-                                      uint16_t level /* [in]  */,
+                                      struct policy_handle *group_handle /* [in] [ref] */,
+                                      uint32_t rid /* [in]  */)
+{
+       struct samr_DeleteGroupMember r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.group_handle = group_handle;
+       r.in.rid = rid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_DELETEGROUPMEMBER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryGroupMember_state {
+       struct samr_QueryGroupMember orig;
+       struct samr_QueryGroupMember tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryGroupMember_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_group_handle /* [in] [ref] */,
+                                                    struct samr_RidTypeArray **_rids /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryGroupMember_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryGroupMember_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.group_handle = _group_handle;
+
+       /* Out parameters */
+       state->orig.out.rids = _rids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryGroupMember_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_samr,
+                                   NDR_SAMR_QUERYGROUPMEMBER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryGroupMember_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryGroupMember_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.rids = *state->tmp.out.rids;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryGroupMember_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryGroupMember_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_samr_QueryGroupMember(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *group_handle /* [in] [ref] */,
+                                     struct samr_RidTypeArray **rids /* [out] [ref] */)
+{
+       struct samr_QueryGroupMember r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.group_handle = group_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYGROUPMEMBER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *rids = *r.out.rids;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_SetMemberAttributesOfGroup_state {
+       struct samr_SetMemberAttributesOfGroup orig;
+       struct samr_SetMemberAttributesOfGroup tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_group_handle /* [in] [ref] */,
+                                                              uint32_t _unknown1 /* [in]  */,
+                                                              uint32_t _unknown2 /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_SetMemberAttributesOfGroup_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetMemberAttributesOfGroup_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.group_handle = _group_handle;
+       state->orig.in.unknown1 = _unknown1;
+       state->orig.in.unknown2 = _unknown2;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetMemberAttributesOfGroup_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetMemberAttributesOfGroup_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetMemberAttributesOfGroup_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *group_handle /* [in] [ref] */,
+                                               uint32_t unknown1 /* [in]  */,
+                                               uint32_t unknown2 /* [in]  */)
+{
+       struct samr_SetMemberAttributesOfGroup r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.group_handle = group_handle;
+       r.in.unknown1 = unknown1;
+       r.in.unknown2 = unknown2;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_OpenAlias_state {
+       struct samr_OpenAlias orig;
+       struct samr_OpenAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_OpenAlias_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_domain_handle /* [in] [ref] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             uint32_t _rid /* [in]  */,
+                                             struct policy_handle *_alias_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_OpenAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_OpenAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.rid = _rid;
+
+       /* Out parameters */
+       state->orig.out.alias_handle = _alias_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_OpenAlias, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_OpenAlias_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_samr,
+                                   NDR_SAMR_OPENALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_OpenAlias_done, req);
+       return req;
+}
+
+static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenAlias_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.alias_handle = *state->tmp.out.alias_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_OpenAlias_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result)
+{
+       struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenAlias_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_samr_OpenAlias(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *domain_handle /* [in] [ref] */,
+                              uint32_t access_mask /* [in]  */,
+                              uint32_t rid /* [in]  */,
+                              struct policy_handle *alias_handle /* [out] [ref] */)
+{
+       struct samr_OpenAlias r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.access_mask = access_mask;
+       r.in.rid = rid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_OPENALIAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *alias_handle = *r.out.alias_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryAliasInfo_state {
+       struct samr_QueryAliasInfo orig;
+       struct samr_QueryAliasInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryAliasInfo_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                  enum samr_AliasInfoEnum _level /* [in]  */,
+                                                  union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryAliasInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryAliasInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryAliasInfo_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_samr,
+                                   NDR_SAMR_QUERYALIASINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryAliasInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryAliasInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryAliasInfo_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryAliasInfo_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_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *alias_handle /* [in] [ref] */,
+                                   enum samr_AliasInfoEnum level /* [in]  */,
+                                   union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct samr_QueryAliasInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYALIASINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_SetAliasInfo_state {
+       struct samr_SetAliasInfo orig;
+       struct samr_SetAliasInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetAliasInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                enum samr_AliasInfoEnum _level /* [in]  */,
+                                                union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_SetAliasInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetAliasInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETALIASINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetAliasInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetAliasInfo_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetAliasInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetAliasInfo_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_samr_SetAliasInfo(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *alias_handle /* [in] [ref] */,
+                                 enum samr_AliasInfoEnum level /* [in]  */,
+                                 union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */)
+{
+       struct samr_SetAliasInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_SETALIASINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_DeleteDomAlias_state {
+       struct samr_DeleteDomAlias orig;
+       struct samr_DeleteDomAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_DeleteDomAlias_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_alias_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_DeleteDomAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_DeleteDomAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+
+       /* Out parameters */
+       state->orig.out.alias_handle = _alias_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_DeleteDomAlias_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_samr,
+                                   NDR_SAMR_DELETEDOMALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_DeleteDomAlias_done, req);
+       return req;
+}
+
+static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteDomAlias_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.alias_handle = *state->tmp.out.alias_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_DeleteDomAlias_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteDomAlias_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_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *alias_handle /* [in,out] [ref] */)
+{
+       struct samr_DeleteDomAlias r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_DELETEDOMALIAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *alias_handle = *r.out.alias_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_AddAliasMember_state {
+       struct samr_AddAliasMember orig;
+       struct samr_AddAliasMember tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_AddAliasMember_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                  struct dom_sid2 *_sid /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_AddAliasMember_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_AddAliasMember_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+       state->orig.in.sid = _sid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_ADDALIASMEMBER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_AddAliasMember_done, req);
+       return req;
+}
+
+static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_AddAliasMember_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_AddAliasMember_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_AddAliasMember_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_samr_AddAliasMember(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *alias_handle /* [in] [ref] */,
+                                   struct dom_sid2 *sid /* [in] [ref] */)
+{
+       struct samr_AddAliasMember r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+       r.in.sid = sid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_ADDALIASMEMBER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_DeleteAliasMember_state {
+       struct samr_DeleteAliasMember orig;
+       struct samr_DeleteAliasMember tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_DeleteAliasMember_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                     struct dom_sid2 *_sid /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_DeleteAliasMember_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_DeleteAliasMember_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+       state->orig.in.sid = _sid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_DELETEALIASMEMBER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_DeleteAliasMember_done, req);
+       return req;
+}
+
+static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteAliasMember_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_DeleteAliasMember_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteAliasMember_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_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *alias_handle /* [in] [ref] */,
+                                      struct dom_sid2 *sid /* [in] [ref] */)
+{
+       struct samr_DeleteAliasMember r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+       r.in.sid = sid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_DELETEALIASMEMBER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_GetMembersInAlias_state {
+       struct samr_GetMembersInAlias orig;
+       struct samr_GetMembersInAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetMembersInAlias_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                     struct lsa_SidArray *_sids /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_GetMembersInAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetMembersInAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+
+       /* Out parameters */
+       state->orig.out.sids = _sids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetMembersInAlias_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_samr,
+                                   NDR_SAMR_GETMEMBERSINALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetMembersInAlias_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetMembersInAlias_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);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetMembersInAlias_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetMembersInAlias_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_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *alias_handle /* [in] [ref] */,
+                                      struct lsa_SidArray *sids /* [out] [ref] */)
+{
+       struct samr_GetMembersInAlias r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_GETMEMBERSINALIAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *sids = *r.out.sids;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_OpenUser_state {
+       struct samr_OpenUser orig;
+       struct samr_OpenUser tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_OpenUser_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_OpenUser_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_domain_handle /* [in] [ref] */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            uint32_t _rid /* [in]  */,
+                                            struct policy_handle *_user_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_OpenUser_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_OpenUser_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.rid = _rid;
+
+       /* Out parameters */
+       state->orig.out.user_handle = _user_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_OpenUser, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_OpenUser_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_samr,
+                                   NDR_SAMR_OPENUSER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_OpenUser_done, req);
+       return req;
+}
+
+static void rpccli_samr_OpenUser_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_OpenUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenUser_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.user_handle = *state->tmp.out.user_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_OpenUser, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_OpenUser_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_OpenUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_OpenUser_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_samr_OpenUser(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             struct policy_handle *domain_handle /* [in] [ref] */,
+                             uint32_t access_mask /* [in]  */,
+                             uint32_t rid /* [in]  */,
+                             struct policy_handle *user_handle /* [out] [ref] */)
+{
+       struct samr_OpenUser r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.access_mask = access_mask;
+       r.in.rid = rid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_OpenUser, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_OPENUSER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *user_handle = *r.out.user_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_DeleteUser_state {
+       struct samr_DeleteUser orig;
+       struct samr_DeleteUser tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_DeleteUser_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_user_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_DeleteUser_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_DeleteUser_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+
+       /* Out parameters */
+       state->orig.out.user_handle = _user_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteUser, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_DeleteUser_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_samr,
+                                   NDR_SAMR_DELETEUSER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_DeleteUser_done, req);
+       return req;
+}
+
+static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteUser_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.user_handle = *state->tmp.out.user_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_DeleteUser_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result)
+{
+       struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_DeleteUser_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_samr_DeleteUser(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *user_handle /* [in,out] [ref] */)
+{
+       struct samr_DeleteUser r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_DELETEUSER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *user_handle = *r.out.user_handle;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryUserInfo_state {
+       struct samr_QueryUserInfo orig;
+       struct samr_QueryUserInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryUserInfo_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_user_handle /* [in] [ref] */,
+                                                 enum samr_UserInfoLevel _level /* [in]  */,
+                                                 union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryUserInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryUserInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryUserInfo_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_samr,
+                                   NDR_SAMR_QUERYUSERINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryUserInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryUserInfo_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryUserInfo_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_samr_QueryUserInfo(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *user_handle /* [in] [ref] */,
+                                  enum samr_UserInfoLevel level /* [in]  */,
+                                  union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct samr_QueryUserInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYUSERINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_SetUserInfo_state {
+       struct samr_SetUserInfo orig;
+       struct samr_SetUserInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetUserInfo_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_user_handle /* [in] [ref] */,
+                                               enum samr_UserInfoLevel _level /* [in]  */,
+                                               union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_SetUserInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetUserInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETUSERINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetUserInfo_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetUserInfo_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetUserInfo_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_samr_SetUserInfo(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *user_handle /* [in] [ref] */,
+                                enum samr_UserInfoLevel level /* [in]  */,
+                                union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
+{
+       struct samr_SetUserInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_SETUSERINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_ChangePasswordUser_state {
+       struct samr_ChangePasswordUser orig;
+       struct samr_ChangePasswordUser tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_ChangePasswordUser_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_user_handle /* [in] [ref] */,
+                                                      uint8_t _lm_present /* [in]  */,
+                                                      struct samr_Password *_old_lm_crypted /* [in] [unique] */,
+                                                      struct samr_Password *_new_lm_crypted /* [in] [unique] */,
+                                                      uint8_t _nt_present /* [in]  */,
+                                                      struct samr_Password *_old_nt_crypted /* [in] [unique] */,
+                                                      struct samr_Password *_new_nt_crypted /* [in] [unique] */,
+                                                      uint8_t _cross1_present /* [in]  */,
+                                                      struct samr_Password *_nt_cross /* [in] [unique] */,
+                                                      uint8_t _cross2_present /* [in]  */,
+                                                      struct samr_Password *_lm_cross /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_ChangePasswordUser_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_ChangePasswordUser_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+       state->orig.in.lm_present = _lm_present;
+       state->orig.in.old_lm_crypted = _old_lm_crypted;
+       state->orig.in.new_lm_crypted = _new_lm_crypted;
+       state->orig.in.nt_present = _nt_present;
+       state->orig.in.old_nt_crypted = _old_nt_crypted;
+       state->orig.in.new_nt_crypted = _new_nt_crypted;
+       state->orig.in.cross1_present = _cross1_present;
+       state->orig.in.nt_cross = _nt_cross;
+       state->orig.in.cross2_present = _cross2_present;
+       state->orig.in.lm_cross = _lm_cross;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_CHANGEPASSWORDUSER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser_done, req);
+       return req;
+}
+
+static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_ChangePasswordUser_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_ChangePasswordUser_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result)
+{
+       struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_ChangePasswordUser_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_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *user_handle /* [in] [ref] */,
+                                       uint8_t lm_present /* [in]  */,
+                                       struct samr_Password *old_lm_crypted /* [in] [unique] */,
+                                       struct samr_Password *new_lm_crypted /* [in] [unique] */,
+                                       uint8_t nt_present /* [in]  */,
+                                       struct samr_Password *old_nt_crypted /* [in] [unique] */,
+                                       struct samr_Password *new_nt_crypted /* [in] [unique] */,
+                                       uint8_t cross1_present /* [in]  */,
+                                       struct samr_Password *nt_cross /* [in] [unique] */,
+                                       uint8_t cross2_present /* [in]  */,
+                                       struct samr_Password *lm_cross /* [in] [unique] */)
+{
+       struct samr_ChangePasswordUser r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+       r.in.lm_present = lm_present;
+       r.in.old_lm_crypted = old_lm_crypted;
+       r.in.new_lm_crypted = new_lm_crypted;
+       r.in.nt_present = nt_present;
+       r.in.old_nt_crypted = old_nt_crypted;
+       r.in.new_nt_crypted = new_nt_crypted;
+       r.in.cross1_present = cross1_present;
+       r.in.nt_cross = nt_cross;
+       r.in.cross2_present = cross2_present;
+       r.in.lm_cross = lm_cross;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_CHANGEPASSWORDUSER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_GetGroupsForUser_state {
+       struct samr_GetGroupsForUser orig;
+       struct samr_GetGroupsForUser tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetGroupsForUser_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_user_handle /* [in] [ref] */,
+                                                    struct samr_RidWithAttributeArray **_rids /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_GetGroupsForUser_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetGroupsForUser_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+
+       /* Out parameters */
+       state->orig.out.rids = _rids;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetGroupsForUser_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_samr,
+                                   NDR_SAMR_GETGROUPSFORUSER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetGroupsForUser_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetGroupsForUser_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.rids = *state->tmp.out.rids;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetGroupsForUser_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetGroupsForUser_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_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *user_handle /* [in] [ref] */,
+                                     struct samr_RidWithAttributeArray **rids /* [out] [ref] */)
+{
+       struct samr_GetGroupsForUser r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_GETGROUPSFORUSER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *rids = *r.out.rids;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryDisplayInfo_state {
+       struct samr_QueryDisplayInfo orig;
+       struct samr_QueryDisplayInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryDisplayInfo_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                    uint16_t _level /* [in]  */,
+                                                    uint32_t _start_idx /* [in]  */,
+                                                    uint32_t _max_entries /* [in]  */,
+                                                    uint32_t _buf_size /* [in]  */,
+                                                    uint32_t *_total_size /* [out] [ref] */,
+                                                    uint32_t *_returned_size /* [out] [ref] */,
+                                                    union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryDisplayInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryDisplayInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+       state->orig.in.start_idx = _start_idx;
+       state->orig.in.max_entries = _max_entries;
+       state->orig.in.buf_size = _buf_size;
+
+       /* Out parameters */
+       state->orig.out.total_size = _total_size;
+       state->orig.out.returned_size = _returned_size;
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryDisplayInfo_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_samr,
+                                   NDR_SAMR_QUERYDISPLAYINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDisplayInfo_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.total_size = *state->tmp.out.total_size;
+       *state->orig.out.returned_size = *state->tmp.out.returned_size;
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryDisplayInfo_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *domain_handle /* [in] [ref] */,
+                                     uint16_t level /* [in]  */,
+                                     uint32_t start_idx /* [in]  */,
+                                     uint32_t max_entries /* [in]  */,
+                                     uint32_t buf_size /* [in]  */,
+                                     uint32_t *total_size /* [out] [ref] */,
+                                     uint32_t *returned_size /* [out] [ref] */,
+                                     union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
+{
+       struct samr_QueryDisplayInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.level = level;
+       r.in.start_idx = start_idx;
+       r.in.max_entries = max_entries;
+       r.in.buf_size = buf_size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYDISPLAYINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *total_size = *r.out.total_size;
+       *returned_size = *r.out.returned_size;
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_GetDisplayEnumerationIndex_state {
+       struct samr_GetDisplayEnumerationIndex orig;
+       struct samr_GetDisplayEnumerationIndex tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                              uint16_t _level /* [in]  */,
+                                                              struct lsa_String *_name /* [in] [ref] */,
+                                                              uint32_t *_idx /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_GetDisplayEnumerationIndex_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetDisplayEnumerationIndex_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+       state->orig.in.name = _name;
+
+       /* Out parameters */
+       state->orig.out.idx = _idx;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetDisplayEnumerationIndex_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_samr,
+                                   NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetDisplayEnumerationIndex_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.idx = *state->tmp.out.idx;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetDisplayEnumerationIndex_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *domain_handle /* [in] [ref] */,
+                                               uint16_t level /* [in]  */,
+                                               struct lsa_String *name /* [in] [ref] */,
+                                               uint32_t *idx /* [out] [ref] */)
+{
+       struct samr_GetDisplayEnumerationIndex r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.level = level;
+       r.in.name = name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *idx = *r.out.idx;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_TestPrivateFunctionsDomain_state {
+       struct samr_TestPrivateFunctionsDomain orig;
+       struct samr_TestPrivateFunctionsDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_domain_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_TestPrivateFunctionsDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_TestPrivateFunctionsDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsDomain_done, req);
+       return req;
+}
+
+static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_TestPrivateFunctionsDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_TestPrivateFunctionsDomain_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result)
+{
+       struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *domain_handle /* [in] [ref] */)
+{
+       struct samr_TestPrivateFunctionsDomain r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_TestPrivateFunctionsUser_state {
+       struct samr_TestPrivateFunctionsUser orig;
+       struct samr_TestPrivateFunctionsUser tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_TestPrivateFunctionsUser_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_user_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_TestPrivateFunctionsUser_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_TestPrivateFunctionsUser_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsUser_done, req);
+       return req;
+}
+
+static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_TestPrivateFunctionsUser_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_TestPrivateFunctionsUser_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result)
+{
+       struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
+               req, struct rpccli_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct policy_handle *user_handle /* [in] [ref] */)
+{
+       struct samr_TestPrivateFunctionsUser r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_GetUserPwInfo_state {
+       struct samr_GetUserPwInfo orig;
+       struct samr_GetUserPwInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetUserPwInfo_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_user_handle /* [in] [ref] */,
+                                                 struct samr_PwInfo *_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_GetUserPwInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetUserPwInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetUserPwInfo_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_samr,
+                                   NDR_SAMR_GETUSERPWINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetUserPwInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetUserPwInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetUserPwInfo_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result)
+{
+       struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetUserPwInfo_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_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  struct policy_handle *user_handle /* [in] [ref] */,
+                                  struct samr_PwInfo *info /* [out] [ref] */)
+{
+       struct samr_GetUserPwInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_GETUSERPWINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_RemoveMemberFromForeignDomain_state {
+       struct samr_RemoveMemberFromForeignDomain orig;
+       struct samr_RemoveMemberFromForeignDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli,
+                                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                                 struct dom_sid2 *_sid /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_RemoveMemberFromForeignDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_RemoveMemberFromForeignDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.sid = _sid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_RemoveMemberFromForeignDomain_done, req);
+       return req;
+}
+
+static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_RemoveMemberFromForeignDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       NTSTATUS *result)
+{
+       struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
+               req, struct rpccli_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  struct policy_handle *domain_handle /* [in] [ref] */,
+                                                  struct dom_sid2 *sid /* [in] [ref] */)
+{
+       struct samr_RemoveMemberFromForeignDomain r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.sid = sid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryDomainInfo2_state {
+       struct samr_QueryDomainInfo2 orig;
+       struct samr_QueryDomainInfo2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryDomainInfo2_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                    enum samr_DomainInfoClass _level /* [in]  */,
+                                                    union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryDomainInfo2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryDomainInfo2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryDomainInfo2_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_samr,
+                                   NDR_SAMR_QUERYDOMAININFO2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo2_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDomainInfo2_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryDomainInfo2_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *domain_handle /* [in] [ref] */,
+                                     enum samr_DomainInfoClass level /* [in]  */,
+                                     union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct samr_QueryDomainInfo2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYDOMAININFO2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryUserInfo2_state {
+       struct samr_QueryUserInfo2 orig;
+       struct samr_QueryUserInfo2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryUserInfo2_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_user_handle /* [in] [ref] */,
+                                                  enum samr_UserInfoLevel _level /* [in]  */,
+                                                  union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryUserInfo2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryUserInfo2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryUserInfo2_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_samr,
+                                   NDR_SAMR_QUERYUSERINFO2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo2_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryUserInfo2_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryUserInfo2_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result)
+{
+       struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryUserInfo2_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_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *user_handle /* [in] [ref] */,
+                                   enum samr_UserInfoLevel level /* [in]  */,
+                                   union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
+{
+       struct samr_QueryUserInfo2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.user_handle = user_handle;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYUSERINFO2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryDisplayInfo2_state {
+       struct samr_QueryDisplayInfo2 orig;
+       struct samr_QueryDisplayInfo2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryDisplayInfo2_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     uint16_t _level /* [in]  */,
+                                                     uint32_t _start_idx /* [in]  */,
+                                                     uint32_t _max_entries /* [in]  */,
+                                                     uint32_t _buf_size /* [in]  */,
+                                                     uint32_t *_total_size /* [out] [ref] */,
+                                                     uint32_t *_returned_size /* [out] [ref] */,
+                                                     union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryDisplayInfo2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryDisplayInfo2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+       state->orig.in.start_idx = _start_idx;
+       state->orig.in.max_entries = _max_entries;
+       state->orig.in.buf_size = _buf_size;
+
+       /* Out parameters */
+       state->orig.out.total_size = _total_size;
+       state->orig.out.returned_size = _returned_size;
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryDisplayInfo2_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_samr,
+                                   NDR_SAMR_QUERYDISPLAYINFO2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo2_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDisplayInfo2_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.total_size = *state->tmp.out.total_size;
+       *state->orig.out.returned_size = *state->tmp.out.returned_size;
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryDisplayInfo2_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *domain_handle /* [in] [ref] */,
+                                      uint16_t level /* [in]  */,
+                                      uint32_t start_idx /* [in]  */,
+                                      uint32_t max_entries /* [in]  */,
+                                      uint32_t buf_size /* [in]  */,
+                                      uint32_t *total_size /* [out] [ref] */,
+                                      uint32_t *returned_size /* [out] [ref] */,
+                                      union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
+{
+       struct samr_QueryDisplayInfo2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.level = level;
+       r.in.start_idx = start_idx;
+       r.in.max_entries = max_entries;
+       r.in.buf_size = buf_size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYDISPLAYINFO2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *total_size = *r.out.total_size;
+       *returned_size = *r.out.returned_size;
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_GetDisplayEnumerationIndex2_state {
+       struct samr_GetDisplayEnumerationIndex2 orig;
+       struct samr_GetDisplayEnumerationIndex2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex2_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                               uint16_t _level /* [in]  */,
+                                                               struct lsa_String *_name /* [in] [ref] */,
+                                                               uint32_t *_idx /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_GetDisplayEnumerationIndex2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetDisplayEnumerationIndex2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+       state->orig.in.name = _name;
+
+       /* Out parameters */
+       state->orig.out.idx = _idx;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetDisplayEnumerationIndex2_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_samr,
+                                   NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex2_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetDisplayEnumerationIndex2_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.idx = *state->tmp.out.idx;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     NTSTATUS *result)
+{
+       struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                struct policy_handle *domain_handle /* [in] [ref] */,
+                                                uint16_t level /* [in]  */,
+                                                struct lsa_String *name /* [in] [ref] */,
+                                                uint32_t *idx /* [out] [ref] */)
+{
+       struct samr_GetDisplayEnumerationIndex2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.level = level;
+       r.in.name = name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *idx = *r.out.idx;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_CreateUser2_state {
+       struct samr_CreateUser2 orig;
+       struct samr_CreateUser2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_CreateUser2_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_domain_handle /* [in] [ref] */,
+                                               struct lsa_String *_account_name /* [in] [ref] */,
+                                               uint32_t _acct_flags /* [in]  */,
+                                               uint32_t _access_mask /* [in]  */,
+                                               struct policy_handle *_user_handle /* [out] [ref] */,
+                                               uint32_t *_access_granted /* [out] [ref] */,
+                                               uint32_t *_rid /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_CreateUser2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_CreateUser2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.account_name = _account_name;
+       state->orig.in.acct_flags = _acct_flags;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.user_handle = _user_handle;
+       state->orig.out.access_granted = _access_granted;
+       state->orig.out.rid = _rid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_CreateUser2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_CreateUser2_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_samr,
+                                   NDR_SAMR_CREATEUSER2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_CreateUser2_done, req);
+       return req;
+}
+
+static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateUser2_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.user_handle = *state->tmp.out.user_handle;
+       *state->orig.out.access_granted = *state->tmp.out.access_granted;
+       *state->orig.out.rid = *state->tmp.out.rid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_CreateUser2_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result)
+{
+       struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
+               req, struct rpccli_samr_CreateUser2_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_samr_CreateUser2(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *domain_handle /* [in] [ref] */,
+                                struct lsa_String *account_name /* [in] [ref] */,
+                                uint32_t acct_flags /* [in]  */,
+                                uint32_t access_mask /* [in]  */,
+                                struct policy_handle *user_handle /* [out] [ref] */,
+                                uint32_t *access_granted /* [out] [ref] */,
+                                uint32_t *rid /* [out] [ref] */)
+{
+       struct samr_CreateUser2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.account_name = account_name;
+       r.in.acct_flags = acct_flags;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_CREATEUSER2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *user_handle = *r.out.user_handle;
+       *access_granted = *r.out.access_granted;
+       *rid = *r.out.rid;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_QueryDisplayInfo3_state {
+       struct samr_QueryDisplayInfo3 orig;
+       struct samr_QueryDisplayInfo3 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_QueryDisplayInfo3_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     uint16_t _level /* [in]  */,
+                                                     uint32_t _start_idx /* [in]  */,
+                                                     uint32_t _max_entries /* [in]  */,
+                                                     uint32_t _buf_size /* [in]  */,
+                                                     uint32_t *_total_size /* [out] [ref] */,
+                                                     uint32_t *_returned_size /* [out] [ref] */,
+                                                     union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_QueryDisplayInfo3_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_QueryDisplayInfo3_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.level = _level;
+       state->orig.in.start_idx = _start_idx;
+       state->orig.in.max_entries = _max_entries;
+       state->orig.in.buf_size = _buf_size;
+
+       /* Out parameters */
+       state->orig.out.total_size = _total_size;
+       state->orig.out.returned_size = _returned_size;
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_QueryDisplayInfo3_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_samr,
+                                   NDR_SAMR_QUERYDISPLAYINFO3,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo3_done, req);
+       return req;
+}
+
+static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDisplayInfo3_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.total_size = *state->tmp.out.total_size;
+       *state->orig.out.returned_size = *state->tmp.out.returned_size;
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_QueryDisplayInfo3_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result)
+{
+       struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
+               req, struct rpccli_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *domain_handle /* [in] [ref] */,
+                                      uint16_t level /* [in]  */,
                                       uint32_t start_idx /* [in]  */,
                                       uint32_t max_entries /* [in]  */,
                                       uint32_t buf_size /* [in]  */,
@@ -2217,24 +8597,671 @@ NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
                                       uint32_t *returned_size /* [out] [ref] */,
                                       union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
 {
-       struct samr_QueryDisplayInfo3 r;
+       struct samr_QueryDisplayInfo3 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_handle = domain_handle;
+       r.in.level = level;
+       r.in.start_idx = start_idx;
+       r.in.max_entries = max_entries;
+       r.in.buf_size = buf_size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_QUERYDISPLAYINFO3,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *total_size = *r.out.total_size;
+       *returned_size = *r.out.returned_size;
+       *info = *r.out.info;
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_AddMultipleMembersToAlias_state {
+       struct samr_AddMultipleMembersToAlias orig;
+       struct samr_AddMultipleMembersToAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_AddMultipleMembersToAlias_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                             struct lsa_SidArray *_sids /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_AddMultipleMembersToAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_AddMultipleMembersToAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+       state->orig.in.sids = _sids;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_AddMultipleMembersToAlias_done, req);
+       return req;
+}
+
+static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_AddMultipleMembersToAlias_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_AddMultipleMembersToAlias_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result)
+{
+       struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *alias_handle /* [in] [ref] */,
+                                              struct lsa_SidArray *sids /* [in] [ref] */)
+{
+       struct samr_AddMultipleMembersToAlias r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+       r.in.sids = sids;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_RemoveMultipleMembersFromAlias_state {
+       struct samr_RemoveMultipleMembersFromAlias orig;
+       struct samr_RemoveMultipleMembersFromAlias tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_RemoveMultipleMembersFromAlias_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                                  struct lsa_SidArray *_sids /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.alias_handle = _alias_handle;
+       state->orig.in.sids = _sids;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_RemoveMultipleMembersFromAlias_done, req);
+       return req;
+}
+
+static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_RemoveMultipleMembersFromAlias_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        NTSTATUS *result)
+{
+       struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
+               req, struct rpccli_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   struct policy_handle *alias_handle /* [in] [ref] */,
+                                                   struct lsa_SidArray *sids /* [in] [ref] */)
+{
+       struct samr_RemoveMultipleMembersFromAlias r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.alias_handle = alias_handle;
+       r.in.sids = sids;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_OemChangePasswordUser2_state {
+       struct samr_OemChangePasswordUser2 orig;
+       struct samr_OemChangePasswordUser2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_OemChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct lsa_AsciiString *_server /* [in] [unique] */,
+                                                          struct lsa_AsciiString *_account /* [in] [ref] */,
+                                                          struct samr_CryptPassword *_password /* [in] [unique] */,
+                                                          struct samr_Password *_hash /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_OemChangePasswordUser2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_OemChangePasswordUser2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.account = _account;
+       state->orig.in.password = _password;
+       state->orig.in.hash = _hash;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_OEMCHANGEPASSWORDUSER2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_OemChangePasswordUser2_done, req);
+       return req;
+}
+
+static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
+               req, struct rpccli_samr_OemChangePasswordUser2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_OemChangePasswordUser2_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result)
+{
+       struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
+               req, struct rpccli_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           struct lsa_AsciiString *server /* [in] [unique] */,
+                                           struct lsa_AsciiString *account /* [in] [ref] */,
+                                           struct samr_CryptPassword *password /* [in] [unique] */,
+                                           struct samr_Password *hash /* [in] [unique] */)
+{
+       struct samr_OemChangePasswordUser2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server = server;
+       r.in.account = account;
+       r.in.password = password;
+       r.in.hash = hash;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_OEMCHANGEPASSWORDUSER2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_ChangePasswordUser2_state {
+       struct samr_ChangePasswordUser2 orig;
+       struct samr_ChangePasswordUser2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_ChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct lsa_String *_server /* [in] [unique] */,
+                                                       struct lsa_String *_account /* [in] [ref] */,
+                                                       struct samr_CryptPassword *_nt_password /* [in] [unique] */,
+                                                       struct samr_Password *_nt_verifier /* [in] [unique] */,
+                                                       uint8_t _lm_change /* [in]  */,
+                                                       struct samr_CryptPassword *_lm_password /* [in] [unique] */,
+                                                       struct samr_Password *_lm_verifier /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_ChangePasswordUser2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_ChangePasswordUser2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.account = _account;
+       state->orig.in.nt_password = _nt_password;
+       state->orig.in.nt_verifier = _nt_verifier;
+       state->orig.in.lm_change = _lm_change;
+       state->orig.in.lm_password = _lm_password;
+       state->orig.in.lm_verifier = _lm_verifier;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_CHANGEPASSWORDUSER2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser2_done, req);
+       return req;
+}
+
+static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
+               req, struct rpccli_samr_ChangePasswordUser2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_ChangePasswordUser2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
+               req, struct rpccli_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct lsa_String *server /* [in] [unique] */,
+                                        struct lsa_String *account /* [in] [ref] */,
+                                        struct samr_CryptPassword *nt_password /* [in] [unique] */,
+                                        struct samr_Password *nt_verifier /* [in] [unique] */,
+                                        uint8_t lm_change /* [in]  */,
+                                        struct samr_CryptPassword *lm_password /* [in] [unique] */,
+                                        struct samr_Password *lm_verifier /* [in] [unique] */)
+{
+       struct samr_ChangePasswordUser2 r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
-       r.in.level = level;
-       r.in.start_idx = start_idx;
-       r.in.max_entries = max_entries;
-       r.in.buf_size = buf_size;
+       r.in.server = server;
+       r.in.account = account;
+       r.in.nt_password = nt_password;
+       r.in.nt_verifier = nt_verifier;
+       r.in.lm_change = lm_change;
+       r.in.lm_password = lm_password;
+       r.in.lm_verifier = lm_verifier;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r);
+               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_QUERYDISPLAYINFO3,
+                               NDR_SAMR_CHANGEPASSWORDUSER2,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2242,7 +9269,167 @@ NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r);
+               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       return r.out.result;
+}
+
+struct rpccli_samr_GetDomPwInfo_state {
+       struct samr_GetDomPwInfo orig;
+       struct samr_GetDomPwInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetDomPwInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct lsa_String *_domain_name /* [in] [unique] */,
+                                                struct samr_PwInfo *_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_GetDomPwInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetDomPwInfo_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;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetDomPwInfo_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_samr,
+                                   NDR_SAMR_GETDOMPWINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetDomPwInfo_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetDomPwInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetDomPwInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetDomPwInfo_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_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct lsa_String *domain_name /* [in] [unique] */,
+                                 struct samr_PwInfo *info /* [out] [ref] */)
+{
+       struct samr_GetDomPwInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.domain_name = domain_name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_samr,
+                               NDR_SAMR_GETDOMPWINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2250,34 +9437,156 @@ NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *total_size = *r.out.total_size;
-       *returned_size = *r.out.returned_size;
        *info = *r.out.info;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              struct policy_handle *alias_handle /* [in] [ref] */,
-                                              struct lsa_SidArray *sids /* [in] [ref] */)
+struct rpccli_samr_Connect2_state {
+       struct samr_Connect2 orig;
+       struct samr_Connect2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Connect2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Connect2_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */)
 {
-       struct samr_AddMultipleMembersToAlias r;
+       struct tevent_req *req;
+       struct rpccli_samr_Connect2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Connect2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.connect_handle = _connect_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_Connect2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_Connect2_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_samr,
+                                   NDR_SAMR_CONNECT2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Connect2_done, req);
+       return req;
+}
+
+static void rpccli_samr_Connect2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Connect2_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect2_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.connect_handle = *state->tmp.out.connect_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_Connect2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Connect2_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_Connect2_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect2_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_samr_Connect2(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             const char *system_name /* [in] [unique,charset(UTF16)] */,
+                             uint32_t access_mask /* [in]  */,
+                             struct policy_handle *connect_handle /* [out] [ref] */)
+{
+       struct samr_Connect2 r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
-       r.in.sids = sids;
+       r.in.system_name = system_name;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r);
+               NDR_PRINT_IN_DEBUG(samr_Connect2, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
+                               NDR_SAMR_CONNECT2,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2285,7 +9594,7 @@ NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Connect2, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2293,31 +9602,150 @@ NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *connect_handle = *r.out.connect_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
-                                                   TALLOC_CTX *mem_ctx,
-                                                   struct policy_handle *alias_handle /* [in] [ref] */,
-                                                   struct lsa_SidArray *sids /* [in] [ref] */)
+struct rpccli_samr_SetUserInfo2_state {
+       struct samr_SetUserInfo2 orig;
+       struct samr_SetUserInfo2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetUserInfo2_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_user_handle /* [in] [ref] */,
+                                                enum samr_UserInfoLevel _level /* [in]  */,
+                                                union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
 {
-       struct samr_RemoveMultipleMembersFromAlias r;
+       struct tevent_req *req;
+       struct rpccli_samr_SetUserInfo2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetUserInfo2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.user_handle = _user_handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETUSERINFO2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo2_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetUserInfo2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetUserInfo2_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result)
+{
+       struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetUserInfo2_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_samr_SetUserInfo2(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *user_handle /* [in] [ref] */,
+                                 enum samr_UserInfoLevel level /* [in]  */,
+                                 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
+{
+       struct samr_SetUserInfo2 r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.alias_handle = alias_handle;
-       r.in.sids = sids;
+       r.in.user_handle = user_handle;
+       r.in.level = level;
+       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
+                               NDR_SAMR_SETUSERINFO2,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2325,7 +9753,7 @@ NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2338,80 +9766,148 @@ NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           struct lsa_AsciiString *server /* [in] [unique] */,
-                                           struct lsa_AsciiString *account /* [in] [ref] */,
-                                           struct samr_CryptPassword *password /* [in] [unique] */,
-                                           struct samr_Password *hash /* [in] [unique] */)
+struct rpccli_samr_SetBootKeyInformation_state {
+       struct samr_SetBootKeyInformation orig;
+       struct samr_SetBootKeyInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_connect_handle /* [in] [ref] */,
+                                                         uint32_t _unknown1 /* [in]  */,
+                                                         uint32_t _unknown2 /* [in]  */,
+                                                         uint32_t _unknown3 /* [in]  */)
 {
-       struct samr_OemChangePasswordUser2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_SetBootKeyInformation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetBootKeyInformation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server = server;
-       r.in.account = account;
-       r.in.password = password;
-       r.in.hash = hash;
+       state->orig.in.connect_handle = _connect_handle;
+       state->orig.in.unknown1 = _unknown1;
+       state->orig.in.unknown2 = _unknown2;
+       state->orig.in.unknown3 = _unknown3;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_OEMCHANGEPASSWORDUSER2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETBOOTKEYINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetBootKeyInformation_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetBootKeyInformation_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetBootKeyInformation_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetBootKeyInformation_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct lsa_String *server /* [in] [unique] */,
-                                        struct lsa_String *account /* [in] [ref] */,
-                                        struct samr_CryptPassword *nt_password /* [in] [unique] */,
-                                        struct samr_Password *nt_verifier /* [in] [unique] */,
-                                        uint8_t lm_change /* [in]  */,
-                                        struct samr_CryptPassword *lm_password /* [in] [unique] */,
-                                        struct samr_Password *lm_verifier /* [in] [unique] */)
+NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *connect_handle /* [in] [ref] */,
+                                          uint32_t unknown1 /* [in]  */,
+                                          uint32_t unknown2 /* [in]  */,
+                                          uint32_t unknown3 /* [in]  */)
 {
-       struct samr_ChangePasswordUser2 r;
+       struct samr_SetBootKeyInformation r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server = server;
-       r.in.account = account;
-       r.in.nt_password = nt_password;
-       r.in.nt_verifier = nt_verifier;
-       r.in.lm_change = lm_change;
-       r.in.lm_password = lm_password;
-       r.in.lm_verifier = lm_verifier;
+       r.in.connect_handle = connect_handle;
+       r.in.unknown1 = unknown1;
+       r.in.unknown2 = unknown2;
+       r.in.unknown3 = unknown3;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r);
+               NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_CHANGEPASSWORDUSER2,
+                               NDR_SAMR_SETBOOTKEYINFORMATION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2419,7 +9915,7 @@ NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2432,67 +9928,146 @@ NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct lsa_String *domain_name /* [in] [unique] */,
-                                 struct samr_PwInfo *info /* [out] [ref] */)
+struct rpccli_samr_GetBootKeyInformation_state {
+       struct samr_GetBootKeyInformation orig;
+       struct samr_GetBootKeyInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_GetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                         uint32_t *_unknown /* [out] [ref] */)
 {
-       struct samr_GetDomPwInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_GetBootKeyInformation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_GetBootKeyInformation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_name = domain_name;
+       state->orig.in.domain_handle = _domain_handle;
+
+       /* Out parameters */
+       state->orig.out.unknown = _unknown;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r);
+               NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_GETDOMPWINFO,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_GetBootKeyInformation_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_samr,
+                                   NDR_SAMR_GETBOOTKEYINFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_GetBootKeyInformation_done, req);
+       return req;
+}
+
+static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetBootKeyInformation_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.unknown = *state->tmp.out.unknown;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r);
+               NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_GetBootKeyInformation_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result)
+{
+       struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
+               req, struct rpccli_samr_GetBootKeyInformation_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             const char *system_name /* [in] [unique,charset(UTF16)] */,
-                             uint32_t access_mask /* [in]  */,
-                             struct policy_handle *connect_handle /* [out] [ref] */)
+NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *domain_handle /* [in] [ref] */,
+                                          uint32_t *unknown /* [out] [ref] */)
 {
-       struct samr_Connect2 r;
+       struct samr_GetBootKeyInformation r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.system_name = system_name;
-       r.in.access_mask = access_mask;
+       r.in.domain_handle = domain_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_Connect2, &r);
+               NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_CONNECT2,
+                               NDR_SAMR_GETBOOTKEYINFORMATION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2500,7 +10075,7 @@ NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_Connect2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2508,78 +10083,160 @@ NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *connect_handle = *r.out.connect_handle;
+       *unknown = *r.out.unknown;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *user_handle /* [in] [ref] */,
-                                 enum samr_UserInfoLevel level /* [in]  */,
-                                 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
+struct rpccli_samr_Connect3_state {
+       struct samr_Connect3 orig;
+       struct samr_Connect3 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Connect3_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Connect3_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            uint32_t _unknown /* [in]  */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */)
 {
-       struct samr_SetUserInfo2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_Connect3_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Connect3_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.user_handle = user_handle;
-       r.in.level = level;
-       r.in.info = info;
+       state->orig.in.system_name = _system_name;
+       state->orig.in.unknown = _unknown;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.connect_handle = _connect_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r);
+               NDR_PRINT_IN_DEBUG(samr_Connect3, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_SETUSERINFO2,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_Connect3_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_samr,
+                                   NDR_SAMR_CONNECT3,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Connect3_done, req);
+       return req;
+}
+
+static void rpccli_samr_Connect3_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Connect3_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect3_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Connect3, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Connect3_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_Connect3_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect3_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *connect_handle /* [in] [ref] */,
-                                          uint32_t unknown1 /* [in]  */,
-                                          uint32_t unknown2 /* [in]  */,
-                                          uint32_t unknown3 /* [in]  */)
+NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
+                             TALLOC_CTX *mem_ctx,
+                             const char *system_name /* [in] [unique,charset(UTF16)] */,
+                             uint32_t unknown /* [in]  */,
+                             uint32_t access_mask /* [in]  */,
+                             struct policy_handle *connect_handle /* [out] [ref] */)
 {
-       struct samr_SetBootKeyInformation r;
+       struct samr_Connect3 r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.connect_handle = connect_handle;
-       r.in.unknown1 = unknown1;
-       r.in.unknown2 = unknown2;
-       r.in.unknown3 = unknown3;
+       r.in.system_name = system_name;
+       r.in.unknown = unknown;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r);
+               NDR_PRINT_IN_DEBUG(samr_Connect3, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_SETBOOTKEYINFORMATION,
+                               NDR_SAMR_CONNECT3,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2587,7 +10244,7 @@ NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Connect3, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2595,74 +10252,160 @@ NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *connect_handle = *r.out.connect_handle;
 
        /* Return result */
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *domain_handle /* [in] [ref] */,
-                                          uint32_t *unknown /* [out] [ref] */)
+struct rpccli_samr_Connect4_state {
+       struct samr_Connect4 orig;
+       struct samr_Connect4 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Connect4_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Connect4_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            enum samr_ConnectVersion _client_version /* [in]  */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */)
 {
-       struct samr_GetBootKeyInformation r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_Connect4_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Connect4_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.domain_handle = domain_handle;
+       state->orig.in.system_name = _system_name;
+       state->orig.in.client_version = _client_version;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.connect_handle = _connect_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r);
+               NDR_PRINT_IN_DEBUG(samr_Connect4, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_GETBOOTKEYINFORMATION,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_Connect4_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_samr,
+                                   NDR_SAMR_CONNECT4,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Connect4_done, req);
+       return req;
+}
+
+static void rpccli_samr_Connect4_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Connect4_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect4_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Connect4, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Connect4_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_Connect4_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect4_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *unknown = *r.out.unknown;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *system_name /* [in] [unique,charset(UTF16)] */,
-                             uint32_t unknown /* [in]  */,
+                             enum samr_ConnectVersion client_version /* [in]  */,
                              uint32_t access_mask /* [in]  */,
                              struct policy_handle *connect_handle /* [out] [ref] */)
 {
-       struct samr_Connect3 r;
+       struct samr_Connect4 r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.system_name = system_name;
-       r.in.unknown = unknown;
+       r.in.client_version = client_version;
        r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_Connect3, &r);
+               NDR_PRINT_IN_DEBUG(samr_Connect4, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_samr,
-                               NDR_SAMR_CONNECT3,
+                               NDR_SAMR_CONNECT4,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2670,7 +10413,7 @@ NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_Connect3, &r);
+               NDR_PRINT_OUT_DEBUG(samr_Connect4, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2684,48 +10427,142 @@ NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
-                             TALLOC_CTX *mem_ctx,
-                             const char *system_name /* [in] [unique,charset(UTF16)] */,
-                             enum samr_ConnectVersion client_version /* [in]  */,
-                             uint32_t access_mask /* [in]  */,
-                             struct policy_handle *connect_handle /* [out] [ref] */)
+struct rpccli_samr_ChangePasswordUser3_state {
+       struct samr_ChangePasswordUser3 orig;
+       struct samr_ChangePasswordUser3 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_ChangePasswordUser3_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct lsa_String *_server /* [in] [unique] */,
+                                                       struct lsa_String *_account /* [in] [ref] */,
+                                                       struct samr_CryptPassword *_nt_password /* [in] [unique] */,
+                                                       struct samr_Password *_nt_verifier /* [in] [unique] */,
+                                                       uint8_t _lm_change /* [in]  */,
+                                                       struct samr_CryptPassword *_lm_password /* [in] [unique] */,
+                                                       struct samr_Password *_lm_verifier /* [in] [unique] */,
+                                                       struct samr_CryptPassword *_password3 /* [in] [unique] */,
+                                                       struct samr_DomInfo1 **_dominfo /* [out] [ref] */,
+                                                       struct samr_ChangeReject **_reject /* [out] [ref] */)
 {
-       struct samr_Connect4 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_samr_ChangePasswordUser3_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_ChangePasswordUser3_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.system_name = system_name;
-       r.in.client_version = client_version;
-       r.in.access_mask = access_mask;
+       state->orig.in.server = _server;
+       state->orig.in.account = _account;
+       state->orig.in.nt_password = _nt_password;
+       state->orig.in.nt_verifier = _nt_verifier;
+       state->orig.in.lm_change = _lm_change;
+       state->orig.in.lm_password = _lm_password;
+       state->orig.in.lm_verifier = _lm_verifier;
+       state->orig.in.password3 = _password3;
+
+       /* Out parameters */
+       state->orig.out.dominfo = _dominfo;
+       state->orig.out.reject = _reject;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(samr_Connect4, &r);
+               NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_samr,
-                               NDR_SAMR_CONNECT4,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_ChangePasswordUser3_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_samr,
+                                   NDR_SAMR_CHANGEPASSWORDUSER3,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser3_done, req);
+       return req;
+}
+
+static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
+               req, struct rpccli_samr_ChangePasswordUser3_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.dominfo = *state->tmp.out.dominfo;
+       *state->orig.out.reject = *state->tmp.out.reject;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(samr_Connect4, &r);
+               NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_ChangePasswordUser3_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result)
+{
+       struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
+               req, struct rpccli_samr_ChangePasswordUser3_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *connect_handle = *r.out.connect_handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       return r.out.result;
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
@@ -2784,6 +10621,139 @@ NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_Connect5_state {
+       struct samr_Connect5 orig;
+       struct samr_Connect5 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_Connect5_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_Connect5_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            uint32_t _level_in /* [in]  */,
+                                            union samr_ConnectInfo *_info_in /* [in] [ref,switch_is(level_in)] */,
+                                            uint32_t *_level_out /* [out] [ref] */,
+                                            union samr_ConnectInfo *_info_out /* [out] [ref,switch_is(*level_out)] */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_Connect5_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_Connect5_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.level_in = _level_in;
+       state->orig.in.info_in = _info_in;
+
+       /* Out parameters */
+       state->orig.out.level_out = _level_out;
+       state->orig.out.info_out = _info_out;
+       state->orig.out.connect_handle = _connect_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_Connect5, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_Connect5_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_samr,
+                                   NDR_SAMR_CONNECT5,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_Connect5_done, req);
+       return req;
+}
+
+static void rpccli_samr_Connect5_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_Connect5_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect5_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.level_out = *state->tmp.out.level_out;
+       *state->orig.out.info_out = *state->tmp.out.info_out;
+       *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_Connect5, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_Connect5_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_Connect5_state *state = tevent_req_data(
+               req, struct rpccli_samr_Connect5_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_samr_Connect5(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *system_name /* [in] [unique,charset(UTF16)] */,
@@ -2834,6 +10804,129 @@ NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_RidToSid_state {
+       struct samr_RidToSid orig;
+       struct samr_RidToSid tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_RidToSid_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_RidToSid_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_domain_handle /* [in] [ref] */,
+                                            uint32_t _rid /* [in]  */,
+                                            struct dom_sid2 **_sid /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_RidToSid_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_RidToSid_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.domain_handle = _domain_handle;
+       state->orig.in.rid = _rid;
+
+       /* Out parameters */
+       state->orig.out.sid = _sid;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_RidToSid, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_RidToSid_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_samr,
+                                   NDR_SAMR_RIDTOSID,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_RidToSid_done, req);
+       return req;
+}
+
+static void rpccli_samr_RidToSid_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_RidToSid_state *state = tevent_req_data(
+               req, struct rpccli_samr_RidToSid_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.sid = *state->tmp.out.sid;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_RidToSid, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_RidToSid_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result)
+{
+       struct rpccli_samr_RidToSid_state *state = tevent_req_data(
+               req, struct rpccli_samr_RidToSid_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_samr_RidToSid(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *domain_handle /* [in] [ref] */,
@@ -2876,6 +10969,122 @@ NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_SetDsrmPassword_state {
+       struct samr_SetDsrmPassword orig;
+       struct samr_SetDsrmPassword tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_SetDsrmPassword_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct lsa_String *_name /* [in] [unique] */,
+                                                   uint32_t _unknown /* [in]  */,
+                                                   struct samr_Password *_hash /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_SetDsrmPassword_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_SetDsrmPassword_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.name = _name;
+       state->orig.in.unknown = _unknown;
+       state->orig.in.hash = _hash;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_samr,
+                                   NDR_SAMR_SETDSRMPASSWORD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_SetDsrmPassword_done, req);
+       return req;
+}
+
+static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetDsrmPassword_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_SetDsrmPassword_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result)
+{
+       struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
+               req, struct rpccli_samr_SetDsrmPassword_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_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct lsa_String *name /* [in] [unique] */,
@@ -2918,6 +11127,129 @@ NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
+struct rpccli_samr_ValidatePassword_state {
+       struct samr_ValidatePassword orig;
+       struct samr_ValidatePassword tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_samr_ValidatePassword_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    enum samr_ValidatePasswordLevel _level /* [in]  */,
+                                                    union samr_ValidatePasswordReq *_req /* [in] [ref,switch_is(level)] */,
+                                                    union samr_ValidatePasswordRep **_rep /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_samr_ValidatePassword_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_samr_ValidatePassword_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.level = _level;
+       state->orig.in.req = _req;
+
+       /* Out parameters */
+       state->orig.out.rep = _rep;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_samr_ValidatePassword_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_samr,
+                                   NDR_SAMR_VALIDATEPASSWORD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_samr_ValidatePassword_done, req);
+       return req;
+}
+
+static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
+               req, struct rpccli_samr_ValidatePassword_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.rep = *state->tmp.out.rep;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_samr_ValidatePassword_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result)
+{
+       struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
+               req, struct rpccli_samr_ValidatePassword_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_samr_ValidatePassword(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      enum samr_ValidatePasswordLevel level /* [in]  */,
index 7e351ddb93d95a8477f692e83cd00b2a2d8cffea..ed2baa9aba122af40c417286e9a79a81f3c2fa36 100644 (file)
@@ -1,32 +1,93 @@
 #include "../librpc/gen_ndr/ndr_samr.h"
 #ifndef __CLI_SAMR__
 #define __CLI_SAMR__
+struct tevent_req *rpccli_samr_Connect_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct rpc_pipe_client *cli,
+                                           uint16_t *_system_name /* [in] [unique] */,
+                                           uint32_t _access_mask /* [in]  */,
+                                           struct policy_handle *_connect_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_Connect_recv(struct tevent_req *req,
+                                 TALLOC_CTX *mem_ctx,
+                                 NTSTATUS *result);
 NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli,
                             TALLOC_CTX *mem_ctx,
                             uint16_t *system_name /* [in] [unique] */,
                             uint32_t access_mask /* [in]  */,
                             struct policy_handle *connect_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_Close_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli,
+                                         struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_samr_Close_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               NTSTATUS *result);
 NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           struct policy_handle *handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_samr_SetSecurity_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _sec_info /* [in]  */,
+                                               struct sec_desc_buf *_sdbuf /* [in] [ref] */);
+NTSTATUS rpccli_samr_SetSecurity_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 uint32_t sec_info /* [in]  */,
                                 struct sec_desc_buf *sdbuf /* [in] [ref] */);
+struct tevent_req *rpccli_samr_QuerySecurity_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 uint32_t _sec_info /* [in]  */,
+                                                 struct sec_desc_buf **_sdbuf /* [out] [ref] */);
+NTSTATUS rpccli_samr_QuerySecurity_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
                                   uint32_t sec_info /* [in]  */,
                                   struct sec_desc_buf **sdbuf /* [out] [ref] */);
+struct tevent_req *rpccli_samr_Shutdown_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_connect_handle /* [in] [ref] */);
+NTSTATUS rpccli_samr_Shutdown_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *connect_handle /* [in] [ref] */);
+struct tevent_req *rpccli_samr_LookupDomain_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_connect_handle /* [in] [ref] */,
+                                                struct lsa_String *_domain_name /* [in] [ref] */,
+                                                struct dom_sid2 **_sid /* [out] [ref] */);
+NTSTATUS rpccli_samr_LookupDomain_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *connect_handle /* [in] [ref] */,
                                  struct lsa_String *domain_name /* [in] [ref] */,
                                  struct dom_sid2 **sid /* [out] [ref] */);
+struct tevent_req *rpccli_samr_EnumDomains_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_connect_handle /* [in] [ref] */,
+                                               uint32_t *_resume_handle /* [in,out] [ref] */,
+                                               struct samr_SamArray **_sam /* [out] [ref] */,
+                                               uint32_t _buf_size /* [in]  */,
+                                               uint32_t *_num_entries /* [out] [ref] */);
+NTSTATUS rpccli_samr_EnumDomains_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *connect_handle /* [in] [ref] */,
@@ -34,22 +95,61 @@ NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
                                 struct samr_SamArray **sam /* [out] [ref] */,
                                 uint32_t buf_size /* [in]  */,
                                 uint32_t *num_entries /* [out] [ref] */);
+struct tevent_req *rpccli_samr_OpenDomain_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_connect_handle /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct dom_sid2 *_sid /* [in] [ref] */,
+                                              struct policy_handle *_domain_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_OpenDomain_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *connect_handle /* [in] [ref] */,
                                uint32_t access_mask /* [in]  */,
                                struct dom_sid2 *sid /* [in] [ref] */,
                                struct policy_handle *domain_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_QueryDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                   enum samr_DomainInfoClass _level /* [in]  */,
+                                                   union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryDomainInfo_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *domain_handle /* [in] [ref] */,
                                     enum samr_DomainInfoClass level /* [in]  */,
                                     union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_SetDomainInfo_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                 enum samr_DomainInfoClass _level /* [in]  */,
+                                                 union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_SetDomainInfo_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *domain_handle /* [in] [ref] */,
                                   enum samr_DomainInfoClass level /* [in]  */,
                                   union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_CreateDomainGroup_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     struct lsa_String *_name /* [in] [ref] */,
+                                                     uint32_t _access_mask /* [in]  */,
+                                                     struct policy_handle *_group_handle /* [out] [ref] */,
+                                                     uint32_t *_rid /* [out] [ref] */);
+NTSTATUS rpccli_samr_CreateDomainGroup_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *domain_handle /* [in] [ref] */,
@@ -57,6 +157,17 @@ NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
                                       uint32_t access_mask /* [in]  */,
                                       struct policy_handle *group_handle /* [out] [ref] */,
                                       uint32_t *rid /* [out] [ref] */);
+struct tevent_req *rpccli_samr_EnumDomainGroups_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                    uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                    struct samr_SamArray **_sam /* [out] [ref] */,
+                                                    uint32_t _max_size /* [in]  */,
+                                                    uint32_t *_num_entries /* [out] [ref] */);
+NTSTATUS rpccli_samr_EnumDomainGroups_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *domain_handle /* [in] [ref] */,
@@ -64,6 +175,17 @@ NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
                                      struct samr_SamArray **sam /* [out] [ref] */,
                                      uint32_t max_size /* [in]  */,
                                      uint32_t *num_entries /* [out] [ref] */);
+struct tevent_req *rpccli_samr_CreateUser_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_domain_handle /* [in] [ref] */,
+                                              struct lsa_String *_account_name /* [in] [ref] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_user_handle /* [out] [ref] */,
+                                              uint32_t *_rid /* [out] [ref] */);
+NTSTATUS rpccli_samr_CreateUser_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *domain_handle /* [in] [ref] */,
@@ -71,6 +193,18 @@ NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *user_handle /* [out] [ref] */,
                                uint32_t *rid /* [out] [ref] */);
+struct tevent_req *rpccli_samr_EnumDomainUsers_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                   uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                   uint32_t _acct_flags /* [in]  */,
+                                                   struct samr_SamArray **_sam /* [out] [ref] */,
+                                                   uint32_t _max_size /* [in]  */,
+                                                   uint32_t *_num_entries /* [out] [ref] */);
+NTSTATUS rpccli_samr_EnumDomainUsers_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *domain_handle /* [in] [ref] */,
@@ -79,6 +213,17 @@ NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
                                     struct samr_SamArray **sam /* [out] [ref] */,
                                     uint32_t max_size /* [in]  */,
                                     uint32_t *num_entries /* [out] [ref] */);
+struct tevent_req *rpccli_samr_CreateDomAlias_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                  struct lsa_String *_alias_name /* [in] [ref] */,
+                                                  uint32_t _access_mask /* [in]  */,
+                                                  struct policy_handle *_alias_handle /* [out] [ref] */,
+                                                  uint32_t *_rid /* [out] [ref] */);
+NTSTATUS rpccli_samr_CreateDomAlias_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *domain_handle /* [in] [ref] */,
@@ -86,6 +231,17 @@ NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
                                    uint32_t access_mask /* [in]  */,
                                    struct policy_handle *alias_handle /* [out] [ref] */,
                                    uint32_t *rid /* [out] [ref] */);
+struct tevent_req *rpccli_samr_EnumDomainAliases_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     uint32_t *_resume_handle /* [in,out] [ref] */,
+                                                     struct samr_SamArray **_sam /* [out] [ref] */,
+                                                     uint32_t _max_size /* [in]  */,
+                                                     uint32_t *_num_entries /* [out] [ref] */);
+NTSTATUS rpccli_samr_EnumDomainAliases_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *domain_handle /* [in] [ref] */,
@@ -93,11 +249,31 @@ NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
                                       struct samr_SamArray **sam /* [out] [ref] */,
                                       uint32_t max_size /* [in]  */,
                                       uint32_t *num_entries /* [out] [ref] */);
+struct tevent_req *rpccli_samr_GetAliasMembership_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                      struct lsa_SidArray *_sids /* [in] [ref] */,
+                                                      struct samr_Ids *_rids /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetAliasMembership_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *domain_handle /* [in] [ref] */,
                                        struct lsa_SidArray *sids /* [in] [ref] */,
                                        struct samr_Ids *rids /* [out] [ref] */);
+struct tevent_req *rpccli_samr_LookupNames_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_domain_handle /* [in] [ref] */,
+                                               uint32_t _num_names /* [in] [range(0,1000)] */,
+                                               struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
+                                               struct samr_Ids *_rids /* [out] [ref] */,
+                                               struct samr_Ids *_types /* [out] [ref] */);
+NTSTATUS rpccli_samr_LookupNames_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *domain_handle /* [in] [ref] */,
@@ -105,6 +281,17 @@ NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
                                 struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
                                 struct samr_Ids *rids /* [out] [ref] */,
                                 struct samr_Ids *types /* [out] [ref] */);
+struct tevent_req *rpccli_samr_LookupRids_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_domain_handle /* [in] [ref] */,
+                                              uint32_t _num_rids /* [in] [range(0,1000)] */,
+                                              uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
+                                              struct lsa_Strings *_names /* [out] [ref] */,
+                                              struct samr_Ids *_types /* [out] [ref] */);
+NTSTATUS rpccli_samr_LookupRids_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *domain_handle /* [in] [ref] */,
@@ -112,93 +299,273 @@ NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
                                uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
                                struct lsa_Strings *names /* [out] [ref] */,
                                struct samr_Ids *types /* [out] [ref] */);
+struct tevent_req *rpccli_samr_OpenGroup_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_domain_handle /* [in] [ref] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             uint32_t _rid /* [in]  */,
+                                             struct policy_handle *_group_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_OpenGroup_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *domain_handle /* [in] [ref] */,
                               uint32_t access_mask /* [in]  */,
                               uint32_t rid /* [in]  */,
                               struct policy_handle *group_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_QueryGroupInfo_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_group_handle /* [in] [ref] */,
+                                                  enum samr_GroupInfoEnum _level /* [in]  */,
+                                                  union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryGroupInfo_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *group_handle /* [in] [ref] */,
                                    enum samr_GroupInfoEnum level /* [in]  */,
                                    union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_SetGroupInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_group_handle /* [in] [ref] */,
+                                                enum samr_GroupInfoEnum _level /* [in]  */,
+                                                union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_SetGroupInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *group_handle /* [in] [ref] */,
                                  enum samr_GroupInfoEnum level /* [in]  */,
                                  union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_AddGroupMember_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_group_handle /* [in] [ref] */,
+                                                  uint32_t _rid /* [in]  */,
+                                                  uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_samr_AddGroupMember_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *group_handle /* [in] [ref] */,
                                    uint32_t rid /* [in]  */,
                                    uint32_t flags /* [in]  */);
+struct tevent_req *rpccli_samr_DeleteDomainGroup_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_group_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_samr_DeleteDomainGroup_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *group_handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_samr_DeleteGroupMember_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_group_handle /* [in] [ref] */,
+                                                     uint32_t _rid /* [in]  */);
+NTSTATUS rpccli_samr_DeleteGroupMember_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *group_handle /* [in] [ref] */,
                                       uint32_t rid /* [in]  */);
+struct tevent_req *rpccli_samr_QueryGroupMember_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_group_handle /* [in] [ref] */,
+                                                    struct samr_RidTypeArray **_rids /* [out] [ref] */);
+NTSTATUS rpccli_samr_QueryGroupMember_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *group_handle /* [in] [ref] */,
                                      struct samr_RidTypeArray **rids /* [out] [ref] */);
+struct tevent_req *rpccli_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_group_handle /* [in] [ref] */,
+                                                              uint32_t _unknown1 /* [in]  */,
+                                                              uint32_t _unknown2 /* [in]  */);
+NTSTATUS rpccli_samr_SetMemberAttributesOfGroup_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *group_handle /* [in] [ref] */,
                                                uint32_t unknown1 /* [in]  */,
                                                uint32_t unknown2 /* [in]  */);
+struct tevent_req *rpccli_samr_OpenAlias_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_domain_handle /* [in] [ref] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             uint32_t _rid /* [in]  */,
+                                             struct policy_handle *_alias_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_OpenAlias_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   NTSTATUS *result);
 NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *domain_handle /* [in] [ref] */,
                               uint32_t access_mask /* [in]  */,
                               uint32_t rid /* [in]  */,
                               struct policy_handle *alias_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_QueryAliasInfo_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                  enum samr_AliasInfoEnum _level /* [in]  */,
+                                                  union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryAliasInfo_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *alias_handle /* [in] [ref] */,
                                    enum samr_AliasInfoEnum level /* [in]  */,
                                    union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_SetAliasInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                enum samr_AliasInfoEnum _level /* [in]  */,
+                                                union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_SetAliasInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *alias_handle /* [in] [ref] */,
                                  enum samr_AliasInfoEnum level /* [in]  */,
                                  union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_DeleteDomAlias_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_alias_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_samr_DeleteDomAlias_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *alias_handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_samr_AddAliasMember_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                  struct dom_sid2 *_sid /* [in] [ref] */);
+NTSTATUS rpccli_samr_AddAliasMember_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *alias_handle /* [in] [ref] */,
                                    struct dom_sid2 *sid /* [in] [ref] */);
+struct tevent_req *rpccli_samr_DeleteAliasMember_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                     struct dom_sid2 *_sid /* [in] [ref] */);
+NTSTATUS rpccli_samr_DeleteAliasMember_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *alias_handle /* [in] [ref] */,
                                       struct dom_sid2 *sid /* [in] [ref] */);
+struct tevent_req *rpccli_samr_GetMembersInAlias_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                     struct lsa_SidArray *_sids /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetMembersInAlias_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *alias_handle /* [in] [ref] */,
                                       struct lsa_SidArray *sids /* [out] [ref] */);
+struct tevent_req *rpccli_samr_OpenUser_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_domain_handle /* [in] [ref] */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            uint32_t _rid /* [in]  */,
+                                            struct policy_handle *_user_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_OpenUser_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *domain_handle /* [in] [ref] */,
                              uint32_t access_mask /* [in]  */,
                              uint32_t rid /* [in]  */,
                              struct policy_handle *user_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_DeleteUser_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_user_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_samr_DeleteUser_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *user_handle /* [in,out] [ref] */);
+struct tevent_req *rpccli_samr_QueryUserInfo_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_user_handle /* [in] [ref] */,
+                                                 enum samr_UserInfoLevel _level /* [in]  */,
+                                                 union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryUserInfo_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *user_handle /* [in] [ref] */,
                                   enum samr_UserInfoLevel level /* [in]  */,
                                   union samr_UserInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_SetUserInfo_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_user_handle /* [in] [ref] */,
+                                               enum samr_UserInfoLevel _level /* [in]  */,
+                                               union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_SetUserInfo_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *user_handle /* [in] [ref] */,
                                 enum samr_UserInfoLevel level /* [in]  */,
                                 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_ChangePasswordUser_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_user_handle /* [in] [ref] */,
+                                                      uint8_t _lm_present /* [in]  */,
+                                                      struct samr_Password *_old_lm_crypted /* [in] [unique] */,
+                                                      struct samr_Password *_new_lm_crypted /* [in] [unique] */,
+                                                      uint8_t _nt_present /* [in]  */,
+                                                      struct samr_Password *_old_nt_crypted /* [in] [unique] */,
+                                                      struct samr_Password *_new_nt_crypted /* [in] [unique] */,
+                                                      uint8_t _cross1_present /* [in]  */,
+                                                      struct samr_Password *_nt_cross /* [in] [unique] */,
+                                                      uint8_t _cross2_present /* [in]  */,
+                                                      struct samr_Password *_lm_cross /* [in] [unique] */);
+NTSTATUS rpccli_samr_ChangePasswordUser_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            NTSTATUS *result);
 NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *user_handle /* [in] [ref] */,
@@ -212,10 +579,32 @@ NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
                                        struct samr_Password *nt_cross /* [in] [unique] */,
                                        uint8_t cross2_present /* [in]  */,
                                        struct samr_Password *lm_cross /* [in] [unique] */);
+struct tevent_req *rpccli_samr_GetGroupsForUser_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_user_handle /* [in] [ref] */,
+                                                    struct samr_RidWithAttributeArray **_rids /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetGroupsForUser_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *user_handle /* [in] [ref] */,
                                      struct samr_RidWithAttributeArray **rids /* [out] [ref] */);
+struct tevent_req *rpccli_samr_QueryDisplayInfo_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                    uint16_t _level /* [in]  */,
+                                                    uint32_t _start_idx /* [in]  */,
+                                                    uint32_t _max_entries /* [in]  */,
+                                                    uint32_t _buf_size /* [in]  */,
+                                                    uint32_t *_total_size /* [out] [ref] */,
+                                                    uint32_t *_returned_size /* [out] [ref] */,
+                                                    union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryDisplayInfo_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *domain_handle /* [in] [ref] */,
@@ -226,36 +615,108 @@ NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
                                      uint32_t *total_size /* [out] [ref] */,
                                      uint32_t *returned_size /* [out] [ref] */,
                                      union samr_DispInfo *info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                              uint16_t _level /* [in]  */,
+                                                              struct lsa_String *_name /* [in] [ref] */,
+                                                              uint32_t *_idx /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetDisplayEnumerationIndex_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *domain_handle /* [in] [ref] */,
                                                uint16_t level /* [in]  */,
                                                struct lsa_String *name /* [in] [ref] */,
                                                uint32_t *idx /* [out] [ref] */);
+struct tevent_req *rpccli_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_domain_handle /* [in] [ref] */);
+NTSTATUS rpccli_samr_TestPrivateFunctionsDomain_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    NTSTATUS *result);
 NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *domain_handle /* [in] [ref] */);
+struct tevent_req *rpccli_samr_TestPrivateFunctionsUser_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_user_handle /* [in] [ref] */);
+NTSTATUS rpccli_samr_TestPrivateFunctionsUser_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *user_handle /* [in] [ref] */);
+struct tevent_req *rpccli_samr_GetUserPwInfo_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_user_handle /* [in] [ref] */,
+                                                 struct samr_PwInfo *_info /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetUserPwInfo_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       NTSTATUS *result);
 NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *user_handle /* [in] [ref] */,
                                   struct samr_PwInfo *info /* [out] [ref] */);
+struct tevent_req *rpccli_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli,
+                                                                 struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                                 struct dom_sid2 *_sid /* [in] [ref] */);
+NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       NTSTATUS *result);
 NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   struct policy_handle *domain_handle /* [in] [ref] */,
                                                   struct dom_sid2 *sid /* [in] [ref] */);
+struct tevent_req *rpccli_samr_QueryDomainInfo2_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                    enum samr_DomainInfoClass _level /* [in]  */,
+                                                    union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryDomainInfo2_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *domain_handle /* [in] [ref] */,
                                      enum samr_DomainInfoClass level /* [in]  */,
                                      union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_QueryUserInfo2_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_user_handle /* [in] [ref] */,
+                                                  enum samr_UserInfoLevel _level /* [in]  */,
+                                                  union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryUserInfo2_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *user_handle /* [in] [ref] */,
                                    enum samr_UserInfoLevel level /* [in]  */,
                                    union samr_UserInfo **info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_QueryDisplayInfo2_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     uint16_t _level /* [in]  */,
+                                                     uint32_t _start_idx /* [in]  */,
+                                                     uint32_t _max_entries /* [in]  */,
+                                                     uint32_t _buf_size /* [in]  */,
+                                                     uint32_t *_total_size /* [out] [ref] */,
+                                                     uint32_t *_returned_size /* [out] [ref] */,
+                                                     union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryDisplayInfo2_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *domain_handle /* [in] [ref] */,
@@ -266,12 +727,35 @@ NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
                                       uint32_t *total_size /* [out] [ref] */,
                                       uint32_t *returned_size /* [out] [ref] */,
                                       union samr_DispInfo *info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex2_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                               uint16_t _level /* [in]  */,
+                                                               struct lsa_String *_name /* [in] [ref] */,
+                                                               uint32_t *_idx /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     NTSTATUS *result);
 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 struct policy_handle *domain_handle /* [in] [ref] */,
                                                 uint16_t level /* [in]  */,
                                                 struct lsa_String *name /* [in] [ref] */,
                                                 uint32_t *idx /* [out] [ref] */);
+struct tevent_req *rpccli_samr_CreateUser2_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_domain_handle /* [in] [ref] */,
+                                               struct lsa_String *_account_name /* [in] [ref] */,
+                                               uint32_t _acct_flags /* [in]  */,
+                                               uint32_t _access_mask /* [in]  */,
+                                               struct policy_handle *_user_handle /* [out] [ref] */,
+                                               uint32_t *_access_granted /* [out] [ref] */,
+                                               uint32_t *_rid /* [out] [ref] */);
+NTSTATUS rpccli_samr_CreateUser2_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     NTSTATUS *result);
 NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *domain_handle /* [in] [ref] */,
@@ -281,6 +765,20 @@ NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
                                 struct policy_handle *user_handle /* [out] [ref] */,
                                 uint32_t *access_granted /* [out] [ref] */,
                                 uint32_t *rid /* [out] [ref] */);
+struct tevent_req *rpccli_samr_QueryDisplayInfo3_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                     uint16_t _level /* [in]  */,
+                                                     uint32_t _start_idx /* [in]  */,
+                                                     uint32_t _max_entries /* [in]  */,
+                                                     uint32_t _buf_size /* [in]  */,
+                                                     uint32_t *_total_size /* [out] [ref] */,
+                                                     uint32_t *_returned_size /* [out] [ref] */,
+                                                     union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_QueryDisplayInfo3_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           NTSTATUS *result);
 NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *domain_handle /* [in] [ref] */,
@@ -291,20 +789,59 @@ NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
                                       uint32_t *total_size /* [out] [ref] */,
                                       uint32_t *returned_size /* [out] [ref] */,
                                       union samr_DispInfo *info /* [out] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_AddMultipleMembersToAlias_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                             struct lsa_SidArray *_sids /* [in] [ref] */);
+NTSTATUS rpccli_samr_AddMultipleMembersToAlias_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   NTSTATUS *result);
 NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *alias_handle /* [in] [ref] */,
                                               struct lsa_SidArray *sids /* [in] [ref] */);
+struct tevent_req *rpccli_samr_RemoveMultipleMembersFromAlias_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  struct policy_handle *_alias_handle /* [in] [ref] */,
+                                                                  struct lsa_SidArray *_sids /* [in] [ref] */);
+NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        NTSTATUS *result);
 NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    struct policy_handle *alias_handle /* [in] [ref] */,
                                                    struct lsa_SidArray *sids /* [in] [ref] */);
+struct tevent_req *rpccli_samr_OemChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct lsa_AsciiString *_server /* [in] [unique] */,
+                                                          struct lsa_AsciiString *_account /* [in] [ref] */,
+                                                          struct samr_CryptPassword *_password /* [in] [unique] */,
+                                                          struct samr_Password *_hash /* [in] [unique] */);
+NTSTATUS rpccli_samr_OemChangePasswordUser2_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                NTSTATUS *result);
 NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct lsa_AsciiString *server /* [in] [unique] */,
                                            struct lsa_AsciiString *account /* [in] [ref] */,
                                            struct samr_CryptPassword *password /* [in] [unique] */,
                                            struct samr_Password *hash /* [in] [unique] */);
+struct tevent_req *rpccli_samr_ChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct lsa_String *_server /* [in] [unique] */,
+                                                       struct lsa_String *_account /* [in] [ref] */,
+                                                       struct samr_CryptPassword *_nt_password /* [in] [unique] */,
+                                                       struct samr_Password *_nt_verifier /* [in] [unique] */,
+                                                       uint8_t _lm_change /* [in]  */,
+                                                       struct samr_CryptPassword *_lm_password /* [in] [unique] */,
+                                                       struct samr_Password *_lm_verifier /* [in] [unique] */);
+NTSTATUS rpccli_samr_ChangePasswordUser2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct lsa_String *server /* [in] [unique] */,
@@ -314,42 +851,122 @@ NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
                                         uint8_t lm_change /* [in]  */,
                                         struct samr_CryptPassword *lm_password /* [in] [unique] */,
                                         struct samr_Password *lm_verifier /* [in] [unique] */);
+struct tevent_req *rpccli_samr_GetDomPwInfo_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct lsa_String *_domain_name /* [in] [unique] */,
+                                                struct samr_PwInfo *_info /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetDomPwInfo_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct lsa_String *domain_name /* [in] [unique] */,
                                  struct samr_PwInfo *info /* [out] [ref] */);
+struct tevent_req *rpccli_samr_Connect2_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_Connect2_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *system_name /* [in] [unique,charset(UTF16)] */,
                              uint32_t access_mask /* [in]  */,
                              struct policy_handle *connect_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_SetUserInfo2_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_user_handle /* [in] [ref] */,
+                                                enum samr_UserInfoLevel _level /* [in]  */,
+                                                union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_SetUserInfo2_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      NTSTATUS *result);
 NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *user_handle /* [in] [ref] */,
                                  enum samr_UserInfoLevel level /* [in]  */,
                                  union samr_UserInfo *info /* [in] [ref,switch_is(level)] */);
+struct tevent_req *rpccli_samr_SetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_connect_handle /* [in] [ref] */,
+                                                         uint32_t _unknown1 /* [in]  */,
+                                                         uint32_t _unknown2 /* [in]  */,
+                                                         uint32_t _unknown3 /* [in]  */);
+NTSTATUS rpccli_samr_SetBootKeyInformation_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *connect_handle /* [in] [ref] */,
                                           uint32_t unknown1 /* [in]  */,
                                           uint32_t unknown2 /* [in]  */,
                                           uint32_t unknown3 /* [in]  */);
+struct tevent_req *rpccli_samr_GetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_domain_handle /* [in] [ref] */,
+                                                         uint32_t *_unknown /* [out] [ref] */);
+NTSTATUS rpccli_samr_GetBootKeyInformation_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               NTSTATUS *result);
 NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *domain_handle /* [in] [ref] */,
                                           uint32_t *unknown /* [out] [ref] */);
+struct tevent_req *rpccli_samr_Connect3_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            uint32_t _unknown /* [in]  */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_Connect3_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *system_name /* [in] [unique,charset(UTF16)] */,
                              uint32_t unknown /* [in]  */,
                              uint32_t access_mask /* [in]  */,
                              struct policy_handle *connect_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_Connect4_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            enum samr_ConnectVersion _client_version /* [in]  */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_Connect4_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *system_name /* [in] [unique,charset(UTF16)] */,
                              enum samr_ConnectVersion client_version /* [in]  */,
                              uint32_t access_mask /* [in]  */,
                              struct policy_handle *connect_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_ChangePasswordUser3_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct lsa_String *_server /* [in] [unique] */,
+                                                       struct lsa_String *_account /* [in] [ref] */,
+                                                       struct samr_CryptPassword *_nt_password /* [in] [unique] */,
+                                                       struct samr_Password *_nt_verifier /* [in] [unique] */,
+                                                       uint8_t _lm_change /* [in]  */,
+                                                       struct samr_CryptPassword *_lm_password /* [in] [unique] */,
+                                                       struct samr_Password *_lm_verifier /* [in] [unique] */,
+                                                       struct samr_CryptPassword *_password3 /* [in] [unique] */,
+                                                       struct samr_DomInfo1 **_dominfo /* [out] [ref] */,
+                                                       struct samr_ChangeReject **_reject /* [out] [ref] */);
+NTSTATUS rpccli_samr_ChangePasswordUser3_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             NTSTATUS *result);
 NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct lsa_String *server /* [in] [unique] */,
@@ -362,6 +979,19 @@ NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
                                         struct samr_CryptPassword *password3 /* [in] [unique] */,
                                         struct samr_DomInfo1 **dominfo /* [out] [ref] */,
                                         struct samr_ChangeReject **reject /* [out] [ref] */);
+struct tevent_req *rpccli_samr_Connect5_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            const char *_system_name /* [in] [unique,charset(UTF16)] */,
+                                            uint32_t _access_mask /* [in]  */,
+                                            uint32_t _level_in /* [in]  */,
+                                            union samr_ConnectInfo *_info_in /* [in] [ref,switch_is(level_in)] */,
+                                            uint32_t *_level_out /* [out] [ref] */,
+                                            union samr_ConnectInfo *_info_out /* [out] [ref,switch_is(*level_out)] */,
+                                            struct policy_handle *_connect_handle /* [out] [ref] */);
+NTSTATUS rpccli_samr_Connect5_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              const char *system_name /* [in] [unique,charset(UTF16)] */,
@@ -371,16 +1001,43 @@ NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
                              uint32_t *level_out /* [out] [ref] */,
                              union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */,
                              struct policy_handle *connect_handle /* [out] [ref] */);
+struct tevent_req *rpccli_samr_RidToSid_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct rpc_pipe_client *cli,
+                                            struct policy_handle *_domain_handle /* [in] [ref] */,
+                                            uint32_t _rid /* [in]  */,
+                                            struct dom_sid2 **_sid /* [out] [ref] */);
+NTSTATUS rpccli_samr_RidToSid_recv(struct tevent_req *req,
+                                  TALLOC_CTX *mem_ctx,
+                                  NTSTATUS *result);
 NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli,
                              TALLOC_CTX *mem_ctx,
                              struct policy_handle *domain_handle /* [in] [ref] */,
                              uint32_t rid /* [in]  */,
                              struct dom_sid2 **sid /* [out] [ref] */);
+struct tevent_req *rpccli_samr_SetDsrmPassword_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct lsa_String *_name /* [in] [unique] */,
+                                                   uint32_t _unknown /* [in]  */,
+                                                   struct samr_Password *_hash /* [in] [unique] */);
+NTSTATUS rpccli_samr_SetDsrmPassword_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         NTSTATUS *result);
 NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct lsa_String *name /* [in] [unique] */,
                                     uint32_t unknown /* [in]  */,
                                     struct samr_Password *hash /* [in] [unique] */);
+struct tevent_req *rpccli_samr_ValidatePassword_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    enum samr_ValidatePasswordLevel _level /* [in]  */,
+                                                    union samr_ValidatePasswordReq *_req /* [in] [ref,switch_is(level)] */,
+                                                    union samr_ValidatePasswordRep **_rep /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_samr_ValidatePassword_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          NTSTATUS *result);
 NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      enum samr_ValidatePasswordLevel level /* [in]  */,
index 38031b615de118b0435d11cb2d30551e986578ba..21a7236c31229d5df366e8b52adbced67d2be00c 100644 (file)
@@ -6,6 +6,141 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_spoolss.h"
 
+struct rpccli_spoolss_EnumPrinters_state {
+       struct spoolss_EnumPrinters orig;
+       struct spoolss_EnumPrinters tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrinters_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrinters_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   uint32_t _flags /* [in]  */,
+                                                   const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   DATA_BLOB *_buffer /* [in] [unique] */,
+                                                   uint32_t _offered /* [in]  */,
+                                                   uint32_t *_count /* [out] [ref] */,
+                                                   union spoolss_PrinterInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                   uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrinters_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrinters_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.flags = _flags;
+       state->orig.in.server = _server;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrinters_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTERS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinters_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrinters_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrinters_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinters_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinters_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrinters_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinters_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_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     uint32_t flags /* [in]  */,
@@ -63,6 +198,133 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_OpenPrinter_state {
+       struct spoolss_OpenPrinter orig;
+       struct spoolss_OpenPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_OpenPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_OpenPrinter_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_printername /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_datatype /* [in] [unique,charset(UTF16)] */,
+                                                  struct spoolss_DevmodeContainer _devmode_ctr /* [in]  */,
+                                                  uint32_t _access_mask /* [in]  */,
+                                                  struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_OpenPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_OpenPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.printername = _printername;
+       state->orig.in.datatype = _datatype;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_OpenPrinter_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_spoolss,
+                                   NDR_SPOOLSS_OPENPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_OpenPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_OpenPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_OpenPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_OpenPrinter_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_OpenPrinter_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_spoolss_OpenPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_OpenPrinter_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_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *printername /* [in] [unique,charset(UTF16)] */,
@@ -114,6 +376,124 @@ NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_SetJob_state {
+       struct spoolss_SetJob orig;
+       struct spoolss_SetJob tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_SetJob_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_SetJob_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _job_id /* [in]  */,
+                                             struct spoolss_JobInfoContainer *_ctr /* [in] [unique] */,
+                                             enum spoolss_JobControl _command /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_SetJob_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_SetJob_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.job_id = _job_id;
+       state->orig.in.ctr = _ctr;
+       state->orig.in.command = _command;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetJob, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SETJOB,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_SetJob_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_SetJob_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_SetJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetJob_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_SetJob_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_spoolss_SetJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetJob_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_spoolss_SetJob(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -163,6 +543,140 @@ NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetJob_state {
+       struct spoolss_GetJob orig;
+       struct spoolss_GetJob tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetJob_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetJob_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _job_id /* [in]  */,
+                                             uint32_t _level /* [in]  */,
+                                             DATA_BLOB *_buffer /* [in] [unique] */,
+                                             uint32_t _offered /* [in]  */,
+                                             union spoolss_JobInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                             uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetJob_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetJob_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.job_id = _job_id;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetJob, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetJob_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_spoolss,
+                                   NDR_SPOOLSS_GETJOB,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetJob_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetJob_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetJob_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetJob_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_spoolss_GetJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetJob_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_spoolss_GetJob(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -220,6 +734,143 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_EnumJobs_state {
+       struct spoolss_EnumJobs orig;
+       struct spoolss_EnumJobs tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumJobs_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumJobs_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _firstjob /* [in]  */,
+                                               uint32_t _numjobs /* [in]  */,
+                                               uint32_t _level /* [in]  */,
+                                               DATA_BLOB *_buffer /* [in] [unique] */,
+                                               uint32_t _offered /* [in]  */,
+                                               uint32_t *_count /* [out] [ref] */,
+                                               union spoolss_JobInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                               uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumJobs_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumJobs_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.firstjob = _firstjob;
+       state->orig.in.numjobs = _numjobs;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumJobs_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_spoolss,
+                                   NDR_SPOOLSS_ENUMJOBS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumJobs_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumJobs_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumJobs_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumJobs_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumJobs_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_spoolss_EnumJobs_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumJobs_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_spoolss_EnumJobs(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -279,47 +930,174 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server /* [in] [unique,charset(UTF16)] */,
-                                  struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
-                                  struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
-                                  struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
-                                  struct policy_handle *handle /* [out] [ref] */,
-                                  WERROR *werror)
+struct rpccli_spoolss_AddPrinter_state {
+       struct spoolss_AddPrinter orig;
+       struct spoolss_AddPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrinter_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
+                                                 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
+                                                 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
+                                                 struct policy_handle *_handle /* [out] [ref] */)
 {
-       struct spoolss_AddPrinter r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.server = server;
-       r.in.info_ctr = info_ctr;
-       r.in.devmode_ctr = devmode_ctr;
-       r.in.secdesc_ctr = secdesc_ctr;
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrinter_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrinter_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDPRINTER,
-                               &r);
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+       state->orig.in.secdesc_ctr = _secdesc_ctr;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_AddPrinter_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinter_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinter_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_spoolss_AddPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinter_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_spoolss_AddPrinter(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server /* [in] [unique,charset(UTF16)] */,
+                                  struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
+                                  struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
+                                  struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
+                                  struct policy_handle *handle /* [out] [ref] */,
+                                  WERROR *werror)
+{
+       struct spoolss_AddPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server = server;
+       r.in.info_ctr = info_ctr;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.secdesc_ctr = secdesc_ctr;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
        *handle = *r.out.handle;
 
        /* Return result */
@@ -330,6 +1108,118 @@ NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_DeletePrinter_state {
+       struct spoolss_DeletePrinter orig;
+       struct spoolss_DeletePrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinter_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinter_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinter_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_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -373,6 +1263,126 @@ NTSTATUS rpccli_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_SetPrinter_state {
+       struct spoolss_SetPrinter orig;
+       struct spoolss_SetPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_SetPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_SetPrinter_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
+                                                 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
+                                                 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
+                                                 enum spoolss_PrinterControl _command /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_SetPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_SetPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+       state->orig.in.secdesc_ctr = _secdesc_ctr;
+       state->orig.in.command = _command;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SETPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_SetPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_SetPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_SetPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetPrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinter_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_spoolss_SetPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetPrinter_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_spoolss_SetPrinter(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -424,6 +1434,138 @@ NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetPrinter_state {
+       struct spoolss_GetPrinter orig;
+       struct spoolss_GetPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrinter_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 uint32_t _level /* [in]  */,
+                                                 DATA_BLOB *_buffer /* [in] [unique] */,
+                                                 uint32_t _offered /* [in]  */,
+                                                 union spoolss_PrinterInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                 uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrinter_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinter_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinter_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_spoolss_GetPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinter_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_spoolss_GetPrinter(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -479,6 +1621,120 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_AddPrinterDriver_state {
+       struct spoolss_AddPrinterDriver orig;
+       struct spoolss_AddPrinterDriver tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrinterDriver_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrinterDriver_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                       struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrinterDriver_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrinterDriver_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.info_ctr = _info_ctr;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTERDRIVER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterDriver_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrinterDriver_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrinterDriver_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterDriver_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterDriver_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_AddPrinterDriver_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterDriver_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_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *servername /* [in] [unique,charset(UTF16)] */,
@@ -524,10 +1780,145 @@ NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          const char *server /* [in] [unique,charset(UTF16)] */,
-                                          const char *environment /* [in] [unique,charset(UTF16)] */,
+struct rpccli_spoolss_EnumPrinterDrivers_state {
+       struct spoolss_EnumPrinterDrivers orig;
+       struct spoolss_EnumPrinterDrivers tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrinterDrivers_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrinterDrivers_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                         const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                         uint32_t _level /* [in]  */,
+                                                         DATA_BLOB *_buffer /* [in] [unique] */,
+                                                         uint32_t _offered /* [in]  */,
+                                                         uint32_t *_count /* [out] [ref] */,
+                                                         union spoolss_DriverInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                         uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrinterDrivers_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrinterDrivers_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.environment = _environment;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrinterDrivers_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTERDRIVERS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterDrivers_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrinterDrivers_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterDrivers_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinterDrivers_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrinterDrivers_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterDrivers_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_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          const char *server /* [in] [unique,charset(UTF16)] */,
+                                          const char *environment /* [in] [unique,charset(UTF16)] */,
                                           uint32_t level /* [in]  */,
                                           DATA_BLOB *buffer /* [in] [unique] */,
                                           uint32_t offered /* [in]  */,
@@ -581,6 +1972,140 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetPrinterDriver_state {
+       struct spoolss_GetPrinterDriver orig;
+       struct spoolss_GetPrinterDriver tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrinterDriver_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrinterDriver_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_architecture /* [in] [unique,charset(UTF16)] */,
+                                                       uint32_t _level /* [in]  */,
+                                                       DATA_BLOB *_buffer /* [in] [unique] */,
+                                                       uint32_t _offered /* [in]  */,
+                                                       union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                       uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrinterDriver_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrinterDriver_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.architecture = _architecture;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrinterDriver_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTERDRIVER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriver_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrinterDriver_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrinterDriver_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDriver_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriver_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_GetPrinterDriver_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDriver_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_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -638,6 +2163,140 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetPrinterDriverDirectory_state {
+       struct spoolss_GetPrinterDriverDirectory orig;
+       struct spoolss_GetPrinterDriverDirectory tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrinterDriverDirectory_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrinterDriverDirectory_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                                uint32_t _level /* [in]  */,
+                                                                DATA_BLOB *_buffer /* [in] [unique] */,
+                                                                uint32_t _offered /* [in]  */,
+                                                                union spoolss_DriverDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                                uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrinterDriverDirectory_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrinterDriverDirectory_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.environment = _environment;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrinterDriverDirectory_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriverDirectory_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrinterDriverDirectory_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDriverDirectory_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_spoolss_GetPrinterDriverDirectory_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDriverDirectory_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_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server /* [in] [unique,charset(UTF16)] */,
@@ -695,6 +2354,122 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_DeletePrinterDriver_state {
+       struct spoolss_DeletePrinterDriver orig;
+       struct spoolss_DeletePrinterDriver tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterDriver_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterDriver_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_architecture /* [in] [charset(UTF16)] */,
+                                                          const char *_driver /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterDriver_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterDriver_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.architecture = _architecture;
+       state->orig.in.driver = _driver;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERDRIVER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterDriver_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrinterDriver_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterDriver_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterDriver_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinterDriver_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterDriver_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_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server /* [in] [unique,charset(UTF16)] */,
@@ -742,6 +2517,124 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_AddPrintProcessor_state {
+       struct spoolss_AddPrintProcessor orig;
+       struct spoolss_AddPrintProcessor tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrintProcessor_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrintProcessor_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_architecture /* [in] [charset(UTF16)] */,
+                                                        const char *_path_name /* [in] [charset(UTF16)] */,
+                                                        const char *_print_processor_name /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrintProcessor_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrintProcessor_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.architecture = _architecture;
+       state->orig.in.path_name = _path_name;
+       state->orig.in.print_processor_name = _print_processor_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTPROCESSOR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrintProcessor_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrintProcessor_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrintProcessor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrintProcessor_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrintProcessor_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_spoolss_AddPrintProcessor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrintProcessor_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_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server /* [in] [unique,charset(UTF16)] */,
@@ -791,39 +2684,174 @@ NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           const char *servername /* [in] [unique,charset(UTF16)] */,
-                                           const char *environment /* [in] [unique,charset(UTF16)] */,
-                                           uint32_t level /* [in]  */,
-                                           DATA_BLOB *buffer /* [in] [unique] */,
-                                           uint32_t offered /* [in]  */,
-                                           uint32_t *count /* [out] [ref] */,
-                                           union spoolss_PrintProcessorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
-                                           uint32_t *needed /* [out] [ref] */,
-                                           WERROR *werror)
+struct rpccli_spoolss_EnumPrintProcessors_state {
+       struct spoolss_EnumPrintProcessors orig;
+       struct spoolss_EnumPrintProcessors tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrintProcessors_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrintProcessors_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _level /* [in]  */,
+                                                          DATA_BLOB *_buffer /* [in] [unique] */,
+                                                          uint32_t _offered /* [in]  */,
+                                                          uint32_t *_count /* [out] [ref] */,
+                                                          union spoolss_PrintProcessorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                          uint32_t *_needed /* [out] [ref] */)
 {
-       struct spoolss_EnumPrintProcessors r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrintProcessors_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrintProcessors_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.servername = servername;
-       r.in.environment = environment;
-       r.in.level = level;
-       r.in.buffer = buffer;
-       r.in.offered = offered;
+       state->orig.in.servername = _servername;
+       state->orig.in.environment = _environment;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ENUMPRINTPROCESSORS,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrintProcessors_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
+       }
 
-       if (!NT_STATUS_IS_OK(status)) {
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTPROCESSORS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrintProcessors_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrintProcessors_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrintProcessors_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrintProcessors_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrintProcessors_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrintProcessors_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_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           const char *servername /* [in] [unique,charset(UTF16)] */,
+                                           const char *environment /* [in] [unique,charset(UTF16)] */,
+                                           uint32_t level /* [in]  */,
+                                           DATA_BLOB *buffer /* [in] [unique] */,
+                                           uint32_t offered /* [in]  */,
+                                           uint32_t *count /* [out] [ref] */,
+                                           union spoolss_PrintProcessorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                           uint32_t *needed /* [out] [ref] */,
+                                           WERROR *werror)
+{
+       struct spoolss_EnumPrintProcessors r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.servername = servername;
+       r.in.environment = environment;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTPROCESSORS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
@@ -848,6 +2876,140 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetPrintProcessorDirectory_state {
+       struct spoolss_GetPrintProcessorDirectory orig;
+       struct spoolss_GetPrintProcessorDirectory tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrintProcessorDirectory_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrintProcessorDirectory_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli,
+                                                                 const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                                 const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                                 uint32_t _level /* [in]  */,
+                                                                 DATA_BLOB *_buffer /* [in] [unique] */,
+                                                                 uint32_t _offered /* [in]  */,
+                                                                 union spoolss_PrintProcessorDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                                 uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrintProcessorDirectory_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrintProcessorDirectory_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.environment = _environment;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrintProcessorDirectory_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrintProcessorDirectory_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrintProcessorDirectory_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrintProcessorDirectory_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result)
+{
+       struct rpccli_spoolss_GetPrintProcessorDirectory_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrintProcessorDirectory_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_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   const char *server /* [in] [unique,charset(UTF16)] */,
@@ -905,6 +3067,131 @@ NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_StartDocPrinter_state {
+       struct spoolss_StartDocPrinter orig;
+       struct spoolss_StartDocPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_StartDocPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_StartDocPrinter_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      uint32_t _level /* [in]  */,
+                                                      union spoolss_DocumentInfo _info /* [in] [switch_is(level)] */,
+                                                      uint32_t *_job_id /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_StartDocPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_StartDocPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+       state->orig.out.job_id = _job_id;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_StartDocPrinter_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_spoolss,
+                                   NDR_SPOOLSS_STARTDOCPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_StartDocPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_StartDocPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_StartDocPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_StartDocPrinter_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.job_id = *state->tmp.out.job_id;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_StartDocPrinter_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_spoolss_StartDocPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_StartDocPrinter_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_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
@@ -954,6 +3241,118 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_StartPagePrinter_state {
+       struct spoolss_StartPagePrinter orig;
+       struct spoolss_StartPagePrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_StartPagePrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_StartPagePrinter_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_StartPagePrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_StartPagePrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_STARTPAGEPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_StartPagePrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_StartPagePrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_StartPagePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_StartPagePrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_StartPagePrinter_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_StartPagePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_StartPagePrinter_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_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -997,6 +3396,131 @@ NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_WritePrinter_state {
+       struct spoolss_WritePrinter orig;
+       struct spoolss_WritePrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_WritePrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_WritePrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   DATA_BLOB _data /* [in]  */,
+                                                   uint32_t __data_size /* [in] [value(r->in.data.length)] */,
+                                                   uint32_t *_num_written /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_WritePrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_WritePrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.data = _data;
+       state->orig.in._data_size = __data_size;
+
+       /* Out parameters */
+       state->orig.out.num_written = _num_written;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_WritePrinter_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_spoolss,
+                                   NDR_SPOOLSS_WRITEPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_WritePrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_WritePrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_WritePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_WritePrinter_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.num_written = *state->tmp.out.num_written;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_WritePrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_WritePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_WritePrinter_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_spoolss_WritePrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
@@ -1046,16 +3570,128 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *handle /* [in] [ref] */,
-                                      WERROR *werror)
+struct rpccli_spoolss_EndPagePrinter_state {
+       struct spoolss_EndPagePrinter orig;
+       struct spoolss_EndPagePrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EndPagePrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EndPagePrinter_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */)
 {
-       struct spoolss_EndPagePrinter r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_EndPagePrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EndPagePrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ENDPAGEPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EndPagePrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EndPagePrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EndPagePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EndPagePrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EndPagePrinter_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_spoolss_EndPagePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EndPagePrinter_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_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      WERROR *werror)
+{
+       struct spoolss_EndPagePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &r);
@@ -1089,6 +3725,118 @@ NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_AbortPrinter_state {
+       struct spoolss_AbortPrinter orig;
+       struct spoolss_AbortPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AbortPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AbortPrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AbortPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AbortPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ABORTPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AbortPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AbortPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AbortPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AbortPrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AbortPrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_AbortPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AbortPrinter_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_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
@@ -1132,6 +3880,132 @@ NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_ReadPrinter_state {
+       struct spoolss_ReadPrinter orig;
+       struct spoolss_ReadPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ReadPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ReadPrinter_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  uint8_t *_data /* [out] [ref,size_is(data_size)] */,
+                                                  uint32_t _data_size /* [in]  */,
+                                                  uint32_t *__data_size /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ReadPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ReadPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.data_size = _data_size;
+
+       /* Out parameters */
+       state->orig.out.data = _data;
+       state->orig.out._data_size = __data_size;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_ReadPrinter_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_spoolss,
+                                   NDR_SPOOLSS_READPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ReadPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ReadPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ReadPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ReadPrinter_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 */
+       memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.data_size * sizeof(*state->orig.out.data));
+       *state->orig.out._data_size = *state->tmp.out._data_size;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ReadPrinter_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_spoolss_ReadPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ReadPrinter_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_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
@@ -1181,6 +4055,118 @@ NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_EndDocPrinter_state {
+       struct spoolss_EndDocPrinter orig;
+       struct spoolss_EndDocPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EndDocPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EndDocPrinter_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EndDocPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EndDocPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ENDDOCPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EndDocPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EndDocPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EndDocPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EndDocPrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EndDocPrinter_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_spoolss_EndDocPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EndDocPrinter_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_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -1224,6 +4210,137 @@ NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_AddJob_state {
+       struct spoolss_AddJob orig;
+       struct spoolss_AddJob tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddJob_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddJob_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _level /* [in]  */,
+                                             uint8_t *_buffer /* [in,out] [unique,size_is(offered)] */,
+                                             uint32_t _offered /* [in]  */,
+                                             uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddJob_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddJob_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddJob, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_AddJob_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_spoolss,
+                                   NDR_SPOOLSS_ADDJOB,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddJob_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddJob_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddJob_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 */
+       if (state->orig.out.buffer && state->tmp.out.buffer) {
+               memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddJob_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_spoolss_AddJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddJob_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_spoolss_AddJob(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -1278,36 +4395,150 @@ NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct policy_handle *handle /* [in] [ref] */,
-                                   uint32_t jobid /* [in]  */,
-                                   WERROR *werror)
+struct rpccli_spoolss_ScheduleJob_state {
+       struct spoolss_ScheduleJob orig;
+       struct spoolss_ScheduleJob tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ScheduleJob_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ScheduleJob_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  uint32_t _jobid /* [in]  */)
 {
-       struct spoolss_ScheduleJob r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_ScheduleJob_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ScheduleJob_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.jobid = jobid;
+       state->orig.in.handle = _handle;
+       state->orig.in.jobid = _jobid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_SCHEDULEJOB,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SCHEDULEJOB,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ScheduleJob_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
-       }
+static void rpccli_spoolss_ScheduleJob_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ScheduleJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ScheduleJob_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ScheduleJob_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_spoolss_ScheduleJob_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ScheduleJob_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_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   struct policy_handle *handle /* [in] [ref] */,
+                                   uint32_t jobid /* [in]  */,
+                                   WERROR *werror)
+{
+       struct spoolss_ScheduleJob r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.jobid = jobid;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SCHEDULEJOB,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
+       }
 
        if (NT_STATUS_IS_ERR(status)) {
                return status;
@@ -1323,6 +4554,137 @@ NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetPrinterData_state {
+       struct spoolss_GetPrinterData orig;
+       struct spoolss_GetPrinterData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrinterData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrinterData_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     const char *_value_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _offered /* [in]  */,
+                                                     enum winreg_Type *_type /* [out] [ref] */,
+                                                     union spoolss_PrinterData *_data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
+                                                     uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrinterData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrinterData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.value_name = _value_name;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.type = _type;
+       state->orig.out.data = _data;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrinterData_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTERDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterData_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrinterData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterData_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.type = *state->tmp.out.type;
+       *state->orig.out.data = *state->tmp.out.data;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterData_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_spoolss_GetPrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterData_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_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
@@ -1376,6 +4738,126 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_SetPrinterData_state {
+       struct spoolss_SetPrinterData orig;
+       struct spoolss_SetPrinterData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_SetPrinterData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     const char *_value_name /* [in] [charset(UTF16)] */,
+                                                     enum winreg_Type _type /* [in]  */,
+                                                     union spoolss_PrinterData _data /* [in] [subcontext(4),switch_is(type)] */,
+                                                     uint32_t __offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_SetPrinterData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_SetPrinterData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.value_name = _value_name;
+       state->orig.in.type = _type;
+       state->orig.in.data = _data;
+       state->orig.in._offered = __offered;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SETPRINTERDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_SetPrinterData_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_SetPrinterData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_SetPrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetPrinterData_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinterData_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_spoolss_SetPrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetPrinterData_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_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
@@ -1427,6 +4909,116 @@ NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_WaitForPrinterChange_state {
+       struct spoolss_WaitForPrinterChange orig;
+       struct spoolss_WaitForPrinterChange tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_WaitForPrinterChange_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_WaitForPrinterChange_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_WaitForPrinterChange_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_WaitForPrinterChange_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_WAITFORPRINTERCHANGE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_WaitForPrinterChange_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_WaitForPrinterChange_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_WaitForPrinterChange_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_WaitForPrinterChange_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_WaitForPrinterChange_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_spoolss_WaitForPrinterChange_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_WaitForPrinterChange_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_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror)
@@ -1468,6 +5060,126 @@ NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_ClosePrinter_state {
+       struct spoolss_ClosePrinter orig;
+       struct spoolss_ClosePrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ClosePrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ClosePrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ClosePrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ClosePrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_ClosePrinter_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_spoolss,
+                                   NDR_SPOOLSS_CLOSEPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ClosePrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ClosePrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ClosePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ClosePrinter_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ClosePrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_ClosePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ClosePrinter_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_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in,out] [ref] */,
@@ -1512,27 +5224,143 @@ NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in] [ref] */,
-                               uint32_t level /* [in]  */,
-                               union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
-                               WERROR *werror)
+struct rpccli_spoolss_AddForm_state {
+       struct spoolss_AddForm orig;
+       struct spoolss_AddForm tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddForm_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddForm_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              uint32_t _level /* [in]  */,
+                                              union spoolss_AddFormInfo _info /* [in] [switch_is(level)] */)
 {
-       struct spoolss_AddForm r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddForm_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddForm_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.level = level;
-       r.in.info = info;
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddForm, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDFORM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddForm_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddForm_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddForm_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddForm_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_spoolss_AddForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddForm_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_spoolss_AddForm(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               uint32_t level /* [in]  */,
+                               union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
+                               WERROR *werror)
+{
+       struct spoolss_AddForm r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
                                &ndr_table_spoolss,
                                NDR_SPOOLSS_ADDFORM,
                                &r);
@@ -1559,6 +5387,120 @@ NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_DeleteForm_state {
+       struct spoolss_DeleteForm orig;
+       struct spoolss_DeleteForm tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeleteForm_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeleteForm_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 const char *_form_name /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeleteForm_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeleteForm_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.form_name = _form_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEFORM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeleteForm_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeleteForm_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeleteForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeleteForm_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeleteForm_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_spoolss_DeleteForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeleteForm_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_spoolss_DeleteForm(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -1604,6 +5546,140 @@ NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_GetForm_state {
+       struct spoolss_GetForm orig;
+       struct spoolss_GetForm tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetForm_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetForm_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              const char *_form_name /* [in] [charset(UTF16)] */,
+                                              uint32_t _level /* [in]  */,
+                                              DATA_BLOB *_buffer /* [in] [unique] */,
+                                              uint32_t _offered /* [in]  */,
+                                              union spoolss_FormInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                              uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetForm_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetForm_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.form_name = _form_name;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetForm, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetForm_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_spoolss,
+                                   NDR_SPOOLSS_GETFORM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetForm_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetForm_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetForm_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetForm_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_spoolss_GetForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetForm_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_spoolss_GetForm(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -1661,6 +5737,124 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_SetForm_state {
+       struct spoolss_SetForm orig;
+       struct spoolss_SetForm tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_SetForm_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_SetForm_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              const char *_form_name /* [in] [charset(UTF16)] */,
+                                              uint32_t _level /* [in]  */,
+                                              union spoolss_AddFormInfo _info /* [in] [switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_SetForm_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_SetForm_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.form_name = _form_name;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetForm, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SETFORM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_SetForm_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_SetForm_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_SetForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetForm_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_SetForm_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_spoolss_SetForm_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetForm_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_spoolss_SetForm(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -1710,6 +5904,139 @@ NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_EnumForms_state {
+       struct spoolss_EnumForms orig;
+       struct spoolss_EnumForms tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumForms_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumForms_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                uint32_t _level /* [in]  */,
+                                                DATA_BLOB *_buffer /* [in] [unique] */,
+                                                uint32_t _offered /* [in]  */,
+                                                uint32_t *_count /* [out] [ref] */,
+                                                union spoolss_FormInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumForms_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumForms_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumForms_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_spoolss,
+                                   NDR_SPOOLSS_ENUMFORMS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumForms_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumForms_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumForms_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumForms_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumForms_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_spoolss_EnumForms_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumForms_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_spoolss_EnumForms(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
@@ -1765,33 +6092,166 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *servername /* [in] [unique,charset(UTF16)] */,
-                                 uint32_t level /* [in]  */,
-                                 DATA_BLOB *buffer /* [in] [unique] */,
-                                 uint32_t offered /* [in]  */,
-                                 uint32_t *count /* [out] [ref] */,
-                                 union spoolss_PortInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
-                                 uint32_t *needed /* [out] [ref] */,
-                                 WERROR *werror)
+struct rpccli_spoolss_EnumPorts_state {
+       struct spoolss_EnumPorts orig;
+       struct spoolss_EnumPorts tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPorts_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPorts_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                uint32_t _level /* [in]  */,
+                                                DATA_BLOB *_buffer /* [in] [unique] */,
+                                                uint32_t _offered /* [in]  */,
+                                                uint32_t *_count /* [out] [ref] */,
+                                                union spoolss_PortInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                uint32_t *_needed /* [out] [ref] */)
 {
-       struct spoolss_EnumPorts r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPorts_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPorts_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.servername = servername;
-       r.in.level = level;
-       r.in.buffer = buffer;
-       r.in.offered = offered;
+       state->orig.in.servername = _servername;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPorts_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPORTS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPorts_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPorts_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPorts_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPorts_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPorts_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_spoolss_EnumPorts_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPorts_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_spoolss_EnumPorts(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *servername /* [in] [unique,charset(UTF16)] */,
+                                 uint32_t level /* [in]  */,
+                                 DATA_BLOB *buffer /* [in] [unique] */,
+                                 uint32_t offered /* [in]  */,
+                                 uint32_t *count /* [out] [ref] */,
+                                 union spoolss_PortInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                 uint32_t *needed /* [out] [ref] */,
+                                 WERROR *werror)
+{
+       struct spoolss_EnumPorts r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.servername = servername;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
                                NDR_SPOOLSS_ENUMPORTS,
                                &r);
 
@@ -1820,6 +6280,139 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_EnumMonitors_state {
+       struct spoolss_EnumMonitors orig;
+       struct spoolss_EnumMonitors tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumMonitors_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumMonitors_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   DATA_BLOB *_buffer /* [in] [unique] */,
+                                                   uint32_t _offered /* [in]  */,
+                                                   uint32_t *_count /* [out] [ref] */,
+                                                   union spoolss_MonitorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                   uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumMonitors_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumMonitors_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumMonitors_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_spoolss,
+                                   NDR_SPOOLSS_ENUMMONITORS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumMonitors_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumMonitors_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumMonitors_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumMonitors_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumMonitors_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_EnumMonitors_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumMonitors_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_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *servername /* [in] [unique,charset(UTF16)] */,
@@ -1875,6 +6468,122 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_AddPort_state {
+       struct spoolss_AddPort orig;
+       struct spoolss_AddPort tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPort_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPort_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                              uint32_t _unknown /* [in]  */,
+                                              const char *_monitor_name /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPort_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPort_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.unknown = _unknown;
+       state->orig.in.monitor_name = _monitor_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPort, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPORT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPort_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPort_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPort_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPort_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPort_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_spoolss_AddPort_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPort_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_spoolss_AddPort(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1922,6 +6631,116 @@ NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_spoolss_ConfigurePort_state {
+       struct spoolss_ConfigurePort orig;
+       struct spoolss_ConfigurePort tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ConfigurePort_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ConfigurePort_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ConfigurePort_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ConfigurePort_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_CONFIGUREPORT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ConfigurePort_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ConfigurePort_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ConfigurePort_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ConfigurePort_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ConfigurePort_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_spoolss_ConfigurePort_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ConfigurePort_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_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      WERROR *werror)
@@ -1963,69 +6782,133 @@ NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+struct rpccli_spoolss_DeletePort_state {
+       struct spoolss_DeletePort orig;
+       struct spoolss_DeletePort tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePort_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePort_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
 {
-       struct spoolss_DeletePort r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePort_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePort_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPORT,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPORT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePort_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePort_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePort_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePort_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePort_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_spoolss_DeletePort_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePort_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *handle /* [in] [ref] */,
-                                       struct policy_handle *gdi_handle /* [out] [ref] */,
-                                       struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
-                                       WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
 {
-       struct spoolss_CreatePrinterIC r;
+       struct spoolss_DeletePort r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.devmode_ctr = devmode_ctr;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_CREATEPRINTERIC,
+                               NDR_SPOOLSS_DELETEPORT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2033,7 +6916,7 @@ NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2041,7 +6924,6 @@ NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *gdi_handle = *r.out.gdi_handle;
 
        /* Return result */
        if (werror) {
@@ -2051,66 +6933,151 @@ NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
-                                                TALLOC_CTX *mem_ctx,
-                                                WERROR *werror)
+struct rpccli_spoolss_CreatePrinterIC_state {
+       struct spoolss_CreatePrinterIC orig;
+       struct spoolss_CreatePrinterIC tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_CreatePrinterIC_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_CreatePrinterIC_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct policy_handle *_gdi_handle /* [out] [ref] */,
+                                                      struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */)
 {
-       struct spoolss_PlayGDIScriptOnPrinterIC r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_CreatePrinterIC_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_CreatePrinterIC_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+
+       /* Out parameters */
+       state->orig.out.gdi_handle = _gdi_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_CreatePrinterIC_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_spoolss,
+                                   NDR_SPOOLSS_CREATEPRINTERIC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_CreatePrinterIC_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_CreatePrinterIC_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_CreatePrinterIC_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_CreatePrinterIC_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_CreatePrinterIC_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_spoolss_CreatePrinterIC_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_CreatePrinterIC_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *gdi_handle /* [in,out] [ref] */,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct policy_handle *gdi_handle /* [out] [ref] */,
+                                       struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                        WERROR *werror)
 {
-       struct spoolss_DeletePrinterIC r;
+       struct spoolss_CreatePrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.gdi_handle = gdi_handle;
+       r.in.handle = handle;
+       r.in.devmode_ctr = devmode_ctr;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTERIC,
+                               NDR_SPOOLSS_CREATEPRINTERIC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2118,7 +7085,7 @@ NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2136,64 +7103,133 @@ NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            WERROR *werror)
+struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state {
+       struct spoolss_PlayGDIScriptOnPrinterIC orig;
+       struct spoolss_PlayGDIScriptOnPrinterIC tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_PlayGDIScriptOnPrinterIC_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli)
 {
-       struct spoolss_AddPrinterConnection r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDPRINTERCONNECTION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_PlayGDIScriptOnPrinterIC_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_PlayGDIScriptOnPrinterIC_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result)
+{
+       struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_PlayGDIScriptOnPrinterIC_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               WERROR *werror)
+NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *werror)
 {
-       struct spoolss_DeletePrinterConnection r;
+       struct spoolss_PlayGDIScriptOnPrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTERCONNECTION,
+                               NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2201,7 +7237,7 @@ NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2218,64 +7254,145 @@ NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         WERROR *werror)
+struct rpccli_spoolss_DeletePrinterIC_state {
+       struct spoolss_DeletePrinterIC orig;
+       struct spoolss_DeletePrinterIC tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterIC_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterIC_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_gdi_handle /* [in,out] [ref] */)
 {
-       struct spoolss_PrinterMessageBox r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterIC_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterIC_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.gdi_handle = _gdi_handle;
+
+       /* Out parameters */
+       state->orig.out.gdi_handle = _gdi_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_PRINTERMESSAGEBOX,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_DeletePrinterIC_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_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERIC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterIC_done, req);
+       return req;
+}
 
+static void rpccli_spoolss_DeletePrinterIC_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterIC_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterIC_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.gdi_handle = *state->tmp.out.gdi_handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterIC_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinterIC_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterIC_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *gdi_handle /* [in,out] [ref] */,
+                                       WERROR *werror)
 {
-       struct spoolss_AddMonitor r;
+       struct spoolss_DeletePrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.gdi_handle = gdi_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDMONITOR,
+                               NDR_SPOOLSS_DELETEPRINTERIC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2283,7 +7400,7 @@ NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2291,6 +7408,7 @@ NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *gdi_handle = *r.out.gdi_handle;
 
        /* Return result */
        if (werror) {
@@ -2300,64 +7418,133 @@ NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     WERROR *werror)
+struct rpccli_spoolss_AddPrinterConnection_state {
+       struct spoolss_AddPrinterConnection orig;
+       struct spoolss_AddPrinterConnection tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrinterConnection_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrinterConnection_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
 {
-       struct spoolss_DeleteMonitor r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrinterConnection_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrinterConnection_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEMONITOR,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTERCONNECTION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterConnection_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrinterConnection_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrinterConnection_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterConnection_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterConnection_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_spoolss_AddPrinterConnection_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterConnection_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror)
 {
-       struct spoolss_DeletePrintProcessor r;
+       struct spoolss_AddPrinterConnection r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTPROCESSOR,
+                               NDR_SPOOLSS_ADDPRINTERCONNECTION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2365,7 +7552,7 @@ NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2382,64 +7569,133 @@ NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+struct rpccli_spoolss_DeletePrinterConnection_state {
+       struct spoolss_DeletePrinterConnection orig;
+       struct spoolss_DeletePrinterConnection tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterConnection_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterConnection_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli)
 {
-       struct spoolss_AddPrintProvidor r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterConnection_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterConnection_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDPRINTPROVIDOR,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERCONNECTION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterConnection_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
+static void rpccli_spoolss_DeletePrinterConnection_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterConnection_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterConnection_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       /* Return variables */
+       /* Copy out parameters */
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &state->orig);
        }
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_done(req);
 }
 
-NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrinterConnection_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result)
 {
-       struct spoolss_DeletePrintProvidor r;
+       struct rpccli_spoolss_DeletePrinterConnection_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterConnection_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_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *werror)
+{
+       struct spoolss_DeletePrinterConnection r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTPROVIDOR,
+                               NDR_SPOOLSS_DELETEPRINTERCONNECTION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2447,7 +7703,7 @@ NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2464,86 +7720,133 @@ NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              const char *servername /* [in] [unique,charset(UTF16)] */,
-                                              const char *print_processor_name /* [in] [unique,charset(UTF16)] */,
-                                              uint32_t level /* [in]  */,
-                                              DATA_BLOB *buffer /* [in] [unique] */,
-                                              uint32_t offered /* [in]  */,
-                                              uint32_t *count /* [out] [ref] */,
-                                              union spoolss_PrintProcDataTypesInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
-                                              uint32_t *needed /* [out] [ref] */,
-                                              WERROR *werror)
+struct rpccli_spoolss_PrinterMessageBox_state {
+       struct spoolss_PrinterMessageBox orig;
+       struct spoolss_PrinterMessageBox tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_PrinterMessageBox_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_PrinterMessageBox_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli)
 {
-       struct spoolss_EnumPrintProcDataTypes r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_PrinterMessageBox_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_PrinterMessageBox_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.servername = servername;
-       r.in.print_processor_name = print_processor_name;
-       r.in.level = level;
-       r.in.buffer = buffer;
-       r.in.offered = offered;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_PRINTERMESSAGEBOX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_PrinterMessageBox_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_PrinterMessageBox_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_PrinterMessageBox_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_PrinterMessageBox_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_PrinterMessageBox_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_spoolss_PrinterMessageBox_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_PrinterMessageBox_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *count = *r.out.count;
-       *info = *r.out.info;
-       *needed = *r.out.needed;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *handle /* [in] [ref] */,
-                                    const char *data_type /* [in] [unique,charset(UTF16)] */,
-                                    struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
-                                    WERROR *werror)
+NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *werror)
 {
-       struct spoolss_ResetPrinter r;
+       struct spoolss_PrinterMessageBox r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.data_type = data_type;
-       r.in.devmode_ctr = devmode_ctr;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_RESETPRINTER,
+                               NDR_SPOOLSS_PRINTERMESSAGEBOX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2551,7 +7854,7 @@ NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2568,88 +7871,133 @@ NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *handle /* [in] [ref] */,
-                                         const char *architecture /* [in] [unique,charset(UTF16)] */,
-                                         uint32_t level /* [in]  */,
-                                         DATA_BLOB *buffer /* [in] [unique] */,
-                                         uint32_t offered /* [in]  */,
-                                         uint32_t client_major_version /* [in]  */,
-                                         uint32_t client_minor_version /* [in]  */,
-                                         union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
-                                         uint32_t *needed /* [out] [ref] */,
-                                         uint32_t *server_major_version /* [out] [ref] */,
-                                         uint32_t *server_minor_version /* [out] [ref] */,
-                                         WERROR *werror)
+struct rpccli_spoolss_AddMonitor_state {
+       struct spoolss_AddMonitor orig;
+       struct spoolss_AddMonitor tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddMonitor_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddMonitor_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli)
 {
-       struct spoolss_GetPrinterDriver2 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddMonitor_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddMonitor_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.architecture = architecture;
-       r.in.level = level;
-       r.in.buffer = buffer;
-       r.in.offered = offered;
-       r.in.client_major_version = client_major_version;
-       r.in.client_minor_version = client_minor_version;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_GETPRINTERDRIVER2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDMONITOR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddMonitor_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddMonitor_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddMonitor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddMonitor_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddMonitor_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_spoolss_AddMonitor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddMonitor_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       if (info && r.out.info) {
-               *info = *r.out.info;
-       }
-       *needed = *r.out.needed;
-       *server_major_version = *r.out.server_major_version;
-       *server_minor_version = *r.out.server_minor_version;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
-                                                          TALLOC_CTX *mem_ctx,
-                                                          WERROR *werror)
+NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  WERROR *werror)
 {
-       struct spoolss_FindFirstPrinterChangeNotification r;
+       struct spoolss_AddMonitor r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
+                               NDR_SPOOLSS_ADDMONITOR,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2657,7 +8005,7 @@ NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_clien
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2674,66 +8022,133 @@ NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_clien
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
-                                                         TALLOC_CTX *mem_ctx,
-                                                         WERROR *werror)
+struct rpccli_spoolss_DeleteMonitor_state {
+       struct spoolss_DeleteMonitor orig;
+       struct spoolss_DeleteMonitor tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeleteMonitor_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeleteMonitor_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli)
 {
-       struct spoolss_FindNextPrinterChangeNotification r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeleteMonitor_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeleteMonitor_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEMONITOR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeleteMonitor_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeleteMonitor_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeleteMonitor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeleteMonitor_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeleteMonitor_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_spoolss_DeleteMonitor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeleteMonitor_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              struct policy_handle *handle /* [in] [ref] */,
-                                              WERROR *werror)
+NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *werror)
 {
-       struct spoolss_FindClosePrinterNotify r;
+       struct spoolss_DeleteMonitor r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
+                               NDR_SPOOLSS_DELETEMONITOR,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2741,7 +8156,7 @@ NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2758,75 +8173,133 @@ NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
-                                                                   TALLOC_CTX *mem_ctx,
-                                                                   WERROR *werror)
-{
-       struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
-       NTSTATUS status;
+struct rpccli_spoolss_DeletePrintProcessor_state {
+       struct spoolss_DeletePrintProcessor orig;
+       struct spoolss_DeletePrintProcessor tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
 
-       /* In parameters */
+static void rpccli_spoolss_DeletePrintProcessor_done(struct tevent_req *subreq);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+struct tevent_req *rpccli_spoolss_DeletePrintProcessor_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrintProcessor_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrintProcessor_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
-                               &r);
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTPROCESSOR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrintProcessor_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrintProcessor_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrintProcessor_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrintProcessor_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrintProcessor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrintProcessor_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        const char *server_name /* [in] [charset(UTF16)] */,
-                                        uint32_t printer_local /* [in]  */,
-                                        enum winreg_Type type /* [in]  */,
-                                        uint32_t bufsize /* [in] [range(0,512)] */,
-                                        uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
-                                        struct policy_handle *handle /* [out] [ref] */,
-                                        WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
 {
-       struct spoolss_ReplyOpenPrinter r;
+       struct spoolss_DeletePrintProcessor r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.printer_local = printer_local;
-       r.in.type = type;
-       r.in.bufsize = bufsize;
-       r.in.buffer = buffer;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_REPLYOPENPRINTER,
+                               NDR_SPOOLSS_DELETEPRINTPROCESSOR,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2834,7 +8307,7 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2842,7 +8315,6 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        if (werror) {
@@ -2852,74 +8324,133 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          struct policy_handle *handle /* [in] [ref] */,
-                                          uint32_t flags /* [in]  */,
-                                          uint32_t bufsize /* [in] [range(0,512)] */,
-                                          uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
-                                          WERROR *werror)
+struct rpccli_spoolss_AddPrintProvidor_state {
+       struct spoolss_AddPrintProvidor orig;
+       struct spoolss_AddPrintProvidor tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrintProvidor_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrintProvidor_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
 {
-       struct spoolss_RouterReplyPrinter r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrintProvidor_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrintProvidor_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.flags = flags;
-       r.in.bufsize = bufsize;
-       r.in.buffer = buffer;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ROUTERREPLYPRINTER,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTPROVIDOR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrintProvidor_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrintProvidor_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrintProvidor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrintProvidor_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrintProvidor_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_AddPrintProvidor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrintProvidor_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *handle /* [in,out] [ref] */,
-                                         WERROR *werror)
+NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
 {
-       struct spoolss_ReplyClosePrinter r;
+       struct spoolss_AddPrintProvidor r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_REPLYCLOSEPRINTER,
+                               NDR_SPOOLSS_ADDPRINTPROVIDOR,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2927,7 +8458,7 @@ NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2935,7 +8466,6 @@ NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        if (werror) {
@@ -2945,64 +8475,133 @@ NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 WERROR *werror)
+struct rpccli_spoolss_DeletePrintProvidor_state {
+       struct spoolss_DeletePrintProvidor orig;
+       struct spoolss_DeletePrintProvidor tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrintProvidor_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrintProvidor_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
 {
-       struct spoolss_AddPortEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrintProvidor_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrintProvidor_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDPORTEX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTPROVIDOR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrintProvidor_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrintProvidor_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrintProvidor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrintProvidor_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrintProvidor_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrintProvidor_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrintProvidor_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
-                                                                TALLOC_CTX *mem_ctx,
-                                                                WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *werror)
 {
-       struct spoolss_RouterFindFirstPrinterChangeNotification r;
+       struct spoolss_DeletePrintProvidor r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
+                               NDR_SPOOLSS_DELETEPRINTPROVIDOR,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3010,7 +8609,7 @@ NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3027,64 +8626,171 @@ NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   WERROR *werror)
+struct rpccli_spoolss_EnumPrintProcDataTypes_state {
+       struct spoolss_EnumPrintProcDataTypes orig;
+       struct spoolss_EnumPrintProcDataTypes tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrintProcDataTypes_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrintProcDataTypes_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                             const char *_print_processor_name /* [in] [unique,charset(UTF16)] */,
+                                                             uint32_t _level /* [in]  */,
+                                                             DATA_BLOB *_buffer /* [in] [unique] */,
+                                                             uint32_t _offered /* [in]  */,
+                                                             uint32_t *_count /* [out] [ref] */,
+                                                             union spoolss_PrintProcDataTypesInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                             uint32_t *_needed /* [out] [ref] */)
 {
-       struct spoolss_SpoolerInit r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrintProcDataTypes_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrintProcDataTypes_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.servername = _servername;
+       state->orig.in.print_processor_name = _print_processor_name;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_SPOOLERINIT,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrintProcDataTypes_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrintProcDataTypes_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrintProcDataTypes_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrintProcDataTypes_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrintProcDataTypes_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrintProcDataTypes_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      WERROR *werror)
+NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              const char *servername /* [in] [unique,charset(UTF16)] */,
+                                              const char *print_processor_name /* [in] [unique,charset(UTF16)] */,
+                                              uint32_t level /* [in]  */,
+                                              DATA_BLOB *buffer /* [in] [unique] */,
+                                              uint32_t offered /* [in]  */,
+                                              uint32_t *count /* [out] [ref] */,
+                                              union spoolss_PrintProcDataTypesInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                              uint32_t *needed /* [out] [ref] */,
+                                              WERROR *werror)
 {
-       struct spoolss_ResetPrinterEx r;
+       struct spoolss_EnumPrintProcDataTypes r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.servername = servername;
+       r.in.print_processor_name = print_processor_name;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_RESETPRINTEREX,
+                               NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3092,7 +8798,4293 @@ NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *count = *r.out.count;
+       *info = *r.out.info;
+       *needed = *r.out.needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_ResetPrinter_state {
+       struct spoolss_ResetPrinter orig;
+       struct spoolss_ResetPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ResetPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ResetPrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   const char *_data_type /* [in] [unique,charset(UTF16)] */,
+                                                   struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ResetPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ResetPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.data_type = _data_type;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_RESETPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ResetPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ResetPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ResetPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ResetPrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ResetPrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_ResetPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ResetPrinter_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_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    const char *data_type /* [in] [unique,charset(UTF16)] */,
+                                    struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
+                                    WERROR *werror)
+{
+       struct spoolss_ResetPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.data_type = data_type;
+       r.in.devmode_ctr = devmode_ctr;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_RESETPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_GetPrinterDriver2_state {
+       struct spoolss_GetPrinterDriver2 orig;
+       struct spoolss_GetPrinterDriver2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrinterDriver2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrinterDriver2_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_architecture /* [in] [unique,charset(UTF16)] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        DATA_BLOB *_buffer /* [in] [unique] */,
+                                                        uint32_t _offered /* [in]  */,
+                                                        uint32_t _client_major_version /* [in]  */,
+                                                        uint32_t _client_minor_version /* [in]  */,
+                                                        union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                        uint32_t *_needed /* [out] [ref] */,
+                                                        uint32_t *_server_major_version /* [out] [ref] */,
+                                                        uint32_t *_server_minor_version /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrinterDriver2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrinterDriver2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.architecture = _architecture;
+       state->orig.in.level = _level;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+       state->orig.in.client_major_version = _client_major_version;
+       state->orig.in.client_minor_version = _client_minor_version;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+       state->orig.out.server_major_version = _server_major_version;
+       state->orig.out.server_minor_version = _server_minor_version;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrinterDriver2_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTERDRIVER2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDriver2_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrinterDriver2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDriver2_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 */
+       if (state->orig.out.info && state->tmp.out.info) {
+               *state->orig.out.info = *state->tmp.out.info;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.server_major_version = *state->tmp.out.server_major_version;
+       *state->orig.out.server_minor_version = *state->tmp.out.server_minor_version;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriver2_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_spoolss_GetPrinterDriver2_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDriver2_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_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in] [ref] */,
+                                         const char *architecture /* [in] [unique,charset(UTF16)] */,
+                                         uint32_t level /* [in]  */,
+                                         DATA_BLOB *buffer /* [in] [unique] */,
+                                         uint32_t offered /* [in]  */,
+                                         uint32_t client_major_version /* [in]  */,
+                                         uint32_t client_minor_version /* [in]  */,
+                                         union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                         uint32_t *needed /* [out] [ref] */,
+                                         uint32_t *server_major_version /* [out] [ref] */,
+                                         uint32_t *server_minor_version /* [out] [ref] */,
+                                         WERROR *werror)
+{
+       struct spoolss_GetPrinterDriver2 r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.architecture = architecture;
+       r.in.level = level;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+       r.in.client_major_version = client_major_version;
+       r.in.client_minor_version = client_minor_version;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTERDRIVER2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (info && r.out.info) {
+               *info = *r.out.info;
+       }
+       *needed = *r.out.needed;
+       *server_major_version = *r.out.server_major_version;
+       *server_minor_version = *r.out.server_minor_version;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_FindFirstPrinterChangeNotification_state {
+       struct spoolss_FindFirstPrinterChangeNotification orig;
+       struct spoolss_FindFirstPrinterChangeNotification tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_FindFirstPrinterChangeNotification_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_FindFirstPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
+                                                                         struct tevent_context *ev,
+                                                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_FindFirstPrinterChangeNotification_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_FindFirstPrinterChangeNotification_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_FindFirstPrinterChangeNotification_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_FindFirstPrinterChangeNotification_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification_recv(struct tevent_req *req,
+                                                               TALLOC_CTX *mem_ctx,
+                                                               WERROR *result)
+{
+       struct rpccli_spoolss_FindFirstPrinterChangeNotification_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_FindFirstPrinterChangeNotification_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_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                          TALLOC_CTX *mem_ctx,
+                                                          WERROR *werror)
+{
+       struct spoolss_FindFirstPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_FindNextPrinterChangeNotification_state {
+       struct spoolss_FindNextPrinterChangeNotification orig;
+       struct spoolss_FindNextPrinterChangeNotification tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_FindNextPrinterChangeNotification_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_FindNextPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
+                                                                        struct tevent_context *ev,
+                                                                        struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_FindNextPrinterChangeNotification_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_FindNextPrinterChangeNotification_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_FindNextPrinterChangeNotification_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_FindNextPrinterChangeNotification_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification_recv(struct tevent_req *req,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *result)
+{
+       struct rpccli_spoolss_FindNextPrinterChangeNotification_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_FindNextPrinterChangeNotification_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_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                         TALLOC_CTX *mem_ctx,
+                                                         WERROR *werror)
+{
+       struct spoolss_FindNextPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_FindClosePrinterNotify_state {
+       struct spoolss_FindClosePrinterNotify orig;
+       struct spoolss_FindClosePrinterNotify tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_FindClosePrinterNotify_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_FindClosePrinterNotify_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_FindClosePrinterNotify_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_FindClosePrinterNotify_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_FindClosePrinterNotify_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_FindClosePrinterNotify_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_FindClosePrinterNotify_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_FindClosePrinterNotify_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_spoolss_FindClosePrinterNotify_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_FindClosePrinterNotify_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_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *handle /* [in] [ref] */,
+                                              WERROR *werror)
+{
+       struct spoolss_FindClosePrinterNotify r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state {
+       struct spoolss_RouterFindFirstPrinterChangeNotificationOld orig;
+       struct spoolss_RouterFindFirstPrinterChangeNotificationOld tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_send(TALLOC_CTX *mem_ctx,
+                                                                                  struct tevent_context *ev,
+                                                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_recv(struct tevent_req *req,
+                                                                        TALLOC_CTX *mem_ctx,
+                                                                        WERROR *result)
+{
+       struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_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_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
+                                                                   TALLOC_CTX *mem_ctx,
+                                                                   WERROR *werror)
+{
+       struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_ReplyOpenPrinter_state {
+       struct spoolss_ReplyOpenPrinter orig;
+       struct spoolss_ReplyOpenPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ReplyOpenPrinter_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _printer_local /* [in]  */,
+                                                       enum winreg_Type _type /* [in]  */,
+                                                       uint32_t _bufsize /* [in] [range(0,512)] */,
+                                                       uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */,
+                                                       struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ReplyOpenPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ReplyOpenPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.printer_local = _printer_local;
+       state->orig.in.type = _type;
+       state->orig.in.bufsize = _bufsize;
+       state->orig.in.buffer = _buffer;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_ReplyOpenPrinter_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_spoolss,
+                                   NDR_SPOOLSS_REPLYOPENPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ReplyOpenPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ReplyOpenPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ReplyOpenPrinter_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ReplyOpenPrinter_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_ReplyOpenPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ReplyOpenPrinter_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_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        const char *server_name /* [in] [charset(UTF16)] */,
+                                        uint32_t printer_local /* [in]  */,
+                                        enum winreg_Type type /* [in]  */,
+                                        uint32_t bufsize /* [in] [range(0,512)] */,
+                                        uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
+                                        struct policy_handle *handle /* [out] [ref] */,
+                                        WERROR *werror)
+{
+       struct spoolss_ReplyOpenPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.printer_local = printer_local;
+       r.in.type = type;
+       r.in.bufsize = bufsize;
+       r.in.buffer = buffer;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REPLYOPENPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_RouterReplyPrinter_state {
+       struct spoolss_RouterReplyPrinter orig;
+       struct spoolss_RouterReplyPrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_RouterReplyPrinter_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _flags /* [in]  */,
+                                                         uint32_t _bufsize /* [in] [range(0,512)] */,
+                                                         uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_RouterReplyPrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_RouterReplyPrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.flags = _flags;
+       state->orig.in.bufsize = _bufsize;
+       state->orig.in.buffer = _buffer;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ROUTERREPLYPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_RouterReplyPrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_RouterReplyPrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterReplyPrinter_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_RouterReplyPrinter_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_spoolss_RouterReplyPrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterReplyPrinter_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_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct policy_handle *handle /* [in] [ref] */,
+                                          uint32_t flags /* [in]  */,
+                                          uint32_t bufsize /* [in] [range(0,512)] */,
+                                          uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
+                                          WERROR *werror)
+{
+       struct spoolss_RouterReplyPrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.flags = flags;
+       r.in.bufsize = bufsize;
+       r.in.buffer = buffer;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERREPLYPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_ReplyClosePrinter_state {
+       struct spoolss_ReplyClosePrinter orig;
+       struct spoolss_ReplyClosePrinter tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ReplyClosePrinter_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ReplyClosePrinter_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ReplyClosePrinter_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_ReplyClosePrinter_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_spoolss,
+                                   NDR_SPOOLSS_REPLYCLOSEPRINTER,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ReplyClosePrinter_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ReplyClosePrinter_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ReplyClosePrinter_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ReplyClosePrinter_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_spoolss_ReplyClosePrinter_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ReplyClosePrinter_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_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in,out] [ref] */,
+                                         WERROR *werror)
+{
+       struct spoolss_ReplyClosePrinter r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REPLYCLOSEPRINTER,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_AddPortEx_state {
+       struct spoolss_AddPortEx orig;
+       struct spoolss_AddPortEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPortEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPortEx_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPortEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPortEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPORTEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPortEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPortEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPortEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPortEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPortEx_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_spoolss_AddPortEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPortEx_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_spoolss_AddPortEx(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 WERROR *werror)
+{
+       struct spoolss_AddPortEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPORTEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state {
+       struct spoolss_RouterFindFirstPrinterChangeNotification orig;
+       struct spoolss_RouterFindFirstPrinterChangeNotification tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_RouterFindFirstPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
+                                                                               struct tevent_context *ev,
+                                                                               struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_RouterFindFirstPrinterChangeNotification_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification_recv(struct tevent_req *req,
+                                                                     TALLOC_CTX *mem_ctx,
+                                                                     WERROR *result)
+{
+       struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterFindFirstPrinterChangeNotification_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_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
+                                                                TALLOC_CTX *mem_ctx,
+                                                                WERROR *werror)
+{
+       struct spoolss_RouterFindFirstPrinterChangeNotification r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_SpoolerInit_state {
+       struct spoolss_SpoolerInit orig;
+       struct spoolss_SpoolerInit tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_SpoolerInit_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_SpoolerInit_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_SpoolerInit_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_SpoolerInit_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SPOOLERINIT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_SpoolerInit_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_SpoolerInit_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_SpoolerInit_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SpoolerInit_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_SpoolerInit_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_spoolss_SpoolerInit_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SpoolerInit_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_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *werror)
+{
+       struct spoolss_SpoolerInit r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SPOOLERINIT,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_ResetPrinterEx_state {
+       struct spoolss_ResetPrinterEx orig;
+       struct spoolss_ResetPrinterEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_ResetPrinterEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_ResetPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_ResetPrinterEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_ResetPrinterEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_RESETPRINTEREX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_ResetPrinterEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_ResetPrinterEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_ResetPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ResetPrinterEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_ResetPrinterEx_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_spoolss_ResetPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_ResetPrinterEx_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_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *werror)
+{
+       struct spoolss_ResetPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_RESETPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state {
+       struct spoolss_RemoteFindFirstPrinterChangeNotifyEx orig;
+       struct spoolss_RemoteFindFirstPrinterChangeNotifyEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_send(TALLOC_CTX *mem_ctx,
+                                                                           struct tevent_context *ev,
+                                                                           struct rpc_pipe_client *cli,
+                                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                                           uint32_t _flags /* [in]  */,
+                                                                           uint32_t _options /* [in]  */,
+                                                                           const char *_local_machine /* [in] [unique,charset(UTF16)] */,
+                                                                           uint32_t _printer_local /* [in]  */,
+                                                                           struct spoolss_NotifyOption *_notify_options /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.flags = _flags;
+       state->orig.in.options = _options;
+       state->orig.in.local_machine = _local_machine;
+       state->orig.in.printer_local = _printer_local;
+       state->orig.in.notify_options = _notify_options;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_recv(struct tevent_req *req,
+                                                                 TALLOC_CTX *mem_ctx,
+                                                                 WERROR *result)
+{
+       struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_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_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
+                                                            TALLOC_CTX *mem_ctx,
+                                                            struct policy_handle *handle /* [in] [ref] */,
+                                                            uint32_t flags /* [in]  */,
+                                                            uint32_t options /* [in]  */,
+                                                            const char *local_machine /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t printer_local /* [in]  */,
+                                                            struct spoolss_NotifyOption *notify_options /* [in] [unique] */,
+                                                            WERROR *werror)
+{
+       struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.flags = flags;
+       r.in.options = options;
+       r.in.local_machine = local_machine;
+       r.in.printer_local = printer_local;
+       r.in.notify_options = notify_options;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_RouterReplyPrinterEx_state {
+       struct spoolss_RouterReplyPrinterEx orig;
+       struct spoolss_RouterReplyPrinterEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_RouterReplyPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                           uint32_t _color /* [in]  */,
+                                                           uint32_t _flags /* [in]  */,
+                                                           uint32_t *_reply_result /* [out] [ref] */,
+                                                           uint32_t _reply_type /* [in]  */,
+                                                           union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_RouterReplyPrinterEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_RouterReplyPrinterEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.color = _color;
+       state->orig.in.flags = _flags;
+       state->orig.in.reply_type = _reply_type;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+       state->orig.out.reply_result = _reply_result;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_RouterReplyPrinterEx_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_spoolss,
+                                   NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_RouterReplyPrinterEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_RouterReplyPrinterEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterReplyPrinterEx_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.reply_result = *state->tmp.out.reply_result;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_RouterReplyPrinterEx_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_spoolss_RouterReplyPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterReplyPrinterEx_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_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            struct policy_handle *handle /* [in] [ref] */,
+                                            uint32_t color /* [in]  */,
+                                            uint32_t flags /* [in]  */,
+                                            uint32_t *reply_result /* [out] [ref] */,
+                                            uint32_t reply_type /* [in]  */,
+                                            union spoolss_ReplyPrinterInfo info /* [in] [switch_is(reply_type)] */,
+                                            WERROR *werror)
+{
+       struct spoolss_RouterReplyPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.color = color;
+       r.in.flags = flags;
+       r.in.reply_type = reply_type;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *reply_result = *r.out.reply_result;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state {
+       struct spoolss_RouterRefreshPrinterChangeNotify orig;
+       struct spoolss_RouterRefreshPrinterChangeNotify tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_RouterRefreshPrinterChangeNotify_send(TALLOC_CTX *mem_ctx,
+                                                                       struct tevent_context *ev,
+                                                                       struct rpc_pipe_client *cli,
+                                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                                       uint32_t _change_low /* [in]  */,
+                                                                       struct spoolss_NotifyOption *_options /* [in] [unique] */,
+                                                                       struct spoolss_NotifyInfo **_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.change_low = _change_low;
+       state->orig.in.options = _options;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_RouterRefreshPrinterChangeNotify_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_spoolss,
+                                   NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_RouterRefreshPrinterChangeNotify_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_RouterRefreshPrinterChangeNotify_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify_recv(struct tevent_req *req,
+                                                             TALLOC_CTX *mem_ctx,
+                                                             WERROR *result)
+{
+       struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_RouterRefreshPrinterChangeNotify_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_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client *cli,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        struct policy_handle *handle /* [in] [ref] */,
+                                                        uint32_t change_low /* [in]  */,
+                                                        struct spoolss_NotifyOption *options /* [in] [unique] */,
+                                                        struct spoolss_NotifyInfo **info /* [out] [ref] */,
+                                                        WERROR *werror)
+{
+       struct spoolss_RouterRefreshPrinterChangeNotify r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.change_low = change_low;
+       r.in.options = options;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_44_state {
+       struct spoolss_44 orig;
+       struct spoolss_44 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_44_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_44_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_44_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_44_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_44, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_44,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_44_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_44_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_44_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_44_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_44, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_44_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_44_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_44_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_spoolss_44(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
+{
+       struct spoolss_44 r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_44, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_44,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_OpenPrinterEx_state {
+       struct spoolss_OpenPrinterEx orig;
+       struct spoolss_OpenPrinterEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_OpenPrinterEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_OpenPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_printername /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_datatype /* [in] [unique,charset(UTF16)] */,
+                                                    struct spoolss_DevmodeContainer _devmode_ctr /* [in]  */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    uint32_t _level /* [in]  */,
+                                                    union spoolss_UserLevel _userlevel /* [in] [switch_is(level)] */,
+                                                    struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_OpenPrinterEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_OpenPrinterEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.printername = _printername;
+       state->orig.in.datatype = _datatype;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.level = _level;
+       state->orig.in.userlevel = _userlevel;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_OpenPrinterEx_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_spoolss,
+                                   NDR_SPOOLSS_OPENPRINTEREX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_OpenPrinterEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_OpenPrinterEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_OpenPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_OpenPrinterEx_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_OpenPrinterEx_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_spoolss_OpenPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_OpenPrinterEx_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_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *printername /* [in] [unique,charset(UTF16)] */,
+                                     const char *datatype /* [in] [unique,charset(UTF16)] */,
+                                     struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
+                                     uint32_t access_mask /* [in]  */,
+                                     uint32_t level /* [in]  */,
+                                     union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
+                                     struct policy_handle *handle /* [out] [ref] */,
+                                     WERROR *werror)
+{
+       struct spoolss_OpenPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.printername = printername;
+       r.in.datatype = datatype;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.access_mask = access_mask;
+       r.in.level = level;
+       r.in.userlevel = userlevel;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_OPENPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_AddPrinterEx_state {
+       struct spoolss_AddPrinterEx orig;
+       struct spoolss_AddPrinterEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrinterEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                   struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
+                                                   struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
+                                                   struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
+                                                   struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
+                                                   struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrinterEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrinterEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.devmode_ctr = _devmode_ctr;
+       state->orig.in.secdesc_ctr = _secdesc_ctr;
+       state->orig.in.userlevel_ctr = _userlevel_ctr;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_AddPrinterEx_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_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTEREX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrinterEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterEx_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterEx_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_spoolss_AddPrinterEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterEx_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_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *server /* [in] [unique,charset(UTF16)] */,
+                                    struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
+                                    struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
+                                    struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
+                                    struct spoolss_UserLevelCtr *userlevel_ctr /* [in] [ref] */,
+                                    struct policy_handle *handle /* [out] [ref] */,
+                                    WERROR *werror)
+{
+       struct spoolss_AddPrinterEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server = server;
+       r.in.info_ctr = info_ctr;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.secdesc_ctr = secdesc_ctr;
+       r.in.userlevel_ctr = userlevel_ctr;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ADDPRINTEREX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_47_state {
+       struct spoolss_47 orig;
+       struct spoolss_47 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_47_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_47_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_47_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_47_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_47, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_47,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_47_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_47_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_47_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_47_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_47, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_47_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_47_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_47_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_spoolss_47(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
+{
+       struct spoolss_47 r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_47, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_47,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_EnumPrinterData_state {
+       struct spoolss_EnumPrinterData orig;
+       struct spoolss_EnumPrinterData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrinterData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrinterData_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      uint32_t _enum_index /* [in]  */,
+                                                      const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
+                                                      uint32_t _value_offered /* [in]  */,
+                                                      uint32_t *_value_needed /* [out] [ref] */,
+                                                      enum winreg_Type *_type /* [out] [ref] */,
+                                                      uint8_t *_data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
+                                                      uint32_t _data_offered /* [in]  */,
+                                                      uint32_t *_data_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrinterData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrinterData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.enum_index = _enum_index;
+       state->orig.in.value_offered = _value_offered;
+       state->orig.in.data_offered = _data_offered;
+
+       /* Out parameters */
+       state->orig.out.value_name = _value_name;
+       state->orig.out.value_needed = _value_needed;
+       state->orig.out.type = _type;
+       state->orig.out.data = _data;
+       state->orig.out.data_needed = _data_needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrinterData_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTERDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterData_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrinterData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterData_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 */
+       memcpy(CONST_DISCARD(char *, state->orig.out.value_name), state->tmp.out.value_name, state->tmp.in.value_offered / 2 * sizeof(*state->orig.out.value_name));
+       *state->orig.out.value_needed = *state->tmp.out.value_needed;
+       *state->orig.out.type = *state->tmp.out.type;
+       memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.data_offered * sizeof(*state->orig.out.data));
+       *state->orig.out.data_needed = *state->tmp.out.data_needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinterData_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterData_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_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       uint32_t enum_index /* [in]  */,
+                                       const char *value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
+                                       uint32_t value_offered /* [in]  */,
+                                       uint32_t *value_needed /* [out] [ref] */,
+                                       enum winreg_Type *type /* [out] [ref] */,
+                                       uint8_t *data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
+                                       uint32_t data_offered /* [in]  */,
+                                       uint32_t *data_needed /* [out] [ref] */,
+                                       WERROR *werror)
+{
+       struct spoolss_EnumPrinterData r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.enum_index = enum_index;
+       r.in.value_offered = value_offered;
+       r.in.data_offered = data_offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTERDATA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
+       *value_needed = *r.out.value_needed;
+       *type = *r.out.type;
+       memcpy(data, r.out.data, r.in.data_offered * sizeof(*data));
+       *data_needed = *r.out.data_needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_DeletePrinterData_state {
+       struct spoolss_DeletePrinterData orig;
+       struct spoolss_DeletePrinterData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterData_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_value_name /* [in] [charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.value_name = _value_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterData_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrinterData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterData_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterData_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinterData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterData_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_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in] [ref] */,
+                                         const char *value_name /* [in] [charset(UTF16)] */,
+                                         WERROR *werror)
+{
+       struct spoolss_DeletePrinterData r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.value_name = value_name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_DELETEPRINTERDATA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_4a_state {
+       struct spoolss_4a orig;
+       struct spoolss_4a tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_4a_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_4a_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_4a_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_4a_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_4a, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_4A,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_4a_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_4a_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_4a_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_4a_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_4a, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_4a_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_4a_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_4a_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_spoolss_4a(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
+{
+       struct spoolss_4a r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_4a, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_4A,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_4a, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_4b_state {
+       struct spoolss_4b orig;
+       struct spoolss_4b tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_4b_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_4b_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_4b_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_4b_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_4b, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_4B,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_4b_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_4b_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_4b_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_4b_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_4b, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_4b_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_4b_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_4b_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_spoolss_4b(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
+{
+       struct spoolss_4b r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_4b, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_4B,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_4b, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_4c_state {
+       struct spoolss_4c orig;
+       struct spoolss_4c tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_4c_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_4c_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_4c_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_4c_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_4c, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_4C,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_4c_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_4c_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_4c_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_4c_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_4c, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_4c_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_4c_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_4c_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_spoolss_4c(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
+{
+       struct spoolss_4c r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_4c, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_4C,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_4c, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_SetPrinterDataEx_state {
+       struct spoolss_SetPrinterDataEx orig;
+       struct spoolss_SetPrinterDataEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_key_name /* [in] [charset(UTF16)] */,
+                                                       const char *_value_name /* [in] [charset(UTF16)] */,
+                                                       enum winreg_Type _type /* [in]  */,
+                                                       uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
+                                                       uint32_t _offered /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_SetPrinterDataEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_SetPrinterDataEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.key_name = _key_name;
+       state->orig.in.value_name = _value_name;
+       state->orig.in.type = _type;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_SETPRINTERDATAEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_SetPrinterDataEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_SetPrinterDataEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetPrinterDataEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinterDataEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_SetPrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_SetPrinterDataEx_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_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        const char *key_name /* [in] [charset(UTF16)] */,
+                                        const char *value_name /* [in] [charset(UTF16)] */,
+                                        enum winreg_Type type /* [in]  */,
+                                        uint8_t *buffer /* [in] [ref,size_is(offered)] */,
+                                        uint32_t offered /* [in]  */,
+                                        WERROR *werror)
+{
+       struct spoolss_SetPrinterDataEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.key_name = key_name;
+       r.in.value_name = value_name;
+       r.in.type = type;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_SETPRINTERDATAEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3109,35 +13101,531 @@ NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
-                                                            TALLOC_CTX *mem_ctx,
-                                                            struct policy_handle *handle /* [in] [ref] */,
-                                                            uint32_t flags /* [in]  */,
-                                                            uint32_t options /* [in]  */,
-                                                            const char *local_machine /* [in] [unique,charset(UTF16)] */,
-                                                            uint32_t printer_local /* [in]  */,
-                                                            struct spoolss_NotifyOption *notify_options /* [in] [unique] */,
-                                                            WERROR *werror)
+struct rpccli_spoolss_GetPrinterDataEx_state {
+       struct spoolss_GetPrinterDataEx orig;
+       struct spoolss_GetPrinterDataEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_key_name /* [in] [charset(UTF16)] */,
+                                                       const char *_value_name /* [in] [charset(UTF16)] */,
+                                                       enum winreg_Type *_type /* [out] [ref] */,
+                                                       uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                       uint32_t _offered /* [in]  */,
+                                                       uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_GetPrinterDataEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_GetPrinterDataEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.key_name = _key_name;
+       state->orig.in.value_name = _value_name;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.type = _type;
+       state->orig.out.buffer = _buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_GetPrinterDataEx_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_spoolss,
+                                   NDR_SPOOLSS_GETPRINTERDATAEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_GetPrinterDataEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_GetPrinterDataEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDataEx_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.type = *state->tmp.out.type;
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDataEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_GetPrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_GetPrinterDataEx_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_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        const char *key_name /* [in] [charset(UTF16)] */,
+                                        const char *value_name /* [in] [charset(UTF16)] */,
+                                        enum winreg_Type *type /* [out] [ref] */,
+                                        uint8_t *buffer /* [out] [ref,size_is(offered)] */,
+                                        uint32_t offered /* [in]  */,
+                                        uint32_t *needed /* [out] [ref] */,
+                                        WERROR *werror)
+{
+       struct spoolss_GetPrinterDataEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.key_name = key_name;
+       r.in.value_name = value_name;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_GETPRINTERDATAEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *type = *r.out.type;
+       memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
+       *needed = *r.out.needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_EnumPrinterDataEx_state {
+       struct spoolss_EnumPrinterDataEx orig;
+       struct spoolss_EnumPrinterDataEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_key_name /* [in] [charset(UTF16)] */,
+                                                        uint32_t _offered /* [in]  */,
+                                                        uint32_t *_count /* [out] [ref] */,
+                                                        struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
+                                                        uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrinterDataEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrinterDataEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.key_name = _key_name;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.count = _count;
+       state->orig.out.info = _info;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrinterDataEx_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTERDATAEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterDataEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrinterDataEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterDataEx_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.count = *state->tmp.out.count;
+       *state->orig.out.info = *state->tmp.out.info;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinterDataEx_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterDataEx_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_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in] [ref] */,
+                                         const char *key_name /* [in] [charset(UTF16)] */,
+                                         uint32_t offered /* [in]  */,
+                                         uint32_t *count /* [out] [ref] */,
+                                         struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */,
+                                         uint32_t *needed /* [out] [ref] */,
+                                         WERROR *werror)
+{
+       struct spoolss_EnumPrinterDataEx r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.key_name = key_name;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_spoolss,
+                               NDR_SPOOLSS_ENUMPRINTERDATAEX,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *count = *r.out.count;
+       *info = *r.out.info;
+       *needed = *r.out.needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_spoolss_EnumPrinterKey_state {
+       struct spoolss_EnumPrinterKey orig;
+       struct spoolss_EnumPrinterKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_EnumPrinterKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_EnumPrinterKey_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     const char *_key_name /* [in] [charset(UTF16)] */,
+                                                     const char ** *_key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
+                                                     uint32_t _offered /* [in]  */,
+                                                     uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_spoolss_EnumPrinterKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_EnumPrinterKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.key_name = _key_name;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.key_buffer = _key_buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_EnumPrinterKey_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_spoolss,
+                                   NDR_SPOOLSS_ENUMPRINTERKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_EnumPrinterKey_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_EnumPrinterKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_EnumPrinterKey_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterKey_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.key_buffer = *state->tmp.out.key_buffer;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinterKey_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_spoolss_EnumPrinterKey_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_EnumPrinterKey_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_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle /* [in] [ref] */,
+                                      const char *key_name /* [in] [charset(UTF16)] */,
+                                      const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
+                                      uint32_t offered /* [in]  */,
+                                      uint32_t *needed /* [out] [ref] */,
+                                      WERROR *werror)
 {
-       struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
+       struct spoolss_EnumPrinterKey r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.flags = flags;
-       r.in.options = options;
-       r.in.local_machine = local_machine;
-       r.in.printer_local = printer_local;
-       r.in.notify_options = notify_options;
+       r.in.key_name = key_name;
+       r.in.offered = offered;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
+                               NDR_SPOOLSS_ENUMPRINTERKEY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3145,7 +13633,7 @@ NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_cli
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3153,6 +13641,8 @@ NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_cli
        }
 
        /* Return variables */
+       *key_buffer = *r.out.key_buffer;
+       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -3162,83 +13652,145 @@ NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_cli
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            struct policy_handle *handle /* [in] [ref] */,
-                                            uint32_t color /* [in]  */,
-                                            uint32_t flags /* [in]  */,
-                                            uint32_t *reply_result /* [out] [ref] */,
-                                            uint32_t reply_type /* [in]  */,
-                                            union spoolss_ReplyPrinterInfo info /* [in] [switch_is(reply_type)] */,
-                                            WERROR *werror)
+struct rpccli_spoolss_DeletePrinterDataEx_state {
+       struct spoolss_DeletePrinterDataEx orig;
+       struct spoolss_DeletePrinterDataEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          const char *_key_name /* [in] [charset(UTF16)] */,
+                                                          const char *_value_name /* [in] [charset(UTF16)] */)
 {
-       struct spoolss_RouterReplyPrinterEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterDataEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterDataEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.color = color;
-       r.in.flags = flags;
-       r.in.reply_type = reply_type;
-       r.in.info = info;
+       state->orig.in.handle = _handle;
+       state->orig.in.key_name = _key_name;
+       state->orig.in.value_name = _value_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERDATAEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterDataEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrinterDataEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterDataEx_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterDataEx_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinterDataEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterDataEx_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *reply_result = *r.out.reply_result;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client *cli,
-                                                        TALLOC_CTX *mem_ctx,
-                                                        struct policy_handle *handle /* [in] [ref] */,
-                                                        uint32_t change_low /* [in]  */,
-                                                        struct spoolss_NotifyOption *options /* [in] [unique] */,
-                                                        struct spoolss_NotifyInfo **info /* [out] [ref] */,
-                                                        WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           struct policy_handle *handle /* [in] [ref] */,
+                                           const char *key_name /* [in] [charset(UTF16)] */,
+                                           const char *value_name /* [in] [charset(UTF16)] */,
+                                           WERROR *werror)
 {
-       struct spoolss_RouterRefreshPrinterChangeNotify r;
+       struct spoolss_DeletePrinterDataEx r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.change_low = change_low;
-       r.in.options = options;
+       r.in.key_name = key_name;
+       r.in.value_name = value_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY,
+                               NDR_SPOOLSS_DELETEPRINTERDATAEX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3246,7 +13798,7 @@ NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3254,7 +13806,6 @@ NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        if (werror) {
@@ -3264,77 +13815,141 @@ NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_DeletePrinterKey_state {
+       struct spoolss_DeletePrinterKey orig;
+       struct spoolss_DeletePrinterKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterKey_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_key_name /* [in] [charset(UTF16)] */)
 {
-       struct spoolss_44 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.key_name = _key_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_44, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_44,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterKey_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrinterKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterKey_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterKey_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterKey_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinterKey_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterKey_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     const char *printername /* [in] [unique,charset(UTF16)] */,
-                                     const char *datatype /* [in] [unique,charset(UTF16)] */,
-                                     struct spoolss_DevmodeContainer devmode_ctr /* [in]  */,
-                                     uint32_t access_mask /* [in]  */,
-                                     uint32_t level /* [in]  */,
-                                     union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
-                                     struct policy_handle *handle /* [out] [ref] */,
-                                     WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        const char *key_name /* [in] [charset(UTF16)] */,
+                                        WERROR *werror)
 {
-       struct spoolss_OpenPrinterEx r;
+       struct spoolss_DeletePrinterKey r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.printername = printername;
-       r.in.datatype = datatype;
-       r.in.devmode_ctr = devmode_ctr;
-       r.in.access_mask = access_mask;
-       r.in.level = level;
-       r.in.userlevel = userlevel;
+       r.in.handle = handle;
+       r.in.key_name = key_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_OPENPRINTEREX,
+                               NDR_SPOOLSS_DELETEPRINTERKEY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3342,7 +13957,7 @@ NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3350,7 +13965,6 @@ NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *handle = *r.out.handle;
 
        /* Return result */
        if (werror) {
@@ -3360,76 +13974,133 @@ NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    const char *server /* [in] [unique,charset(UTF16)] */,
-                                    struct spoolss_SetPrinterInfoCtr *info_ctr /* [in] [ref] */,
-                                    struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
-                                    struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
-                                    struct spoolss_UserLevelCtr *userlevel_ctr /* [in] [ref] */,
-                                    struct policy_handle *handle /* [out] [ref] */,
-                                    WERROR *werror)
+struct rpccli_spoolss_53_state {
+       struct spoolss_53 orig;
+       struct spoolss_53 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_53_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_53_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_AddPrinterEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_53_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_53_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server = server;
-       r.in.info_ctr = info_ctr;
-       r.in.devmode_ctr = devmode_ctr;
-       r.in.secdesc_ctr = secdesc_ctr;
-       r.in.userlevel_ctr = userlevel_ctr;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_53, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDPRINTEREX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_53,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_53_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_53_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_53_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_53_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_53, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_53_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_53_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_53_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *handle = *r.out.handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
 {
-       struct spoolss_47 r;
+       struct spoolss_53 r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_47, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_53, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_47,
+                               NDR_SPOOLSS_53,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3437,7 +14108,7 @@ NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_53, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3454,86 +14125,153 @@ NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       struct policy_handle *handle /* [in] [ref] */,
-                                       uint32_t enum_index /* [in]  */,
-                                       const char *value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
-                                       uint32_t value_offered /* [in]  */,
-                                       uint32_t *value_needed /* [out] [ref] */,
-                                       enum winreg_Type *type /* [out] [ref] */,
-                                       uint8_t *data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
-                                       uint32_t data_offered /* [in]  */,
-                                       uint32_t *data_needed /* [out] [ref] */,
-                                       WERROR *werror)
+struct rpccli_spoolss_DeletePrinterDriverEx_state {
+       struct spoolss_DeletePrinterDriverEx orig;
+       struct spoolss_DeletePrinterDriverEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_DeletePrinterDriverEx_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                            const char *_architecture /* [in] [charset(UTF16)] */,
+                                                            const char *_driver /* [in] [charset(UTF16)] */,
+                                                            uint32_t _delete_flags /* [in]  */,
+                                                            uint32_t _version /* [in]  */)
 {
-       struct spoolss_EnumPrinterData r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_DeletePrinterDriverEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_DeletePrinterDriverEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.enum_index = enum_index;
-       r.in.value_offered = value_offered;
-       r.in.data_offered = data_offered;
+       state->orig.in.server = _server;
+       state->orig.in.architecture = _architecture;
+       state->orig.in.driver = _driver;
+       state->orig.in.delete_flags = _delete_flags;
+       state->orig.in.version = _version;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterData, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ENUMPRINTERDATA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_DeletePrinterDriverEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_DeletePrinterDriverEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterDriverEx_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterData, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterDriverEx_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_spoolss_DeletePrinterDriverEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_DeletePrinterDriverEx_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name));
-       *value_needed = *r.out.value_needed;
-       *type = *r.out.type;
-       memcpy(data, r.out.data, r.in.data_offered * sizeof(*data));
-       *data_needed = *r.out.data_needed;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *handle /* [in] [ref] */,
-                                         const char *value_name /* [in] [charset(UTF16)] */,
-                                         WERROR *werror)
+NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             const char *server /* [in] [unique,charset(UTF16)] */,
+                                             const char *architecture /* [in] [charset(UTF16)] */,
+                                             const char *driver /* [in] [charset(UTF16)] */,
+                                             uint32_t delete_flags /* [in]  */,
+                                             uint32_t version /* [in]  */,
+                                             WERROR *werror)
 {
-       struct spoolss_DeletePrinterData r;
+       struct spoolss_DeletePrinterDriverEx r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.value_name = value_name;
+       r.in.server = server;
+       r.in.architecture = architecture;
+       r.in.driver = driver;
+       r.in.delete_flags = delete_flags;
+       r.in.version = version;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterData, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTERDATA,
+                               NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3541,7 +14279,7 @@ NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterData, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3558,64 +14296,133 @@ NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_4a(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_55_state {
+       struct spoolss_55 orig;
+       struct spoolss_55 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_55_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_55_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_4a r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_55_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_55_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_4a, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_55, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_4A,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_55,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_55_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_55_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_55_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_55_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_4a, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_55, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_55_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_55_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_55_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
 {
-       struct spoolss_4b r;
+       struct spoolss_55 r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_4b, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_55, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_4B,
+                               NDR_SPOOLSS_55,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3623,7 +14430,7 @@ NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_4b, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_55, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3640,76 +14447,133 @@ NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_4c(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_56_state {
+       struct spoolss_56 orig;
+       struct spoolss_56 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_56_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_56_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_4c r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_56_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_56_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_4c, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_56, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_4C,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_56,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_56_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_56_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_56_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_56_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_4c, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_56, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_56_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_56_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_56_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        const char *key_name /* [in] [charset(UTF16)] */,
-                                        const char *value_name /* [in] [charset(UTF16)] */,
-                                        enum winreg_Type type /* [in]  */,
-                                        uint8_t *buffer /* [in] [ref,size_is(offered)] */,
-                                        uint32_t offered /* [in]  */,
-                                        WERROR *werror)
+NTSTATUS rpccli_spoolss_56(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
 {
-       struct spoolss_SetPrinterDataEx r;
+       struct spoolss_56 r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.key_name = key_name;
-       r.in.value_name = value_name;
-       r.in.type = type;
-       r.in.buffer = buffer;
-       r.in.offered = offered;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_SetPrinterDataEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_56, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_SETPRINTERDATAEX,
+                               NDR_SPOOLSS_56,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3717,7 +14581,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterDataEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_56, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3734,87 +14598,133 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        const char *key_name /* [in] [charset(UTF16)] */,
-                                        const char *value_name /* [in] [charset(UTF16)] */,
-                                        enum winreg_Type *type /* [out] [ref] */,
-                                        uint8_t *buffer /* [out] [ref,size_is(offered)] */,
-                                        uint32_t offered /* [in]  */,
-                                        uint32_t *needed /* [out] [ref] */,
-                                        WERROR *werror)
+struct rpccli_spoolss_57_state {
+       struct spoolss_57 orig;
+       struct spoolss_57 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_57_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_57_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_GetPrinterDataEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_57_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_57_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.key_name = key_name;
-       r.in.value_name = value_name;
-       r.in.offered = offered;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDataEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_57, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_GETPRINTERDATAEX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_57,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, rpccli_spoolss_57_done, req);
+       return req;
+}
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDataEx, &r);
+static void rpccli_spoolss_57_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_57_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_57_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       /* Return variables */
-       *type = *r.out.type;
-       memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
-       *needed = *r.out.needed;
+       /* Copy out parameters */
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_57, &state->orig);
        }
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_done(req);
 }
 
-NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *handle /* [in] [ref] */,
-                                         const char *key_name /* [in] [charset(UTF16)] */,
-                                         uint32_t offered /* [in]  */,
-                                         uint32_t *count /* [out] [ref] */,
-                                         struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */,
-                                         uint32_t *needed /* [out] [ref] */,
-                                         WERROR *werror)
+NTSTATUS rpccli_spoolss_57_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_57_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_57_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_spoolss_57(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
 {
-       struct spoolss_EnumPrinterDataEx r;
+       struct spoolss_57 r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.key_name = key_name;
-       r.in.offered = offered;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDataEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_57, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_ENUMPRINTERDATAEX,
+                               NDR_SPOOLSS_57,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3822,7 +14732,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDataEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_57, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3830,9 +14740,6 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *count = *r.out.count;
-       *info = *r.out.info;
-       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -3842,80 +14749,173 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      struct policy_handle *handle /* [in] [ref] */,
-                                      const char *key_name /* [in] [charset(UTF16)] */,
-                                      const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
-                                      uint32_t offered /* [in]  */,
-                                      uint32_t *needed /* [out] [ref] */,
-                                      WERROR *werror)
+struct rpccli_spoolss_XcvData_state {
+       struct spoolss_XcvData orig;
+       struct spoolss_XcvData tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_XcvData_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_XcvData_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              const char *_function_name /* [in] [charset(UTF16)] */,
+                                              DATA_BLOB _in_data /* [in]  */,
+                                              uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
+                                              uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
+                                              uint32_t _out_data_size /* [in]  */,
+                                              uint32_t *_needed /* [out] [ref] */,
+                                              uint32_t *_status_code /* [in,out] [ref] */)
 {
-       struct spoolss_EnumPrinterKey r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_XcvData_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_XcvData_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.key_name = key_name;
-       r.in.offered = offered;
+       state->orig.in.handle = _handle;
+       state->orig.in.function_name = _function_name;
+       state->orig.in.in_data = _in_data;
+       state->orig.in._in_data_length = __in_data_length;
+       state->orig.in.out_data_size = _out_data_size;
+       state->orig.in.status_code = _status_code;
+
+       /* Out parameters */
+       state->orig.out.out_data = _out_data;
+       state->orig.out.needed = _needed;
+       state->orig.out.status_code = _status_code;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_XcvData, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_ENUMPRINTERKEY,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_spoolss_XcvData_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_spoolss,
+                                   NDR_SPOOLSS_XCVDATA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_XcvData_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_XcvData_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_XcvData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_XcvData_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       memcpy(state->orig.out.out_data, state->tmp.out.out_data, state->tmp.in.out_data_size * sizeof(*state->orig.out.out_data));
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.status_code = *state->tmp.out.status_code;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterKey, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_XcvData_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_spoolss_XcvData_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_XcvData_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *key_buffer = *r.out.key_buffer;
-       *needed = *r.out.needed;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           struct policy_handle *handle /* [in] [ref] */,
-                                           const char *key_name /* [in] [charset(UTF16)] */,
-                                           const char *value_name /* [in] [charset(UTF16)] */,
-                                           WERROR *werror)
+NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               const char *function_name /* [in] [charset(UTF16)] */,
+                               DATA_BLOB in_data /* [in]  */,
+                               uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
+                               uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
+                               uint32_t out_data_size /* [in]  */,
+                               uint32_t *needed /* [out] [ref] */,
+                               uint32_t *status_code /* [in,out] [ref] */,
+                               WERROR *werror)
 {
-       struct spoolss_DeletePrinterDataEx r;
+       struct spoolss_XcvData r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
-       r.in.key_name = key_name;
-       r.in.value_name = value_name;
+       r.in.function_name = function_name;
+       r.in.in_data = in_data;
+       r.in._in_data_length = _in_data_length;
+       r.in.out_data_size = out_data_size;
+       r.in.status_code = status_code;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDataEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTERDATAEX,
+                               NDR_SPOOLSS_XCVDATA,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -3923,7 +14923,7 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDataEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -3931,6 +14931,9 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
+       *needed = *r.out.needed;
+       *status_code = *r.out.status_code;
 
        /* Return result */
        if (werror) {
@@ -3940,68 +14943,145 @@ NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        const char *key_name /* [in] [charset(UTF16)] */,
-                                        WERROR *werror)
+struct rpccli_spoolss_AddPrinterDriverEx_state {
+       struct spoolss_AddPrinterDriverEx orig;
+       struct spoolss_AddPrinterDriverEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_AddPrinterDriverEx_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                         struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
+                                                         uint32_t _flags /* [in]  */)
 {
-       struct spoolss_DeletePrinterKey r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_AddPrinterDriverEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_AddPrinterDriverEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.key_name = key_name;
+       state->orig.in.servername = _servername;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterKey, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTERKEY,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_ADDPRINTERDRIVEREX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_AddPrinterDriverEx_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_AddPrinterDriverEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterDriverEx_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterKey, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterDriverEx_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_spoolss_AddPrinterDriverEx_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_AddPrinterDriverEx_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          const char *servername /* [in] [unique,charset(UTF16)] */,
+                                          struct spoolss_AddDriverInfoCtr *info_ctr /* [in] [ref] */,
+                                          uint32_t flags /* [in]  */,
+                                          WERROR *werror)
 {
-       struct spoolss_53 r;
+       struct spoolss_AddPrinterDriverEx r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.servername = servername;
+       r.in.info_ctr = info_ctr;
+       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_53, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_53,
+                               NDR_SPOOLSS_ADDPRINTERDRIVEREX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -4009,7 +15089,7 @@ NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_53, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -4026,74 +15106,133 @@ NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             const char *server /* [in] [unique,charset(UTF16)] */,
-                                             const char *architecture /* [in] [charset(UTF16)] */,
-                                             const char *driver /* [in] [charset(UTF16)] */,
-                                             uint32_t delete_flags /* [in]  */,
-                                             uint32_t version /* [in]  */,
-                                             WERROR *werror)
+struct rpccli_spoolss_5a_state {
+       struct spoolss_5a orig;
+       struct spoolss_5a tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_5a_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_5a_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_DeletePrinterDriverEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_5a_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_5a_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server = server;
-       r.in.architecture = architecture;
-       r.in.driver = driver;
-       r.in.delete_flags = delete_flags;
-       r.in.version = version;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriverEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5a, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_DELETEPRINTERDRIVEREX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_5A,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_5a_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_5a_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_5a_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5a_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriverEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5a, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_5a_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_5a_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5a_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_5a(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
 {
-       struct spoolss_55 r;
+       struct spoolss_5a r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_55, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5a, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_55,
+                               NDR_SPOOLSS_5A,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -4101,7 +15240,7 @@ NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_55, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5a, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -4118,64 +15257,133 @@ NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_56(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_5b_state {
+       struct spoolss_5b orig;
+       struct spoolss_5b tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_5b_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_5b_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_56 r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_5b_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_5b_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_56, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5b, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_56,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_5B,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_5b_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_5b_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_5b_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5b_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_56, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5b, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_5b_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_5b_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5b_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
 {
-       struct spoolss_57 r;
+       struct spoolss_5b r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_57, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5b, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_57,
+                               NDR_SPOOLSS_5B,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -4183,7 +15391,7 @@ NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_57, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5b, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -4200,87 +15408,133 @@ NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in] [ref] */,
-                               const char *function_name /* [in] [charset(UTF16)] */,
-                               DATA_BLOB in_data /* [in]  */,
-                               uint32_t _in_data_length /* [in] [value(r->in.in_data.length)] */,
-                               uint8_t *out_data /* [out] [ref,size_is(out_data_size)] */,
-                               uint32_t out_data_size /* [in]  */,
-                               uint32_t *needed /* [out] [ref] */,
-                               uint32_t *status_code /* [in,out] [ref] */,
-                               WERROR *werror)
+struct rpccli_spoolss_5c_state {
+       struct spoolss_5c orig;
+       struct spoolss_5c tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_5c_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_5c_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_XcvData r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_5c_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_5c_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.function_name = function_name;
-       r.in.in_data = in_data;
-       r.in._in_data_length = _in_data_length;
-       r.in.out_data_size = out_data_size;
-       r.in.status_code = status_code;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_XcvData, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5c, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_XCVDATA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_5C,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_5c_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_5c_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_5c_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5c_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_XcvData, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5c, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_5c_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_5c_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5c_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       memcpy(out_data, r.out.out_data, r.in.out_data_size * sizeof(*out_data));
-       *needed = *r.out.needed;
-       *status_code = *r.out.status_code;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          const char *servername /* [in] [unique,charset(UTF16)] */,
-                                          struct spoolss_AddDriverInfoCtr *info_ctr /* [in] [ref] */,
-                                          uint32_t flags /* [in]  */,
-                                          WERROR *werror)
+NTSTATUS rpccli_spoolss_5c(struct rpc_pipe_client *cli,
+                          TALLOC_CTX *mem_ctx,
+                          WERROR *werror)
 {
-       struct spoolss_AddPrinterDriverEx r;
+       struct spoolss_5c r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.servername = servername;
-       r.in.info_ctr = info_ctr;
-       r.in.flags = flags;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriverEx, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5c, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_ADDPRINTERDRIVEREX,
+                               NDR_SPOOLSS_5C,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -4288,7 +15542,7 @@ NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriverEx, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5c, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -4305,64 +15559,133 @@ NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_5a(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_5d_state {
+       struct spoolss_5d orig;
+       struct spoolss_5d tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_5d_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_5d_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_5a r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_5d_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_5d_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_5a, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5d, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_5A,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_5D,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_5d_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_5d_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_5d_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5d_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_5a, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5d, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_5d_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_5d_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5d_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
 {
-       struct spoolss_5b r;
+       struct spoolss_5d r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_5b, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5d, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_5B,
+                               NDR_SPOOLSS_5D,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -4370,7 +15693,7 @@ NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_5b, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5d, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -4387,64 +15710,133 @@ NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_5c(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_5e_state {
+       struct spoolss_5e orig;
+       struct spoolss_5e tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_5e_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_5e_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_5c r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_5e_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_5e_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_5c, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5e, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_5C,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_5E,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_5e_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_5e_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_5e_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5e_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_5c, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5e, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_5e_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_5e_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5e_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_spoolss_5e(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror)
 {
-       struct spoolss_5d r;
+       struct spoolss_5e r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_5d, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5e, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_spoolss,
-                               NDR_SPOOLSS_5D,
+                               NDR_SPOOLSS_5E,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -4452,7 +15844,7 @@ NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_5d, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5e, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -4469,45 +15861,114 @@ NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_spoolss_5e(struct rpc_pipe_client *cli,
-                          TALLOC_CTX *mem_ctx,
-                          WERROR *werror)
+struct rpccli_spoolss_5f_state {
+       struct spoolss_5f orig;
+       struct spoolss_5f tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_spoolss_5f_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_spoolss_5f_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli)
 {
-       struct spoolss_5e r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_spoolss_5f_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_spoolss_5f_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_5e, &r);
+               NDR_PRINT_IN_DEBUG(spoolss_5f, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_spoolss,
-                               NDR_SPOOLSS_5E,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_spoolss,
+                                   NDR_SPOOLSS_5F,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_spoolss_5f_done, req);
+       return req;
+}
+
+static void rpccli_spoolss_5f_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_spoolss_5f_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5f_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_5e, &r);
+               NDR_PRINT_OUT_DEBUG(spoolss_5f, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_spoolss_5f_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result)
+{
+       struct rpccli_spoolss_5f_state *state = tevent_req_data(
+               req, struct rpccli_spoolss_5f_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_spoolss_5f(struct rpc_pipe_client *cli,
index b171c69fbd8aa1c4745b5ef8615d3ac2a2059015..abecaef56b9485d9202532f649939a8c1b84db96 100644 (file)
@@ -1,6 +1,20 @@
 #include "../librpc/gen_ndr/ndr_spoolss.h"
 #ifndef __CLI_SPOOLSS__
 #define __CLI_SPOOLSS__
+struct tevent_req *rpccli_spoolss_EnumPrinters_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   uint32_t _flags /* [in]  */,
+                                                   const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   DATA_BLOB *_buffer /* [in] [unique] */,
+                                                   uint32_t _offered /* [in]  */,
+                                                   uint32_t *_count /* [out] [ref] */,
+                                                   union spoolss_PrinterInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                   uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrinters_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     uint32_t flags /* [in]  */,
@@ -12,6 +26,17 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
                                     union spoolss_PrinterInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                     uint32_t *needed /* [out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_OpenPrinter_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_printername /* [in] [unique,charset(UTF16)] */,
+                                                  const char *_datatype /* [in] [unique,charset(UTF16)] */,
+                                                  struct spoolss_DevmodeContainer _devmode_ctr /* [in]  */,
+                                                  uint32_t _access_mask /* [in]  */,
+                                                  struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_OpenPrinter_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *printername /* [in] [unique,charset(UTF16)] */,
@@ -20,6 +45,16 @@ NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
                                    uint32_t access_mask /* [in]  */,
                                    struct policy_handle *handle /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_spoolss_SetJob_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _job_id /* [in]  */,
+                                             struct spoolss_JobInfoContainer *_ctr /* [in] [unique] */,
+                                             enum spoolss_JobControl _command /* [in]  */);
+NTSTATUS rpccli_spoolss_SetJob_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -27,6 +62,19 @@ NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
                               struct spoolss_JobInfoContainer *ctr /* [in] [unique] */,
                               enum spoolss_JobControl command /* [in]  */,
                               WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetJob_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _job_id /* [in]  */,
+                                             uint32_t _level /* [in]  */,
+                                             DATA_BLOB *_buffer /* [in] [unique] */,
+                                             uint32_t _offered /* [in]  */,
+                                             union spoolss_JobInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                             uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetJob_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -37,6 +85,21 @@ NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
                               union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
                               uint32_t *needed /* [out] [ref] */,
                               WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumJobs_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _firstjob /* [in]  */,
+                                               uint32_t _numjobs /* [in]  */,
+                                               uint32_t _level /* [in]  */,
+                                               DATA_BLOB *_buffer /* [in] [unique] */,
+                                               uint32_t _offered /* [in]  */,
+                                               uint32_t *_count /* [out] [ref] */,
+                                               union spoolss_JobInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                               uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumJobs_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -49,6 +112,17 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
                                 union spoolss_JobInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                 uint32_t *needed /* [out] [ref] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrinter_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
+                                                 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
+                                                 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
+                                                 struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_AddPrinter_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server /* [in] [unique,charset(UTF16)] */,
@@ -57,10 +131,28 @@ NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
                                   struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
                                   struct policy_handle *handle /* [out] [ref] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinter_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_DeletePrinter_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_spoolss_SetPrinter_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
+                                                 struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
+                                                 struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
+                                                 enum spoolss_PrinterControl _command /* [in]  */);
+NTSTATUS rpccli_spoolss_SetPrinter_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -69,6 +161,18 @@ NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
                                   struct sec_desc_buf *secdesc_ctr /* [in] [ref] */,
                                   enum spoolss_PrinterControl command /* [in]  */,
                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrinter_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 uint32_t _level /* [in]  */,
+                                                 DATA_BLOB *_buffer /* [in] [unique] */,
+                                                 uint32_t _offered /* [in]  */,
+                                                 union spoolss_PrinterInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                 uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrinter_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -78,11 +182,33 @@ NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
                                   union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
                                   uint32_t *needed /* [out] [ref] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrinterDriver_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                       struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_AddPrinterDriver_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *servername /* [in] [unique,charset(UTF16)] */,
                                         struct spoolss_AddDriverInfoCtr *info_ctr /* [in] [ref] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPrinterDrivers_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                         const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                         uint32_t _level /* [in]  */,
+                                                         DATA_BLOB *_buffer /* [in] [unique] */,
+                                                         uint32_t _offered /* [in]  */,
+                                                         uint32_t *_count /* [out] [ref] */,
+                                                         union spoolss_DriverInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                         uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrinterDrivers_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *server /* [in] [unique,charset(UTF16)] */,
@@ -94,6 +220,19 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
                                           union spoolss_DriverInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                           uint32_t *needed /* [out] [ref] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrinterDriver_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_architecture /* [in] [unique,charset(UTF16)] */,
+                                                       uint32_t _level /* [in]  */,
+                                                       DATA_BLOB *_buffer /* [in] [unique] */,
+                                                       uint32_t _offered /* [in]  */,
+                                                       union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                       uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrinterDriver_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -104,6 +243,19 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
                                         union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
                                         uint32_t *needed /* [out] [ref] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrinterDriverDirectory_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                                uint32_t _level /* [in]  */,
+                                                                DATA_BLOB *_buffer /* [in] [unique] */,
+                                                                uint32_t _offered /* [in]  */,
+                                                                union spoolss_DriverDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                                uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server /* [in] [unique,charset(UTF16)] */,
@@ -114,12 +266,31 @@ NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
                                                  union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
                                                  uint32_t *needed /* [out] [ref] */,
                                                  WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterDriver_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_architecture /* [in] [charset(UTF16)] */,
+                                                          const char *_driver /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_DeletePrinterDriver_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server /* [in] [unique,charset(UTF16)] */,
                                            const char *architecture /* [in] [charset(UTF16)] */,
                                            const char *driver /* [in] [charset(UTF16)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrintProcessor_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_architecture /* [in] [charset(UTF16)] */,
+                                                        const char *_path_name /* [in] [charset(UTF16)] */,
+                                                        const char *_print_processor_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_AddPrintProcessor_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server /* [in] [unique,charset(UTF16)] */,
@@ -127,6 +298,20 @@ NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
                                          const char *path_name /* [in] [charset(UTF16)] */,
                                          const char *print_processor_name /* [in] [charset(UTF16)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPrintProcessors_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _level /* [in]  */,
+                                                          DATA_BLOB *_buffer /* [in] [unique] */,
+                                                          uint32_t _offered /* [in]  */,
+                                                          uint32_t *_count /* [out] [ref] */,
+                                                          union spoolss_PrintProcessorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                          uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrintProcessors_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *servername /* [in] [unique,charset(UTF16)] */,
@@ -138,6 +323,19 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
                                            union spoolss_PrintProcessorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                            uint32_t *needed /* [out] [ref] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrintProcessorDirectory_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli,
+                                                                 const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                                 const char *_environment /* [in] [unique,charset(UTF16)] */,
+                                                                 uint32_t _level /* [in]  */,
+                                                                 DATA_BLOB *_buffer /* [in] [unique] */,
+                                                                 uint32_t _offered /* [in]  */,
+                                                                 union spoolss_PrintProcessorDirectoryInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                                 uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   const char *server /* [in] [unique,charset(UTF16)] */,
@@ -148,6 +346,16 @@ NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
                                                   union spoolss_PrintProcessorDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
                                                   uint32_t *needed /* [out] [ref] */,
                                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_StartDocPrinter_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      uint32_t _level /* [in]  */,
+                                                      union spoolss_DocumentInfo _info /* [in] [switch_is(level)] */,
+                                                      uint32_t *_job_id /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_StartDocPrinter_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
@@ -155,10 +363,27 @@ NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
                                        union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
                                        uint32_t *job_id /* [out] [ref] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_spoolss_StartPagePrinter_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_StartPagePrinter_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_WritePrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   DATA_BLOB _data /* [in]  */,
+                                                   uint32_t __data_size /* [in] [value(r->in.data.length)] */,
+                                                   uint32_t *_num_written /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_WritePrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
@@ -166,14 +391,38 @@ NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
                                     uint32_t _data_size /* [in] [value(r->in.data.length)] */,
                                     uint32_t *num_written /* [out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_EndPagePrinter_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_EndPagePrinter_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_spoolss_AbortPrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_AbortPrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_ReadPrinter_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  uint8_t *_data /* [out] [ref,size_is(data_size)] */,
+                                                  uint32_t _data_size /* [in]  */,
+                                                  uint32_t *__data_size /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_ReadPrinter_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
@@ -181,10 +430,28 @@ NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
                                    uint32_t data_size /* [in]  */,
                                    uint32_t *_data_size /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_spoolss_EndDocPrinter_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_EndDocPrinter_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddJob_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _level /* [in]  */,
+                                             uint8_t *_buffer /* [in,out] [unique,size_is(offered)] */,
+                                             uint32_t _offered /* [in]  */,
+                                             uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_AddJob_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -193,11 +460,31 @@ NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
                               uint32_t offered /* [in]  */,
                               uint32_t *needed /* [out] [ref] */,
                               WERROR *werror);
+struct tevent_req *rpccli_spoolss_ScheduleJob_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  uint32_t _jobid /* [in]  */);
+NTSTATUS rpccli_spoolss_ScheduleJob_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
                                    uint32_t jobid /* [in]  */,
                                    WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrinterData_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     const char *_value_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _offered /* [in]  */,
+                                                     enum winreg_Type *_type /* [out] [ref] */,
+                                                     union spoolss_PrinterData *_data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
+                                                     uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrinterData_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
@@ -207,6 +494,17 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
                                       union spoolss_PrinterData *data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */,
                                       uint32_t *needed /* [out] [ref] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_spoolss_SetPrinterData_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     const char *_value_name /* [in] [charset(UTF16)] */,
+                                                     enum winreg_Type _type /* [in]  */,
+                                                     union spoolss_PrinterData _data /* [in] [subcontext(4),switch_is(type)] */,
+                                                     uint32_t __offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */);
+NTSTATUS rpccli_spoolss_SetPrinterData_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
@@ -215,24 +513,67 @@ NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
                                       union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */,
                                       uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_spoolss_WaitForPrinterChange_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_WaitForPrinterChange_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_spoolss_ClosePrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_spoolss_ClosePrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in,out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddForm_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              uint32_t _level /* [in]  */,
+                                              union spoolss_AddFormInfo _info /* [in] [switch_is(level)] */);
+NTSTATUS rpccli_spoolss_AddForm_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
                                uint32_t level /* [in]  */,
                                union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
                                WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeleteForm_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 const char *_form_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_DeleteForm_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
                                   const char *form_name /* [in] [charset(UTF16)] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetForm_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              const char *_form_name /* [in] [charset(UTF16)] */,
+                                              uint32_t _level /* [in]  */,
+                                              DATA_BLOB *_buffer /* [in] [unique] */,
+                                              uint32_t _offered /* [in]  */,
+                                              union spoolss_FormInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                              uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetForm_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -243,6 +584,16 @@ NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
                                union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
                                uint32_t *needed /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_spoolss_SetForm_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              const char *_form_name /* [in] [charset(UTF16)] */,
+                                              uint32_t _level /* [in]  */,
+                                              union spoolss_AddFormInfo _info /* [in] [switch_is(level)] */);
+NTSTATUS rpccli_spoolss_SetForm_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -250,6 +601,19 @@ NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
                                uint32_t level /* [in]  */,
                                union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
                                WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumForms_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                uint32_t _level /* [in]  */,
+                                                DATA_BLOB *_buffer /* [in] [unique] */,
+                                                uint32_t _offered /* [in]  */,
+                                                uint32_t *_count /* [out] [ref] */,
+                                                union spoolss_FormInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumForms_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
@@ -260,6 +624,19 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
                                  union spoolss_FormInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                  uint32_t *needed /* [out] [ref] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPorts_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                uint32_t _level /* [in]  */,
+                                                DATA_BLOB *_buffer /* [in] [unique] */,
+                                                uint32_t _offered /* [in]  */,
+                                                uint32_t *_count /* [out] [ref] */,
+                                                union spoolss_PortInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPorts_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *servername /* [in] [unique,charset(UTF16)] */,
@@ -270,6 +647,19 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
                                  union spoolss_PortInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                  uint32_t *needed /* [out] [ref] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumMonitors_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   DATA_BLOB *_buffer /* [in] [unique] */,
+                                                   uint32_t _offered /* [in]  */,
+                                                   uint32_t *_count /* [out] [ref] */,
+                                                   union spoolss_MonitorInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                   uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumMonitors_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *servername /* [in] [unique,charset(UTF16)] */,
@@ -280,55 +670,160 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
                                     union spoolss_MonitorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                     uint32_t *needed /* [out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPort_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                              uint32_t _unknown /* [in]  */,
+                                              const char *_monitor_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_AddPort_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                const char *server_name /* [in] [unique,charset(UTF16)] */,
                                uint32_t unknown /* [in]  */,
                                const char *monitor_name /* [in] [charset(UTF16)] */,
                                WERROR *werror);
+struct tevent_req *rpccli_spoolss_ConfigurePort_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_ConfigurePort_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePort_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_DeletePort_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_CreatePrinterIC_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      struct policy_handle *_gdi_handle /* [out] [ref] */,
+                                                      struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_CreatePrinterIC_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        struct policy_handle *gdi_handle /* [out] [ref] */,
                                        struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_spoolss_PlayGDIScriptOnPrinterIC_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result);
 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterIC_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_gdi_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_spoolss_DeletePrinterIC_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *gdi_handle /* [in,out] [ref] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrinterConnection_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_AddPrinterConnection_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterConnection_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_DeletePrinterConnection_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                WERROR *werror);
+struct tevent_req *rpccli_spoolss_PrinterMessageBox_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_PrinterMessageBox_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddMonitor_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_AddMonitor_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeleteMonitor_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_DeleteMonitor_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrintProcessor_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_DeletePrintProcessor_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrintProvidor_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_AddPrintProvidor_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrintProvidor_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_DeletePrintProvidor_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPrintProcDataTypes_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                             const char *_print_processor_name /* [in] [unique,charset(UTF16)] */,
+                                                             uint32_t _level /* [in]  */,
+                                                             DATA_BLOB *_buffer /* [in] [unique] */,
+                                                             uint32_t _offered /* [in]  */,
+                                                             uint32_t *_count /* [out] [ref] */,
+                                                             union spoolss_PrintProcDataTypesInfo **_info /* [out] [ref,switch_is(level),size_is(,*count)] */,
+                                                             uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               const char *servername /* [in] [unique,charset(UTF16)] */,
@@ -340,12 +835,38 @@ NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
                                               union spoolss_PrintProcDataTypesInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */,
                                               uint32_t *needed /* [out] [ref] */,
                                               WERROR *werror);
+struct tevent_req *rpccli_spoolss_ResetPrinter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   const char *_data_type /* [in] [unique,charset(UTF16)] */,
+                                                   struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_ResetPrinter_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     const char *data_type /* [in] [unique,charset(UTF16)] */,
                                     struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrinterDriver2_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_architecture /* [in] [unique,charset(UTF16)] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        DATA_BLOB *_buffer /* [in] [unique] */,
+                                                        uint32_t _offered /* [in]  */,
+                                                        uint32_t _client_major_version /* [in]  */,
+                                                        uint32_t _client_minor_version /* [in]  */,
+                                                        union spoolss_DriverInfo *_info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+                                                        uint32_t *_needed /* [out] [ref] */,
+                                                        uint32_t *_server_major_version /* [out] [ref] */,
+                                                        uint32_t *_server_minor_version /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrinterDriver2_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -360,19 +881,56 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
                                          uint32_t *server_major_version /* [out] [ref] */,
                                          uint32_t *server_minor_version /* [out] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_FindFirstPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
+                                                                         struct tevent_context *ev,
+                                                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification_recv(struct tevent_req *req,
+                                                               TALLOC_CTX *mem_ctx,
+                                                               WERROR *result);
 NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
                                                           TALLOC_CTX *mem_ctx,
                                                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_FindNextPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
+                                                                        struct tevent_context *ev,
+                                                                        struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification_recv(struct tevent_req *req,
+                                                              TALLOC_CTX *mem_ctx,
+                                                              WERROR *result);
 NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
                                                          TALLOC_CTX *mem_ctx,
                                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_FindClosePrinterNotify_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_spoolss_FindClosePrinterNotify_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
                                               WERROR *werror);
+struct tevent_req *rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_send(TALLOC_CTX *mem_ctx,
+                                                                                  struct tevent_context *ev,
+                                                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld_recv(struct tevent_req *req,
+                                                                        TALLOC_CTX *mem_ctx,
+                                                                        WERROR *result);
 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
                                                                    TALLOC_CTX *mem_ctx,
                                                                    WERROR *werror);
+struct tevent_req *rpccli_spoolss_ReplyOpenPrinter_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _printer_local /* [in]  */,
+                                                       enum winreg_Type _type /* [in]  */,
+                                                       uint32_t _bufsize /* [in] [range(0,512)] */,
+                                                       uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */,
+                                                       struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_ReplyOpenPrinter_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [charset(UTF16)] */,
@@ -382,6 +940,16 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
                                         uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
                                         struct policy_handle *handle /* [out] [ref] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_RouterReplyPrinter_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _flags /* [in]  */,
+                                                         uint32_t _bufsize /* [in] [range(0,512)] */,
+                                                         uint8_t *_buffer /* [in] [unique,size_is(bufsize)] */);
+NTSTATUS rpccli_spoolss_RouterReplyPrinter_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -389,22 +957,65 @@ NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
                                           uint32_t bufsize /* [in] [range(0,512)] */,
                                           uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_ReplyClosePrinter_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_spoolss_ReplyClosePrinter_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in,out] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPortEx_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_AddPortEx_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_spoolss_RouterFindFirstPrinterChangeNotification_send(TALLOC_CTX *mem_ctx,
+                                                                               struct tevent_context *ev,
+                                                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification_recv(struct tevent_req *req,
+                                                                     TALLOC_CTX *mem_ctx,
+                                                                     WERROR *result);
 NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
                                                                 TALLOC_CTX *mem_ctx,
                                                                 WERROR *werror);
+struct tevent_req *rpccli_spoolss_SpoolerInit_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_SpoolerInit_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    WERROR *werror);
+struct tevent_req *rpccli_spoolss_ResetPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_ResetPrinterEx_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
+struct tevent_req *rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_send(TALLOC_CTX *mem_ctx,
+                                                                           struct tevent_context *ev,
+                                                                           struct rpc_pipe_client *cli,
+                                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                                           uint32_t _flags /* [in]  */,
+                                                                           uint32_t _options /* [in]  */,
+                                                                           const char *_local_machine /* [in] [unique,charset(UTF16)] */,
+                                                                           uint32_t _printer_local /* [in]  */,
+                                                                           struct spoolss_NotifyOption *_notify_options /* [in] [unique] */);
+NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx_recv(struct tevent_req *req,
+                                                                 TALLOC_CTX *mem_ctx,
+                                                                 WERROR *result);
 NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
                                                             TALLOC_CTX *mem_ctx,
                                                             struct policy_handle *handle /* [in] [ref] */,
@@ -414,6 +1025,18 @@ NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_cli
                                                             uint32_t printer_local /* [in]  */,
                                                             struct spoolss_NotifyOption *notify_options /* [in] [unique] */,
                                                             WERROR *werror);
+struct tevent_req *rpccli_spoolss_RouterReplyPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                           uint32_t _color /* [in]  */,
+                                                           uint32_t _flags /* [in]  */,
+                                                           uint32_t *_reply_result /* [out] [ref] */,
+                                                           uint32_t _reply_type /* [in]  */,
+                                                           union spoolss_ReplyPrinterInfo _info /* [in] [switch_is(reply_type)] */);
+NTSTATUS rpccli_spoolss_RouterReplyPrinterEx_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct policy_handle *handle /* [in] [ref] */,
@@ -423,6 +1046,16 @@ NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
                                             uint32_t reply_type /* [in]  */,
                                             union spoolss_ReplyPrinterInfo info /* [in] [switch_is(reply_type)] */,
                                             WERROR *werror);
+struct tevent_req *rpccli_spoolss_RouterRefreshPrinterChangeNotify_send(TALLOC_CTX *mem_ctx,
+                                                                       struct tevent_context *ev,
+                                                                       struct rpc_pipe_client *cli,
+                                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                                       uint32_t _change_low /* [in]  */,
+                                                                       struct spoolss_NotifyOption *_options /* [in] [unique] */,
+                                                                       struct spoolss_NotifyInfo **_info /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify_recv(struct tevent_req *req,
+                                                             TALLOC_CTX *mem_ctx,
+                                                             WERROR *result);
 NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client *cli,
                                                         TALLOC_CTX *mem_ctx,
                                                         struct policy_handle *handle /* [in] [ref] */,
@@ -430,9 +1063,28 @@ NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client
                                                         struct spoolss_NotifyOption *options /* [in] [unique] */,
                                                         struct spoolss_NotifyInfo **info /* [out] [ref] */,
                                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_44_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_44_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_OpenPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_printername /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_datatype /* [in] [unique,charset(UTF16)] */,
+                                                    struct spoolss_DevmodeContainer _devmode_ctr /* [in]  */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    uint32_t _level /* [in]  */,
+                                                    union spoolss_UserLevel _userlevel /* [in] [switch_is(level)] */,
+                                                    struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_OpenPrinterEx_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *printername /* [in] [unique,charset(UTF16)] */,
@@ -443,6 +1095,18 @@ NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
                                      union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
                                      struct policy_handle *handle /* [out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrinterEx_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                   struct spoolss_SetPrinterInfoCtr *_info_ctr /* [in] [ref] */,
+                                                   struct spoolss_DevmodeContainer *_devmode_ctr /* [in] [ref] */,
+                                                   struct sec_desc_buf *_secdesc_ctr /* [in] [ref] */,
+                                                   struct spoolss_UserLevelCtr *_userlevel_ctr /* [in] [ref] */,
+                                                   struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_AddPrinterEx_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server /* [in] [unique,charset(UTF16)] */,
@@ -452,9 +1116,30 @@ NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
                                     struct spoolss_UserLevelCtr *userlevel_ctr /* [in] [ref] */,
                                     struct policy_handle *handle /* [out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_spoolss_47_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_47_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPrinterData_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      struct policy_handle *_handle /* [in] [ref] */,
+                                                      uint32_t _enum_index /* [in]  */,
+                                                      const char *_value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */,
+                                                      uint32_t _value_offered /* [in]  */,
+                                                      uint32_t *_value_needed /* [out] [ref] */,
+                                                      enum winreg_Type *_type /* [out] [ref] */,
+                                                      uint8_t *_data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */,
+                                                      uint32_t _data_offered /* [in]  */,
+                                                      uint32_t *_data_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrinterData_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle /* [in] [ref] */,
@@ -467,20 +1152,58 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli,
                                        uint32_t data_offered /* [in]  */,
                                        uint32_t *data_needed /* [out] [ref] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterData_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_value_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_DeletePrinterData_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterData(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
                                          const char *value_name /* [in] [charset(UTF16)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_4a_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_4a_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_4a(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_4b_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_4b_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_4b(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_4c_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_4c_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_4c(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_SetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_key_name /* [in] [charset(UTF16)] */,
+                                                       const char *_value_name /* [in] [charset(UTF16)] */,
+                                                       enum winreg_Type _type /* [in]  */,
+                                                       uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
+                                                       uint32_t _offered /* [in]  */);
+NTSTATUS rpccli_spoolss_SetPrinterDataEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -490,6 +1213,19 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli,
                                         uint8_t *buffer /* [in] [ref,size_is(offered)] */,
                                         uint32_t offered /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_GetPrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_key_name /* [in] [charset(UTF16)] */,
+                                                       const char *_value_name /* [in] [charset(UTF16)] */,
+                                                       enum winreg_Type *_type /* [out] [ref] */,
+                                                       uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                       uint32_t _offered /* [in]  */,
+                                                       uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_GetPrinterDataEx_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -500,6 +1236,18 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli,
                                         uint32_t offered /* [in]  */,
                                         uint32_t *needed /* [out] [ref] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_key_name /* [in] [charset(UTF16)] */,
+                                                        uint32_t _offered /* [in]  */,
+                                                        uint32_t *_count /* [out] [ref] */,
+                                                        struct spoolss_PrinterEnumValues **_info /* [out] [ref,size_is(,*count)] */,
+                                                        uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrinterDataEx_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -509,6 +1257,17 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
                                          struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */,
                                          uint32_t *needed /* [out] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_spoolss_EnumPrinterKey_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     struct policy_handle *_handle /* [in] [ref] */,
+                                                     const char *_key_name /* [in] [charset(UTF16)] */,
+                                                     const char ** *_key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
+                                                     uint32_t _offered /* [in]  */,
+                                                     uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_spoolss_EnumPrinterKey_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       struct policy_handle *handle /* [in] [ref] */,
@@ -517,20 +1276,54 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
                                       uint32_t offered /* [in]  */,
                                       uint32_t *needed /* [out] [ref] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterDataEx_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          const char *_key_name /* [in] [charset(UTF16)] */,
+                                                          const char *_value_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_DeletePrinterDataEx_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
                                            const char *key_name /* [in] [charset(UTF16)] */,
                                            const char *value_name /* [in] [charset(UTF16)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterKey_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       const char *_key_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_spoolss_DeletePrinterKey_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterKey(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
                                         const char *key_name /* [in] [charset(UTF16)] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_spoolss_53_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_53_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_53(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_DeletePrinterDriverEx_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server /* [in] [unique,charset(UTF16)] */,
+                                                            const char *_architecture /* [in] [charset(UTF16)] */,
+                                                            const char *_driver /* [in] [charset(UTF16)] */,
+                                                            uint32_t _delete_flags /* [in]  */,
+                                                            uint32_t _version /* [in]  */);
+NTSTATUS rpccli_spoolss_DeletePrinterDriverEx_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server /* [in] [unique,charset(UTF16)] */,
@@ -539,15 +1332,47 @@ NTSTATUS rpccli_spoolss_DeletePrinterDriverEx(struct rpc_pipe_client *cli,
                                              uint32_t delete_flags /* [in]  */,
                                              uint32_t version /* [in]  */,
                                              WERROR *werror);
+struct tevent_req *rpccli_spoolss_55_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_55_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_55(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_56_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_56_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_56(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_57_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_57_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_57(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_XcvData_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              const char *_function_name /* [in] [charset(UTF16)] */,
+                                              DATA_BLOB _in_data /* [in]  */,
+                                              uint32_t __in_data_length /* [in] [value(r->in.in_data.length)] */,
+                                              uint8_t *_out_data /* [out] [ref,size_is(out_data_size)] */,
+                                              uint32_t _out_data_size /* [in]  */,
+                                              uint32_t *_needed /* [out] [ref] */,
+                                              uint32_t *_status_code /* [in,out] [ref] */);
+NTSTATUS rpccli_spoolss_XcvData_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -559,27 +1384,72 @@ NTSTATUS rpccli_spoolss_XcvData(struct rpc_pipe_client *cli,
                                uint32_t *needed /* [out] [ref] */,
                                uint32_t *status_code /* [in,out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_spoolss_AddPrinterDriverEx_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_servername /* [in] [unique,charset(UTF16)] */,
+                                                         struct spoolss_AddDriverInfoCtr *_info_ctr /* [in] [ref] */,
+                                                         uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_spoolss_AddPrinterDriverEx_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_spoolss_AddPrinterDriverEx(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *servername /* [in] [unique,charset(UTF16)] */,
                                           struct spoolss_AddDriverInfoCtr *info_ctr /* [in] [ref] */,
                                           uint32_t flags /* [in]  */,
                                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_5a_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_5a_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_5a(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_5b_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_5b_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_5b(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_5c_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_5c_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_5c(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_5d_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_5d_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_5d(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_5e_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_5e_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_5e(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
+struct tevent_req *rpccli_spoolss_5f_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_spoolss_5f_recv(struct tevent_req *req,
+                               TALLOC_CTX *mem_ctx,
+                               WERROR *result);
 NTSTATUS rpccli_spoolss_5f(struct rpc_pipe_client *cli,
                           TALLOC_CTX *mem_ctx,
                           WERROR *werror);
index d372510135bbf5c0b2a2a949eae823cde3bae5e8..652fd9e0ecc38f85bcc2804bcd86c8139d62aedd 100644 (file)
@@ -6,6 +6,139 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_srvsvc.h"
 
+struct rpccli_srvsvc_NetCharDevEnum_state {
+       struct srvsvc_NetCharDevEnum orig;
+       struct srvsvc_NetCharDevEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevEnum_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                    struct srvsvc_NetCharDevInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                    uint32_t _max_buffer /* [in]  */,
+                                                    uint32_t *_totalentries /* [out] [ref] */,
+                                                    uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetCharDevEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevEnum_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.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevEnum_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevEnum_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_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -61,6 +194,131 @@ NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_srvsvc_NetCharDevGetInfo_state {
+       struct srvsvc_NetCharDevGetInfo orig;
+       struct srvsvc_NetCharDevGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_device_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _level /* [in]  */,
+                                                       union srvsvc_NetCharDevInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.device_name = _device_name;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevGetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetCharDevGetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevGetInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevGetInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevGetInfo_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_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -110,6 +368,122 @@ NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_srvsvc_NetCharDevControl_state {
+       struct srvsvc_NetCharDevControl orig;
+       struct srvsvc_NetCharDevControl tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevControl_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevControl_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_device_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _opcode /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevControl_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevControl_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.device_name = _device_name;
+       state->orig.in.opcode = _opcode;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevControl, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVCONTROL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevControl_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevControl_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevControl_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevControl_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevControl_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevControl_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevControl_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_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -157,6 +531,141 @@ NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_srvsvc_NetCharDevQEnum_state {
+       struct srvsvc_NetCharDevQEnum orig;
+       struct srvsvc_NetCharDevQEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevQEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevQEnum_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_user /* [in] [unique,charset(UTF16)] */,
+                                                     struct srvsvc_NetCharDevQInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                     uint32_t _max_buffer /* [in]  */,
+                                                     uint32_t *_totalentries /* [out] [ref] */,
+                                                     uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevQEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevQEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.user = _user;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetCharDevQEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVQENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevQEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevQEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQEnum_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.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevQEnum_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevQEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQEnum_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_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -214,84 +723,159 @@ NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                         const char *queue_name /* [in] [charset(UTF16)] */,
-                                         const char *user /* [in] [charset(UTF16)] */,
-                                         uint32_t level /* [in]  */,
-                                         union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */,
-                                         WERROR *werror)
+struct rpccli_srvsvc_NetCharDevQGetInfo_state {
+       struct srvsvc_NetCharDevQGetInfo orig;
+       struct srvsvc_NetCharDevQGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevQGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevQGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_queue_name /* [in] [charset(UTF16)] */,
+                                                        const char *_user /* [in] [charset(UTF16)] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        union srvsvc_NetCharDevQInfo *_info /* [out] [ref,switch_is(level)] */)
 {
-       struct srvsvc_NetCharDevQGetInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevQGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevQGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.queue_name = queue_name;
-       r.in.user = user;
-       r.in.level = level;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.queue_name = _queue_name;
+       state->orig.in.user = _user;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETCHARDEVQGETINFO,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetCharDevQGetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVQGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevQGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevQGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQGetInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevQGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQGetInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                          const char *queue_name /* [in] [charset(UTF16)] */,
+                                         const char *user /* [in] [charset(UTF16)] */,
                                          uint32_t level /* [in]  */,
-                                         union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */,
-                                         uint32_t *parm_error /* [in,out] [unique] */,
+                                         union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */,
                                          WERROR *werror)
 {
-       struct srvsvc_NetCharDevQSetInfo r;
+       struct srvsvc_NetCharDevQGetInfo r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
        r.in.queue_name = queue_name;
+       r.in.user = user;
        r.in.level = level;
-       r.in.info = info;
-       r.in.parm_error = parm_error;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETCHARDEVQSETINFO,
+                               NDR_SRVSVC_NETCHARDEVQGETINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -299,7 +883,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -307,9 +891,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       if (parm_error && r.out.parm_error) {
-               *parm_error = *r.out.parm_error;
-       }
+       *info = *r.out.info;
 
        /* Return result */
        if (werror) {
@@ -319,74 +901,163 @@ NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                       const char *queue_name /* [in] [charset(UTF16)] */,
-                                       WERROR *werror)
+struct rpccli_srvsvc_NetCharDevQSetInfo_state {
+       struct srvsvc_NetCharDevQSetInfo orig;
+       struct srvsvc_NetCharDevQSetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevQSetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevQSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_queue_name /* [in] [charset(UTF16)] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        union srvsvc_NetCharDevQInfo _info /* [in] [switch_is(level)] */,
+                                                        uint32_t *_parm_error /* [in,out] [unique] */)
 {
-       struct srvsvc_NetCharDevQPurge r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevQSetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevQSetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.queue_name = queue_name;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.queue_name = _queue_name;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.parm_error = _parm_error;
+
+       /* Out parameters */
+       state->orig.out.parm_error = _parm_error;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETCHARDEVQPURGE,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetCharDevQSetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVQSETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQSetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevQSetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevQSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQSetInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       if (state->orig.out.parm_error && state->tmp.out.parm_error) {
+               *state->orig.out.parm_error = *state->tmp.out.parm_error;
        }
 
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevQSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQSetInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                           const char *queue_name /* [in] [charset(UTF16)] */,
-                                           const char *computer_name /* [in] [charset(UTF16)] */,
-                                           WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                         const char *queue_name /* [in] [charset(UTF16)] */,
+                                         uint32_t level /* [in]  */,
+                                         union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */,
+                                         uint32_t *parm_error /* [in,out] [unique] */,
+                                         WERROR *werror)
 {
-       struct srvsvc_NetCharDevQPurgeSelf r;
+       struct srvsvc_NetCharDevQSetInfo r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
        r.in.queue_name = queue_name;
-       r.in.computer_name = computer_name;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.parm_error = parm_error;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETCHARDEVQPURGESELF,
+                               NDR_SRVSVC_NETCHARDEVQSETINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -394,7 +1065,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -402,6 +1073,9 @@ NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       if (parm_error && r.out.parm_error) {
+               *parm_error = *r.out.parm_error;
+       }
 
        /* Return result */
        if (werror) {
@@ -411,93 +1085,141 @@ NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  const char *path /* [in] [unique,charset(UTF16)] */,
-                                  struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */,
-                                  uint32_t max_buffer /* [in]  */,
-                                  uint32_t *totalentries /* [out] [ref] */,
-                                  uint32_t *resume_handle /* [in,out] [unique] */,
-                                  WERROR *werror)
+struct rpccli_srvsvc_NetCharDevQPurge_state {
+       struct srvsvc_NetCharDevQPurge orig;
+       struct srvsvc_NetCharDevQPurge tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevQPurge_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevQPurge_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_queue_name /* [in] [charset(UTF16)] */)
 {
-       struct srvsvc_NetConnEnum r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevQPurge_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevQPurge_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.path = path;
-       r.in.info_ctr = info_ctr;
-       r.in.max_buffer = max_buffer;
-       r.in.resume_handle = resume_handle;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.queue_name = _queue_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETCONNENUM,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVQPURGE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQPurge_done, req);
+       return req;
+}
 
+static void rpccli_srvsvc_NetCharDevQPurge_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevQPurge_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQPurge_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevQPurge_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevQPurge_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQPurge_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info_ctr = *r.out.info_ctr;
-       *totalentries = *r.out.totalentries;
-       if (resume_handle && r.out.resume_handle) {
-               *resume_handle = *r.out.resume_handle;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  const char *path /* [in] [unique,charset(UTF16)] */,
-                                  const char *user /* [in] [unique,charset(UTF16)] */,
-                                  struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */,
-                                  uint32_t max_buffer /* [in]  */,
-                                  uint32_t *totalentries /* [out] [ref] */,
-                                  uint32_t *resume_handle /* [in,out] [unique] */,
-                                  WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                       const char *queue_name /* [in] [charset(UTF16)] */,
+                                       WERROR *werror)
 {
-       struct srvsvc_NetFileEnum r;
+       struct srvsvc_NetCharDevQPurge r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.path = path;
-       r.in.user = user;
-       r.in.info_ctr = info_ctr;
-       r.in.max_buffer = max_buffer;
-       r.in.resume_handle = resume_handle;
+       r.in.queue_name = queue_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETFILEENUM,
+                               NDR_SRVSVC_NETCHARDEVQPURGE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -505,7 +1227,7 @@ NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -513,11 +1235,6 @@ NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info_ctr = *r.out.info_ctr;
-       *totalentries = *r.out.totalentries;
-       if (resume_handle && r.out.resume_handle) {
-               *resume_handle = *r.out.resume_handle;
-       }
 
        /* Return result */
        if (werror) {
@@ -527,76 +1244,145 @@ NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                     uint32_t fid /* [in]  */,
-                                     uint32_t level /* [in]  */,
-                                     union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */,
-                                     WERROR *werror)
+struct rpccli_srvsvc_NetCharDevQPurgeSelf_state {
+       struct srvsvc_NetCharDevQPurgeSelf orig;
+       struct srvsvc_NetCharDevQPurgeSelf tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetCharDevQPurgeSelf_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetCharDevQPurgeSelf_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_queue_name /* [in] [charset(UTF16)] */,
+                                                          const char *_computer_name /* [in] [charset(UTF16)] */)
 {
-       struct srvsvc_NetFileGetInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetCharDevQPurgeSelf_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetCharDevQPurgeSelf_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.fid = fid;
-       r.in.level = level;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.queue_name = _queue_name;
+       state->orig.in.computer_name = _computer_name;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETFILEGETINFO,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETCHARDEVQPURGESELF,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQPurgeSelf_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetCharDevQPurgeSelf_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetCharDevQPurgeSelf_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQPurgeSelf_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_srvsvc_NetCharDevQPurgeSelf_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetCharDevQPurgeSelf_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                   uint32_t fid /* [in]  */,
-                                   WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                           const char *queue_name /* [in] [charset(UTF16)] */,
+                                           const char *computer_name /* [in] [charset(UTF16)] */,
+                                           WERROR *werror)
 {
-       struct srvsvc_NetFileClose r;
+       struct srvsvc_NetCharDevQPurgeSelf r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.fid = fid;
+       r.in.queue_name = queue_name;
+       r.in.computer_name = computer_name;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETFILECLOSE,
+                               NDR_SRVSVC_NETCHARDEVQPURGESELF,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -604,7 +1390,7 @@ NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -621,88 +1407,169 @@ NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  const char *client /* [in] [unique,charset(UTF16)] */,
-                                  const char *user /* [in] [unique,charset(UTF16)] */,
-                                  struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */,
-                                  uint32_t max_buffer /* [in]  */,
-                                  uint32_t *totalentries /* [out] [ref] */,
-                                  uint32_t *resume_handle /* [in,out] [unique] */,
-                                  WERROR *werror)
+struct rpccli_srvsvc_NetConnEnum_state {
+       struct srvsvc_NetConnEnum orig;
+       struct srvsvc_NetConnEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetConnEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetConnEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_path /* [in] [unique,charset(UTF16)] */,
+                                                 struct srvsvc_NetConnInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                 uint32_t _max_buffer /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */)
 {
-       struct srvsvc_NetSessEnum r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetConnEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetConnEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.client = client;
-       r.in.user = user;
-       r.in.info_ctr = info_ctr;
-       r.in.max_buffer = max_buffer;
-       r.in.resume_handle = resume_handle;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.path = _path;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, &r);
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSESSENUM,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetConnEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETCONNENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetConnEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetConnEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetConnEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetConnEnum_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetConnEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetConnEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetConnEnum_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info_ctr = *r.out.info_ctr;
-       *totalentries = *r.out.totalentries;
-       if (resume_handle && r.out.resume_handle) {
-               *resume_handle = *r.out.resume_handle;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                 const char *client /* [in] [unique,charset(UTF16)] */,
-                                 const char *user /* [in] [unique,charset(UTF16)] */,
-                                 WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  const char *path /* [in] [unique,charset(UTF16)] */,
+                                  struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */,
+                                  uint32_t max_buffer /* [in]  */,
+                                  uint32_t *totalentries /* [out] [ref] */,
+                                  uint32_t *resume_handle /* [in,out] [unique] */,
+                                  WERROR *werror)
 {
-       struct srvsvc_NetSessDel r;
+       struct srvsvc_NetConnEnum r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.client = client;
-       r.in.user = user;
+       r.in.path = path;
+       r.in.info_ctr = info_ctr;
+       r.in.max_buffer = max_buffer;
+       r.in.resume_handle = resume_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSESSDEL,
+                               NDR_SRVSVC_NETCONNENUM,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -710,7 +1577,7 @@ NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -718,6 +1585,11 @@ NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *info_ctr = *r.out.info_ctr;
+       *totalentries = *r.out.totalentries;
+       if (resume_handle && r.out.resume_handle) {
+               *resume_handle = *r.out.resume_handle;
+       }
 
        /* Return result */
        if (werror) {
@@ -727,84 +1599,173 @@ NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  uint32_t level /* [in]  */,
-                                  union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */,
-                                  uint32_t *parm_error /* [in,out] [unique] */,
-                                  WERROR *werror)
+struct rpccli_srvsvc_NetFileEnum_state {
+       struct srvsvc_NetFileEnum orig;
+       struct srvsvc_NetFileEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetFileEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetFileEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_path /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_user /* [in] [unique,charset(UTF16)] */,
+                                                 struct srvsvc_NetFileInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                 uint32_t _max_buffer /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */)
 {
-       struct srvsvc_NetShareAdd r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetFileEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetFileEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.level = level;
-       r.in.info = info;
-       r.in.parm_error = parm_error;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.path = _path;
+       state->orig.in.user = _user;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREADD,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetFileEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETFILEENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetFileEnum_done, req);
+       return req;
+}
 
+static void rpccli_srvsvc_NetFileEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetFileEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetFileEnum_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
        }
 
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetFileEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetFileEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetFileEnum_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       if (parm_error && r.out.parm_error) {
-               *parm_error = *r.out.parm_error;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                      struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */,
-                                      uint32_t max_buffer /* [in]  */,
-                                      uint32_t *totalentries /* [out] [ref] */,
-                                      uint32_t *resume_handle /* [in,out] [unique] */,
-                                      WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  const char *path /* [in] [unique,charset(UTF16)] */,
+                                  const char *user /* [in] [unique,charset(UTF16)] */,
+                                  struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */,
+                                  uint32_t max_buffer /* [in]  */,
+                                  uint32_t *totalentries /* [out] [ref] */,
+                                  uint32_t *resume_handle /* [in,out] [unique] */,
+                                  WERROR *werror)
 {
-       struct srvsvc_NetShareEnumAll r;
+       struct srvsvc_NetFileEnum r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
+       r.in.path = path;
+       r.in.user = user;
        r.in.info_ctr = info_ctr;
        r.in.max_buffer = max_buffer;
        r.in.resume_handle = resume_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREENUMALL,
+                               NDR_SRVSVC_NETFILEENUM,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -812,7 +1773,7 @@ NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -834,82 +1795,155 @@ NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                      const char *share_name /* [in] [charset(UTF16)] */,
-                                      uint32_t level /* [in]  */,
-                                      union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */,
-                                      WERROR *werror)
+struct rpccli_srvsvc_NetFileGetInfo_state {
+       struct srvsvc_NetFileGetInfo orig;
+       struct srvsvc_NetFileGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetFileGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetFileGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _fid /* [in]  */,
+                                                    uint32_t _level /* [in]  */,
+                                                    union srvsvc_NetFileInfo *_info /* [out] [ref,switch_is(level)] */)
 {
-       struct srvsvc_NetShareGetInfo r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetFileGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetFileGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.share_name = share_name;
-       r.in.level = level;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.fid = _fid;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREGETINFO,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetFileGetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETFILEGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetFileGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetFileGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetFileGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetFileGetInfo_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetFileGetInfo_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_srvsvc_NetFileGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetFileGetInfo_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                      const char *share_name /* [in] [charset(UTF16)] */,
-                                      uint32_t level /* [in]  */,
-                                      union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */,
-                                      uint32_t *parm_error /* [in,out] [unique] */,
-                                      WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                     uint32_t fid /* [in]  */,
+                                     uint32_t level /* [in]  */,
+                                     union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */,
+                                     WERROR *werror)
 {
-       struct srvsvc_NetShareSetInfo r;
+       struct srvsvc_NetFileGetInfo r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.share_name = share_name;
+       r.in.fid = fid;
        r.in.level = level;
-       r.in.info = info;
-       r.in.parm_error = parm_error;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHARESETINFO,
+                               NDR_SRVSVC_NETFILEGETINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -917,7 +1951,7 @@ NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -925,9 +1959,7 @@ NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       if (parm_error && r.out.parm_error) {
-               *parm_error = *r.out.parm_error;
-       }
+       *info = *r.out.info;
 
        /* Return result */
        if (werror) {
@@ -937,76 +1969,141 @@ NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  const char *share_name /* [in] [charset(UTF16)] */,
-                                  uint32_t reserved /* [in]  */,
-                                  WERROR *werror)
+struct rpccli_srvsvc_NetFileClose_state {
+       struct srvsvc_NetFileClose orig;
+       struct srvsvc_NetFileClose tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetFileClose_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetFileClose_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  uint32_t _fid /* [in]  */)
 {
-       struct srvsvc_NetShareDel r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetFileClose_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetFileClose_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.share_name = share_name;
-       r.in.reserved = reserved;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.fid = _fid;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREDEL,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETFILECLOSE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetFileClose_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetFileClose_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetFileClose_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetFileClose_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetFileClose_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_srvsvc_NetFileClose_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetFileClose_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                        const char *share_name /* [in] [charset(UTF16)] */,
-                                        uint32_t reserved /* [in]  */,
-                                        WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                   uint32_t fid /* [in]  */,
+                                   WERROR *werror)
 {
-       struct srvsvc_NetShareDelSticky r;
+       struct srvsvc_NetFileClose r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.share_name = share_name;
-       r.in.reserved = reserved;
+       r.in.fid = fid;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREDELSTICKY,
+                               NDR_SRVSVC_NETFILECLOSE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1014,7 +2111,7 @@ NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1031,75 +2128,173 @@ NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                    const char *device_name /* [in] [charset(UTF16)] */,
-                                    enum srvsvc_ShareType *type /* [out] [ref] */,
-                                    WERROR *werror)
+struct rpccli_srvsvc_NetSessEnum_state {
+       struct srvsvc_NetSessEnum orig;
+       struct srvsvc_NetSessEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetSessEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetSessEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_client /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_user /* [in] [unique,charset(UTF16)] */,
+                                                 struct srvsvc_NetSessInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                 uint32_t _max_buffer /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */)
 {
-       struct srvsvc_NetShareCheck r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetSessEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetSessEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.device_name = device_name;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.client = _client;
+       state->orig.in.user = _user;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHARECHECK,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetSessEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETSESSENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetSessEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetSessEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetSessEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSessEnum_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetSessEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetSessEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSessEnum_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *type = *r.out.type;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                    uint32_t level /* [in]  */,
-                                    union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */,
-                                    WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  const char *client /* [in] [unique,charset(UTF16)] */,
+                                  const char *user /* [in] [unique,charset(UTF16)] */,
+                                  struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */,
+                                  uint32_t max_buffer /* [in]  */,
+                                  uint32_t *totalentries /* [out] [ref] */,
+                                  uint32_t *resume_handle /* [in,out] [unique] */,
+                                  WERROR *werror)
 {
-       struct srvsvc_NetSrvGetInfo r;
+       struct srvsvc_NetSessEnum r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.level = level;
+       r.in.client = client;
+       r.in.user = user;
+       r.in.info_ctr = info_ctr;
+       r.in.max_buffer = max_buffer;
+       r.in.resume_handle = resume_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSRVGETINFO,
+                               NDR_SRVSVC_NETSESSENUM,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1107,7 +2302,7 @@ NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1115,7 +2310,11 @@ NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
+       *info_ctr = *r.out.info_ctr;
+       *totalentries = *r.out.totalentries;
+       if (resume_handle && r.out.resume_handle) {
+               *resume_handle = *r.out.resume_handle;
+       }
 
        /* Return result */
        if (werror) {
@@ -1125,31 +2324,145 @@ NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                    uint32_t level /* [in]  */,
-                                    union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */,
-                                    uint32_t *parm_error /* [in,out] [unique] */,
-                                    WERROR *werror)
+struct rpccli_srvsvc_NetSessDel_state {
+       struct srvsvc_NetSessDel orig;
+       struct srvsvc_NetSessDel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetSessDel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetSessDel_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                const char *_client /* [in] [unique,charset(UTF16)] */,
+                                                const char *_user /* [in] [unique,charset(UTF16)] */)
 {
-       struct srvsvc_NetSrvSetInfo r;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetSessDel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetSessDel_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.client = _client;
+       state->orig.in.user = _user;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSESSDEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetSessDel_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetSessDel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetSessDel_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSessDel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetSessDel_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_srvsvc_NetSessDel_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSessDel_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_srvsvc_NetSessDel(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                 const char *client /* [in] [unique,charset(UTF16)] */,
+                                 const char *user /* [in] [unique,charset(UTF16)] */,
+                                 WERROR *werror)
+{
+       struct srvsvc_NetSessDel r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.level = level;
-       r.in.info = info;
-       r.in.parm_error = parm_error;
+       r.in.client = client;
+       r.in.user = user;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSRVSETINFO,
+                               NDR_SRVSVC_NETSESSDEL,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1157,7 +2470,7 @@ NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1165,9 +2478,6 @@ NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       if (parm_error && r.out.parm_error) {
-               *parm_error = *r.out.parm_error;
-       }
 
        /* Return result */
        if (werror) {
@@ -1177,89 +2487,4325 @@ NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  uint32_t level /* [in]  */,
-                                  struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */,
-                                  uint32_t maxlen /* [in]  */,
-                                  uint32_t *totalentries /* [out] [ref] */,
-                                  uint32_t *resume_handle /* [in,out] [unique] */,
-                                  WERROR *werror)
+struct rpccli_srvsvc_NetShareAdd_state {
+       struct srvsvc_NetShareAdd orig;
+       struct srvsvc_NetShareAdd tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareAdd_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareAdd_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 uint32_t _level /* [in]  */,
+                                                 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                 uint32_t *_parm_error /* [in,out] [unique] */)
 {
-       struct srvsvc_NetDiskEnum r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareAdd_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareAdd_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.level = level;
-       r.in.info = info;
-       r.in.maxlen = maxlen;
-       r.in.resume_handle = resume_handle;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.parm_error = _parm_error;
+
+       /* Out parameters */
+       state->orig.out.parm_error = _parm_error;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETDISKENUM,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareAdd_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_srvsvc,
+                                   NDR_SRVSVC_NETSHAREADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareAdd_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareAdd_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareAdd_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareAdd_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, &r);
+       /* Copy out parameters */
+       if (state->orig.out.parm_error && state->tmp.out.parm_error) {
+               *state->orig.out.parm_error = *state->tmp.out.parm_error;
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, &state->orig);
        }
 
-       /* Return variables */
-       *info = *r.out.info;
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareAdd_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareAdd_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareAdd_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_srvsvc_NetShareAdd(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  uint32_t level /* [in]  */,
+                                  union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */,
+                                  uint32_t *parm_error /* [in,out] [unique] */,
+                                  WERROR *werror)
+{
+       struct srvsvc_NetShareAdd r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.parm_error = parm_error;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREADD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (parm_error && r.out.parm_error) {
+               *parm_error = *r.out.parm_error;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareEnumAll_state {
+       struct srvsvc_NetShareEnumAll orig;
+       struct srvsvc_NetShareEnumAll tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareEnumAll_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareEnumAll_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                     uint32_t _max_buffer /* [in]  */,
+                                                     uint32_t *_totalentries /* [out] [ref] */,
+                                                     uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareEnumAll_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareEnumAll_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareEnumAll_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_srvsvc,
+                                   NDR_SRVSVC_NETSHAREENUMALL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareEnumAll_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareEnumAll_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareEnumAll_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareEnumAll_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.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareEnumAll_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareEnumAll_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareEnumAll_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_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                      struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */,
+                                      uint32_t max_buffer /* [in]  */,
+                                      uint32_t *totalentries /* [out] [ref] */,
+                                      uint32_t *resume_handle /* [in,out] [unique] */,
+                                      WERROR *werror)
+{
+       struct srvsvc_NetShareEnumAll r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.info_ctr = info_ctr;
+       r.in.max_buffer = max_buffer;
+       r.in.resume_handle = resume_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREENUMALL,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info_ctr = *r.out.info_ctr;
+       *totalentries = *r.out.totalentries;
+       if (resume_handle && r.out.resume_handle) {
+               *resume_handle = *r.out.resume_handle;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareGetInfo_state {
+       struct srvsvc_NetShareGetInfo orig;
+       struct srvsvc_NetShareGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_share_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union srvsvc_NetShareInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share_name = _share_name;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareGetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETSHAREGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareGetInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareGetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareGetInfo_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_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                      const char *share_name /* [in] [charset(UTF16)] */,
+                                      uint32_t level /* [in]  */,
+                                      union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */,
+                                      WERROR *werror)
+{
+       struct srvsvc_NetShareGetInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.share_name = share_name;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREGETINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareSetInfo_state {
+       struct srvsvc_NetShareSetInfo orig;
+       struct srvsvc_NetShareSetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareSetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_share_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                     uint32_t *_parm_error /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareSetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareSetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share_name = _share_name;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.parm_error = _parm_error;
+
+       /* Out parameters */
+       state->orig.out.parm_error = _parm_error;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareSetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETSHARESETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareSetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareSetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareSetInfo_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 */
+       if (state->orig.out.parm_error && state->tmp.out.parm_error) {
+               *state->orig.out.parm_error = *state->tmp.out.parm_error;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareSetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareSetInfo_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_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                      const char *share_name /* [in] [charset(UTF16)] */,
+                                      uint32_t level /* [in]  */,
+                                      union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */,
+                                      uint32_t *parm_error /* [in,out] [unique] */,
+                                      WERROR *werror)
+{
+       struct srvsvc_NetShareSetInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.share_name = share_name;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.parm_error = parm_error;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHARESETINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (parm_error && r.out.parm_error) {
+               *parm_error = *r.out.parm_error;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareDel_state {
+       struct srvsvc_NetShareDel orig;
+       struct srvsvc_NetShareDel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareDel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareDel_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_share_name /* [in] [charset(UTF16)] */,
+                                                 uint32_t _reserved /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareDel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareDel_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share_name = _share_name;
+       state->orig.in.reserved = _reserved;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSHAREDEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDel_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareDel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareDel_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareDel_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareDel_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDel_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_srvsvc_NetShareDel(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  const char *share_name /* [in] [charset(UTF16)] */,
+                                  uint32_t reserved /* [in]  */,
+                                  WERROR *werror)
+{
+       struct srvsvc_NetShareDel r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.share_name = share_name;
+       r.in.reserved = reserved;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREDEL,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareDelSticky_state {
+       struct srvsvc_NetShareDelSticky orig;
+       struct srvsvc_NetShareDelSticky tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareDelSticky_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareDelSticky_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_share_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _reserved /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareDelSticky_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareDelSticky_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share_name = _share_name;
+       state->orig.in.reserved = _reserved;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSHAREDELSTICKY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDelSticky_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareDelSticky_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareDelSticky_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDelSticky_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareDelSticky_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareDelSticky_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDelSticky_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_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                        const char *share_name /* [in] [charset(UTF16)] */,
+                                        uint32_t reserved /* [in]  */,
+                                        WERROR *werror)
+{
+       struct srvsvc_NetShareDelSticky r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.share_name = share_name;
+       r.in.reserved = reserved;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREDELSTICKY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareCheck_state {
+       struct srvsvc_NetShareCheck orig;
+       struct srvsvc_NetShareCheck tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareCheck_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareCheck_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   const char *_device_name /* [in] [charset(UTF16)] */,
+                                                   enum srvsvc_ShareType *_type /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareCheck_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareCheck_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.device_name = _device_name;
+
+       /* Out parameters */
+       state->orig.out.type = _type;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareCheck_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_srvsvc,
+                                   NDR_SRVSVC_NETSHARECHECK,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareCheck_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareCheck_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareCheck_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareCheck_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.type = *state->tmp.out.type;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareCheck_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareCheck_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareCheck_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_srvsvc_NetShareCheck(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                    const char *device_name /* [in] [charset(UTF16)] */,
+                                    enum srvsvc_ShareType *type /* [out] [ref] */,
+                                    WERROR *werror)
+{
+       struct srvsvc_NetShareCheck r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.device_name = device_name;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHARECHECK,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *type = *r.out.type;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetSrvGetInfo_state {
+       struct srvsvc_NetSrvGetInfo orig;
+       struct srvsvc_NetSrvGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetSrvGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetSrvGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   union srvsvc_NetSrvInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetSrvGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetSrvGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetSrvGetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETSRVGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetSrvGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetSrvGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetSrvGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSrvGetInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetSrvGetInfo_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_srvsvc_NetSrvGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSrvGetInfo_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_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                    uint32_t level /* [in]  */,
+                                    union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */,
+                                    WERROR *werror)
+{
+       struct srvsvc_NetSrvGetInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.level = level;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSRVGETINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetSrvSetInfo_state {
+       struct srvsvc_NetSrvSetInfo orig;
+       struct srvsvc_NetSrvSetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetSrvSetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetSrvSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   union srvsvc_NetSrvInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                   uint32_t *_parm_error /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetSrvSetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetSrvSetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.parm_error = _parm_error;
+
+       /* Out parameters */
+       state->orig.out.parm_error = _parm_error;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetSrvSetInfo_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_srvsvc,
+                                   NDR_SRVSVC_NETSRVSETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetSrvSetInfo_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetSrvSetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetSrvSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSrvSetInfo_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 */
+       if (state->orig.out.parm_error && state->tmp.out.parm_error) {
+               *state->orig.out.parm_error = *state->tmp.out.parm_error;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetSrvSetInfo_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_srvsvc_NetSrvSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSrvSetInfo_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_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                    uint32_t level /* [in]  */,
+                                    union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */,
+                                    uint32_t *parm_error /* [in,out] [unique] */,
+                                    WERROR *werror)
+{
+       struct srvsvc_NetSrvSetInfo r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.parm_error = parm_error;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSRVSETINFO,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (parm_error && r.out.parm_error) {
+               *parm_error = *r.out.parm_error;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetDiskEnum_state {
+       struct srvsvc_NetDiskEnum orig;
+       struct srvsvc_NetDiskEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetDiskEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetDiskEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 uint32_t _level /* [in]  */,
+                                                 struct srvsvc_NetDiskInfo *_info /* [in,out] [ref] */,
+                                                 uint32_t _maxlen /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetDiskEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetDiskEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.maxlen = _maxlen;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetDiskEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETDISKENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetDiskEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetDiskEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetDiskEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetDiskEnum_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.info = *state->tmp.out.info;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetDiskEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetDiskEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetDiskEnum_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_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  uint32_t level /* [in]  */,
+                                  struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */,
+                                  uint32_t maxlen /* [in]  */,
+                                  uint32_t *totalentries /* [out] [ref] */,
+                                  uint32_t *resume_handle /* [in,out] [unique] */,
+                                  WERROR *werror)
+{
+       struct srvsvc_NetDiskEnum r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.level = level;
+       r.in.info = info;
+       r.in.maxlen = maxlen;
+       r.in.resume_handle = resume_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETDISKENUM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+       *totalentries = *r.out.totalentries;
+       if (resume_handle && r.out.resume_handle) {
+               *resume_handle = *r.out.resume_handle;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetServerStatisticsGet_state {
+       struct srvsvc_NetServerStatisticsGet orig;
+       struct srvsvc_NetServerStatisticsGet tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetServerStatisticsGet_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetServerStatisticsGet_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                            const char *_service /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t _level /* [in]  */,
+                                                            uint32_t _options /* [in]  */,
+                                                            struct srvsvc_Statistics **_stats /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetServerStatisticsGet_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetServerStatisticsGet_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.service = _service;
+       state->orig.in.level = _level;
+       state->orig.in.options = _options;
+
+       /* Out parameters */
+       state->orig.out.stats = _stats;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetServerStatisticsGet_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_srvsvc,
+                                   NDR_SRVSVC_NETSERVERSTATISTICSGET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetServerStatisticsGet_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetServerStatisticsGet_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetServerStatisticsGet_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetServerStatisticsGet_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.stats = *state->tmp.out.stats;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetServerStatisticsGet_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_srvsvc_NetServerStatisticsGet_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetServerStatisticsGet_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_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                             const char *service /* [in] [unique,charset(UTF16)] */,
+                                             uint32_t level /* [in]  */,
+                                             uint32_t options /* [in]  */,
+                                             struct srvsvc_Statistics **stats /* [out] [ref] */,
+                                             WERROR *werror)
+{
+       struct srvsvc_NetServerStatisticsGet r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.service = service;
+       r.in.level = level;
+       r.in.options = options;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSERVERSTATISTICSGET,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *stats = *r.out.stats;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetTransportAdd_state {
+       struct srvsvc_NetTransportAdd orig;
+       struct srvsvc_NetTransportAdd tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetTransportAdd_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetTransportAdd_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetTransportAdd_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetTransportAdd_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETTRANSPORTADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetTransportAdd_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetTransportAdd_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetTransportAdd_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetTransportAdd_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetTransportAdd_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetTransportAdd_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetTransportAdd_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_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                      uint32_t level /* [in]  */,
+                                      union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */,
+                                      WERROR *werror)
+{
+       struct srvsvc_NetTransportAdd r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.level = level;
+       r.in.info = info;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETTRANSPORTADD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetTransportEnum_state {
+       struct srvsvc_NetTransportEnum orig;
+       struct srvsvc_NetTransportEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetTransportEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetTransportEnum_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      struct srvsvc_NetTransportInfoCtr *_transports /* [in,out] [ref] */,
+                                                      uint32_t _max_buffer /* [in]  */,
+                                                      uint32_t *_totalentries /* [out] [ref] */,
+                                                      uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetTransportEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetTransportEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.transports = _transports;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.transports = _transports;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetTransportEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETTRANSPORTENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetTransportEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetTransportEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetTransportEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetTransportEnum_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.transports = *state->tmp.out.transports;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetTransportEnum_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_srvsvc_NetTransportEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetTransportEnum_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_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                       struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */,
+                                       uint32_t max_buffer /* [in]  */,
+                                       uint32_t *totalentries /* [out] [ref] */,
+                                       uint32_t *resume_handle /* [in,out] [unique] */,
+                                       WERROR *werror)
+{
+       struct srvsvc_NetTransportEnum r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.transports = transports;
+       r.in.max_buffer = max_buffer;
+       r.in.resume_handle = resume_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETTRANSPORTENUM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *transports = *r.out.transports;
+       *totalentries = *r.out.totalentries;
+       if (resume_handle && r.out.resume_handle) {
+               *resume_handle = *r.out.resume_handle;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetTransportDel_state {
+       struct srvsvc_NetTransportDel orig;
+       struct srvsvc_NetTransportDel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetTransportDel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetTransportDel_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     struct srvsvc_NetTransportInfo0 *_info0 /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetTransportDel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetTransportDel_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+       state->orig.in.info0 = _info0;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETTRANSPORTDEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetTransportDel_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetTransportDel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetTransportDel_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetTransportDel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetTransportDel_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetTransportDel_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetTransportDel_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_srvsvc_NetTransportDel(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                      uint32_t level /* [in]  */,
+                                      struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */,
+                                      WERROR *werror)
+{
+       struct srvsvc_NetTransportDel r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.level = level;
+       r.in.info0 = info0;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETTRANSPORTDEL,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetRemoteTOD_state {
+       struct srvsvc_NetRemoteTOD orig;
+       struct srvsvc_NetRemoteTOD tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetRemoteTOD_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetRemoteTOD_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  struct srvsvc_NetRemoteTODInfo **_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetRemoteTOD_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetRemoteTOD_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetRemoteTOD_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_srvsvc,
+                                   NDR_SRVSVC_NETREMOTETOD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetRemoteTOD_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetRemoteTOD_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetRemoteTOD_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetRemoteTOD_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetRemoteTOD_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_srvsvc_NetRemoteTOD_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetRemoteTOD_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_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                   struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */,
+                                   WERROR *werror)
+{
+       struct srvsvc_NetRemoteTOD r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETREMOTETOD,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info = *r.out.info;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetSetServiceBits_state {
+       struct srvsvc_NetSetServiceBits orig;
+       struct srvsvc_NetSetServiceBits tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetSetServiceBits_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetSetServiceBits_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_transport /* [in] [unique,charset(UTF16)] */,
+                                                       uint32_t _servicebits /* [in]  */,
+                                                       uint32_t _updateimmediately /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetSetServiceBits_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetSetServiceBits_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.transport = _transport;
+       state->orig.in.servicebits = _servicebits;
+       state->orig.in.updateimmediately = _updateimmediately;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSETSERVICEBITS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetSetServiceBits_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetSetServiceBits_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetSetServiceBits_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSetServiceBits_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetSetServiceBits_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_srvsvc_NetSetServiceBits_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSetServiceBits_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_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                        const char *transport /* [in] [unique,charset(UTF16)] */,
+                                        uint32_t servicebits /* [in]  */,
+                                        uint32_t updateimmediately /* [in]  */,
+                                        WERROR *werror)
+{
+       struct srvsvc_NetSetServiceBits r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.transport = transport;
+       r.in.servicebits = servicebits;
+       r.in.updateimmediately = updateimmediately;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSETSERVICEBITS,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetPathType_state {
+       struct srvsvc_NetPathType orig;
+       struct srvsvc_NetPathType tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetPathType_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetPathType_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_path /* [in] [charset(UTF16)] */,
+                                                 uint32_t _pathflags /* [in]  */,
+                                                 uint32_t *_pathtype /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetPathType_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetPathType_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.path = _path;
+       state->orig.in.pathflags = _pathflags;
+
+       /* Out parameters */
+       state->orig.out.pathtype = _pathtype;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetPathType_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_srvsvc,
+                                   NDR_SRVSVC_NETPATHTYPE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetPathType_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetPathType_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetPathType_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPathType_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.pathtype = *state->tmp.out.pathtype;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetPathType_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NetPathType_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPathType_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_srvsvc_NetPathType(struct rpc_pipe_client *cli,
+                                  TALLOC_CTX *mem_ctx,
+                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                  const char *path /* [in] [charset(UTF16)] */,
+                                  uint32_t pathflags /* [in]  */,
+                                  uint32_t *pathtype /* [out] [ref] */,
+                                  WERROR *werror)
+{
+       struct srvsvc_NetPathType r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.path = path;
+       r.in.pathflags = pathflags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETPATHTYPE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *pathtype = *r.out.pathtype;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetPathCanonicalize_state {
+       struct srvsvc_NetPathCanonicalize orig;
+       struct srvsvc_NetPathCanonicalize tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetPathCanonicalize_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetPathCanonicalize_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                         const char *_path /* [in] [charset(UTF16)] */,
+                                                         uint8_t *_can_path /* [out] [size_is(maxbuf)] */,
+                                                         uint32_t _maxbuf /* [in]  */,
+                                                         const char *_prefix /* [in] [charset(UTF16)] */,
+                                                         uint32_t *_pathtype /* [in,out] [ref] */,
+                                                         uint32_t _pathflags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetPathCanonicalize_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetPathCanonicalize_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.path = _path;
+       state->orig.in.maxbuf = _maxbuf;
+       state->orig.in.prefix = _prefix;
+       state->orig.in.pathtype = _pathtype;
+       state->orig.in.pathflags = _pathflags;
+
+       /* Out parameters */
+       state->orig.out.can_path = _can_path;
+       state->orig.out.pathtype = _pathtype;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetPathCanonicalize_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_srvsvc,
+                                   NDR_SRVSVC_NETPATHCANONICALIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetPathCanonicalize_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetPathCanonicalize_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetPathCanonicalize_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPathCanonicalize_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 */
+       memcpy(state->orig.out.can_path, state->tmp.out.can_path, state->tmp.in.maxbuf * sizeof(*state->orig.out.can_path));
+       *state->orig.out.pathtype = *state->tmp.out.pathtype;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetPathCanonicalize_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_srvsvc_NetPathCanonicalize_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPathCanonicalize_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_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                          const char *path /* [in] [charset(UTF16)] */,
+                                          uint8_t *can_path /* [out] [size_is(maxbuf)] */,
+                                          uint32_t maxbuf /* [in]  */,
+                                          const char *prefix /* [in] [charset(UTF16)] */,
+                                          uint32_t *pathtype /* [in,out] [ref] */,
+                                          uint32_t pathflags /* [in]  */,
+                                          WERROR *werror)
+{
+       struct srvsvc_NetPathCanonicalize r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.path = path;
+       r.in.maxbuf = maxbuf;
+       r.in.prefix = prefix;
+       r.in.pathtype = pathtype;
+       r.in.pathflags = pathflags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETPATHCANONICALIZE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       memcpy(can_path, r.out.can_path, r.in.maxbuf * sizeof(*can_path));
+       *pathtype = *r.out.pathtype;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetPathCompare_state {
+       struct srvsvc_NetPathCompare orig;
+       struct srvsvc_NetPathCompare tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetPathCompare_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetPathCompare_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_path1 /* [in] [charset(UTF16)] */,
+                                                    const char *_path2 /* [in] [charset(UTF16)] */,
+                                                    uint32_t _pathtype /* [in]  */,
+                                                    uint32_t _pathflags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetPathCompare_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetPathCompare_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.path1 = _path1;
+       state->orig.in.path2 = _path2;
+       state->orig.in.pathtype = _pathtype;
+       state->orig.in.pathflags = _pathflags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETPATHCOMPARE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetPathCompare_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetPathCompare_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetPathCompare_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPathCompare_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetPathCompare_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_srvsvc_NetPathCompare_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPathCompare_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_srvsvc_NetPathCompare(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                     const char *path1 /* [in] [charset(UTF16)] */,
+                                     const char *path2 /* [in] [charset(UTF16)] */,
+                                     uint32_t pathtype /* [in]  */,
+                                     uint32_t pathflags /* [in]  */,
+                                     WERROR *werror)
+{
+       struct srvsvc_NetPathCompare r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.path1 = path1;
+       r.in.path2 = path2;
+       r.in.pathtype = pathtype;
+       r.in.pathflags = pathflags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETPATHCOMPARE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetNameValidate_state {
+       struct srvsvc_NetNameValidate orig;
+       struct srvsvc_NetNameValidate tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetNameValidate_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetNameValidate_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _name_type /* [in]  */,
+                                                     uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetNameValidate_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetNameValidate_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.name = _name;
+       state->orig.in.name_type = _name_type;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETNAMEVALIDATE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetNameValidate_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetNameValidate_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetNameValidate_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetNameValidate_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetNameValidate_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_srvsvc_NetNameValidate_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetNameValidate_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_srvsvc_NetNameValidate(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                      const char *name /* [in] [charset(UTF16)] */,
+                                      uint32_t name_type /* [in]  */,
+                                      uint32_t flags /* [in]  */,
+                                      WERROR *werror)
+{
+       struct srvsvc_NetNameValidate r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.name = name;
+       r.in.name_type = name_type;
+       r.in.flags = flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETNAMEVALIDATE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state {
+       struct srvsvc_NETRPRNAMECANONICALIZE orig;
+       struct srvsvc_NETRPRNAMECANONICALIZE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRPRNAMECANONICALIZE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRPRNAMECANONICALIZE_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRPRNAMECANONICALIZE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRPRNAMECANONICALIZE_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRPRNAMECANONICALIZE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_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_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *werror)
+{
+       struct srvsvc_NETRPRNAMECANONICALIZE r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETRPRNAMECANONICALIZE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetPRNameCompare_state {
+       struct srvsvc_NetPRNameCompare orig;
+       struct srvsvc_NetPRNameCompare tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetPRNameCompare_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetPRNameCompare_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_name1 /* [in] [charset(UTF16)] */,
+                                                      const char *_name2 /* [in] [charset(UTF16)] */,
+                                                      uint32_t _name_type /* [in]  */,
+                                                      uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetPRNameCompare_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetPRNameCompare_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.name1 = _name1;
+       state->orig.in.name2 = _name2;
+       state->orig.in.name_type = _name_type;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETPRNAMECOMPARE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetPRNameCompare_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetPRNameCompare_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetPRNameCompare_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPRNameCompare_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetPRNameCompare_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_srvsvc_NetPRNameCompare_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetPRNameCompare_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_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                       const char *name1 /* [in] [charset(UTF16)] */,
+                                       const char *name2 /* [in] [charset(UTF16)] */,
+                                       uint32_t name_type /* [in]  */,
+                                       uint32_t flags /* [in]  */,
+                                       WERROR *werror)
+{
+       struct srvsvc_NetPRNameCompare r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.name1 = name1;
+       r.in.name2 = name2;
+       r.in.name_type = name_type;
+       r.in.flags = flags;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETPRNAMECOMPARE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareEnum_state {
+       struct srvsvc_NetShareEnum orig;
+       struct srvsvc_NetShareEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareEnum_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                  uint32_t _max_buffer /* [in]  */,
+                                                  uint32_t *_totalentries /* [out] [ref] */,
+                                                  uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.info_ctr = _info_ctr;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info_ctr = _info_ctr;
+       state->orig.out.totalentries = _totalentries;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareEnum_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_srvsvc,
+                                   NDR_SRVSVC_NETSHAREENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareEnum_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareEnum_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.info_ctr = *state->tmp.out.info_ctr;
+       *state->orig.out.totalentries = *state->tmp.out.totalentries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareEnum_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareEnum_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareEnum_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_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
+                                   TALLOC_CTX *mem_ctx,
+                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                   struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */,
+                                   uint32_t max_buffer /* [in]  */,
+                                   uint32_t *totalentries /* [out] [ref] */,
+                                   uint32_t *resume_handle /* [in,out] [unique] */,
+                                   WERROR *werror)
+{
+       struct srvsvc_NetShareEnum r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.info_ctr = info_ctr;
+       r.in.max_buffer = max_buffer;
+       r.in.resume_handle = resume_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREENUM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *info_ctr = *r.out.info_ctr;
        *totalentries = *r.out.totalentries;
        if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareDelStart_state {
+       struct srvsvc_NetShareDelStart orig;
+       struct srvsvc_NetShareDelStart tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareDelStart_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareDelStart_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_share /* [in] [charset(UTF16)] */,
+                                                      uint32_t _reserved /* [in]  */,
+                                                      struct policy_handle *_hnd /* [out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareDelStart_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareDelStart_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share = _share;
+       state->orig.in.reserved = _reserved;
+
+       /* Out parameters */
+       state->orig.out.hnd = _hnd;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareDelStart_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_srvsvc,
+                                   NDR_SRVSVC_NETSHAREDELSTART,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDelStart_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareDelStart_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareDelStart_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDelStart_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 */
+       if (state->orig.out.hnd && state->tmp.out.hnd) {
+               *state->orig.out.hnd = *state->tmp.out.hnd;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareDelStart_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareDelStart_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDelStart_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_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                       const char *share /* [in] [charset(UTF16)] */,
+                                       uint32_t reserved /* [in]  */,
+                                       struct policy_handle *hnd /* [out] [unique] */,
+                                       WERROR *werror)
+{
+       struct srvsvc_NetShareDelStart r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_unc = server_unc;
+       r.in.share = share;
+       r.in.reserved = reserved;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_srvsvc,
+                               NDR_SRVSVC_NETSHAREDELSTART,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       if (hnd && r.out.hnd) {
+               *hnd = *r.out.hnd;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_srvsvc_NetShareDelCommit_state {
+       struct srvsvc_NetShareDelCommit orig;
+       struct srvsvc_NetShareDelCommit tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetShareDelCommit_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetShareDelCommit_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_hnd /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetShareDelCommit_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetShareDelCommit_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.hnd = _hnd;
+
+       /* Out parameters */
+       state->orig.out.hnd = _hnd;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetShareDelCommit_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_srvsvc,
+                                   NDR_SRVSVC_NETSHAREDELCOMMIT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDelCommit_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetShareDelCommit_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetShareDelCommit_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDelCommit_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 */
+       if (state->orig.out.hnd && state->tmp.out.hnd) {
+               *state->orig.out.hnd = *state->tmp.out.hnd;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetShareDelCommit_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_srvsvc_NetShareDelCommit_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetShareDelCommit_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;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                             const char *service /* [in] [unique,charset(UTF16)] */,
-                                             uint32_t level /* [in]  */,
-                                             uint32_t options /* [in]  */,
-                                             struct srvsvc_Statistics **stats /* [out] [ref] */,
-                                             WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *hnd /* [in,out] [unique] */,
+                                        WERROR *werror)
 {
-       struct srvsvc_NetServerStatisticsGet r;
+       struct srvsvc_NetShareDelCommit r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.service = service;
-       r.in.level = level;
-       r.in.options = options;
+       r.in.hnd = hnd;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSERVERSTATISTICSGET,
+                               NDR_SRVSVC_NETSHAREDELCOMMIT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1267,7 +6813,7 @@ NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1275,7 +6821,9 @@ NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *stats = *r.out.stats;
+       if (hnd && r.out.hnd) {
+               *hnd = *r.out.hnd;
+       }
 
        /* Return result */
        if (werror) {
@@ -1285,79 +6833,159 @@ NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                      uint32_t level /* [in]  */,
-                                      union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */,
-                                      WERROR *werror)
+struct rpccli_srvsvc_NetGetFileSecurity_state {
+       struct srvsvc_NetGetFileSecurity orig;
+       struct srvsvc_NetGetFileSecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetGetFileSecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetGetFileSecurity_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_share /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_file /* [in] [charset(UTF16)] */,
+                                                        uint32_t _securityinformation /* [in]  */,
+                                                        struct sec_desc_buf **_sd_buf /* [out] [ref] */)
 {
-       struct srvsvc_NetTransportAdd r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetGetFileSecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetGetFileSecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.level = level;
-       r.in.info = info;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share = _share;
+       state->orig.in.file = _file;
+       state->orig.in.securityinformation = _securityinformation;
+
+       /* Out parameters */
+       state->orig.out.sd_buf = _sd_buf;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETTRANSPORTADD,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_srvsvc_NetGetFileSecurity_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_srvsvc,
+                                   NDR_SRVSVC_NETGETFILESECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetGetFileSecurity_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetGetFileSecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetGetFileSecurity_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetGetFileSecurity_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.sd_buf = *state->tmp.out.sd_buf;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetGetFileSecurity_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_srvsvc_NetGetFileSecurity_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetGetFileSecurity_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                       struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */,
-                                       uint32_t max_buffer /* [in]  */,
-                                       uint32_t *totalentries /* [out] [ref] */,
-                                       uint32_t *resume_handle /* [in,out] [unique] */,
-                                       WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                         const char *share /* [in] [unique,charset(UTF16)] */,
+                                         const char *file /* [in] [charset(UTF16)] */,
+                                         uint32_t securityinformation /* [in]  */,
+                                         struct sec_desc_buf **sd_buf /* [out] [ref] */,
+                                         WERROR *werror)
 {
-       struct srvsvc_NetTransportEnum r;
+       struct srvsvc_NetGetFileSecurity r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.transports = transports;
-       r.in.max_buffer = max_buffer;
-       r.in.resume_handle = resume_handle;
+       r.in.share = share;
+       r.in.file = file;
+       r.in.securityinformation = securityinformation;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETTRANSPORTENUM,
+                               NDR_SRVSVC_NETGETFILESECURITY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1365,7 +6993,7 @@ NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1373,11 +7001,7 @@ NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *transports = *r.out.transports;
-       *totalentries = *r.out.totalentries;
-       if (resume_handle && r.out.resume_handle) {
-               *resume_handle = *r.out.resume_handle;
-       }
+       *sd_buf = *r.out.sd_buf;
 
        /* Return result */
        if (werror) {
@@ -1387,73 +7011,153 @@ NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                      uint32_t level /* [in]  */,
-                                      struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */,
-                                      WERROR *werror)
+struct rpccli_srvsvc_NetSetFileSecurity_state {
+       struct srvsvc_NetSetFileSecurity orig;
+       struct srvsvc_NetSetFileSecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetSetFileSecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetSetFileSecurity_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_share /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_file /* [in] [charset(UTF16)] */,
+                                                        uint32_t _securityinformation /* [in]  */,
+                                                        struct sec_desc_buf *_sd_buf /* [in] [ref] */)
 {
-       struct srvsvc_NetTransportDel r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetSetFileSecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetSetFileSecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.level = level;
-       r.in.info0 = info0;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.share = _share;
+       state->orig.in.file = _file;
+       state->orig.in.securityinformation = _securityinformation;
+       state->orig.in.sd_buf = _sd_buf;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETTRANSPORTDEL,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSETFILESECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetSetFileSecurity_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetSetFileSecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetSetFileSecurity_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSetFileSecurity_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetSetFileSecurity_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_srvsvc_NetSetFileSecurity_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetSetFileSecurity_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                   struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */,
-                                   WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                         const char *share /* [in] [unique,charset(UTF16)] */,
+                                         const char *file /* [in] [charset(UTF16)] */,
+                                         uint32_t securityinformation /* [in]  */,
+                                         struct sec_desc_buf *sd_buf /* [in] [ref] */,
+                                         WERROR *werror)
 {
-       struct srvsvc_NetRemoteTOD r;
+       struct srvsvc_NetSetFileSecurity r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
+       r.in.share = share;
+       r.in.file = file;
+       r.in.securityinformation = securityinformation;
+       r.in.sd_buf = sd_buf;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETREMOTETOD,
+                               NDR_SRVSVC_NETSETFILESECURITY,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1461,7 +7165,7 @@ NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1469,7 +7173,6 @@ NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info = *r.out.info;
 
        /* Return result */
        if (werror) {
@@ -1479,79 +7182,145 @@ NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                        const char *transport /* [in] [unique,charset(UTF16)] */,
-                                        uint32_t servicebits /* [in]  */,
-                                        uint32_t updateimmediately /* [in]  */,
-                                        WERROR *werror)
+struct rpccli_srvsvc_NetServerTransportAddEx_state {
+       struct srvsvc_NetServerTransportAddEx orig;
+       struct srvsvc_NetServerTransportAddEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetServerTransportAddEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetServerTransportAddEx_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                             uint32_t _level /* [in]  */,
+                                                             union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */)
 {
-       struct srvsvc_NetSetServiceBits r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetServerTransportAddEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetServerTransportAddEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.transport = transport;
-       r.in.servicebits = servicebits;
-       r.in.updateimmediately = updateimmediately;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSETSERVICEBITS,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSERVERTRANSPORTADDEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetServerTransportAddEx_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NetServerTransportAddEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetServerTransportAddEx_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetServerTransportAddEx_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetServerTransportAddEx_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_srvsvc_NetServerTransportAddEx_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetServerTransportAddEx_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx,
-                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                  const char *path /* [in] [charset(UTF16)] */,
-                                  uint32_t pathflags /* [in]  */,
-                                  uint32_t *pathtype /* [out] [ref] */,
-                                  WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                              uint32_t level /* [in]  */,
+                                              union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */,
+                                              WERROR *werror)
 {
-       struct srvsvc_NetPathType r;
+       struct srvsvc_NetServerTransportAddEx r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.path = path;
-       r.in.pathflags = pathflags;
+       r.in.level = level;
+       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETPATHTYPE,
+                               NDR_SRVSVC_NETSERVERTRANSPORTADDEX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1559,7 +7328,7 @@ NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1567,7 +7336,6 @@ NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *pathtype = *r.out.pathtype;
 
        /* Return result */
        if (werror) {
@@ -1577,89 +7345,157 @@ NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                          const char *path /* [in] [charset(UTF16)] */,
-                                          uint8_t *can_path /* [out] [size_is(maxbuf)] */,
-                                          uint32_t maxbuf /* [in]  */,
-                                          const char *prefix /* [in] [charset(UTF16)] */,
-                                          uint32_t *pathtype /* [in,out] [ref] */,
-                                          uint32_t pathflags /* [in]  */,
-                                          WERROR *werror)
+struct rpccli_srvsvc_NetServerSetServiceBitsEx_state {
+       struct srvsvc_NetServerSetServiceBitsEx orig;
+       struct srvsvc_NetServerSetServiceBitsEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NetServerSetServiceBitsEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NetServerSetServiceBitsEx_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_emulated_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_transport /* [in] [unique,charset(UTF16)] */,
+                                                               uint32_t _servicebitsofinterest /* [in]  */,
+                                                               uint32_t _servicebits /* [in]  */,
+                                                               uint32_t _updateimmediately /* [in]  */)
 {
-       struct srvsvc_NetPathCanonicalize r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NetServerSetServiceBitsEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NetServerSetServiceBitsEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.path = path;
-       r.in.maxbuf = maxbuf;
-       r.in.prefix = prefix;
-       r.in.pathtype = pathtype;
-       r.in.pathflags = pathflags;
+       state->orig.in.server_unc = _server_unc;
+       state->orig.in.emulated_server_unc = _emulated_server_unc;
+       state->orig.in.transport = _transport;
+       state->orig.in.servicebitsofinterest = _servicebitsofinterest;
+       state->orig.in.servicebits = _servicebits;
+       state->orig.in.updateimmediately = _updateimmediately;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETPATHCANONICALIZE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETSERVERSETSERVICEBITSEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NetServerSetServiceBitsEx_done, req);
+       return req;
+}
 
+static void rpccli_srvsvc_NetServerSetServiceBitsEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NetServerSetServiceBitsEx_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetServerSetServiceBitsEx_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result)
+{
+       struct rpccli_srvsvc_NetServerSetServiceBitsEx_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NetServerSetServiceBitsEx_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       memcpy(can_path, r.out.can_path, r.in.maxbuf * sizeof(*can_path));
-       *pathtype = *r.out.pathtype;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                     const char *path1 /* [in] [charset(UTF16)] */,
-                                     const char *path2 /* [in] [charset(UTF16)] */,
-                                     uint32_t pathtype /* [in]  */,
-                                     uint32_t pathflags /* [in]  */,
-                                     WERROR *werror)
+NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli,
+                                                TALLOC_CTX *mem_ctx,
+                                                const char *server_unc /* [in] [unique,charset(UTF16)] */,
+                                                const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                const char *transport /* [in] [unique,charset(UTF16)] */,
+                                                uint32_t servicebitsofinterest /* [in]  */,
+                                                uint32_t servicebits /* [in]  */,
+                                                uint32_t updateimmediately /* [in]  */,
+                                                WERROR *werror)
 {
-       struct srvsvc_NetPathCompare r;
+       struct srvsvc_NetServerSetServiceBitsEx r;
        NTSTATUS status;
 
        /* In parameters */
        r.in.server_unc = server_unc;
-       r.in.path1 = path1;
-       r.in.path2 = path2;
-       r.in.pathtype = pathtype;
-       r.in.pathflags = pathflags;
+       r.in.emulated_server_unc = emulated_server_unc;
+       r.in.transport = transport;
+       r.in.servicebitsofinterest = servicebitsofinterest;
+       r.in.servicebits = servicebits;
+       r.in.updateimmediately = updateimmediately;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETPATHCOMPARE,
+                               NDR_SRVSVC_NETSERVERSETSERVICEBITSEX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1667,7 +7503,7 @@ NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1684,72 +7520,133 @@ NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli,
-                                      TALLOC_CTX *mem_ctx,
-                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                      const char *name /* [in] [charset(UTF16)] */,
-                                      uint32_t name_type /* [in]  */,
-                                      uint32_t flags /* [in]  */,
-                                      WERROR *werror)
+struct rpccli_srvsvc_NETRDFSGETVERSION_state {
+       struct srvsvc_NETRDFSGETVERSION orig;
+       struct srvsvc_NETRDFSGETVERSION tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSGETVERSION_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSGETVERSION_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NetNameValidate r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSGETVERSION_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSGETVERSION_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.name = name;
-       r.in.name_type = name_type;
-       r.in.flags = flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETNAMEVALIDATE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSGETVERSION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSGETVERSION_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSGETVERSION_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSGETVERSION_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSGETVERSION_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSGETVERSION_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSGETVERSION_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
 {
-       struct srvsvc_NETRPRNAMECANONICALIZE r;
+       struct srvsvc_NETRDFSGETVERSION r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRPRNAMECANONICALIZE,
+                               NDR_SRVSVC_NETRDFSGETVERSION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1757,7 +7654,7 @@ NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1774,83 +7671,133 @@ NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                       const char *name1 /* [in] [charset(UTF16)] */,
-                                       const char *name2 /* [in] [charset(UTF16)] */,
-                                       uint32_t name_type /* [in]  */,
-                                       uint32_t flags /* [in]  */,
-                                       WERROR *werror)
+struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state {
+       struct srvsvc_NETRDFSCREATELOCALPARTITION orig;
+       struct srvsvc_NETRDFSCREATELOCALPARTITION tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NetPRNameCompare r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.name1 = name1;
-       r.in.name2 = name2;
-       r.in.name_type = name_type;
-       r.in.flags = flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETPRNAMECOMPARE,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSCREATELOCALPARTITION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
-                                   TALLOC_CTX *mem_ctx,
-                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                   struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */,
-                                   uint32_t max_buffer /* [in]  */,
-                                   uint32_t *totalentries /* [out] [ref] */,
-                                   uint32_t *resume_handle /* [in,out] [unique] */,
-                                   WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *werror)
 {
-       struct srvsvc_NetShareEnum r;
+       struct srvsvc_NETRDFSCREATELOCALPARTITION r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.info_ctr = info_ctr;
-       r.in.max_buffer = max_buffer;
-       r.in.resume_handle = resume_handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREENUM,
+                               NDR_SRVSVC_NETRDFSCREATELOCALPARTITION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1858,7 +7805,7 @@ NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1866,11 +7813,6 @@ NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *info_ctr = *r.out.info_ctr;
-       *totalentries = *r.out.totalentries;
-       if (resume_handle && r.out.resume_handle) {
-               *resume_handle = *r.out.resume_handle;
-       }
 
        /* Return result */
        if (werror) {
@@ -1880,76 +7822,133 @@ NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                       const char *share /* [in] [charset(UTF16)] */,
-                                       uint32_t reserved /* [in]  */,
-                                       struct policy_handle *hnd /* [out] [unique] */,
-                                       WERROR *werror)
+struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state {
+       struct srvsvc_NETRDFSDELETELOCALPARTITION orig;
+       struct srvsvc_NETRDFSDELETELOCALPARTITION tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NetShareDelStart r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.share = share;
-       r.in.reserved = reserved;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREDELSTART,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSDELETELOCALPARTITION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       if (hnd && r.out.hnd) {
-               *hnd = *r.out.hnd;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *hnd /* [in,out] [unique] */,
-                                        WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *werror)
 {
-       struct srvsvc_NetShareDelCommit r;
+       struct srvsvc_NETRDFSDELETELOCALPARTITION r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.hnd = hnd;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSHAREDELCOMMIT,
+                               NDR_SRVSVC_NETRDFSDELETELOCALPARTITION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1957,7 +7956,7 @@ NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1965,9 +7964,6 @@ NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       if (hnd && r.out.hnd) {
-               *hnd = *r.out.hnd;
-       }
 
        /* Return result */
        if (werror) {
@@ -1977,84 +7973,133 @@ NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                         const char *share /* [in] [unique,charset(UTF16)] */,
-                                         const char *file /* [in] [charset(UTF16)] */,
-                                         uint32_t securityinformation /* [in]  */,
-                                         struct sec_desc_buf **sd_buf /* [out] [ref] */,
-                                         WERROR *werror)
+struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state {
+       struct srvsvc_NETRDFSSETLOCALVOLUMESTATE orig;
+       struct srvsvc_NETRDFSSETLOCALVOLUMESTATE tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NetGetFileSecurity r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.share = share;
-       r.in.file = file;
-       r.in.securityinformation = securityinformation;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETGETFILESECURITY,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *sd_buf = *r.out.sd_buf;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                         const char *share /* [in] [unique,charset(UTF16)] */,
-                                         const char *file /* [in] [charset(UTF16)] */,
-                                         uint32_t securityinformation /* [in]  */,
-                                         struct sec_desc_buf *sd_buf /* [in] [ref] */,
-                                         WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *werror)
 {
-       struct srvsvc_NetSetFileSecurity r;
+       struct srvsvc_NETRDFSSETLOCALVOLUMESTATE r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.share = share;
-       r.in.file = file;
-       r.in.securityinformation = securityinformation;
-       r.in.sd_buf = sd_buf;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSETFILESECURITY,
+                               NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2062,7 +8107,7 @@ NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2079,82 +8124,133 @@ NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                              uint32_t level /* [in]  */,
-                                              union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */,
-                                              WERROR *werror)
+struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state {
+       struct srvsvc_NETRDFSSETSERVERINFO orig;
+       struct srvsvc_NETRDFSSETSERVERINFO tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSSETSERVERINFO_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSSETSERVERINFO_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NetServerTransportAddEx r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.level = level;
-       r.in.info = info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSERVERTRANSPORTADDEX,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSSETSERVERINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSSETSERVERINFO_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSSETSERVERINFO_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSSETSERVERINFO_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli,
-                                                TALLOC_CTX *mem_ctx,
-                                                const char *server_unc /* [in] [unique,charset(UTF16)] */,
-                                                const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */,
-                                                const char *transport /* [in] [unique,charset(UTF16)] */,
-                                                uint32_t servicebitsofinterest /* [in]  */,
-                                                uint32_t servicebits /* [in]  */,
-                                                uint32_t updateimmediately /* [in]  */,
-                                                WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *werror)
 {
-       struct srvsvc_NetServerSetServiceBitsEx r;
+       struct srvsvc_NETRDFSSETSERVERINFO r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_unc = server_unc;
-       r.in.emulated_server_unc = emulated_server_unc;
-       r.in.transport = transport;
-       r.in.servicebitsofinterest = servicebitsofinterest;
-       r.in.servicebits = servicebits;
-       r.in.updateimmediately = updateimmediately;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETSERVERSETSERVICEBITSEX,
+                               NDR_SRVSVC_NETRDFSSETSERVERINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2162,7 +8258,7 @@ NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2179,64 +8275,133 @@ NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state {
+       struct srvsvc_NETRDFSCREATEEXITPOINT orig;
+       struct srvsvc_NETRDFSCREATEEXITPOINT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSCREATEEXITPOINT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSCREATEEXITPOINT_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NETRDFSGETVERSION r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSGETVERSION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSCREATEEXITPOINT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSCREATEEXITPOINT_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSCREATEEXITPOINT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli,
-                                                  TALLOC_CTX *mem_ctx,
-                                                  WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *werror)
 {
-       struct srvsvc_NETRDFSCREATELOCALPARTITION r;
+       struct srvsvc_NETRDFSCREATEEXITPOINT r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSCREATELOCALPARTITION,
+                               NDR_SRVSVC_NETRDFSCREATEEXITPOINT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2244,7 +8409,7 @@ NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2261,64 +8426,133 @@ NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli,
-                                                  TALLOC_CTX *mem_ctx,
-                                                  WERROR *werror)
+struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state {
+       struct srvsvc_NETRDFSDELETEEXITPOINT orig;
+       struct srvsvc_NETRDFSDELETEEXITPOINT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSDELETEEXITPOINT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSDELETEEXITPOINT_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NETRDFSDELETELOCALPARTITION r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSDELETELOCALPARTITION,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSDELETEEXITPOINT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSDELETEEXITPOINT_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSDELETEEXITPOINT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli,
-                                                 TALLOC_CTX *mem_ctx,
-                                                 WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *werror)
 {
-       struct srvsvc_NETRDFSSETLOCALVOLUMESTATE r;
+       struct srvsvc_NETRDFSDELETEEXITPOINT r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE,
+                               NDR_SRVSVC_NETRDFSDELETEEXITPOINT,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2326,7 +8560,7 @@ NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2343,64 +8577,133 @@ NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror)
+struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state {
+       struct srvsvc_NETRDFSMODIFYPREFIX orig;
+       struct srvsvc_NETRDFSMODIFYPREFIX tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSMODIFYPREFIX_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSMODIFYPREFIX_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NETRDFSSETSERVERINFO r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSSETSERVERINFO,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSMODIFYPREFIX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSMODIFYPREFIX_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSMODIFYPREFIX_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *werror)
 {
-       struct srvsvc_NETRDFSCREATEEXITPOINT r;
+       struct srvsvc_NETRDFSMODIFYPREFIX r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSCREATEEXITPOINT,
+                               NDR_SRVSVC_NETRDFSMODIFYPREFIX,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2408,7 +8711,7 @@ NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2425,64 +8728,133 @@ NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             WERROR *werror)
+struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state {
+       struct srvsvc_NETRDFSFIXLOCALVOLUME orig;
+       struct srvsvc_NETRDFSFIXLOCALVOLUME tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NETRDFSDELETEEXITPOINT r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSDELETEEXITPOINT,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSFIXLOCALVOLUME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          WERROR *werror)
+NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *werror)
 {
-       struct srvsvc_NETRDFSMODIFYPREFIX r;
+       struct srvsvc_NETRDFSFIXLOCALVOLUME r;
        NTSTATUS status;
 
        /* In parameters */
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSMODIFYPREFIX,
+                               NDR_SRVSVC_NETRDFSFIXLOCALVOLUME,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2490,7 +8862,7 @@ NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2507,45 +8879,114 @@ NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            WERROR *werror)
+struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state {
+       struct srvsvc_NETRDFSMANAGERREPORTSITEINFO orig;
+       struct srvsvc_NETRDFSMANAGERREPORTSITEINFO tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli)
 {
-       struct srvsvc_NETRDFSFIXLOCALVOLUME r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
 
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r);
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_srvsvc,
-                               NDR_SRVSVC_NETRDFSFIXLOCALVOLUME,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r);
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result)
+{
+       struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli,
@@ -2589,6 +9030,116 @@ NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state {
+       struct srvsvc_NETRSERVERTRANSPORTDELEX orig;
+       struct srvsvc_NETRSERVERTRANSPORTDELEX tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_srvsvc,
+                                   NDR_SRVSVC_NETRSERVERTRANSPORTDELEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_done, req);
+       return req;
+}
+
+static void rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result)
+{
+       struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state *state = tevent_req_data(
+               req, struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_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_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                WERROR *werror)
index f57bf5d37866f30a986f132793506775f5348d69..d55fca55a5857583dcbd19d36edb15d127891264 100644 (file)
@@ -1,6 +1,17 @@
 #include "../librpc/gen_ndr/ndr_srvsvc.h"
 #ifndef __CLI_SRVSVC__
 #define __CLI_SRVSVC__
+struct tevent_req *rpccli_srvsvc_NetCharDevEnum_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                    struct srvsvc_NetCharDevInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                    uint32_t _max_buffer /* [in]  */,
+                                                    uint32_t *_totalentries /* [out] [ref] */,
+                                                    uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetCharDevEnum_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -9,6 +20,16 @@ NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli,
                                      uint32_t *totalentries /* [out] [ref] */,
                                      uint32_t *resume_handle /* [in,out] [unique] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_device_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _level /* [in]  */,
+                                                       union srvsvc_NetCharDevInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetCharDevGetInfo_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -16,12 +37,33 @@ NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli,
                                         uint32_t level /* [in]  */,
                                         union srvsvc_NetCharDevInfo *info /* [out] [ref,switch_is(level)] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevControl_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_device_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _opcode /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetCharDevControl_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                         const char *device_name /* [in] [charset(UTF16)] */,
                                         uint32_t opcode /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevQEnum_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_user /* [in] [unique,charset(UTF16)] */,
+                                                     struct srvsvc_NetCharDevQInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                     uint32_t _max_buffer /* [in]  */,
+                                                     uint32_t *_totalentries /* [out] [ref] */,
+                                                     uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetCharDevQEnum_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -31,6 +73,17 @@ NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli,
                                       uint32_t *totalentries /* [out] [ref] */,
                                       uint32_t *resume_handle /* [in,out] [unique] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevQGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_queue_name /* [in] [charset(UTF16)] */,
+                                                        const char *_user /* [in] [charset(UTF16)] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        union srvsvc_NetCharDevQInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -39,6 +92,17 @@ NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli,
                                          uint32_t level /* [in]  */,
                                          union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevQSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_queue_name /* [in] [charset(UTF16)] */,
+                                                        uint32_t _level /* [in]  */,
+                                                        union srvsvc_NetCharDevQInfo _info /* [in] [switch_is(level)] */,
+                                                        uint32_t *_parm_error /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -47,17 +111,46 @@ NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli,
                                          union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */,
                                          uint32_t *parm_error /* [in,out] [unique] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevQPurge_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_queue_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_srvsvc_NetCharDevQPurge_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                        const char *queue_name /* [in] [charset(UTF16)] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetCharDevQPurgeSelf_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_queue_name /* [in] [charset(UTF16)] */,
+                                                          const char *_computer_name /* [in] [charset(UTF16)] */);
+NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                            const char *queue_name /* [in] [charset(UTF16)] */,
                                            const char *computer_name /* [in] [charset(UTF16)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetConnEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_path /* [in] [unique,charset(UTF16)] */,
+                                                 struct srvsvc_NetConnInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                 uint32_t _max_buffer /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetConnEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -67,6 +160,19 @@ NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli,
                                   uint32_t *totalentries /* [out] [ref] */,
                                   uint32_t *resume_handle /* [in,out] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetFileEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_path /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_user /* [in] [unique,charset(UTF16)] */,
+                                                 struct srvsvc_NetFileInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                 uint32_t _max_buffer /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetFileEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -77,6 +183,16 @@ NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli,
                                   uint32_t *totalentries /* [out] [ref] */,
                                   uint32_t *resume_handle /* [in,out] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetFileGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _fid /* [in]  */,
+                                                    uint32_t _level /* [in]  */,
+                                                    union srvsvc_NetFileInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetFileGetInfo_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -84,11 +200,32 @@ NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli,
                                      uint32_t level /* [in]  */,
                                      union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetFileClose_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  uint32_t _fid /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetFileClose_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                    uint32_t fid /* [in]  */,
                                    WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetSessEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_client /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_user /* [in] [unique,charset(UTF16)] */,
+                                                 struct srvsvc_NetSessInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                 uint32_t _max_buffer /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetSessEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -99,12 +236,31 @@ NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli,
                                   uint32_t *totalentries /* [out] [ref] */,
                                   uint32_t *resume_handle /* [in,out] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetSessDel_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                const char *_client /* [in] [unique,charset(UTF16)] */,
+                                                const char *_user /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_srvsvc_NetSessDel_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                  const char *client /* [in] [unique,charset(UTF16)] */,
                                  const char *user /* [in] [unique,charset(UTF16)] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareAdd_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 uint32_t _level /* [in]  */,
+                                                 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                 uint32_t *_parm_error /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetShareAdd_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -112,6 +268,17 @@ NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli,
                                   union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */,
                                   uint32_t *parm_error /* [in,out] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareEnumAll_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                     uint32_t _max_buffer /* [in]  */,
+                                                     uint32_t *_totalentries /* [out] [ref] */,
+                                                     uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetShareEnumAll_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -120,6 +287,16 @@ NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli,
                                       uint32_t *totalentries /* [out] [ref] */,
                                       uint32_t *resume_handle /* [in,out] [unique] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_share_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union srvsvc_NetShareInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetShareGetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -127,6 +304,17 @@ NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli,
                                       uint32_t level /* [in]  */,
                                       union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_share_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                     uint32_t *_parm_error /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetShareSetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -135,30 +323,76 @@ NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli,
                                       union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */,
                                       uint32_t *parm_error /* [in,out] [unique] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareDel_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_share_name /* [in] [charset(UTF16)] */,
+                                                 uint32_t _reserved /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetShareDel_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                   const char *share_name /* [in] [charset(UTF16)] */,
                                   uint32_t reserved /* [in]  */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareDelSticky_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_share_name /* [in] [charset(UTF16)] */,
+                                                       uint32_t _reserved /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetShareDelSticky_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                         const char *share_name /* [in] [charset(UTF16)] */,
                                         uint32_t reserved /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareCheck_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   const char *_device_name /* [in] [charset(UTF16)] */,
+                                                   enum srvsvc_ShareType *_type /* [out] [ref] */);
+NTSTATUS rpccli_srvsvc_NetShareCheck_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                     const char *device_name /* [in] [charset(UTF16)] */,
                                     enum srvsvc_ShareType *type /* [out] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetSrvGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   union srvsvc_NetSrvInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetSrvGetInfo_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                     uint32_t level /* [in]  */,
                                     union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetSrvSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                   uint32_t _level /* [in]  */,
+                                                   union srvsvc_NetSrvInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                   uint32_t *_parm_error /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetSrvSetInfo_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -166,6 +400,18 @@ NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli,
                                     union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */,
                                     uint32_t *parm_error /* [in,out] [unique] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetDiskEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 uint32_t _level /* [in]  */,
+                                                 struct srvsvc_NetDiskInfo *_info /* [in,out] [ref] */,
+                                                 uint32_t _maxlen /* [in]  */,
+                                                 uint32_t *_totalentries /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetDiskEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -175,6 +421,17 @@ NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli,
                                   uint32_t *totalentries /* [out] [ref] */,
                                   uint32_t *resume_handle /* [in,out] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetServerStatisticsGet_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                            const char *_service /* [in] [unique,charset(UTF16)] */,
+                                                            uint32_t _level /* [in]  */,
+                                                            uint32_t _options /* [in]  */,
+                                                            struct srvsvc_Statistics **_stats /* [out] [ref] */);
+NTSTATUS rpccli_srvsvc_NetServerStatisticsGet_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -183,12 +440,32 @@ NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli,
                                              uint32_t options /* [in]  */,
                                              struct srvsvc_Statistics **stats /* [out] [ref] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetTransportAdd_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetTransportAdd_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                       uint32_t level /* [in]  */,
                                       union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetTransportEnum_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      struct srvsvc_NetTransportInfoCtr *_transports /* [in,out] [ref] */,
+                                                      uint32_t _max_buffer /* [in]  */,
+                                                      uint32_t *_totalentries /* [out] [ref] */,
+                                                      uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetTransportEnum_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -197,17 +474,44 @@ NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli,
                                        uint32_t *totalentries /* [out] [ref] */,
                                        uint32_t *resume_handle /* [in,out] [unique] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetTransportDel_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     struct srvsvc_NetTransportInfo0 *_info0 /* [in] [ref] */);
+NTSTATUS rpccli_srvsvc_NetTransportDel_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                       uint32_t level /* [in]  */,
                                       struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetRemoteTOD_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  struct srvsvc_NetRemoteTODInfo **_info /* [out] [ref] */);
+NTSTATUS rpccli_srvsvc_NetRemoteTOD_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                    struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetSetServiceBits_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_transport /* [in] [unique,charset(UTF16)] */,
+                                                       uint32_t _servicebits /* [in]  */,
+                                                       uint32_t _updateimmediately /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetSetServiceBits_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -215,6 +519,16 @@ NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli,
                                         uint32_t servicebits /* [in]  */,
                                         uint32_t updateimmediately /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetPathType_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                 const char *_path /* [in] [charset(UTF16)] */,
+                                                 uint32_t _pathflags /* [in]  */,
+                                                 uint32_t *_pathtype /* [out] [ref] */);
+NTSTATUS rpccli_srvsvc_NetPathType_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -222,6 +536,19 @@ NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli,
                                   uint32_t pathflags /* [in]  */,
                                   uint32_t *pathtype /* [out] [ref] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetPathCanonicalize_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                         const char *_path /* [in] [charset(UTF16)] */,
+                                                         uint8_t *_can_path /* [out] [size_is(maxbuf)] */,
+                                                         uint32_t _maxbuf /* [in]  */,
+                                                         const char *_prefix /* [in] [charset(UTF16)] */,
+                                                         uint32_t *_pathtype /* [in,out] [ref] */,
+                                                         uint32_t _pathflags /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetPathCanonicalize_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -232,6 +559,17 @@ NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli,
                                           uint32_t *pathtype /* [in,out] [ref] */,
                                           uint32_t pathflags /* [in]  */,
                                           WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetPathCompare_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_path1 /* [in] [charset(UTF16)] */,
+                                                    const char *_path2 /* [in] [charset(UTF16)] */,
+                                                    uint32_t _pathtype /* [in]  */,
+                                                    uint32_t _pathflags /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetPathCompare_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -240,6 +578,16 @@ NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli,
                                      uint32_t pathtype /* [in]  */,
                                      uint32_t pathflags /* [in]  */,
                                      WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetNameValidate_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_name /* [in] [charset(UTF16)] */,
+                                                     uint32_t _name_type /* [in]  */,
+                                                     uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetNameValidate_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -247,9 +595,26 @@ NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli,
                                       uint32_t name_type /* [in]  */,
                                       uint32_t flags /* [in]  */,
                                       WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRPRNAMECANONICALIZE_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetPRNameCompare_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_name1 /* [in] [charset(UTF16)] */,
+                                                      const char *_name2 /* [in] [charset(UTF16)] */,
+                                                      uint32_t _name_type /* [in]  */,
+                                                      uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetPRNameCompare_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -258,6 +623,17 @@ NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli,
                                        uint32_t name_type /* [in]  */,
                                        uint32_t flags /* [in]  */,
                                        WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareEnum_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                  struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */,
+                                                  uint32_t _max_buffer /* [in]  */,
+                                                  uint32_t *_totalentries /* [out] [ref] */,
+                                                  uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetShareEnum_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -266,6 +642,16 @@ NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli,
                                    uint32_t *totalentries /* [out] [ref] */,
                                    uint32_t *resume_handle /* [in,out] [unique] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareDelStart_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_share /* [in] [charset(UTF16)] */,
+                                                      uint32_t _reserved /* [in]  */,
+                                                      struct policy_handle *_hnd /* [out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetShareDelStart_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -273,10 +659,28 @@ NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli,
                                        uint32_t reserved /* [in]  */,
                                        struct policy_handle *hnd /* [out] [unique] */,
                                        WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetShareDelCommit_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_hnd /* [in,out] [unique] */);
+NTSTATUS rpccli_srvsvc_NetShareDelCommit_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *hnd /* [in,out] [unique] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetGetFileSecurity_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_share /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_file /* [in] [charset(UTF16)] */,
+                                                        uint32_t _securityinformation /* [in]  */,
+                                                        struct sec_desc_buf **_sd_buf /* [out] [ref] */);
+NTSTATUS rpccli_srvsvc_NetGetFileSecurity_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -285,6 +689,17 @@ NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli,
                                          uint32_t securityinformation /* [in]  */,
                                          struct sec_desc_buf **sd_buf /* [out] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetSetFileSecurity_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_share /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_file /* [in] [charset(UTF16)] */,
+                                                        uint32_t _securityinformation /* [in]  */,
+                                                        struct sec_desc_buf *_sd_buf /* [in] [ref] */);
+NTSTATUS rpccli_srvsvc_NetSetFileSecurity_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -293,12 +708,33 @@ NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli,
                                          uint32_t securityinformation /* [in]  */,
                                          struct sec_desc_buf *sd_buf /* [in] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetServerTransportAddEx_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                             uint32_t _level /* [in]  */,
+                                                             union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */);
+NTSTATUS rpccli_srvsvc_NetServerTransportAddEx_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               const char *server_unc /* [in] [unique,charset(UTF16)] */,
                                               uint32_t level /* [in]  */,
                                               union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */,
                                               WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NetServerSetServiceBitsEx_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_emulated_server_unc /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_transport /* [in] [unique,charset(UTF16)] */,
+                                                               uint32_t _servicebitsofinterest /* [in]  */,
+                                                               uint32_t _servicebits /* [in]  */,
+                                                               uint32_t _updateimmediately /* [in]  */);
+NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result);
 NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 const char *server_unc /* [in] [unique,charset(UTF16)] */,
@@ -308,36 +744,102 @@ NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli,
                                                 uint32_t servicebits /* [in]  */,
                                                 uint32_t updateimmediately /* [in]  */,
                                                 WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSGETVERSION_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_send(TALLOC_CTX *mem_ctx,
+                                                                 struct tevent_context *ev,
+                                                                 struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_recv(struct tevent_req *req,
+                                                       TALLOC_CTX *mem_ctx,
+                                                       WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli,
                                                   TALLOC_CTX *mem_ctx,
                                                   WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSSETSERVERINFO_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSCREATEEXITPOINT_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSDELETEEXITPOINT_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSMODIFYPREFIX_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    WERROR *werror);
+struct tevent_req *rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli);
+NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result);
 NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                WERROR *werror);
index a95a4e72f71a9be234d01ded8c340e5a9c883e8d..1f814736d9aa397c61fa16b857e9c539ce41bfc5 100644 (file)
@@ -6,6 +6,126 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_svcctl.h"
 
+struct rpccli_svcctl_CloseServiceHandle_state {
+       struct svcctl_CloseServiceHandle orig;
+       struct svcctl_CloseServiceHandle tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_CloseServiceHandle_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_CloseServiceHandle_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_CloseServiceHandle_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_CloseServiceHandle_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_CloseServiceHandle_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_svcctl,
+                                   NDR_SVCCTL_CLOSESERVICEHANDLE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_CloseServiceHandle_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_CloseServiceHandle_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_CloseServiceHandle_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_CloseServiceHandle_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_CloseServiceHandle_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_svcctl_CloseServiceHandle_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_CloseServiceHandle_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_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in,out] [ref] */,
@@ -50,6 +170,129 @@ NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_ControlService_state {
+       struct svcctl_ControlService orig;
+       struct svcctl_ControlService tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_ControlService_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_ControlService_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    enum SERVICE_CONTROL _control /* [in]  */,
+                                                    struct SERVICE_STATUS *_service_status /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_ControlService_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_ControlService_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.control = _control;
+
+       /* Out parameters */
+       state->orig.out.service_status = _service_status;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_ControlService, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_ControlService_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_svcctl,
+                                   NDR_SVCCTL_CONTROLSERVICE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_ControlService_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_ControlService_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_ControlService_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ControlService_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.service_status = *state->tmp.out.service_status;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_ControlService_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_svcctl_ControlService_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ControlService_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_svcctl_ControlService(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -97,6 +340,118 @@ NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_DeleteService_state {
+       struct svcctl_DeleteService orig;
+       struct svcctl_DeleteService tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_DeleteService_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_DeleteService_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_DeleteService_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_DeleteService_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_DELETESERVICE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_DeleteService_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_DeleteService_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_DeleteService_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_DeleteService_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_DeleteService_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_svcctl_DeleteService_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_DeleteService_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_svcctl_DeleteService(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
@@ -140,6 +495,127 @@ NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_LockServiceDatabase_state {
+       struct svcctl_LockServiceDatabase orig;
+       struct svcctl_LockServiceDatabase tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_LockServiceDatabase_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_LockServiceDatabase_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         struct policy_handle *_lock /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_LockServiceDatabase_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_LockServiceDatabase_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.lock = _lock;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_LockServiceDatabase_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_svcctl,
+                                   NDR_SVCCTL_LOCKSERVICEDATABASE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_LockServiceDatabase_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_LockServiceDatabase_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_LockServiceDatabase_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_LockServiceDatabase_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.lock = *state->tmp.out.lock;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_LockServiceDatabase_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_svcctl_LockServiceDatabase_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_LockServiceDatabase_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_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -185,6 +661,134 @@ NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceObjectSecurity_state {
+       struct svcctl_QueryServiceObjectSecurity orig;
+       struct svcctl_QueryServiceObjectSecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                                uint32_t _security_flags /* [in]  */,
+                                                                uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                                uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                                uint32_t *_needed /* [out] [ref,range(0,0x40000)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceObjectSecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceObjectSecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.security_flags = _security_flags;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceObjectSecurity_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceObjectSecurity_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceObjectSecurity_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 */
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceObjectSecurity_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_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  struct policy_handle *handle /* [in] [ref] */,
@@ -236,39 +840,157 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
-                                               TALLOC_CTX *mem_ctx,
-                                               struct policy_handle *handle /* [in] [ref] */,
-                                               uint32_t security_flags /* [in]  */,
-                                               uint8_t *buffer /* [in] [ref,size_is(offered)] */,
-                                               uint32_t offered /* [in]  */,
-                                               WERROR *werror)
+struct rpccli_svcctl_SetServiceObjectSecurity_state {
+       struct svcctl_SetServiceObjectSecurity orig;
+       struct svcctl_SetServiceObjectSecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_SetServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_handle /* [in] [ref] */,
+                                                              uint32_t _security_flags /* [in]  */,
+                                                              uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
+                                                              uint32_t _offered /* [in]  */)
 {
-       struct svcctl_SetServiceObjectSecurity r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_SetServiceObjectSecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_SetServiceObjectSecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.security_flags = security_flags;
-       r.in.buffer = buffer;
-       r.in.offered = offered;
+       state->orig.in.handle = _handle;
+       state->orig.in.security_flags = _security_flags;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.offered = _offered;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r);
-       }
+       /* Out parameters */
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
-                               &r);
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &state->orig);
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_SetServiceObjectSecurity_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SetServiceObjectSecurity_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_SetServiceObjectSecurity_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result)
+{
+       struct rpccli_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SetServiceObjectSecurity_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_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *handle /* [in] [ref] */,
+                                               uint32_t security_flags /* [in]  */,
+                                               uint8_t *buffer /* [in] [ref,size_is(offered)] */,
+                                               uint32_t offered /* [in]  */,
+                                               WERROR *werror)
+{
+       struct svcctl_SetServiceObjectSecurity r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.security_flags = security_flags;
+       r.in.buffer = buffer;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -285,6 +1007,127 @@ NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceStatus_state {
+       struct svcctl_QueryServiceStatus orig;
+       struct svcctl_QueryServiceStatus tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceStatus_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceStatus_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        struct SERVICE_STATUS *_service_status /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceStatus_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceStatus_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.service_status = _service_status;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceStatus_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICESTATUS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceStatus_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceStatus_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceStatus_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceStatus_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.service_status = *state->tmp.out.service_status;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceStatus_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceStatus_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceStatus_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_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -330,6 +1173,116 @@ NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_SetServiceStatus_state {
+       struct svcctl_SetServiceStatus orig;
+       struct svcctl_SetServiceStatus tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_SetServiceStatus_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_SetServiceStatus_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_SetServiceStatus_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_SetServiceStatus_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_SETSERVICESTATUS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_SetServiceStatus_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_SetServiceStatus_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_SetServiceStatus_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SetServiceStatus_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_SetServiceStatus_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_svcctl_SetServiceStatus_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SetServiceStatus_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_svcctl_SetServiceStatus(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror)
@@ -371,6 +1324,126 @@ NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_UnlockServiceDatabase_state {
+       struct svcctl_UnlockServiceDatabase orig;
+       struct svcctl_UnlockServiceDatabase tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_UnlockServiceDatabase_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_lock /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_UnlockServiceDatabase_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_UnlockServiceDatabase_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.lock = _lock;
+
+       /* Out parameters */
+       state->orig.out.lock = _lock;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_UnlockServiceDatabase_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_svcctl,
+                                   NDR_SVCCTL_UNLOCKSERVICEDATABASE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_UnlockServiceDatabase_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_UnlockServiceDatabase_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.lock = *state->tmp.out.lock;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_UnlockServiceDatabase_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_UnlockServiceDatabase_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_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct policy_handle *lock /* [in,out] [ref] */,
@@ -415,6 +1488,116 @@ NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_NotifyBootConfigStatus_state {
+       struct svcctl_NotifyBootConfigStatus orig;
+       struct svcctl_NotifyBootConfigStatus tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_NotifyBootConfigStatus_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_NotifyBootConfigStatus_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_NotifyBootConfigStatus_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_NotifyBootConfigStatus_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_NotifyBootConfigStatus_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_NotifyBootConfigStatus_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_NotifyBootConfigStatus_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_NotifyBootConfigStatus_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_NotifyBootConfigStatus_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_svcctl_NotifyBootConfigStatus_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_NotifyBootConfigStatus_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_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              WERROR *werror)
@@ -456,16 +1639,134 @@ NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        struct policy_handle *handle /* [in] [ref] */,
-                                        uint32_t bits /* [in]  */,
-                                        uint32_t bitson /* [in]  */,
-                                        uint32_t immediate /* [in]  */,
-                                        WERROR *werror)
+struct rpccli_svcctl_SCSetServiceBitsW_state {
+       struct svcctl_SCSetServiceBitsW orig;
+       struct svcctl_SCSetServiceBitsW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_SCSetServiceBitsW_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t _bits /* [in]  */,
+                                                       uint32_t _bitson /* [in]  */,
+                                                       uint32_t _immediate /* [in]  */)
 {
-       struct svcctl_SCSetServiceBitsW r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_SCSetServiceBitsW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_SCSetServiceBitsW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.bits = _bits;
+       state->orig.in.bitson = _bitson;
+       state->orig.in.immediate = _immediate;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_SCSETSERVICEBITSW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_SCSetServiceBitsW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SCSetServiceBitsW_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_SCSetServiceBitsW_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SCSetServiceBitsW_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_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct policy_handle *handle /* [in] [ref] */,
+                                        uint32_t bits /* [in]  */,
+                                        uint32_t bitson /* [in]  */,
+                                        uint32_t immediate /* [in]  */,
+                                        WERROR *werror)
+{
+       struct svcctl_SCSetServiceBitsW r;
+       NTSTATUS status;
 
        /* In parameters */
        r.in.handle = handle;
@@ -505,6 +1806,145 @@ NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_ChangeServiceConfigW_state {
+       struct svcctl_ChangeServiceConfigW orig;
+       struct svcctl_ChangeServiceConfigW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_ChangeServiceConfigW_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          uint32_t _type /* [in]  */,
+                                                          enum svcctl_StartType _start_type /* [in]  */,
+                                                          enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                          const char *_binary_path /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t *_tag_id /* [out] [ref] */,
+                                                          const char *_dependencies /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_display_name /* [in] [unique,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_ChangeServiceConfigW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_ChangeServiceConfigW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.type = _type;
+       state->orig.in.start_type = _start_type;
+       state->orig.in.error_control = _error_control;
+       state->orig.in.binary_path = _binary_path;
+       state->orig.in.load_order_group = _load_order_group;
+       state->orig.in.dependencies = _dependencies;
+       state->orig.in.service_start_name = _service_start_name;
+       state->orig.in.password = _password;
+       state->orig.in.display_name = _display_name;
+
+       /* Out parameters */
+       state->orig.out.tag_id = _tag_id;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_ChangeServiceConfigW_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_svcctl,
+                                   NDR_SVCCTL_CHANGESERVICECONFIGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfigW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfigW_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.tag_id = *state->tmp.out.tag_id;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_ChangeServiceConfigW_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfigW_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_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -568,6 +2008,159 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_CreateServiceW_state {
+       struct svcctl_CreateServiceW orig;
+       struct svcctl_CreateServiceW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_CreateServiceW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_CreateServiceW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_scmanager_handle /* [in] [ref] */,
+                                                    const char *_ServiceName /* [in] [charset(UTF16)] */,
+                                                    const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _desired_access /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_StartType _start_type /* [in]  */,
+                                                    enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                    const char *_binary_path /* [in] [charset(UTF16)] */,
+                                                    const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_TagId /* [in,out] [unique] */,
+                                                    uint8_t *_dependencies /* [in] [unique,size_is(dependencies_size)] */,
+                                                    uint32_t _dependencies_size /* [in]  */,
+                                                    const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                    uint8_t *_password /* [in] [unique,size_is(password_size)] */,
+                                                    uint32_t _password_size /* [in]  */,
+                                                    struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_CreateServiceW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_CreateServiceW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.scmanager_handle = _scmanager_handle;
+       state->orig.in.ServiceName = _ServiceName;
+       state->orig.in.DisplayName = _DisplayName;
+       state->orig.in.desired_access = _desired_access;
+       state->orig.in.type = _type;
+       state->orig.in.start_type = _start_type;
+       state->orig.in.error_control = _error_control;
+       state->orig.in.binary_path = _binary_path;
+       state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
+       state->orig.in.TagId = _TagId;
+       state->orig.in.dependencies = _dependencies;
+       state->orig.in.dependencies_size = _dependencies_size;
+       state->orig.in.service_start_name = _service_start_name;
+       state->orig.in.password = _password;
+       state->orig.in.password_size = _password_size;
+
+       /* Out parameters */
+       state->orig.out.TagId = _TagId;
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_CreateServiceW_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_svcctl,
+                                   NDR_SVCCTL_CREATESERVICEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_CreateServiceW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_CreateServiceW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_CreateServiceW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_CreateServiceW_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 */
+       if (state->orig.out.TagId && state->tmp.out.TagId) {
+               *state->orig.out.TagId = *state->tmp.out.TagId;
+       }
+       *state->orig.out.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_CreateServiceW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_svcctl_CreateServiceW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_CreateServiceW_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_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *scmanager_handle /* [in] [ref] */,
@@ -644,6 +2237,137 @@ NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_EnumDependentServicesW_state {
+       struct svcctl_EnumDependentServicesW orig;
+       struct svcctl_EnumDependentServicesW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_EnumDependentServicesW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_service /* [in] [ref] */,
+                                                            enum svcctl_ServiceState _state /* [in]  */,
+                                                            uint8_t *_service_status /* [out] [ref,size_is(offered)] */,
+                                                            uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                            uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
+                                                            uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_EnumDependentServicesW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_EnumDependentServicesW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.service = _service;
+       state->orig.in.state = _state;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.service_status = _service_status;
+       state->orig.out.needed = _needed;
+       state->orig.out.services_returned = _services_returned;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_EnumDependentServicesW_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_svcctl,
+                                   NDR_SVCCTL_ENUMDEPENDENTSERVICESW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_EnumDependentServicesW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumDependentServicesW_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 */
+       memcpy(state->orig.out.service_status, state->tmp.out.service_status, state->tmp.in.offered * sizeof(*state->orig.out.service_status));
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.services_returned = *state->tmp.out.services_returned;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_EnumDependentServicesW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumDependentServicesW_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_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *service /* [in] [ref] */,
@@ -697,6 +2421,145 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_EnumServicesStatusW_state {
+       struct svcctl_EnumServicesStatusW orig;
+       struct svcctl_EnumServicesStatusW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_EnumServicesStatusW_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _type /* [in]  */,
+                                                         enum svcctl_ServiceState _state /* [in]  */,
+                                                         uint8_t *_service /* [out] [ref,size_is(offered)] */,
+                                                         uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                         uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
+                                                         uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */,
+                                                         uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_EnumServicesStatusW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_EnumServicesStatusW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.type = _type;
+       state->orig.in.state = _state;
+       state->orig.in.offered = _offered;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.service = _service;
+       state->orig.out.needed = _needed;
+       state->orig.out.services_returned = _services_returned;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_EnumServicesStatusW_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_svcctl,
+                                   NDR_SVCCTL_ENUMSERVICESSTATUSW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_EnumServicesStatusW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumServicesStatusW_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 */
+       memcpy(state->orig.out.service, state->tmp.out.service, state->tmp.in.offered * sizeof(*state->orig.out.service));
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.services_returned = *state->tmp.out.services_returned;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_EnumServicesStatusW_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumServicesStatusW_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_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -757,45 +2620,170 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     const char *MachineName /* [in] [unique,charset(UTF16)] */,
-                                     const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
-                                     uint32_t access_mask /* [in]  */,
-                                     struct policy_handle *handle /* [out] [ref] */,
-                                     WERROR *werror)
+struct rpccli_svcctl_OpenSCManagerW_state {
+       struct svcctl_OpenSCManagerW orig;
+       struct svcctl_OpenSCManagerW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_OpenSCManagerW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_OpenSCManagerW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_MachineName /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    struct policy_handle *_handle /* [out] [ref] */)
 {
-       struct svcctl_OpenSCManagerW r;
-       NTSTATUS status;
-
-       /* In parameters */
-       r.in.MachineName = MachineName;
-       r.in.DatabaseName = DatabaseName;
-       r.in.access_mask = access_mask;
+       struct tevent_req *req;
+       struct rpccli_svcctl_OpenSCManagerW_state *state;
+       struct tevent_req *subreq;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_OpenSCManagerW_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_OPENSCMANAGERW,
-                               &r);
+       /* In parameters */
+       state->orig.in.MachineName = _MachineName;
+       state->orig.in.DatabaseName = _DatabaseName;
+       state->orig.in.access_mask = _access_mask;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_OpenSCManagerW_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_OPENSCMANAGERW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_OpenSCManagerW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_OpenSCManagerW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_OpenSCManagerW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenSCManagerW_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_OpenSCManagerW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_svcctl_OpenSCManagerW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenSCManagerW_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_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     const char *MachineName /* [in] [unique,charset(UTF16)] */,
+                                     const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
+                                     uint32_t access_mask /* [in]  */,
+                                     struct policy_handle *handle /* [out] [ref] */,
+                                     WERROR *werror)
+{
+       struct svcctl_OpenSCManagerW r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.MachineName = MachineName;
+       r.in.DatabaseName = DatabaseName;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_OPENSCMANAGERW,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
        *handle = *r.out.handle;
 
        /* Return result */
@@ -806,6 +2794,131 @@ NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_OpenServiceW_state {
+       struct svcctl_OpenServiceW orig;
+       struct svcctl_OpenServiceW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_OpenServiceW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_OpenServiceW_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_scmanager_handle /* [in] [ref] */,
+                                                  const char *_ServiceName /* [in] [charset(UTF16)] */,
+                                                  uint32_t _access_mask /* [in]  */,
+                                                  struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_OpenServiceW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_OpenServiceW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.scmanager_handle = _scmanager_handle;
+       state->orig.in.ServiceName = _ServiceName;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_OpenServiceW_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_svcctl,
+                                   NDR_SVCCTL_OPENSERVICEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_OpenServiceW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_OpenServiceW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_OpenServiceW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenServiceW_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_OpenServiceW_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_svcctl_OpenServiceW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenServiceW_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_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *scmanager_handle /* [in] [ref] */,
@@ -855,6 +2968,132 @@ NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceConfigW_state {
+       struct svcctl_QueryServiceConfigW orig;
+       struct svcctl_QueryServiceConfigW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceConfigW_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         struct QUERY_SERVICE_CONFIG *_query /* [out] [ref] */,
+                                                         uint32_t _offered /* [in] [range(0,8192)] */,
+                                                         uint32_t *_needed /* [out] [ref,range(0,8192)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceConfigW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceConfigW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.query = _query;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceConfigW_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICECONFIGW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfigW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfigW_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.query = *state->tmp.out.query;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceConfigW_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfigW_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_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -904,6 +3143,132 @@ NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceLockStatusW_state {
+       struct svcctl_QueryServiceLockStatusW orig;
+       struct svcctl_QueryServiceLockStatusW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceLockStatusW_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             uint32_t _offered /* [in]  */,
+                                                             struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
+                                                             uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceLockStatusW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceLockStatusW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.lock_status = _lock_status;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceLockStatusW_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICELOCKSTATUSW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceLockStatusW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceLockStatusW_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.lock_status = *state->tmp.out.lock_status;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceLockStatusW_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceLockStatusW_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_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
@@ -953,6 +3318,122 @@ NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_StartServiceW_state {
+       struct svcctl_StartServiceW orig;
+       struct svcctl_StartServiceW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_StartServiceW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_StartServiceW_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   uint32_t _NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
+                                                   struct svcctl_ArgumentString *_Arguments /* [in] [unique,size_is(NumArgs)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_StartServiceW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_StartServiceW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.NumArgs = _NumArgs;
+       state->orig.in.Arguments = _Arguments;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_STARTSERVICEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_StartServiceW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_StartServiceW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_StartServiceW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_StartServiceW_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_StartServiceW_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_svcctl_StartServiceW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_StartServiceW_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_svcctl_StartServiceW(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
@@ -1000,15 +3481,144 @@ NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             struct policy_handle *handle /* [in] [ref] */,
-                                             const char *service_name /* [in] [unique,charset(UTF16)] */,
-                                             const char **display_name /* [out] [ref,charset(UTF16)] */,
-                                             uint32_t *display_name_length /* [in,out] [unique] */,
-                                             WERROR *werror)
+struct rpccli_svcctl_GetServiceDisplayNameW_state {
+       struct svcctl_GetServiceDisplayNameW orig;
+       struct svcctl_GetServiceDisplayNameW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_GetServiceDisplayNameW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_handle /* [in] [ref] */,
+                                                            const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                            const char **_display_name /* [out] [ref,charset(UTF16)] */,
+                                                            uint32_t *_display_name_length /* [in,out] [unique] */)
 {
-       struct svcctl_GetServiceDisplayNameW r;
+       struct tevent_req *req;
+       struct rpccli_svcctl_GetServiceDisplayNameW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_GetServiceDisplayNameW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.service_name = _service_name;
+       state->orig.in.display_name_length = _display_name_length;
+
+       /* Out parameters */
+       state->orig.out.display_name = _display_name;
+       state->orig.out.display_name_length = _display_name_length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_GetServiceDisplayNameW_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_svcctl,
+                                   NDR_SVCCTL_GETSERVICEDISPLAYNAMEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceDisplayNameW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceDisplayNameW_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.display_name = *state->tmp.out.display_name;
+       if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
+               *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_GetServiceDisplayNameW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceDisplayNameW_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_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct policy_handle *handle /* [in] [ref] */,
+                                             const char *service_name /* [in] [unique,charset(UTF16)] */,
+                                             const char **display_name /* [out] [ref,charset(UTF16)] */,
+                                             uint32_t *display_name_length /* [in,out] [unique] */,
+                                             WERROR *werror)
+{
+       struct svcctl_GetServiceDisplayNameW r;
        NTSTATUS status;
 
        /* In parameters */
@@ -1052,6 +3662,135 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_GetServiceKeyNameW_state {
+       struct svcctl_GetServiceKeyNameW orig;
+       struct svcctl_GetServiceKeyNameW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_GetServiceKeyNameW_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                        const char **_key_name /* [out] [ref,charset(UTF16)] */,
+                                                        uint32_t *_display_name_length /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_GetServiceKeyNameW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_GetServiceKeyNameW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.service_name = _service_name;
+       state->orig.in.display_name_length = _display_name_length;
+
+       /* Out parameters */
+       state->orig.out.key_name = _key_name;
+       state->orig.out.display_name_length = _display_name_length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_GetServiceKeyNameW_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_svcctl,
+                                   NDR_SVCCTL_GETSERVICEKEYNAMEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceKeyNameW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceKeyNameW_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.key_name = *state->tmp.out.key_name;
+       if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
+               *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_GetServiceKeyNameW_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceKeyNameW_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_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -1104,6 +3843,124 @@ NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_SCSetServiceBitsA_state {
+       struct svcctl_SCSetServiceBitsA orig;
+       struct svcctl_SCSetServiceBitsA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_SCSetServiceBitsA_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t _bits /* [in]  */,
+                                                       uint32_t _bitson /* [in]  */,
+                                                       uint32_t _immediate /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_SCSetServiceBitsA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_SCSetServiceBitsA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.bits = _bits;
+       state->orig.in.bitson = _bitson;
+       state->orig.in.immediate = _immediate;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_SCSETSERVICEBITSA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_SCSetServiceBitsA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SCSetServiceBitsA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_SCSetServiceBitsA_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SCSetServiceBitsA_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_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -1153,6 +4010,145 @@ NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_ChangeServiceConfigA_state {
+       struct svcctl_ChangeServiceConfigA orig;
+       struct svcctl_ChangeServiceConfigA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_ChangeServiceConfigA_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          uint32_t _type /* [in]  */,
+                                                          enum svcctl_StartType _start_type /* [in]  */,
+                                                          enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                          const char *_binary_path /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t *_tag_id /* [out] [ref] */,
+                                                          const char *_dependencies /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_display_name /* [in] [unique,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_ChangeServiceConfigA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_ChangeServiceConfigA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.type = _type;
+       state->orig.in.start_type = _start_type;
+       state->orig.in.error_control = _error_control;
+       state->orig.in.binary_path = _binary_path;
+       state->orig.in.load_order_group = _load_order_group;
+       state->orig.in.dependencies = _dependencies;
+       state->orig.in.service_start_name = _service_start_name;
+       state->orig.in.password = _password;
+       state->orig.in.display_name = _display_name;
+
+       /* Out parameters */
+       state->orig.out.tag_id = _tag_id;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_ChangeServiceConfigA_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_svcctl,
+                                   NDR_SVCCTL_CHANGESERVICECONFIGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfigA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfigA_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.tag_id = *state->tmp.out.tag_id;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_ChangeServiceConfigA_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfigA_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_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -1216,6 +4212,151 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_CreateServiceA_state {
+       struct svcctl_CreateServiceA orig;
+       struct svcctl_CreateServiceA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_CreateServiceA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_CreateServiceA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _desired_access /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_StartType _start_type /* [in]  */,
+                                                    enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                    const char *_binary_path /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_TagId /* [out] [unique] */,
+                                                    const char *_dependencies /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_password /* [in] [unique,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_CreateServiceA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_CreateServiceA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.ServiceName = _ServiceName;
+       state->orig.in.DisplayName = _DisplayName;
+       state->orig.in.desired_access = _desired_access;
+       state->orig.in.type = _type;
+       state->orig.in.start_type = _start_type;
+       state->orig.in.error_control = _error_control;
+       state->orig.in.binary_path = _binary_path;
+       state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
+       state->orig.in.dependencies = _dependencies;
+       state->orig.in.service_start_name = _service_start_name;
+       state->orig.in.password = _password;
+
+       /* Out parameters */
+       state->orig.out.TagId = _TagId;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_CreateServiceA_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_svcctl,
+                                   NDR_SVCCTL_CREATESERVICEA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_CreateServiceA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_CreateServiceA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_CreateServiceA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_CreateServiceA_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 */
+       if (state->orig.out.TagId && state->tmp.out.TagId) {
+               *state->orig.out.TagId = *state->tmp.out.TagId;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_CreateServiceA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_svcctl_CreateServiceA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_CreateServiceA_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_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -1285,39 +4426,172 @@ NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             struct policy_handle *service /* [in] [ref] */,
-                                             enum svcctl_ServiceState state /* [in]  */,
-                                             struct ENUM_SERVICE_STATUSA *service_status /* [out] [unique] */,
-                                             uint32_t offered /* [in]  */,
-                                             uint32_t *needed /* [out] [ref] */,
-                                             uint32_t *services_returned /* [out] [ref] */,
-                                             WERROR *werror)
+struct rpccli_svcctl_EnumDependentServicesA_state {
+       struct svcctl_EnumDependentServicesA orig;
+       struct svcctl_EnumDependentServicesA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_EnumDependentServicesA_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_service /* [in] [ref] */,
+                                                            enum svcctl_ServiceState _state /* [in]  */,
+                                                            struct ENUM_SERVICE_STATUSA *_service_status /* [out] [unique] */,
+                                                            uint32_t _offered /* [in]  */,
+                                                            uint32_t *_needed /* [out] [ref] */,
+                                                            uint32_t *_services_returned /* [out] [ref] */)
 {
-       struct svcctl_EnumDependentServicesA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_EnumDependentServicesA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_EnumDependentServicesA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.service = service;
-       r.in.state = state;
-       r.in.offered = offered;
+       state->orig.in.service = _service;
+       state->orig.in.state = _state;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.service_status = _service_status;
+       state->orig.out.needed = _needed;
+       state->orig.out.services_returned = _services_returned;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
-                               &r);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_EnumDependentServicesA_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       if (DEBUGLEVEL >= 10) {
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_EnumDependentServicesA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumDependentServicesA_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 */
+       if (state->orig.out.service_status && state->tmp.out.service_status) {
+               *state->orig.out.service_status = *state->tmp.out.service_status;
+       }
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.services_returned = *state->tmp.out.services_returned;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_EnumDependentServicesA_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumDependentServicesA_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_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct policy_handle *service /* [in] [ref] */,
+                                             enum svcctl_ServiceState state /* [in]  */,
+                                             struct ENUM_SERVICE_STATUSA *service_status /* [out] [unique] */,
+                                             uint32_t offered /* [in]  */,
+                                             uint32_t *needed /* [out] [ref] */,
+                                             uint32_t *services_returned /* [out] [ref] */,
+                                             WERROR *werror)
+{
+       struct svcctl_EnumDependentServicesA r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.service = service;
+       r.in.state = state;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
                NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r);
        }
 
@@ -1340,6 +4614,145 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_EnumServicesStatusA_state {
+       struct svcctl_EnumServicesStatusA orig;
+       struct svcctl_EnumServicesStatusA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_EnumServicesStatusA_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _type /* [in]  */,
+                                                         enum svcctl_ServiceState _state /* [in]  */,
+                                                         uint32_t _offered /* [in]  */,
+                                                         uint8_t *_service /* [out] [size_is(offered)] */,
+                                                         uint32_t *_needed /* [out] [ref] */,
+                                                         uint32_t *_services_returned /* [out] [ref] */,
+                                                         uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_EnumServicesStatusA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_EnumServicesStatusA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.type = _type;
+       state->orig.in.state = _state;
+       state->orig.in.offered = _offered;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.service = _service;
+       state->orig.out.needed = _needed;
+       state->orig.out.services_returned = _services_returned;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_EnumServicesStatusA_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_svcctl,
+                                   NDR_SVCCTL_ENUMSERVICESSTATUSA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_EnumServicesStatusA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumServicesStatusA_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 */
+       memcpy(state->orig.out.service, state->tmp.out.service, state->tmp.in.offered * sizeof(*state->orig.out.service));
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.services_returned = *state->tmp.out.services_returned;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_EnumServicesStatusA_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumServicesStatusA_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_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -1400,6 +4813,131 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_OpenSCManagerA_state {
+       struct svcctl_OpenSCManagerA orig;
+       struct svcctl_OpenSCManagerA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_OpenSCManagerA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_OpenSCManagerA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_MachineName /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_OpenSCManagerA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_OpenSCManagerA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.MachineName = _MachineName;
+       state->orig.in.DatabaseName = _DatabaseName;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_OpenSCManagerA_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_svcctl,
+                                   NDR_SVCCTL_OPENSCMANAGERA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_OpenSCManagerA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_OpenSCManagerA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_OpenSCManagerA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenSCManagerA_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_OpenSCManagerA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_svcctl_OpenSCManagerA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenSCManagerA_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_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *MachineName /* [in] [unique,charset(UTF16)] */,
@@ -1449,6 +4987,122 @@ NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_OpenServiceA_state {
+       struct svcctl_OpenServiceA orig;
+       struct svcctl_OpenServiceA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_OpenServiceA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_OpenServiceA_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_scmanager_handle /* [in] [ref] */,
+                                                  const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
+                                                  uint32_t _access_mask /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_OpenServiceA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_OpenServiceA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.scmanager_handle = _scmanager_handle;
+       state->orig.in.ServiceName = _ServiceName;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_OPENSERVICEA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_OpenServiceA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_OpenServiceA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_OpenServiceA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenServiceA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_OpenServiceA_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_svcctl_OpenServiceA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_OpenServiceA_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_svcctl_OpenServiceA(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *scmanager_handle /* [in] [ref] */,
@@ -1496,6 +5150,132 @@ NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceConfigA_state {
+       struct svcctl_QueryServiceConfigA orig;
+       struct svcctl_QueryServiceConfigA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceConfigA_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint8_t *_query /* [out]  */,
+                                                         uint32_t _offered /* [in]  */,
+                                                         uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceConfigA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceConfigA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.query = _query;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceConfigA_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICECONFIGA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfigA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfigA_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 */
+       memcpy(state->orig.out.query, state->tmp.out.query, state->tmp.in.offered * sizeof(*state->orig.out.query));
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceConfigA_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfigA_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_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -1511,63 +5291,867 @@ NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
        r.in.handle = handle;
        r.in.offered = offered;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r);
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_QUERYSERVICECONFIGA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       memcpy(query, r.out.query, r.in.offered * sizeof(*query));
+       *needed = *r.out.needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_svcctl_QueryServiceLockStatusA_state {
+       struct svcctl_QueryServiceLockStatusA orig;
+       struct svcctl_QueryServiceLockStatusA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceLockStatusA_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             uint32_t _offered /* [in]  */,
+                                                             struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
+                                                             uint32_t *_needed /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceLockStatusA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceLockStatusA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.lock_status = _lock_status;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceLockStatusA_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceLockStatusA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceLockStatusA_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.lock_status = *state->tmp.out.lock_status;
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceLockStatusA_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceLockStatusA_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_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *handle /* [in] [ref] */,
+                                              uint32_t offered /* [in]  */,
+                                              struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
+                                              uint32_t *needed /* [out] [ref] */,
+                                              WERROR *werror)
+{
+       struct svcctl_QueryServiceLockStatusA r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.offered = offered;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *lock_status = *r.out.lock_status;
+       *needed = *r.out.needed;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_svcctl_StartServiceA_state {
+       struct svcctl_StartServiceA orig;
+       struct svcctl_StartServiceA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_StartServiceA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_StartServiceA_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   uint32_t _NumArgs /* [in]  */,
+                                                   const char *_Arguments /* [in] [unique,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_StartServiceA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_StartServiceA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.NumArgs = _NumArgs;
+       state->orig.in.Arguments = _Arguments;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_STARTSERVICEA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_StartServiceA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_StartServiceA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_StartServiceA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_StartServiceA_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_StartServiceA_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result)
+{
+       struct rpccli_svcctl_StartServiceA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_StartServiceA_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_svcctl_StartServiceA(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    uint32_t NumArgs /* [in]  */,
+                                    const char *Arguments /* [in] [unique,charset(UTF16)] */,
+                                    WERROR *werror)
+{
+       struct svcctl_StartServiceA r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.NumArgs = NumArgs;
+       r.in.Arguments = Arguments;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_STARTSERVICEA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_svcctl_GetServiceDisplayNameA_state {
+       struct svcctl_GetServiceDisplayNameA orig;
+       struct svcctl_GetServiceDisplayNameA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_GetServiceDisplayNameA_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_handle /* [in] [ref] */,
+                                                            const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                            const char **_display_name /* [out] [ref,charset(UTF16)] */,
+                                                            uint32_t *_display_name_length /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_GetServiceDisplayNameA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_GetServiceDisplayNameA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.service_name = _service_name;
+       state->orig.in.display_name_length = _display_name_length;
+
+       /* Out parameters */
+       state->orig.out.display_name = _display_name;
+       state->orig.out.display_name_length = _display_name_length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_GetServiceDisplayNameA_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_svcctl,
+                                   NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceDisplayNameA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceDisplayNameA_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.display_name = *state->tmp.out.display_name;
+       if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
+               *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_GetServiceDisplayNameA_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceDisplayNameA_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_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct policy_handle *handle /* [in] [ref] */,
+                                             const char *service_name /* [in] [unique,charset(UTF16)] */,
+                                             const char **display_name /* [out] [ref,charset(UTF16)] */,
+                                             uint32_t *display_name_length /* [in,out] [unique] */,
+                                             WERROR *werror)
+{
+       struct svcctl_GetServiceDisplayNameA r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.service_name = service_name;
+       r.in.display_name_length = display_name_length;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *display_name = *r.out.display_name;
+       if (display_name_length && r.out.display_name_length) {
+               *display_name_length = *r.out.display_name_length;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_svcctl_GetServiceKeyNameA_state {
+       struct svcctl_GetServiceKeyNameA orig;
+       struct svcctl_GetServiceKeyNameA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_GetServiceKeyNameA_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                        const char **_key_name /* [out] [ref,charset(UTF16)] */,
+                                                        uint32_t *_display_name_length /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_GetServiceKeyNameA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_GetServiceKeyNameA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.service_name = _service_name;
+       state->orig.in.display_name_length = _display_name_length;
+
+       /* Out parameters */
+       state->orig.out.key_name = _key_name;
+       state->orig.out.display_name_length = _display_name_length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_GetServiceKeyNameA_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_svcctl,
+                                   NDR_SVCCTL_GETSERVICEKEYNAMEA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceKeyNameA_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceKeyNameA_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.key_name = *state->tmp.out.key_name;
+       if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
+               *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_GetServiceKeyNameA_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetServiceKeyNameA_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_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         struct policy_handle *handle /* [in] [ref] */,
+                                         const char *service_name /* [in] [unique,charset(UTF16)] */,
+                                         const char **key_name /* [out] [ref,charset(UTF16)] */,
+                                         uint32_t *display_name_length /* [in,out] [unique] */,
+                                         WERROR *werror)
+{
+       struct svcctl_GetServiceKeyNameA r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.service_name = service_name;
+       r.in.display_name_length = display_name_length;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_svcctl,
+                               NDR_SVCCTL_GETSERVICEKEYNAMEA,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *key_name = *r.out.key_name;
+       if (display_name_length && r.out.display_name_length) {
+               *display_name_length = *r.out.display_name_length;
+       }
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_svcctl_GetCurrentGroupeStateW_state {
+       struct svcctl_GetCurrentGroupeStateW orig;
+       struct svcctl_GetCurrentGroupeStateW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_GetCurrentGroupeStateW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_GetCurrentGroupeStateW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_GetCurrentGroupeStateW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_GetCurrentGroupeStateW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_GETCURRENTGROUPESTATEW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_GetCurrentGroupeStateW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_GetCurrentGroupeStateW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_GetCurrentGroupeStateW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetCurrentGroupeStateW_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_QUERYSERVICECONFIGA,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_svcctl_GetCurrentGroupeStateW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_GetCurrentGroupeStateW_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       memcpy(query, r.out.query, r.in.offered * sizeof(*query));
-       *needed = *r.out.needed;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
-                                              TALLOC_CTX *mem_ctx,
-                                              struct policy_handle *handle /* [in] [ref] */,
-                                              uint32_t offered /* [in]  */,
-                                              struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
-                                              uint32_t *needed /* [out] [ref] */,
-                                              WERROR *werror)
+NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *werror)
 {
-       struct svcctl_QueryServiceLockStatusA r;
+       struct svcctl_GetCurrentGroupeStateW r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.offered = offered;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_svcctl,
-                               NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
+                               NDR_SVCCTL_GETCURRENTGROUPESTATEW,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1575,7 +6159,7 @@ NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1583,8 +6167,6 @@ NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *lock_status = *r.out.lock_status;
-       *needed = *r.out.needed;
 
        /* Return result */
        if (werror) {
@@ -1594,77 +6176,133 @@ NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct policy_handle *handle /* [in] [ref] */,
-                                    uint32_t NumArgs /* [in]  */,
-                                    const char *Arguments /* [in] [unique,charset(UTF16)] */,
-                                    WERROR *werror)
+struct rpccli_svcctl_EnumServiceGroupW_state {
+       struct svcctl_EnumServiceGroupW orig;
+       struct svcctl_EnumServiceGroupW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_EnumServiceGroupW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_EnumServiceGroupW_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli)
 {
-       struct svcctl_StartServiceA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_EnumServiceGroupW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_EnumServiceGroupW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.NumArgs = NumArgs;
-       r.in.Arguments = Arguments;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_STARTSERVICEA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_ENUMSERVICEGROUPW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_EnumServiceGroupW_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_EnumServiceGroupW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_EnumServiceGroupW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumServiceGroupW_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_EnumServiceGroupW_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_svcctl_EnumServiceGroupW_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_EnumServiceGroupW_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             struct policy_handle *handle /* [in] [ref] */,
-                                             const char *service_name /* [in] [unique,charset(UTF16)] */,
-                                             const char **display_name /* [out] [ref,charset(UTF16)] */,
-                                             uint32_t *display_name_length /* [in,out] [unique] */,
-                                             WERROR *werror)
+NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *werror)
 {
-       struct svcctl_GetServiceDisplayNameA r;
+       struct svcctl_EnumServiceGroupW r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.service_name = service_name;
-       r.in.display_name_length = display_name_length;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_svcctl,
-                               NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
+                               NDR_SVCCTL_ENUMSERVICEGROUPW,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1672,7 +6310,7 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1680,10 +6318,6 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
-       *display_name = *r.out.display_name;
-       if (display_name_length && r.out.display_name_length) {
-               *display_name_length = *r.out.display_name_length;
-       }
 
        /* Return result */
        if (werror) {
@@ -1693,75 +6327,145 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
-                                         TALLOC_CTX *mem_ctx,
-                                         struct policy_handle *handle /* [in] [ref] */,
-                                         const char *service_name /* [in] [unique,charset(UTF16)] */,
-                                         const char **key_name /* [out] [ref,charset(UTF16)] */,
-                                         uint32_t *display_name_length /* [in,out] [unique] */,
-                                         WERROR *werror)
+struct rpccli_svcctl_ChangeServiceConfig2A_state {
+       struct svcctl_ChangeServiceConfig2A orig;
+       struct svcctl_ChangeServiceConfig2A tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_ChangeServiceConfig2A_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                           uint32_t _info_level /* [in]  */,
+                                                           uint8_t *_info /* [in] [unique] */)
 {
-       struct svcctl_GetServiceKeyNameA r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_ChangeServiceConfig2A_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_ChangeServiceConfig2A_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.service_name = service_name;
-       r.in.display_name_length = display_name_length;
+       state->orig.in.handle = _handle;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_GETSERVICEKEYNAMEA,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_CHANGESERVICECONFIG2A,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfig2A_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfig2A_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_ChangeServiceConfig2A_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfig2A_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *key_name = *r.out.key_name;
-       if (display_name_length && r.out.display_name_length) {
-               *display_name_length = *r.out.display_name_length;
-       }
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             WERROR *werror)
+NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            struct policy_handle *handle /* [in] [ref] */,
+                                            uint32_t info_level /* [in]  */,
+                                            uint8_t *info /* [in] [unique] */,
+                                            WERROR *werror)
 {
-       struct svcctl_GetCurrentGroupeStateW r;
+       struct svcctl_ChangeServiceConfig2A r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.info_level = info_level;
+       r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_svcctl,
-                               NDR_SVCCTL_GETCURRENTGROUPESTATEW,
+                               NDR_SVCCTL_CHANGESERVICECONFIG2A,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1769,7 +6473,7 @@ NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1786,55 +6490,130 @@ NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli,
-                                        TALLOC_CTX *mem_ctx,
-                                        WERROR *werror)
+struct rpccli_svcctl_ChangeServiceConfig2W_state {
+       struct svcctl_ChangeServiceConfig2W orig;
+       struct svcctl_ChangeServiceConfig2W tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_ChangeServiceConfig2W_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                           uint32_t _info_level /* [in]  */,
+                                                           uint8_t *_info /* [in] [unique] */)
 {
-       struct svcctl_EnumServiceGroupW r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_ChangeServiceConfig2W_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_ChangeServiceConfig2W_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.info = _info;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_ENUMSERVICEGROUPW,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_CHANGESERVICECONFIG2W,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfig2W_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfig2W_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_ChangeServiceConfig2W_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_ChangeServiceConfig2W_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct policy_handle *handle /* [in] [ref] */,
                                             uint32_t info_level /* [in]  */,
                                             uint8_t *info /* [in] [unique] */,
                                             WERROR *werror)
 {
-       struct svcctl_ChangeServiceConfig2A r;
+       struct svcctl_ChangeServiceConfig2W r;
        NTSTATUS status;
 
        /* In parameters */
@@ -1843,13 +6622,13 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
        r.in.info = info;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_svcctl,
-                               NDR_SVCCTL_CHANGESERVICECONFIG2A,
+                               NDR_SVCCTL_CHANGESERVICECONFIG2W,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1857,7 +6636,7 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1874,51 +6653,132 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            struct policy_handle *handle /* [in] [ref] */,
-                                            uint32_t info_level /* [in]  */,
-                                            uint8_t *info /* [in] [unique] */,
-                                            WERROR *werror)
+struct rpccli_svcctl_QueryServiceConfig2A_state {
+       struct svcctl_QueryServiceConfig2A orig;
+       struct svcctl_QueryServiceConfig2A tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceConfig2A_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          enum svcctl_ConfigLevel _info_level /* [in]  */,
+                                                          uint8_t *_buffer /* [out]  */,
+                                                          uint32_t _offered /* [in]  */,
+                                                          uint32_t *_needed /* [out] [ref] */)
 {
-       struct svcctl_ChangeServiceConfig2W r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceConfig2A_state *state;
+       struct tevent_req *subreq;
 
-       /* In parameters */
-       r.in.handle = handle;
-       r.in.info_level = info_level;
-       r.in.info = info;
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceConfig2A_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r);
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_svcctl,
-                               NDR_SVCCTL_CHANGESERVICECONFIG2W,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceConfig2A_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICECONFIG2A,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfig2A_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfig2A_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r);
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceConfig2A_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfig2A_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
@@ -1972,6 +6832,134 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceConfig2W_state {
+       struct svcctl_QueryServiceConfig2W orig;
+       struct svcctl_QueryServiceConfig2W tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceConfig2W_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          enum svcctl_ConfigLevel _info_level /* [in]  */,
+                                                          uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                          uint32_t _offered /* [in] [range(0,8192)] */,
+                                                          uint32_t *_needed /* [out] [ref,range(0,8192)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceConfig2W_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceConfig2W_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceConfig2W_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICECONFIG2W,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfig2W_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfig2W_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 */
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceConfig2W_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceConfig2W_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_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -2023,6 +7011,134 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_QueryServiceStatusEx_state {
+       struct svcctl_QueryServiceStatusEx orig;
+       struct svcctl_QueryServiceStatusEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_QueryServiceStatusEx_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          enum svcctl_StatusLevel _info_level /* [in]  */,
+                                                          uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                          uint32_t _offered /* [in] [range(0,8192)] */,
+                                                          uint32_t *_needed /* [out] [ref,range(0,8192)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_QueryServiceStatusEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_QueryServiceStatusEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.offered = _offered;
+
+       /* Out parameters */
+       state->orig.out.buffer = _buffer;
+       state->orig.out.needed = _needed;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_svcctl_QueryServiceStatusEx_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_svcctl,
+                                   NDR_SVCCTL_QUERYSERVICESTATUSEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceStatusEx_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceStatusEx_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 */
+       memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
+       *state->orig.out.needed = *state->tmp.out.needed;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_QueryServiceStatusEx_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_QueryServiceStatusEx_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_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -2074,6 +7190,150 @@ NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_EnumServicesStatusExA_state {
+       struct EnumServicesStatusExA orig;
+       struct EnumServicesStatusExA tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_EnumServicesStatusExA_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_EnumServicesStatusExA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_scmanager /* [in] [ref] */,
+                                                    uint32_t _info_level /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_ServiceState _state /* [in]  */,
+                                                    uint8_t *_services /* [out]  */,
+                                                    uint32_t _offered /* [in]  */,
+                                                    uint32_t *_needed /* [out] [ref] */,
+                                                    uint32_t *_service_returned /* [out] [ref] */,
+                                                    uint32_t *_resume_handle /* [in,out] [unique] */,
+                                                    const char **_group_name /* [out] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_EnumServicesStatusExA_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_EnumServicesStatusExA_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.scmanager = _scmanager;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.type = _type;
+       state->orig.in.state = _state;
+       state->orig.in.offered = _offered;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.services = _services;
+       state->orig.out.needed = _needed;
+       state->orig.out.service_returned = _service_returned;
+       state->orig.out.resume_handle = _resume_handle;
+       state->orig.out.group_name = _group_name;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_EnumServicesStatusExA_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_svcctl,
+                                   NDR_ENUMSERVICESSTATUSEXA,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_EnumServicesStatusExA_done, req);
+       return req;
+}
+
+static void rpccli_EnumServicesStatusExA_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_EnumServicesStatusExA_state *state = tevent_req_data(
+               req, struct rpccli_EnumServicesStatusExA_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 */
+       memcpy(state->orig.out.services, state->tmp.out.services, state->tmp.in.offered * sizeof(*state->orig.out.services));
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.service_returned = *state->tmp.out.service_returned;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+       *state->orig.out.group_name = *state->tmp.out.group_name;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_EnumServicesStatusExA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_EnumServicesStatusExA_state *state = tevent_req_data(
+               req, struct rpccli_EnumServicesStatusExA_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_EnumServicesStatusExA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *scmanager /* [in] [ref] */,
@@ -2138,6 +7398,149 @@ NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_EnumServicesStatusExW_state {
+       struct EnumServicesStatusExW orig;
+       struct EnumServicesStatusExW tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_EnumServicesStatusExW_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_EnumServicesStatusExW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_scmanager /* [in] [ref] */,
+                                                    uint32_t _info_level /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_ServiceState _state /* [in]  */,
+                                                    uint8_t *_services /* [out] [ref,size_is(offered)] */,
+                                                    uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                    uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
+                                                    uint32_t *_service_returned /* [out] [ref,range(0,0x40000)] */,
+                                                    uint32_t *_resume_handle /* [in,out] [unique,range(0,0x40000)] */,
+                                                    const char *_group_name /* [in] [unique,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_EnumServicesStatusExW_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_EnumServicesStatusExW_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.scmanager = _scmanager;
+       state->orig.in.info_level = _info_level;
+       state->orig.in.type = _type;
+       state->orig.in.state = _state;
+       state->orig.in.offered = _offered;
+       state->orig.in.resume_handle = _resume_handle;
+       state->orig.in.group_name = _group_name;
+
+       /* Out parameters */
+       state->orig.out.services = _services;
+       state->orig.out.needed = _needed;
+       state->orig.out.service_returned = _service_returned;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_EnumServicesStatusExW_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_svcctl,
+                                   NDR_ENUMSERVICESSTATUSEXW,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_EnumServicesStatusExW_done, req);
+       return req;
+}
+
+static void rpccli_EnumServicesStatusExW_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_EnumServicesStatusExW_state *state = tevent_req_data(
+               req, struct rpccli_EnumServicesStatusExW_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 */
+       memcpy(state->orig.out.services, state->tmp.out.services, state->tmp.in.offered * sizeof(*state->orig.out.services));
+       *state->orig.out.needed = *state->tmp.out.needed;
+       *state->orig.out.service_returned = *state->tmp.out.service_returned;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_EnumServicesStatusExW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_EnumServicesStatusExW_state *state = tevent_req_data(
+               req, struct rpccli_EnumServicesStatusExW_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_EnumServicesStatusExW(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *scmanager /* [in] [ref] */,
@@ -2202,6 +7605,116 @@ NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_svcctl_SCSendTSMessage_state {
+       struct svcctl_SCSendTSMessage orig;
+       struct svcctl_SCSendTSMessage tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_svcctl_SCSendTSMessage_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_svcctl_SCSendTSMessage_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_svcctl_SCSendTSMessage_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_svcctl_SCSendTSMessage_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_svcctl,
+                                   NDR_SVCCTL_SCSENDTSMESSAGE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_svcctl_SCSendTSMessage_done, req);
+       return req;
+}
+
+static void rpccli_svcctl_SCSendTSMessage_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_svcctl_SCSendTSMessage_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SCSendTSMessage_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_svcctl_SCSendTSMessage_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_svcctl_SCSendTSMessage_state *state = tevent_req_data(
+               req, struct rpccli_svcctl_SCSendTSMessage_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_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror)
index fcfb219d388c04b69bb2da1a8903f65abc7949fa..40a37f10ee2937c0f2dedf93438eb7d9c480bbf3 100644 (file)
@@ -1,25 +1,67 @@
 #include "../librpc/gen_ndr/ndr_svcctl.h"
 #ifndef __CLI_SVCCTL__
 #define __CLI_SVCCTL__
+struct tevent_req *rpccli_svcctl_CloseServiceHandle_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_svcctl_CloseServiceHandle_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in,out] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_svcctl_ControlService_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    enum SERVICE_CONTROL _control /* [in]  */,
+                                                    struct SERVICE_STATUS *_service_status /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_ControlService_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      enum SERVICE_CONTROL control /* [in]  */,
                                      struct SERVICE_STATUS *service_status /* [out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_svcctl_DeleteService_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_svcctl_DeleteService_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_svcctl_LockServiceDatabase_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         struct policy_handle *_lock /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_LockServiceDatabase_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
                                           struct policy_handle *lock /* [out] [ref] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                                uint32_t _security_flags /* [in]  */,
+                                                                uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                                uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                                uint32_t *_needed /* [out] [ref,range(0,0x40000)] */);
+NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  struct policy_handle *handle /* [in] [ref] */,
@@ -28,6 +70,16 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
                                                  uint32_t offered /* [in] [range(0,0x40000)] */,
                                                  uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
                                                  WERROR *werror);
+struct tevent_req *rpccli_svcctl_SetServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              struct policy_handle *_handle /* [in] [ref] */,
+                                                              uint32_t _security_flags /* [in]  */,
+                                                              uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
+                                                              uint32_t _offered /* [in]  */);
+NTSTATUS rpccli_svcctl_SetServiceObjectSecurity_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result);
 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                struct policy_handle *handle /* [in] [ref] */,
@@ -35,21 +87,58 @@ NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
                                                uint8_t *buffer /* [in] [ref,size_is(offered)] */,
                                                uint32_t offered /* [in]  */,
                                                WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceStatus_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        struct SERVICE_STATUS *_service_status /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_QueryServiceStatus_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
                                          struct SERVICE_STATUS *service_status /* [out] [ref] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_svcctl_SetServiceStatus_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli);
+NTSTATUS rpccli_svcctl_SetServiceStatus_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        WERROR *werror);
+struct tevent_req *rpccli_svcctl_UnlockServiceDatabase_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_lock /* [in,out] [ref] */);
+NTSTATUS rpccli_svcctl_UnlockServiceDatabase_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct policy_handle *lock /* [in,out] [ref] */,
                                             WERROR *werror);
+struct tevent_req *rpccli_svcctl_NotifyBootConfigStatus_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_svcctl_NotifyBootConfigStatus_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              WERROR *werror);
+struct tevent_req *rpccli_svcctl_SCSetServiceBitsW_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t _bits /* [in]  */,
+                                                       uint32_t _bitson /* [in]  */,
+                                                       uint32_t _immediate /* [in]  */);
+NTSTATUS rpccli_svcctl_SCSetServiceBitsW_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -57,6 +146,23 @@ NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
                                         uint32_t bitson /* [in]  */,
                                         uint32_t immediate /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_svcctl_ChangeServiceConfigW_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          uint32_t _type /* [in]  */,
+                                                          enum svcctl_StartType _start_type /* [in]  */,
+                                                          enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                          const char *_binary_path /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t *_tag_id /* [out] [ref] */,
+                                                          const char *_dependencies /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_display_name /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_svcctl_ChangeServiceConfigW_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -71,6 +177,28 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
                                            const char *password /* [in] [unique,charset(UTF16)] */,
                                            const char *display_name /* [in] [unique,charset(UTF16)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_svcctl_CreateServiceW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_scmanager_handle /* [in] [ref] */,
+                                                    const char *_ServiceName /* [in] [charset(UTF16)] */,
+                                                    const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _desired_access /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_StartType _start_type /* [in]  */,
+                                                    enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                    const char *_binary_path /* [in] [charset(UTF16)] */,
+                                                    const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_TagId /* [in,out] [unique] */,
+                                                    uint8_t *_dependencies /* [in] [unique,size_is(dependencies_size)] */,
+                                                    uint32_t _dependencies_size /* [in]  */,
+                                                    const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                    uint8_t *_password /* [in] [unique,size_is(password_size)] */,
+                                                    uint32_t _password_size /* [in]  */,
+                                                    struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_CreateServiceW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *scmanager_handle /* [in] [ref] */,
@@ -90,6 +218,18 @@ NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
                                      uint32_t password_size /* [in]  */,
                                      struct policy_handle *handle /* [out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_svcctl_EnumDependentServicesW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_service /* [in] [ref] */,
+                                                            enum svcctl_ServiceState _state /* [in]  */,
+                                                            uint8_t *_service_status /* [out] [ref,size_is(offered)] */,
+                                                            uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                            uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
+                                                            uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */);
+NTSTATUS rpccli_svcctl_EnumDependentServicesW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *service /* [in] [ref] */,
@@ -99,6 +239,20 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
                                              uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
                                              uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_svcctl_EnumServicesStatusW_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _type /* [in]  */,
+                                                         enum svcctl_ServiceState _state /* [in]  */,
+                                                         uint8_t *_service /* [out] [ref,size_is(offered)] */,
+                                                         uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                         uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
+                                                         uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */,
+                                                         uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_svcctl_EnumServicesStatusW_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -110,6 +264,16 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
                                           uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
                                           uint32_t *resume_handle /* [in,out] [unique] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_svcctl_OpenSCManagerW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_MachineName /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_OpenSCManagerW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *MachineName /* [in] [unique,charset(UTF16)] */,
@@ -117,6 +281,16 @@ NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
                                      uint32_t access_mask /* [in]  */,
                                      struct policy_handle *handle /* [out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_svcctl_OpenServiceW_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_scmanager_handle /* [in] [ref] */,
+                                                  const char *_ServiceName /* [in] [charset(UTF16)] */,
+                                                  uint32_t _access_mask /* [in]  */,
+                                                  struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_OpenServiceW_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *scmanager_handle /* [in] [ref] */,
@@ -124,6 +298,16 @@ NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
                                    uint32_t access_mask /* [in]  */,
                                    struct policy_handle *handle /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceConfigW_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         struct QUERY_SERVICE_CONFIG *_query /* [out] [ref] */,
+                                                         uint32_t _offered /* [in] [range(0,8192)] */,
+                                                         uint32_t *_needed /* [out] [ref,range(0,8192)] */);
+NTSTATUS rpccli_svcctl_QueryServiceConfigW_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -131,6 +315,16 @@ NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
                                           uint32_t offered /* [in] [range(0,8192)] */,
                                           uint32_t *needed /* [out] [ref,range(0,8192)] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceLockStatusW_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             uint32_t _offered /* [in]  */,
+                                                             struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
+                                                             uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_QueryServiceLockStatusW_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
@@ -138,12 +332,31 @@ NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
                                               struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
                                               uint32_t *needed /* [out] [ref] */,
                                               WERROR *werror);
+struct tevent_req *rpccli_svcctl_StartServiceW_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   uint32_t _NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
+                                                   struct svcctl_ArgumentString *_Arguments /* [in] [unique,size_is(NumArgs)] */);
+NTSTATUS rpccli_svcctl_StartServiceW_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     uint32_t NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
                                     struct svcctl_ArgumentString *Arguments /* [in] [unique,size_is(NumArgs)] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_svcctl_GetServiceDisplayNameW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_handle /* [in] [ref] */,
+                                                            const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                            const char **_display_name /* [out] [ref,charset(UTF16)] */,
+                                                            uint32_t *_display_name_length /* [in,out] [unique] */);
+NTSTATUS rpccli_svcctl_GetServiceDisplayNameW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *handle /* [in] [ref] */,
@@ -151,6 +364,16 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
                                              const char **display_name /* [out] [ref,charset(UTF16)] */,
                                              uint32_t *display_name_length /* [in,out] [unique] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_svcctl_GetServiceKeyNameW_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                        const char **_key_name /* [out] [ref,charset(UTF16)] */,
+                                                        uint32_t *_display_name_length /* [in,out] [unique] */);
+NTSTATUS rpccli_svcctl_GetServiceKeyNameW_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -158,6 +381,16 @@ NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
                                          const char **key_name /* [out] [ref,charset(UTF16)] */,
                                          uint32_t *display_name_length /* [in,out] [unique] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_svcctl_SCSetServiceBitsA_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       struct policy_handle *_handle /* [in] [ref] */,
+                                                       uint32_t _bits /* [in]  */,
+                                                       uint32_t _bitson /* [in]  */,
+                                                       uint32_t _immediate /* [in]  */);
+NTSTATUS rpccli_svcctl_SCSetServiceBitsA_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         struct policy_handle *handle /* [in] [ref] */,
@@ -165,6 +398,23 @@ NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
                                         uint32_t bitson /* [in]  */,
                                         uint32_t immediate /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_svcctl_ChangeServiceConfigA_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          uint32_t _type /* [in]  */,
+                                                          enum svcctl_StartType _start_type /* [in]  */,
+                                                          enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                          const char *_binary_path /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t *_tag_id /* [out] [ref] */,
+                                                          const char *_dependencies /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                          const char *_display_name /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_svcctl_ChangeServiceConfigA_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -179,6 +429,25 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
                                            const char *password /* [in] [unique,charset(UTF16)] */,
                                            const char *display_name /* [in] [unique,charset(UTF16)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_svcctl_CreateServiceA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _desired_access /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_StartType _start_type /* [in]  */,
+                                                    enum svcctl_ErrorControl _error_control /* [in]  */,
+                                                    const char *_binary_path /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t *_TagId /* [out] [unique] */,
+                                                    const char *_dependencies /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_password /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_svcctl_CreateServiceA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -195,6 +464,18 @@ NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
                                      const char *service_start_name /* [in] [unique,charset(UTF16)] */,
                                      const char *password /* [in] [unique,charset(UTF16)] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_svcctl_EnumDependentServicesA_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_service /* [in] [ref] */,
+                                                            enum svcctl_ServiceState _state /* [in]  */,
+                                                            struct ENUM_SERVICE_STATUSA *_service_status /* [out] [unique] */,
+                                                            uint32_t _offered /* [in]  */,
+                                                            uint32_t *_needed /* [out] [ref] */,
+                                                            uint32_t *_services_returned /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_EnumDependentServicesA_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *service /* [in] [ref] */,
@@ -204,6 +485,20 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
                                              uint32_t *needed /* [out] [ref] */,
                                              uint32_t *services_returned /* [out] [ref] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_svcctl_EnumServicesStatusA_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint32_t _type /* [in]  */,
+                                                         enum svcctl_ServiceState _state /* [in]  */,
+                                                         uint32_t _offered /* [in]  */,
+                                                         uint8_t *_service /* [out] [size_is(offered)] */,
+                                                         uint32_t *_needed /* [out] [ref] */,
+                                                         uint32_t *_services_returned /* [out] [ref] */,
+                                                         uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_svcctl_EnumServicesStatusA_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -215,6 +510,16 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
                                           uint32_t *services_returned /* [out] [ref] */,
                                           uint32_t *resume_handle /* [in,out] [unique] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_svcctl_OpenSCManagerA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_MachineName /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _access_mask /* [in]  */,
+                                                    struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_OpenSCManagerA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *MachineName /* [in] [unique,charset(UTF16)] */,
@@ -222,12 +527,31 @@ NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
                                      uint32_t access_mask /* [in]  */,
                                      struct policy_handle *handle /* [out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_svcctl_OpenServiceA_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_scmanager_handle /* [in] [ref] */,
+                                                  const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
+                                                  uint32_t _access_mask /* [in]  */);
+NTSTATUS rpccli_svcctl_OpenServiceA_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *scmanager_handle /* [in] [ref] */,
                                    const char *ServiceName /* [in] [unique,charset(UTF16)] */,
                                    uint32_t access_mask /* [in]  */,
                                    WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceConfigA_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_handle /* [in] [ref] */,
+                                                         uint8_t *_query /* [out]  */,
+                                                         uint32_t _offered /* [in]  */,
+                                                         uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_QueryServiceConfigA_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *handle /* [in] [ref] */,
@@ -235,6 +559,16 @@ NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
                                           uint32_t offered /* [in]  */,
                                           uint32_t *needed /* [out] [ref] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceLockStatusA_send(TALLOC_CTX *mem_ctx,
+                                                             struct tevent_context *ev,
+                                                             struct rpc_pipe_client *cli,
+                                                             struct policy_handle *_handle /* [in] [ref] */,
+                                                             uint32_t _offered /* [in]  */,
+                                                             struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
+                                                             uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_QueryServiceLockStatusA_recv(struct tevent_req *req,
+                                                   TALLOC_CTX *mem_ctx,
+                                                   WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* [in] [ref] */,
@@ -242,12 +576,31 @@ NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
                                               struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
                                               uint32_t *needed /* [out] [ref] */,
                                               WERROR *werror);
+struct tevent_req *rpccli_svcctl_StartServiceA_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct rpc_pipe_client *cli,
+                                                   struct policy_handle *_handle /* [in] [ref] */,
+                                                   uint32_t _NumArgs /* [in]  */,
+                                                   const char *_Arguments /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_svcctl_StartServiceA_recv(struct tevent_req *req,
+                                         TALLOC_CTX *mem_ctx,
+                                         WERROR *result);
 NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle /* [in] [ref] */,
                                     uint32_t NumArgs /* [in]  */,
                                     const char *Arguments /* [in] [unique,charset(UTF16)] */,
                                     WERROR *werror);
+struct tevent_req *rpccli_svcctl_GetServiceDisplayNameA_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            struct policy_handle *_handle /* [in] [ref] */,
+                                                            const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                            const char **_display_name /* [out] [ref,charset(UTF16)] */,
+                                                            uint32_t *_display_name_length /* [in,out] [unique] */);
+NTSTATUS rpccli_svcctl_GetServiceDisplayNameA_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              struct policy_handle *handle /* [in] [ref] */,
@@ -255,6 +608,16 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
                                              const char **display_name /* [out] [ref,charset(UTF16)] */,
                                              uint32_t *display_name_length /* [in,out] [unique] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_svcctl_GetServiceKeyNameA_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        struct policy_handle *_handle /* [in] [ref] */,
+                                                        const char *_service_name /* [in] [unique,charset(UTF16)] */,
+                                                        const char **_key_name /* [out] [ref,charset(UTF16)] */,
+                                                        uint32_t *_display_name_length /* [in,out] [unique] */);
+NTSTATUS rpccli_svcctl_GetServiceKeyNameA_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          struct policy_handle *handle /* [in] [ref] */,
@@ -262,24 +625,65 @@ NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
                                          const char **key_name /* [out] [ref,charset(UTF16)] */,
                                          uint32_t *display_name_length /* [in,out] [unique] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_svcctl_GetCurrentGroupeStateW_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli);
+NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              WERROR *werror);
+struct tevent_req *rpccli_svcctl_EnumServiceGroupW_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli);
+NTSTATUS rpccli_svcctl_EnumServiceGroupW_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         WERROR *werror);
+struct tevent_req *rpccli_svcctl_ChangeServiceConfig2A_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                           uint32_t _info_level /* [in]  */,
+                                                           uint8_t *_info /* [in] [unique] */);
+NTSTATUS rpccli_svcctl_ChangeServiceConfig2A_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct policy_handle *handle /* [in] [ref] */,
                                             uint32_t info_level /* [in]  */,
                                             uint8_t *info /* [in] [unique] */,
                                             WERROR *werror);
+struct tevent_req *rpccli_svcctl_ChangeServiceConfig2W_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           struct policy_handle *_handle /* [in] [ref] */,
+                                                           uint32_t _info_level /* [in]  */,
+                                                           uint8_t *_info /* [in] [unique] */);
+NTSTATUS rpccli_svcctl_ChangeServiceConfig2W_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             struct policy_handle *handle /* [in] [ref] */,
                                             uint32_t info_level /* [in]  */,
                                             uint8_t *info /* [in] [unique] */,
                                             WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceConfig2A_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          enum svcctl_ConfigLevel _info_level /* [in]  */,
+                                                          uint8_t *_buffer /* [out]  */,
+                                                          uint32_t _offered /* [in]  */,
+                                                          uint32_t *_needed /* [out] [ref] */);
+NTSTATUS rpccli_svcctl_QueryServiceConfig2A_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -288,6 +692,17 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
                                            uint32_t offered /* [in]  */,
                                            uint32_t *needed /* [out] [ref] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceConfig2W_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          enum svcctl_ConfigLevel _info_level /* [in]  */,
+                                                          uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                          uint32_t _offered /* [in] [range(0,8192)] */,
+                                                          uint32_t *_needed /* [out] [ref,range(0,8192)] */);
+NTSTATUS rpccli_svcctl_QueryServiceConfig2W_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -296,6 +711,17 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
                                            uint32_t offered /* [in] [range(0,8192)] */,
                                            uint32_t *needed /* [out] [ref,range(0,8192)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_svcctl_QueryServiceStatusEx_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          enum svcctl_StatusLevel _info_level /* [in]  */,
+                                                          uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
+                                                          uint32_t _offered /* [in] [range(0,8192)] */,
+                                                          uint32_t *_needed /* [out] [ref,range(0,8192)] */);
+NTSTATUS rpccli_svcctl_QueryServiceStatusEx_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -304,6 +730,22 @@ NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
                                            uint32_t offered /* [in] [range(0,8192)] */,
                                            uint32_t *needed /* [out] [ref,range(0,8192)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_EnumServicesStatusExA_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_scmanager /* [in] [ref] */,
+                                                    uint32_t _info_level /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_ServiceState _state /* [in]  */,
+                                                    uint8_t *_services /* [out]  */,
+                                                    uint32_t _offered /* [in]  */,
+                                                    uint32_t *_needed /* [out] [ref] */,
+                                                    uint32_t *_service_returned /* [out] [ref] */,
+                                                    uint32_t *_resume_handle /* [in,out] [unique] */,
+                                                    const char **_group_name /* [out] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_EnumServicesStatusExA_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *scmanager /* [in] [ref] */,
@@ -317,6 +759,22 @@ NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
                                      uint32_t *resume_handle /* [in,out] [unique] */,
                                      const char **group_name /* [out] [ref,charset(UTF16)] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_EnumServicesStatusExW_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_scmanager /* [in] [ref] */,
+                                                    uint32_t _info_level /* [in]  */,
+                                                    uint32_t _type /* [in]  */,
+                                                    enum svcctl_ServiceState _state /* [in]  */,
+                                                    uint8_t *_services /* [out] [ref,size_is(offered)] */,
+                                                    uint32_t _offered /* [in] [range(0,0x40000)] */,
+                                                    uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
+                                                    uint32_t *_service_returned /* [out] [ref,range(0,0x40000)] */,
+                                                    uint32_t *_resume_handle /* [in,out] [unique,range(0,0x40000)] */,
+                                                    const char *_group_name /* [in] [unique,charset(UTF16)] */);
+NTSTATUS rpccli_EnumServicesStatusExW_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *scmanager /* [in] [ref] */,
@@ -330,6 +788,12 @@ NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
                                      uint32_t *resume_handle /* [in,out] [unique,range(0,0x40000)] */,
                                      const char *group_name /* [in] [unique,charset(UTF16)] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_svcctl_SCSendTSMessage_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli);
+NTSTATUS rpccli_svcctl_SCSendTSMessage_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       WERROR *werror);
index b18554e63e11ee6f1ceaec5b27b7cccd8c8f6daa..d0936028a4c7b57ea7108b23d31b71a95f382871 100644 (file)
@@ -6,6 +6,129 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_winreg.h"
 
+struct rpccli_winreg_OpenHKCR_state {
+       struct winreg_OpenHKCR orig;
+       struct winreg_OpenHKCR tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKCR_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKCR_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKCR_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKCR_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKCR_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_winreg,
+                                   NDR_WINREG_OPENHKCR,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCR_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKCR_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKCR_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKCR_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKCR_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_winreg_OpenHKCR(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
@@ -53,6 +176,129 @@ NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_OpenHKCU_state {
+       struct winreg_OpenHKCU orig;
+       struct winreg_OpenHKCU tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKCU_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKCU_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKCU_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_winreg,
+                                   NDR_WINREG_OPENHKCU,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCU_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKCU_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKCU_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKCU_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_winreg_OpenHKCU(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
@@ -100,6 +346,129 @@ NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_OpenHKLM_state {
+       struct winreg_OpenHKLM orig;
+       struct winreg_OpenHKLM tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKLM_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKLM_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKLM_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_winreg,
+                                   NDR_WINREG_OPENHKLM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKLM_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKLM_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKLM_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKLM_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_winreg_OpenHKLM(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
@@ -147,6 +516,129 @@ NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_OpenHKPD_state {
+       struct winreg_OpenHKPD orig;
+       struct winreg_OpenHKPD tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKPD_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKPD_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKPD_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_winreg,
+                                   NDR_WINREG_OPENHKPD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPD_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKPD_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKPD_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKPD_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_winreg_OpenHKPD(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
@@ -194,6 +686,129 @@ NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_OpenHKU_state {
+       struct winreg_OpenHKU orig;
+       struct winreg_OpenHKU tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t *_system_name /* [in] [unique] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKU_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKU_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKU_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_winreg,
+                                   NDR_WINREG_OPENHKU,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKU_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKU_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKU_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKU_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_winreg_OpenHKU(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint16_t *system_name /* [in] [unique] */,
@@ -241,52 +856,309 @@ NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in,out] [ref] */,
-                               WERROR *werror)
-{
-       struct winreg_CloseKey r;
-       NTSTATUS status;
+struct rpccli_winreg_CloseKey_state {
+       struct winreg_CloseKey orig;
+       struct winreg_CloseKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
 
-       /* In parameters */
-       r.in.handle = handle;
+static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq);
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r);
+struct tevent_req *rpccli_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_CloseKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_CloseKey_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_CLOSEKEY,
-                               &r);
+       /* In parameters */
+       state->orig.in.handle = _handle;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r);
+               NDR_PRINT_IN_DEBUG(winreg_CloseKey, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_CloseKey_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *handle = *r.out.handle;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
-       if (werror) {
-               *werror = r.out.result;
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_CLOSEKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
-
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_set_callback(subreq, rpccli_winreg_CloseKey_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
+static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_CloseKey_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_CloseKey_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_CloseKey_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_winreg_CloseKey(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in,out] [ref] */,
+                               WERROR *werror)
+{
+       struct winreg_CloseKey r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_CLOSEKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_winreg_CreateKey_state {
+       struct winreg_CreateKey orig;
+       struct winreg_CreateKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               struct winreg_String _name /* [in]  */,
+                                               struct winreg_String _keyclass /* [in]  */,
+                                               uint32_t _options /* [in]  */,
+                                               uint32_t _access_mask /* [in]  */,
+                                               struct winreg_SecBuf *_secdesc /* [in] [unique] */,
+                                               struct policy_handle *_new_handle /* [out] [ref] */,
+                                               enum winreg_CreateAction *_action_taken /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_CreateKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_CreateKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.keyclass = _keyclass;
+       state->orig.in.options = _options;
+       state->orig.in.access_mask = _access_mask;
+       state->orig.in.secdesc = _secdesc;
+       state->orig.in.action_taken = _action_taken;
+
+       /* Out parameters */
+       state->orig.out.new_handle = _new_handle;
+       state->orig.out.action_taken = _action_taken;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_CreateKey, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_CreateKey_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_winreg,
+                                   NDR_WINREG_CREATEKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_CreateKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_CreateKey_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.new_handle = *state->tmp.out.new_handle;
+       if (state->orig.out.action_taken && state->tmp.out.action_taken) {
+               *state->orig.out.action_taken = *state->tmp.out.action_taken;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_CreateKey_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_CreateKey_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_winreg_CreateKey(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 struct winreg_String name /* [in]  */,
                                 struct winreg_String keyclass /* [in]  */,
@@ -345,6 +1217,120 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_DeleteKey_state {
+       struct winreg_DeleteKey orig;
+       struct winreg_DeleteKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               struct winreg_String _key /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_DeleteKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_DeleteKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.key = _key;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_DELETEKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_DeleteKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_DeleteKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_DeleteKey_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_DeleteKey_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_winreg_DeleteKey(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -390,6 +1376,120 @@ NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_DeleteValue_state {
+       struct winreg_DeleteValue orig;
+       struct winreg_DeleteValue tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 struct winreg_String _value /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_DeleteValue_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_DeleteValue_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.value = _value;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_DELETEVALUE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_DeleteValue_done, req);
+       return req;
+}
+
+static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_DeleteValue_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_DeleteValue_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_DeleteValue_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_winreg_DeleteValue(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
@@ -435,6 +1535,142 @@ NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_EnumKey_state {
+       struct winreg_EnumKey orig;
+       struct winreg_EnumKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _enum_index /* [in]  */,
+                                             struct winreg_StringBuf *_name /* [in,out] [ref] */,
+                                             struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
+                                             NTTIME *_last_changed_time /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_EnumKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_EnumKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.enum_index = _enum_index;
+       state->orig.in.name = _name;
+       state->orig.in.keyclass = _keyclass;
+       state->orig.in.last_changed_time = _last_changed_time;
+
+       /* Out parameters */
+       state->orig.out.name = _name;
+       state->orig.out.keyclass = _keyclass;
+       state->orig.out.last_changed_time = _last_changed_time;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_EnumKey, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_EnumKey_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_winreg,
+                                   NDR_WINREG_ENUMKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_EnumKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_EnumKey_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.name = *state->tmp.out.name;
+       if (state->orig.out.keyclass && state->tmp.out.keyclass) {
+               *state->orig.out.keyclass = *state->tmp.out.keyclass;
+       }
+       if (state->orig.out.last_changed_time && state->tmp.out.last_changed_time) {
+               *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_EnumKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_EnumKey_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_winreg_EnumKey(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -493,7 +1729,155 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
+struct rpccli_winreg_EnumValue_state {
+       struct winreg_EnumValue orig;
+       struct winreg_EnumValue tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _enum_index /* [in]  */,
+                                               struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
+                                               enum winreg_Type *_type /* [in,out] [unique] */,
+                                               uint8_t *_value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
+                                               uint32_t *_size /* [in,out] [unique] */,
+                                               uint32_t *_length /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_EnumValue_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_EnumValue_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.enum_index = _enum_index;
+       state->orig.in.name = _name;
+       state->orig.in.type = _type;
+       state->orig.in.value = _value;
+       state->orig.in.size = _size;
+       state->orig.in.length = _length;
+
+       /* Out parameters */
+       state->orig.out.name = _name;
+       state->orig.out.type = _type;
+       state->orig.out.value = _value;
+       state->orig.out.size = _size;
+       state->orig.out.length = _length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_EnumValue, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_EnumValue_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_winreg,
+                                   NDR_WINREG_ENUMVALUE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_EnumValue_done, req);
+       return req;
+}
+
+static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_EnumValue_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.name = *state->tmp.out.name;
+       if (state->orig.out.type && state->tmp.out.type) {
+               *state->orig.out.type = *state->tmp.out.type;
+       }
+       if (state->orig.out.value && state->tmp.out.value) {
+               memcpy(state->orig.out.value, state->tmp.out.value, *state->tmp.in.size * sizeof(*state->orig.out.value));
+       }
+       if (state->orig.out.size && state->tmp.out.size) {
+               *state->orig.out.size = *state->tmp.out.size;
+       }
+       if (state->orig.out.length && state->tmp.out.length) {
+               *state->orig.out.length = *state->tmp.out.length;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_EnumValue_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_EnumValue_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_winreg_EnumValue(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 uint32_t enum_index /* [in]  */,
@@ -561,6 +1945,118 @@ NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_FlushKey_state {
+       struct winreg_FlushKey orig;
+       struct winreg_FlushKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_FlushKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_FlushKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_FlushKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_FLUSHKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_FlushKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_FlushKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_FlushKey_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_FlushKey_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_winreg_FlushKey(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -604,6 +2100,130 @@ NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_GetKeySecurity_state {
+       struct winreg_GetKeySecurity orig;
+       struct winreg_GetKeySecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    uint32_t _sec_info /* [in]  */,
+                                                    struct KeySecurityData *_sd /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_GetKeySecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_GetKeySecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sec_info = _sec_info;
+       state->orig.in.sd = _sd;
+
+       /* Out parameters */
+       state->orig.out.sd = _sd;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_GetKeySecurity_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_winreg,
+                                   NDR_WINREG_GETKEYSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_GetKeySecurity_done, req);
+       return req;
+}
+
+static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
+               req, struct rpccli_winreg_GetKeySecurity_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.sd = *state->tmp.out.sd;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_GetKeySecurity_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
+               req, struct rpccli_winreg_GetKeySecurity_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_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
@@ -652,6 +2272,122 @@ NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_LoadKey_state {
+       struct winreg_LoadKey orig;
+       struct winreg_LoadKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct winreg_String *_keyname /* [in] [unique] */,
+                                             struct winreg_String *_filename /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_LoadKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_LoadKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.keyname = _keyname;
+       state->orig.in.filename = _filename;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_LoadKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_LOADKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_LoadKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_LoadKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_LoadKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_LoadKey_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_winreg_LoadKey(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -699,6 +2435,130 @@ NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_NotifyChangeKeyValue_state {
+       struct winreg_NotifyChangeKeyValue orig;
+       struct winreg_NotifyChangeKeyValue tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          uint8_t _watch_subtree /* [in]  */,
+                                                          uint32_t _notify_filter /* [in]  */,
+                                                          uint32_t _unknown /* [in]  */,
+                                                          struct winreg_String _string1 /* [in]  */,
+                                                          struct winreg_String _string2 /* [in]  */,
+                                                          uint32_t _unknown2 /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_NotifyChangeKeyValue_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_NotifyChangeKeyValue_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.watch_subtree = _watch_subtree;
+       state->orig.in.notify_filter = _notify_filter;
+       state->orig.in.unknown = _unknown;
+       state->orig.in.string1 = _string1;
+       state->orig.in.string2 = _string2;
+       state->orig.in.unknown2 = _unknown2;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_NOTIFYCHANGEKEYVALUE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_NotifyChangeKeyValue_done, req);
+       return req;
+}
+
+static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_NotifyChangeKeyValue_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_NotifyChangeKeyValue_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_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -754,50 +2614,177 @@ NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              struct policy_handle *parent_handle /* [in] [ref] */,
-                              struct winreg_String keyname /* [in]  */,
-                              uint32_t unknown /* [in]  */,
-                              uint32_t access_mask /* [in]  */,
-                              struct policy_handle *handle /* [out] [ref] */,
-                              WERROR *werror)
+struct rpccli_winreg_OpenKey_state {
+       struct winreg_OpenKey orig;
+       struct winreg_OpenKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_parent_handle /* [in] [ref] */,
+                                             struct winreg_String _keyname /* [in]  */,
+                                             uint32_t _unknown /* [in]  */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_handle /* [out] [ref] */)
 {
-       struct winreg_OpenKey r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenKey_state *state;
+       struct tevent_req *subreq;
 
-       /* In parameters */
-       r.in.parent_handle = parent_handle;
-       r.in.keyname = keyname;
-       r.in.unknown = unknown;
-       r.in.access_mask = access_mask;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r);
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenKey_state);
+       if (req == NULL) {
+               return NULL;
        }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_OPENKEY,
-                               &r);
+       /* In parameters */
+       state->orig.in.parent_handle = _parent_handle;
+       state->orig.in.keyname = _keyname;
+       state->orig.in.unknown = _unknown;
+       state->orig.in.access_mask = _access_mask;
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r);
+               NDR_PRINT_IN_DEBUG(winreg_OpenKey, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
-               return status;
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenKey_out_memory");
+       if (tevent_req_nomem(state->out_mem_ctx, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       /* Return variables */
-       *handle = *r.out.handle;
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
 
-       /* Return result */
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_OPENKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenKey_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenKey_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_winreg_OpenKey(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *parent_handle /* [in] [ref] */,
+                              struct winreg_String keyname /* [in]  */,
+                              uint32_t unknown /* [in]  */,
+                              uint32_t access_mask /* [in]  */,
+                              struct policy_handle *handle /* [out] [ref] */,
+                              WERROR *werror)
+{
+       struct winreg_OpenKey r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.parent_handle = parent_handle;
+       r.in.keyname = keyname;
+       r.in.unknown = unknown;
+       r.in.access_mask = access_mask;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_OPENKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+       *handle = *r.out.handle;
+
+       /* Return result */
        if (werror) {
                *werror = r.out.result;
        }
@@ -805,6 +2792,152 @@ NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_QueryInfoKey_state {
+       struct winreg_QueryInfoKey orig;
+       struct winreg_QueryInfoKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  struct winreg_String *_classname /* [in,out] [ref] */,
+                                                  uint32_t *_num_subkeys /* [out] [ref] */,
+                                                  uint32_t *_max_subkeylen /* [out] [ref] */,
+                                                  uint32_t *_max_classlen /* [out] [ref] */,
+                                                  uint32_t *_num_values /* [out] [ref] */,
+                                                  uint32_t *_max_valnamelen /* [out] [ref] */,
+                                                  uint32_t *_max_valbufsize /* [out] [ref] */,
+                                                  uint32_t *_secdescsize /* [out] [ref] */,
+                                                  NTTIME *_last_changed_time /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_QueryInfoKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_QueryInfoKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.classname = _classname;
+
+       /* Out parameters */
+       state->orig.out.classname = _classname;
+       state->orig.out.num_subkeys = _num_subkeys;
+       state->orig.out.max_subkeylen = _max_subkeylen;
+       state->orig.out.max_classlen = _max_classlen;
+       state->orig.out.num_values = _num_values;
+       state->orig.out.max_valnamelen = _max_valnamelen;
+       state->orig.out.max_valbufsize = _max_valbufsize;
+       state->orig.out.secdescsize = _secdescsize;
+       state->orig.out.last_changed_time = _last_changed_time;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_QueryInfoKey_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_winreg,
+                                   NDR_WINREG_QUERYINFOKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_QueryInfoKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryInfoKey_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.classname = *state->tmp.out.classname;
+       *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
+       *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
+       *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
+       *state->orig.out.num_values = *state->tmp.out.num_values;
+       *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
+       *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
+       *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
+       *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_QueryInfoKey_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result)
+{
+       struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryInfoKey_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_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
@@ -867,6 +3000,150 @@ NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_QueryValue_state {
+       struct winreg_QueryValue orig;
+       struct winreg_QueryValue tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                struct winreg_String *_value_name /* [in] [ref] */,
+                                                enum winreg_Type *_type /* [in,out] [unique] */,
+                                                uint8_t *_data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
+                                                uint32_t *_data_size /* [in,out] [unique] */,
+                                                uint32_t *_data_length /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_QueryValue_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_QueryValue_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.value_name = _value_name;
+       state->orig.in.type = _type;
+       state->orig.in.data = _data;
+       state->orig.in.data_size = _data_size;
+       state->orig.in.data_length = _data_length;
+
+       /* Out parameters */
+       state->orig.out.type = _type;
+       state->orig.out.data = _data;
+       state->orig.out.data_size = _data_size;
+       state->orig.out.data_length = _data_length;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_QueryValue, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_QueryValue_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_winreg,
+                                   NDR_WINREG_QUERYVALUE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_QueryValue_done, req);
+       return req;
+}
+
+static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryValue_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 */
+       if (state->orig.out.type && state->tmp.out.type) {
+               *state->orig.out.type = *state->tmp.out.type;
+       }
+       if (state->orig.out.data && state->tmp.out.data) {
+               memcpy(state->orig.out.data, state->tmp.out.data, *state->tmp.in.data_size * sizeof(*state->orig.out.data));
+       }
+       if (state->orig.out.data_size && state->tmp.out.data_size) {
+               *state->orig.out.data_size = *state->tmp.out.data_size;
+       }
+       if (state->orig.out.data_length && state->tmp.out.data_length) {
+               *state->orig.out.data_length = *state->tmp.out.data_length;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_QueryValue_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryValue_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_winreg_QueryValue(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
@@ -932,6 +3209,116 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_ReplaceKey_state {
+       struct winreg_ReplaceKey orig;
+       struct winreg_ReplaceKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_ReplaceKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_ReplaceKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_REPLACEKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_ReplaceKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_ReplaceKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_ReplaceKey_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_ReplaceKey_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_winreg_ReplaceKey(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror)
@@ -973,6 +3360,122 @@ NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_RestoreKey_state {
+       struct winreg_RestoreKey orig;
+       struct winreg_RestoreKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                struct winreg_String *_filename /* [in] [ref] */,
+                                                uint32_t _flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_RestoreKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_RestoreKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.filename = _filename;
+       state->orig.in.flags = _flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_RESTOREKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_RestoreKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_RestoreKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_RestoreKey_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_RestoreKey_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_winreg_RestoreKey(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
@@ -1020,14 +3523,130 @@ NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
-                              TALLOC_CTX *mem_ctx,
-                              struct policy_handle *handle /* [in] [ref] */,
-                              struct winreg_String *filename /* [in] [ref] */,
-                              struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
-                              WERROR *werror)
+struct rpccli_winreg_SaveKey_state {
+       struct winreg_SaveKey orig;
+       struct winreg_SaveKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct winreg_String *_filename /* [in] [ref] */,
+                                             struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
 {
-       struct winreg_SaveKey r;
+       struct tevent_req *req;
+       struct rpccli_winreg_SaveKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_SaveKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.filename = _filename;
+       state->orig.in.sec_attrib = _sec_attrib;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_SaveKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_SAVEKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_SaveKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SaveKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_SaveKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result)
+{
+       struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SaveKey_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_winreg_SaveKey(struct rpc_pipe_client *cli,
+                              TALLOC_CTX *mem_ctx,
+                              struct policy_handle *handle /* [in] [ref] */,
+                              struct winreg_String *filename /* [in] [ref] */,
+                              struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
+                              WERROR *werror)
+{
+       struct winreg_SaveKey r;
        NTSTATUS status;
 
        /* In parameters */
@@ -1039,57 +3658,821 @@ NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
                NDR_PRINT_IN_DEBUG(winreg_SaveKey, &r);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_SAVEKEY,
-                               &r);
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_SAVEKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_winreg_SetKeySecurity_state {
+       struct winreg_SetKeySecurity orig;
+       struct winreg_SetKeySecurity tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    uint32_t _sec_info /* [in]  */,
+                                                    struct KeySecurityData *_sd /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_SetKeySecurity_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_SetKeySecurity_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.sec_info = _sec_info;
+       state->orig.in.sd = _sd;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_SETKEYSECURITY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_SetKeySecurity_done, req);
+       return req;
+}
+
+static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SetKeySecurity_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_SetKeySecurity_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SetKeySecurity_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_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
+                                     TALLOC_CTX *mem_ctx,
+                                     struct policy_handle *handle /* [in] [ref] */,
+                                     uint32_t sec_info /* [in]  */,
+                                     struct KeySecurityData *sd /* [in] [ref] */,
+                                     WERROR *werror)
+{
+       struct winreg_SetKeySecurity r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.sec_info = sec_info;
+       r.in.sd = sd;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_SETKEYSECURITY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_winreg_SetValue_state {
+       struct winreg_SetValue orig;
+       struct winreg_SetValue tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_SetValue_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              struct winreg_String _name /* [in]  */,
+                                              enum winreg_Type _type /* [in]  */,
+                                              uint8_t *_data /* [in] [ref,size_is(size)] */,
+                                              uint32_t _size /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_SetValue_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_SetValue_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.handle = _handle;
+       state->orig.in.name = _name;
+       state->orig.in.type = _type;
+       state->orig.in.data = _data;
+       state->orig.in.size = _size;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_SetValue, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_SETVALUE,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_SetValue_done, req);
+       return req;
+}
+
+static void rpccli_winreg_SetValue_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_SetValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SetValue_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SetValue, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_SetValue_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_SetValue_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SetValue_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_winreg_SetValue(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *handle /* [in] [ref] */,
+                               struct winreg_String name /* [in]  */,
+                               enum winreg_Type type /* [in]  */,
+                               uint8_t *data /* [in] [ref,size_is(size)] */,
+                               uint32_t size /* [in]  */,
+                               WERROR *werror)
+{
+       struct winreg_SetValue r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.type = type;
+       r.in.data = data;
+       r.in.size = size;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_SetValue, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_SETVALUE,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_winreg_UnLoadKey_state {
+       struct winreg_UnLoadKey orig;
+       struct winreg_UnLoadKey tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_UnLoadKey_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_UnLoadKey_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_UNLOADKEY,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_UnLoadKey_done, req);
+       return req;
+}
+
+static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_UnLoadKey_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_UnLoadKey_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
+               req, struct rpccli_winreg_UnLoadKey_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_winreg_UnLoadKey(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                WERROR *werror)
+{
+       struct winreg_UnLoadKey r;
+       NTSTATUS status;
+
+       /* In parameters */
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_UNLOADKEY,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_winreg_InitiateSystemShutdown_state {
+       struct winreg_InitiateSystemShutdown orig;
+       struct winreg_InitiateSystemShutdown tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            uint16_t *_hostname /* [in] [unique] */,
+                                                            struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                            uint32_t _timeout /* [in]  */,
+                                                            uint8_t _force_apps /* [in]  */,
+                                                            uint8_t _do_reboot /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_InitiateSystemShutdown_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_InitiateSystemShutdown_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.hostname = _hostname;
+       state->orig.in.message = _message;
+       state->orig.in.timeout = _timeout;
+       state->orig.in.force_apps = _force_apps;
+       state->orig.in.do_reboot = _do_reboot;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_INITIATESYSTEMSHUTDOWN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdown_done, req);
+       return req;
+}
+
+static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
+               req, struct rpccli_winreg_InitiateSystemShutdown_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
+               req, struct rpccli_winreg_InitiateSystemShutdown_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_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
+                                             TALLOC_CTX *mem_ctx,
+                                             uint16_t *hostname /* [in] [unique] */,
+                                             struct lsa_StringLarge *message /* [in] [unique] */,
+                                             uint32_t timeout /* [in]  */,
+                                             uint8_t force_apps /* [in]  */,
+                                             uint8_t do_reboot /* [in]  */,
+                                             WERROR *werror)
+{
+       struct winreg_InitiateSystemShutdown r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.hostname = hostname;
+       r.in.message = message;
+       r.in.timeout = timeout;
+       r.in.force_apps = force_apps;
+       r.in.do_reboot = do_reboot;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_winreg,
+                               NDR_WINREG_INITIATESYSTEMSHUTDOWN,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_winreg_AbortSystemShutdown_state {
+       struct winreg_AbortSystemShutdown orig;
+       struct winreg_AbortSystemShutdown tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         uint16_t *_server /* [in] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_AbortSystemShutdown_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_AbortSystemShutdown_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server = _server;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_ABORTSYSTEMSHUTDOWN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_AbortSystemShutdown_done, req);
+       return req;
+}
+
+static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
+               req, struct rpccli_winreg_AbortSystemShutdown_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
+               req, struct rpccli_winreg_AbortSystemShutdown_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct policy_handle *handle /* [in] [ref] */,
-                                     uint32_t sec_info /* [in]  */,
-                                     struct KeySecurityData *sd /* [in] [ref] */,
-                                     WERROR *werror)
+NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
+                                          TALLOC_CTX *mem_ctx,
+                                          uint16_t *server /* [in] [unique] */,
+                                          WERROR *werror)
 {
-       struct winreg_SetKeySecurity r;
+       struct winreg_AbortSystemShutdown r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.sec_info = sec_info;
-       r.in.sd = sd;
+       r.in.server = server;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r);
+               NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_winreg,
-                               NDR_WINREG_SETKEYSECURITY,
+                               NDR_WINREG_ABORTSYSTEMSHUTDOWN,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1097,7 +4480,7 @@ NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1114,74 +4497,147 @@ NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               struct policy_handle *handle /* [in] [ref] */,
-                               struct winreg_String name /* [in]  */,
-                               enum winreg_Type type /* [in]  */,
-                               uint8_t *data /* [in] [ref,size_is(size)] */,
-                               uint32_t size /* [in]  */,
-                               WERROR *werror)
+struct rpccli_winreg_GetVersion_state {
+       struct winreg_GetVersion orig;
+       struct winreg_GetVersion tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                uint32_t *_version /* [out] [ref] */)
 {
-       struct winreg_SetValue r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_winreg_GetVersion_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_GetVersion_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
-       r.in.name = name;
-       r.in.type = type;
-       r.in.data = data;
-       r.in.size = size;
+       state->orig.in.handle = _handle;
+
+       /* Out parameters */
+       state->orig.out.version = _version;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_SetValue, &r);
+               NDR_PRINT_IN_DEBUG(winreg_GetVersion, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_SETVALUE,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_GetVersion_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_winreg,
+                                   NDR_WINREG_GETVERSION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_GetVersion_done, req);
+       return req;
+}
+
+static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
+               req, struct rpccli_winreg_GetVersion_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.version = *state->tmp.out.version;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_GetVersion_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
+               req, struct rpccli_winreg_GetVersion_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx,
-                                WERROR *werror)
+NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *handle /* [in] [ref] */,
+                                 uint32_t *version /* [out] [ref] */,
+                                 WERROR *werror)
 {
-       struct winreg_UnLoadKey r;
+       struct winreg_GetVersion r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r);
+               NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_winreg,
-                               NDR_WINREG_UNLOADKEY,
+                               NDR_WINREG_GETVERSION,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1189,7 +4645,7 @@ NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1197,6 +4653,7 @@ NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *version = *r.out.version;
 
        /* Return result */
        if (werror) {
@@ -1206,76 +4663,151 @@ NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
-                                             TALLOC_CTX *mem_ctx,
-                                             uint16_t *hostname /* [in] [unique] */,
-                                             struct lsa_StringLarge *message /* [in] [unique] */,
-                                             uint32_t timeout /* [in]  */,
-                                             uint8_t force_apps /* [in]  */,
-                                             uint8_t do_reboot /* [in]  */,
-                                             WERROR *werror)
+struct rpccli_winreg_OpenHKCC_state {
+       struct winreg_OpenHKCC orig;
+       struct winreg_OpenHKCC tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
 {
-       struct winreg_InitiateSystemShutdown r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKCC_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKCC_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.hostname = hostname;
-       r.in.message = message;
-       r.in.timeout = timeout;
-       r.in.force_apps = force_apps;
-       r.in.do_reboot = do_reboot;
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r);
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_INITIATESYSTEMSHUTDOWN,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKCC_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_winreg,
+                                   NDR_WINREG_OPENHKCC,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCC_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKCC_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKCC_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKCC_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
-                                          TALLOC_CTX *mem_ctx,
-                                          uint16_t *server /* [in] [unique] */,
-                                          WERROR *werror)
+NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               uint16_t *system_name /* [in] [unique] */,
+                               uint32_t access_mask /* [in]  */,
+                               struct policy_handle *handle /* [out] [ref] */,
+                               WERROR *werror)
 {
-       struct winreg_AbortSystemShutdown r;
+       struct winreg_OpenHKCC r;
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server = server;
+       r.in.system_name = system_name;
+       r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r);
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_winreg,
-                               NDR_WINREG_ABORTSYSTEMSHUTDOWN,
+                               NDR_WINREG_OPENHKCC,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1283,7 +4815,7 @@ NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1291,6 +4823,7 @@ NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *handle = *r.out.handle;
 
        /* Return result */
        if (werror) {
@@ -1300,59 +4833,137 @@ NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct policy_handle *handle /* [in] [ref] */,
-                                 uint32_t *version /* [out] [ref] */,
-                                 WERROR *werror)
+struct rpccli_winreg_OpenHKDD_state {
+       struct winreg_OpenHKDD orig;
+       struct winreg_OpenHKDD tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
 {
-       struct winreg_GetVersion r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKDD_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKDD_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.handle = handle;
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r);
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_GETVERSION,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKDD_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_winreg,
+                                   NDR_WINREG_OPENHKDD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKDD_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKDD_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKDD_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKDD_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *version = *r.out.version;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
-NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror)
 {
-       struct winreg_OpenHKCC r;
+       struct winreg_OpenHKDD r;
        NTSTATUS status;
 
        /* In parameters */
@@ -1360,13 +4971,13 @@ NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
        r.in.access_mask = access_mask;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r);
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r);
        }
 
        status = cli->dispatch(cli,
                                mem_ctx,
                                &ndr_table_winreg,
-                               NDR_WINREG_OPENHKCC,
+                               NDR_WINREG_OPENHKDD,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -1374,7 +4985,7 @@ NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -1392,51 +5003,138 @@ NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               uint16_t *system_name /* [in] [unique] */,
-                               uint32_t access_mask /* [in]  */,
-                               struct policy_handle *handle /* [out] [ref] */,
-                               WERROR *werror)
+struct rpccli_winreg_QueryMultipleValues_state {
+       struct winreg_QueryMultipleValues orig;
+       struct winreg_QueryMultipleValues tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_key_handle /* [in] [ref] */,
+                                                         struct QueryMultipleValue *_values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
+                                                         uint32_t _num_values /* [in]  */,
+                                                         uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
+                                                         uint32_t *_buffer_size /* [in,out] [ref] */)
 {
-       struct winreg_OpenHKDD r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_winreg_QueryMultipleValues_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_QueryMultipleValues_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.system_name = system_name;
-       r.in.access_mask = access_mask;
+       state->orig.in.key_handle = _key_handle;
+       state->orig.in.values = _values;
+       state->orig.in.num_values = _num_values;
+       state->orig.in.buffer = _buffer;
+       state->orig.in.buffer_size = _buffer_size;
+
+       /* Out parameters */
+       state->orig.out.values = _values;
+       state->orig.out.buffer = _buffer;
+       state->orig.out.buffer_size = _buffer_size;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r);
+               NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_winreg,
-                               NDR_WINREG_OPENHKDD,
-                               &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_QueryMultipleValues_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_winreg,
+                                   NDR_WINREG_QUERYMULTIPLEVALUES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues_done, req);
+       return req;
+}
+
+static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryMultipleValues_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
+       }
+
+       /* Copy out parameters */
+       memcpy(state->orig.out.values, state->tmp.out.values, state->tmp.in.num_values * sizeof(*state->orig.out.values));
+       if (state->orig.out.buffer && state->tmp.out.buffer) {
+               memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.buffer_size * sizeof(*state->orig.out.buffer));
        }
+       *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r);
+               NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_QueryMultipleValues_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryMultipleValues_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
-       *handle = *r.out.handle;
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
@@ -1495,6 +5193,128 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_InitiateSystemShutdownEx_state {
+       struct winreg_InitiateSystemShutdownEx orig;
+       struct winreg_InitiateSystemShutdownEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              uint16_t *_hostname /* [in] [unique] */,
+                                                              struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                              uint32_t _timeout /* [in]  */,
+                                                              uint8_t _force_apps /* [in]  */,
+                                                              uint8_t _do_reboot /* [in]  */,
+                                                              uint32_t _reason /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_InitiateSystemShutdownEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_InitiateSystemShutdownEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.hostname = _hostname;
+       state->orig.in.message = _message;
+       state->orig.in.timeout = _timeout;
+       state->orig.in.force_apps = _force_apps;
+       state->orig.in.do_reboot = _do_reboot;
+       state->orig.in.reason = _reason;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdownEx_done, req);
+       return req;
+}
+
+static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
+               req, struct rpccli_winreg_InitiateSystemShutdownEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result)
+{
+       struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
+               req, struct rpccli_winreg_InitiateSystemShutdownEx_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_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                uint16_t *hostname /* [in] [unique] */,
@@ -1548,6 +5368,116 @@ NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_SaveKeyEx_state {
+       struct winreg_SaveKeyEx orig;
+       struct winreg_SaveKeyEx tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_SaveKeyEx_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_SaveKeyEx_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_SAVEKEYEX,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_SaveKeyEx_done, req);
+       return req;
+}
+
+static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SaveKeyEx_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_SaveKeyEx_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result)
+{
+       struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
+               req, struct rpccli_winreg_SaveKeyEx_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_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 WERROR *werror)
@@ -1589,6 +5519,129 @@ NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_OpenHKPT_state {
+       struct winreg_OpenHKPT orig;
+       struct winreg_OpenHKPT tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKPT_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKPT_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKPT_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_winreg,
+                                   NDR_WINREG_OPENHKPT,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPT_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKPT_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKPT_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKPT_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_winreg_OpenHKPT(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
@@ -1636,6 +5689,129 @@ NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_OpenHKPN_state {
+       struct winreg_OpenHKPN orig;
+       struct winreg_OpenHKPN tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_OpenHKPN_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_OpenHKPN_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.system_name = _system_name;
+       state->orig.in.access_mask = _access_mask;
+
+       /* Out parameters */
+       state->orig.out.handle = _handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_winreg_OpenHKPN_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_winreg,
+                                   NDR_WINREG_OPENHKPN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPN_done, req);
+       return req;
+}
+
+static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKPN_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.handle = *state->tmp.out.handle;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_OpenHKPN_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result)
+{
+       struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
+               req, struct rpccli_winreg_OpenHKPN_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_winreg_OpenHKPN(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
@@ -1683,6 +5859,116 @@ NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_winreg_QueryMultipleValues2_state {
+       struct winreg_QueryMultipleValues2 orig;
+       struct winreg_QueryMultipleValues2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli)
+{
+       struct tevent_req *req;
+       struct rpccli_winreg_QueryMultipleValues2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_winreg_QueryMultipleValues2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_winreg,
+                                   NDR_WINREG_QUERYMULTIPLEVALUES2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues2_done, req);
+       return req;
+}
+
+static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryMultipleValues2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
+               req, struct rpccli_winreg_QueryMultipleValues2_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_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror)
index 20d2a755cedf955cbc1390f2e4ff5455776b9ffa..2d7ac0c658b6395d3facb8c95dc41841cd9af377 100644 (file)
 #include "../librpc/gen_ndr/ndr_winreg.h"
 #ifndef __CLI_WINREG__
 #define __CLI_WINREG__
+struct tevent_req *rpccli_winreg_OpenHKCR_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKCR_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKCU_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKLM_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKPD_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             uint16_t *_system_name /* [in] [unique] */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKU_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               uint16_t *system_name /* [in] [unique] */,
                               uint32_t access_mask /* [in]  */,
                               struct policy_handle *handle /* [out] [ref] */,
                               WERROR *werror);
+struct tevent_req *rpccli_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in,out] [ref] */);
+NTSTATUS rpccli_winreg_CloseKey_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in,out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               struct winreg_String _name /* [in]  */,
+                                               struct winreg_String _keyclass /* [in]  */,
+                                               uint32_t _options /* [in]  */,
+                                               uint32_t _access_mask /* [in]  */,
+                                               struct winreg_SecBuf *_secdesc /* [in] [unique] */,
+                                               struct policy_handle *_new_handle /* [out] [ref] */,
+                                               enum winreg_CreateAction *_action_taken /* [in,out] [unique] */);
+NTSTATUS rpccli_winreg_CreateKey_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -46,16 +112,43 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
                                 struct policy_handle *new_handle /* [out] [ref] */,
                                 enum winreg_CreateAction *action_taken /* [in,out] [unique] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               struct winreg_String _key /* [in]  */);
+NTSTATUS rpccli_winreg_DeleteKey_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
                                 struct winreg_String key /* [in]  */,
                                 WERROR *werror);
+struct tevent_req *rpccli_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 struct policy_handle *_handle /* [in] [ref] */,
+                                                 struct winreg_String _value /* [in]  */);
+NTSTATUS rpccli_winreg_DeleteValue_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   struct policy_handle *handle /* [in] [ref] */,
                                   struct winreg_String value /* [in]  */,
                                   WERROR *werror);
+struct tevent_req *rpccli_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             uint32_t _enum_index /* [in]  */,
+                                             struct winreg_StringBuf *_name /* [in,out] [ref] */,
+                                             struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
+                                             NTTIME *_last_changed_time /* [in,out] [unique] */);
+NTSTATUS rpccli_winreg_EnumKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
@@ -64,6 +157,19 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
                               struct winreg_StringBuf *keyclass /* [in,out] [unique] */,
                               NTTIME *last_changed_time /* [in,out] [unique] */,
                               WERROR *werror);
+struct tevent_req *rpccli_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli,
+                                               struct policy_handle *_handle /* [in] [ref] */,
+                                               uint32_t _enum_index /* [in]  */,
+                                               struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
+                                               enum winreg_Type *_type /* [in,out] [unique] */,
+                                               uint8_t *_value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
+                                               uint32_t *_size /* [in,out] [unique] */,
+                                               uint32_t *_length /* [in,out] [unique] */);
+NTSTATUS rpccli_winreg_EnumValue_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 struct policy_handle *handle /* [in] [ref] */,
@@ -74,22 +180,60 @@ NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
                                 uint32_t *size /* [in,out] [unique] */,
                                 uint32_t *length /* [in,out] [unique] */,
                                 WERROR *werror);
+struct tevent_req *rpccli_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */);
+NTSTATUS rpccli_winreg_FlushKey_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    uint32_t _sec_info /* [in]  */,
+                                                    struct KeySecurityData *_sd /* [in,out] [ref] */);
+NTSTATUS rpccli_winreg_GetKeySecurity_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      uint32_t sec_info /* [in]  */,
                                      struct KeySecurityData *sd /* [in,out] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct winreg_String *_keyname /* [in] [unique] */,
+                                             struct winreg_String *_filename /* [in] [unique] */);
+NTSTATUS rpccli_winreg_LoadKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
                               struct winreg_String *keyname /* [in] [unique] */,
                               struct winreg_String *filename /* [in] [unique] */,
                               WERROR *werror);
+struct tevent_req *rpccli_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          struct policy_handle *_handle /* [in] [ref] */,
+                                                          uint8_t _watch_subtree /* [in]  */,
+                                                          uint32_t _notify_filter /* [in]  */,
+                                                          uint32_t _unknown /* [in]  */,
+                                                          struct winreg_String _string1 /* [in]  */,
+                                                          struct winreg_String _string2 /* [in]  */,
+                                                          uint32_t _unknown2 /* [in]  */);
+NTSTATUS rpccli_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
@@ -100,6 +244,17 @@ NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
                                            struct winreg_String string2 /* [in]  */,
                                            uint32_t unknown2 /* [in]  */,
                                            WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_parent_handle /* [in] [ref] */,
+                                             struct winreg_String _keyname /* [in]  */,
+                                             uint32_t _unknown /* [in]  */,
+                                             uint32_t _access_mask /* [in]  */,
+                                             struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *parent_handle /* [in] [ref] */,
@@ -108,6 +263,22 @@ NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
                               uint32_t access_mask /* [in]  */,
                               struct policy_handle *handle /* [out] [ref] */,
                               WERROR *werror);
+struct tevent_req *rpccli_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
+                                                  struct tevent_context *ev,
+                                                  struct rpc_pipe_client *cli,
+                                                  struct policy_handle *_handle /* [in] [ref] */,
+                                                  struct winreg_String *_classname /* [in,out] [ref] */,
+                                                  uint32_t *_num_subkeys /* [out] [ref] */,
+                                                  uint32_t *_max_subkeylen /* [out] [ref] */,
+                                                  uint32_t *_max_classlen /* [out] [ref] */,
+                                                  uint32_t *_num_values /* [out] [ref] */,
+                                                  uint32_t *_max_valnamelen /* [out] [ref] */,
+                                                  uint32_t *_max_valbufsize /* [out] [ref] */,
+                                                  uint32_t *_secdescsize /* [out] [ref] */,
+                                                  NTTIME *_last_changed_time /* [out] [ref] */);
+NTSTATUS rpccli_winreg_QueryInfoKey_recv(struct tevent_req *req,
+                                        TALLOC_CTX *mem_ctx,
+                                        WERROR *result);
 NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
                                    struct policy_handle *handle /* [in] [ref] */,
@@ -121,6 +292,18 @@ NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
                                    uint32_t *secdescsize /* [out] [ref] */,
                                    NTTIME *last_changed_time /* [out] [ref] */,
                                    WERROR *werror);
+struct tevent_req *rpccli_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                struct winreg_String *_value_name /* [in] [ref] */,
+                                                enum winreg_Type *_type /* [in,out] [unique] */,
+                                                uint8_t *_data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
+                                                uint32_t *_data_size /* [in,out] [unique] */,
+                                                uint32_t *_data_length /* [in,out] [unique] */);
+NTSTATUS rpccli_winreg_QueryValue_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
@@ -130,27 +313,71 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
                                  uint32_t *data_size /* [in,out] [unique] */,
                                  uint32_t *data_length /* [in,out] [unique] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli);
+NTSTATUS rpccli_winreg_ReplaceKey_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  WERROR *werror);
+struct tevent_req *rpccli_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                struct winreg_String *_filename /* [in] [ref] */,
+                                                uint32_t _flags /* [in]  */);
+NTSTATUS rpccli_winreg_RestoreKey_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
                                  struct winreg_String *filename /* [in] [ref] */,
                                  uint32_t flags /* [in]  */,
                                  WERROR *werror);
+struct tevent_req *rpccli_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct rpc_pipe_client *cli,
+                                             struct policy_handle *_handle /* [in] [ref] */,
+                                             struct winreg_String *_filename /* [in] [ref] */,
+                                             struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */);
+NTSTATUS rpccli_winreg_SaveKey_recv(struct tevent_req *req,
+                                   TALLOC_CTX *mem_ctx,
+                                   WERROR *result);
 NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
                               TALLOC_CTX *mem_ctx,
                               struct policy_handle *handle /* [in] [ref] */,
                               struct winreg_String *filename /* [in] [ref] */,
                               struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
                               WERROR *werror);
+struct tevent_req *rpccli_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    struct policy_handle *_handle /* [in] [ref] */,
+                                                    uint32_t _sec_info /* [in]  */,
+                                                    struct KeySecurityData *_sd /* [in] [ref] */);
+NTSTATUS rpccli_winreg_SetKeySecurity_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      struct policy_handle *handle /* [in] [ref] */,
                                      uint32_t sec_info /* [in]  */,
                                      struct KeySecurityData *sd /* [in] [ref] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              struct policy_handle *_handle /* [in] [ref] */,
+                                              struct winreg_String _name /* [in]  */,
+                                              enum winreg_Type _type /* [in]  */,
+                                              uint8_t *_data /* [in] [ref,size_is(size)] */,
+                                              uint32_t _size /* [in]  */);
+NTSTATUS rpccli_winreg_SetValue_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *handle /* [in] [ref] */,
@@ -159,9 +386,26 @@ NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
                                uint8_t *data /* [in] [ref,size_is(size)] */,
                                uint32_t size /* [in]  */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_winreg_UnLoadKey_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 WERROR *werror);
+struct tevent_req *rpccli_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            uint16_t *_hostname /* [in] [unique] */,
+                                                            struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                            uint32_t _timeout /* [in]  */,
+                                                            uint8_t _force_apps /* [in]  */,
+                                                            uint8_t _do_reboot /* [in]  */);
+NTSTATUS rpccli_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              uint16_t *hostname /* [in] [unique] */,
@@ -170,27 +414,71 @@ NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
                                              uint8_t force_apps /* [in]  */,
                                              uint8_t do_reboot /* [in]  */,
                                              WERROR *werror);
+struct tevent_req *rpccli_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         uint16_t *_server /* [in] [unique] */);
+NTSTATUS rpccli_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           uint16_t *server /* [in] [unique] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                struct policy_handle *_handle /* [in] [ref] */,
+                                                uint32_t *_version /* [out] [ref] */);
+NTSTATUS rpccli_winreg_GetVersion_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  struct policy_handle *handle /* [in] [ref] */,
                                  uint32_t *version /* [out] [ref] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKCC_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKDD_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         struct policy_handle *_key_handle /* [in] [ref] */,
+                                                         struct QueryMultipleValue *_values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
+                                                         uint32_t _num_values /* [in]  */,
+                                                         uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
+                                                         uint32_t *_buffer_size /* [in,out] [ref] */);
+NTSTATUS rpccli_winreg_QueryMultipleValues_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           struct policy_handle *key_handle /* [in] [ref] */,
@@ -199,6 +487,18 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
                                           uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
                                           uint32_t *buffer_size /* [in,out] [ref] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
+                                                              struct tevent_context *ev,
+                                                              struct rpc_pipe_client *cli,
+                                                              uint16_t *_hostname /* [in] [unique] */,
+                                                              struct lsa_StringLarge *_message /* [in] [unique] */,
+                                                              uint32_t _timeout /* [in]  */,
+                                                              uint8_t _force_apps /* [in]  */,
+                                                              uint8_t _do_reboot /* [in]  */,
+                                                              uint32_t _reason /* [in]  */);
+NTSTATUS rpccli_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
+                                                    TALLOC_CTX *mem_ctx,
+                                                    WERROR *result);
 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
                                                TALLOC_CTX *mem_ctx,
                                                uint16_t *hostname /* [in] [unique] */,
@@ -208,21 +508,51 @@ NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
                                                uint8_t do_reboot /* [in]  */,
                                                uint32_t reason /* [in]  */,
                                                WERROR *werror);
+struct tevent_req *rpccli_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
+                                               struct tevent_context *ev,
+                                               struct rpc_pipe_client *cli);
+NTSTATUS rpccli_winreg_SaveKeyEx_recv(struct tevent_req *req,
+                                     TALLOC_CTX *mem_ctx,
+                                     WERROR *result);
 NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKPT_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct rpc_pipe_client *cli,
+                                              uint16_t *_system_name /* [in] [unique] */,
+                                              uint32_t _access_mask /* [in]  */,
+                                              struct policy_handle *_handle /* [out] [ref] */);
+NTSTATUS rpccli_winreg_OpenHKPN_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    WERROR *result);
 NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                uint16_t *system_name /* [in] [unique] */,
                                uint32_t access_mask /* [in]  */,
                                struct policy_handle *handle /* [out] [ref] */,
                                WERROR *werror);
+struct tevent_req *rpccli_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli);
+NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            WERROR *werror);
index c143058942cfcbc3cd046c1afa83cc94cf256450..f40238af54639586af2db9e66215001f42ac55b2 100644 (file)
@@ -6,6 +6,129 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/cli_wkssvc.h"
 
+struct rpccli_wkssvc_NetWkstaGetInfo_state {
+       struct wkssvc_NetWkstaGetInfo orig;
+       struct wkssvc_NetWkstaGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetWkstaGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union wkssvc_NetWkstaInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetWkstaGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetWkstaGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetWkstaGetInfo_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_wkssvc,
+                                   NDR_WKSSVC_NETWKSTAGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaGetInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetWkstaGetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaGetInfo_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_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -53,6 +176,132 @@ NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetWkstaSetInfo_state {
+       struct wkssvc_NetWkstaSetInfo orig;
+       struct wkssvc_NetWkstaSetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetWkstaSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union wkssvc_NetWkstaInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                     uint32_t *_parm_error /* [in,out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetWkstaSetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetWkstaSetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.parm_error = _parm_error;
+
+       /* Out parameters */
+       state->orig.out.parm_error = _parm_error;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetWkstaSetInfo_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_wkssvc,
+                                   NDR_WKSSVC_NETWKSTASETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaSetInfo_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaSetInfo_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.parm_error = *state->tmp.out.parm_error;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetWkstaSetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaSetInfo_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_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -103,6 +352,139 @@ NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetWkstaEnumUsers_state {
+       struct wkssvc_NetWkstaEnumUsers orig;
+       struct wkssvc_NetWkstaEnumUsers tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetWkstaEnumUsers_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       struct wkssvc_NetWkstaEnumUsersInfo *_info /* [in,out] [ref] */,
+                                                       uint32_t _prefmaxlen /* [in]  */,
+                                                       uint32_t *_entries_read /* [out] [ref] */,
+                                                       uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetWkstaEnumUsers_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetWkstaEnumUsers_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.info = _info;
+       state->orig.in.prefmaxlen = _prefmaxlen;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.entries_read = _entries_read;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetWkstaEnumUsers_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_wkssvc,
+                                   NDR_WKSSVC_NETWKSTAENUMUSERS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaEnumUsers_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaEnumUsers_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.info = *state->tmp.out.info;
+       *state->orig.out.entries_read = *state->tmp.out.entries_read;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaEnumUsers_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_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -158,6 +540,129 @@ NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrWkstaUserGetInfo_state {
+       struct wkssvc_NetrWkstaUserGetInfo orig;
+       struct wkssvc_NetrWkstaUserGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrWkstaUserGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_unknown /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _level /* [in]  */,
+                                                          union wkssvc_NetrWkstaUserInfo *_info /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.unknown = _unknown;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrWkstaUserGetInfo_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_wkssvc,
+                                   NDR_WKSSVC_NETRWKSTAUSERGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_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_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *unknown /* [in] [unique,charset(UTF16)] */,
@@ -205,6 +710,134 @@ NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrWkstaUserSetInfo_state {
+       struct wkssvc_NetrWkstaUserSetInfo orig;
+       struct wkssvc_NetrWkstaUserSetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrWkstaUserSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_unknown /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _level /* [in]  */,
+                                                          union wkssvc_NetrWkstaUserInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                          uint32_t *_parm_err /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.unknown = _unknown;
+       state->orig.in.level = _level;
+       state->orig.in.info = _info;
+       state->orig.in.parm_err = _parm_err;
+
+       /* Out parameters */
+       state->orig.out.parm_err = _parm_err;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrWkstaUserSetInfo_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_wkssvc,
+                                   NDR_WKSSVC_NETRWKSTAUSERSETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserSetInfo_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_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 */
+       if (state->orig.out.parm_err && state->tmp.out.parm_err) {
+               *state->orig.out.parm_err = *state->tmp.out.parm_err;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result)
+{
+       struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_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_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *unknown /* [in] [unique,charset(UTF16)] */,
@@ -257,40 +890,173 @@ NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
-                                            TALLOC_CTX *mem_ctx,
-                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                            struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */,
-                                            uint32_t max_buffer /* [in]  */,
-                                            uint32_t *total_entries /* [out] [ref] */,
-                                            uint32_t *resume_handle /* [in,out] [unique] */,
-                                            WERROR *werror)
+struct rpccli_wkssvc_NetWkstaTransportEnum_state {
+       struct wkssvc_NetWkstaTransportEnum orig;
+       struct wkssvc_NetWkstaTransportEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetWkstaTransportEnum_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           struct wkssvc_NetWkstaTransportInfo *_info /* [in,out] [ref] */,
+                                                           uint32_t _max_buffer /* [in]  */,
+                                                           uint32_t *_total_entries /* [out] [ref] */,
+                                                           uint32_t *_resume_handle /* [in,out] [unique] */)
 {
-       struct wkssvc_NetWkstaTransportEnum r;
-       NTSTATUS status;
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetWkstaTransportEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetWkstaTransportEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.info = info;
-       r.in.max_buffer = max_buffer;
-       r.in.resume_handle = resume_handle;
+       state->orig.in.server_name = _server_name;
+       state->orig.in.info = _info;
+       state->orig.in.max_buffer = _max_buffer;
+       state->orig.in.resume_handle = _resume_handle;
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
-       }
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.total_entries = _total_entries;
+       state->orig.out.resume_handle = _resume_handle;
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_wkssvc,
-                               NDR_WKSSVC_NETWKSTATRANSPORTENUM,
-                               &r);
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &state->orig);
        }
 
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetWkstaTransportEnum_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_wkssvc,
+                                   NDR_WKSSVC_NETWKSTATRANSPORTENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaTransportEnum_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaTransportEnum_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.info = *state->tmp.out.info;
+       *state->orig.out.total_entries = *state->tmp.out.total_entries;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetWkstaTransportEnum_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_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
+                                            TALLOC_CTX *mem_ctx,
+                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                            struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */,
+                                            uint32_t max_buffer /* [in]  */,
+                                            uint32_t *total_entries /* [out] [ref] */,
+                                            uint32_t *resume_handle /* [in,out] [unique] */,
+                                            WERROR *werror)
+{
+       struct wkssvc_NetWkstaTransportEnum r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.info = info;
+       r.in.max_buffer = max_buffer;
+       r.in.resume_handle = resume_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wkssvc,
+                               NDR_WKSSVC_NETWKSTATRANSPORTENUM,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -312,6 +1078,134 @@ NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrWkstaTransportAdd_state {
+       struct wkssvc_NetrWkstaTransportAdd orig;
+       struct wkssvc_NetrWkstaTransportAdd tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrWkstaTransportAdd_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           uint32_t _level /* [in]  */,
+                                                           struct wkssvc_NetWkstaTransportInfo0 *_info0 /* [in] [ref] */,
+                                                           uint32_t *_parm_err /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.level = _level;
+       state->orig.in.info0 = _info0;
+       state->orig.in.parm_err = _parm_err;
+
+       /* Out parameters */
+       state->orig.out.parm_err = _parm_err;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrWkstaTransportAdd_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_wkssvc,
+                                   NDR_WKSSVC_NETRWKSTATRANSPORTADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportAdd_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaTransportAdd_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 */
+       if (state->orig.out.parm_err && state->tmp.out.parm_err) {
+               *state->orig.out.parm_err = *state->tmp.out.parm_err;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaTransportAdd_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_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -364,6 +1258,122 @@ NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrWkstaTransportDel_state {
+       struct wkssvc_NetrWkstaTransportDel orig;
+       struct wkssvc_NetrWkstaTransportDel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrWkstaTransportDel_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           const char *_transport_name /* [in] [unique,charset(UTF16)] */,
+                                                           uint32_t _unknown3 /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrWkstaTransportDel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrWkstaTransportDel_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.transport_name = _transport_name;
+       state->orig.in.unknown3 = _unknown3;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportDel_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaTransportDel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWkstaTransportDel_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_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -411,6 +1421,134 @@ NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrUseAdd_state {
+       struct wkssvc_NetrUseAdd orig;
+       struct wkssvc_NetrUseAdd tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrUseAdd_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                uint32_t _level /* [in]  */,
+                                                union wkssvc_NetrUseGetInfoCtr *_ctr /* [in] [ref,switch_is(level)] */,
+                                                uint32_t *_parm_err /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrUseAdd_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrUseAdd_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.level = _level;
+       state->orig.in.ctr = _ctr;
+       state->orig.in.parm_err = _parm_err;
+
+       /* Out parameters */
+       state->orig.out.parm_err = _parm_err;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrUseAdd_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_wkssvc,
+                                   NDR_WKSSVC_NETRUSEADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseAdd_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseAdd_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 */
+       if (state->orig.out.parm_err && state->tmp.out.parm_err) {
+               *state->orig.out.parm_err = *state->tmp.out.parm_err;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrUseAdd_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseAdd_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_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -463,6 +1601,131 @@ NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrUseGetInfo_state {
+       struct wkssvc_NetrUseGetInfo orig;
+       struct wkssvc_NetrUseGetInfo tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrUseGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_use_name /* [in] [ref,charset(UTF16)] */,
+                                                    uint32_t _level /* [in]  */,
+                                                    union wkssvc_NetrUseGetInfoCtr *_ctr /* [out] [ref,switch_is(level)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrUseGetInfo_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrUseGetInfo_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.use_name = _use_name;
+       state->orig.in.level = _level;
+
+       /* Out parameters */
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrUseGetInfo_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_wkssvc,
+                                   NDR_WKSSVC_NETRUSEGETINFO,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseGetInfo_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseGetInfo_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.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrUseGetInfo_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseGetInfo_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_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -512,14 +1775,130 @@ NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
-NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
-                                 TALLOC_CTX *mem_ctx,
-                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                 const char *use_name /* [in] [ref,charset(UTF16)] */,
-                                 uint32_t force_cond /* [in]  */,
-                                 WERROR *werror)
+struct rpccli_wkssvc_NetrUseDel_state {
+       struct wkssvc_NetrUseDel orig;
+       struct wkssvc_NetrUseDel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrUseDel_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                const char *_use_name /* [in] [ref,charset(UTF16)] */,
+                                                uint32_t _force_cond /* [in]  */)
 {
-       struct wkssvc_NetrUseDel r;
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrUseDel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrUseDel_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.use_name = _use_name;
+       state->orig.in.force_cond = _force_cond;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRUSEDEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseDel_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseDel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrUseDel_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result)
+{
+       struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseDel_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_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                 const char *use_name /* [in] [ref,charset(UTF16)] */,
+                                 uint32_t force_cond /* [in]  */,
+                                 WERROR *werror)
+{
+       struct wkssvc_NetrUseDel r;
        NTSTATUS status;
 
        /* In parameters */
@@ -559,6 +1938,139 @@ NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrUseEnum_state {
+       struct wkssvc_NetrUseEnum orig;
+       struct wkssvc_NetrUseEnum tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrUseEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                 struct wkssvc_NetrUseEnumInfo *_info /* [in,out] [ref] */,
+                                                 uint32_t _prefmaxlen /* [in]  */,
+                                                 uint32_t *_entries_read /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrUseEnum_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrUseEnum_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.info = _info;
+       state->orig.in.prefmaxlen = _prefmaxlen;
+       state->orig.in.resume_handle = _resume_handle;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+       state->orig.out.entries_read = _entries_read;
+       state->orig.out.resume_handle = _resume_handle;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrUseEnum_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_wkssvc,
+                                   NDR_WKSSVC_NETRUSEENUM,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseEnum_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseEnum_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.info = *state->tmp.out.info;
+       *state->orig.out.entries_read = *state->tmp.out.entries_read;
+       if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
+               *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
+       }
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrUseEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result)
+{
+       struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUseEnum_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_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -614,6 +2126,126 @@ NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrMessageBufferSend_state {
+       struct wkssvc_NetrMessageBufferSend orig;
+       struct wkssvc_NetrMessageBufferSend tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrMessageBufferSend_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           const char *_message_name /* [in] [ref,charset(UTF16)] */,
+                                                           const char *_message_sender_name /* [in] [unique,charset(UTF16)] */,
+                                                           uint8_t *_message_buffer /* [in] [ref,size_is(message_size)] */,
+                                                           uint32_t _message_size /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrMessageBufferSend_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrMessageBufferSend_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.message_name = _message_name;
+       state->orig.in.message_sender_name = _message_sender_name;
+       state->orig.in.message_buffer = _message_buffer;
+       state->orig.in.message_size = _message_size;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrMessageBufferSend_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrMessageBufferSend_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrMessageBufferSend_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result)
+{
+       struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrMessageBufferSend_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_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -665,6 +2297,133 @@ NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state {
+       struct wkssvc_NetrWorkstationStatisticsGet orig;
+       struct wkssvc_NetrWorkstationStatisticsGet tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrWorkstationStatisticsGet_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                  const char *_unknown2 /* [in] [unique,charset(UTF16)] */,
+                                                                  uint32_t _unknown3 /* [in]  */,
+                                                                  uint32_t _unknown4 /* [in]  */,
+                                                                  struct wkssvc_NetrWorkstationStatistics **_info /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.unknown2 = _unknown2;
+       state->orig.in.unknown3 = _unknown3;
+       state->orig.in.unknown4 = _unknown4;
+
+       /* Out parameters */
+       state->orig.out.info = _info;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrWorkstationStatisticsGet_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_wkssvc,
+                                   NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWorkstationStatisticsGet_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_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.info = *state->tmp.out.info;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result)
+{
+       struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_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_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -716,6 +2475,118 @@ NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrLogonDomainNameAdd_state {
+       struct wkssvc_NetrLogonDomainNameAdd orig;
+       struct wkssvc_NetrLogonDomainNameAdd tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameAdd_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_domain_name /* [in] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrLogonDomainNameAdd_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;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameAdd_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_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_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *domain_name /* [in] [ref,charset(UTF16)] */,
@@ -759,6 +2630,118 @@ NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrLogonDomainNameDel_state {
+       struct wkssvc_NetrLogonDomainNameDel orig;
+       struct wkssvc_NetrLogonDomainNameDel tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameDel_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_domain_name /* [in] [ref,charset(UTF16)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrLogonDomainNameDel_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;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameDel_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrLogonDomainNameDel_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrLogonDomainNameDel_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_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *domain_name /* [in] [ref,charset(UTF16)] */,
@@ -802,6 +2785,128 @@ NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrJoinDomain_state {
+       struct wkssvc_NetrJoinDomain orig;
+       struct wkssvc_NetrJoinDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrJoinDomain_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                    const char *_account_ou /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _join_flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrJoinDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrJoinDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.domain_name = _domain_name;
+       state->orig.in.account_ou = _account_ou;
+       state->orig.in.Account = _Account;
+       state->orig.in.password = _password;
+       state->orig.in.join_flags = _join_flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRJOINDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrJoinDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrJoinDomain_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result)
+{
+       struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrJoinDomain_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_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -855,6 +2960,124 @@ NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrUnjoinDomain_state {
+       struct wkssvc_NetrUnjoinDomain orig;
+       struct wkssvc_NetrUnjoinDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                      uint32_t _unjoin_flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrUnjoinDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrUnjoinDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.Account = _Account;
+       state->orig.in.password = _password;
+       state->orig.in.unjoin_flags = _unjoin_flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRUNJOINDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUnjoinDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrUnjoinDomain_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUnjoinDomain_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_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -904,6 +3127,126 @@ NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrRenameMachineInDomain_state {
+       struct wkssvc_NetrRenameMachineInDomain orig;
+       struct wkssvc_NetrRenameMachineInDomain tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                               uint32_t _RenameOptions /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.NewMachineName = _NewMachineName;
+       state->orig.in.Account = _Account;
+       state->orig.in.password = _password;
+       state->orig.in.RenameOptions = _RenameOptions;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrRenameMachineInDomain_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result)
+{
+       struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrRenameMachineInDomain_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_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -952,58 +3295,303 @@ NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
                *werror = r.out.result;
        }
 
-       return werror_to_ntstatus(r.out.result);
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_wkssvc_NetrValidateName_state {
+       struct wkssvc_NetrValidateName orig;
+       struct wkssvc_NetrValidateName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrValidateName_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_name /* [in] [ref,charset(UTF16)] */,
+                                                      const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_Password /* [in] [unique,charset(UTF16)] */,
+                                                      enum wkssvc_NetValidateNameType _name_type /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrValidateName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrValidateName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.name = _name;
+       state->orig.in.Account = _Account;
+       state->orig.in.Password = _Password;
+       state->orig.in.name_type = _name_type;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRVALIDATENAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrValidateName_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrValidateName_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result)
+{
+       struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrValidateName_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_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                       const char *name /* [in] [ref,charset(UTF16)] */,
+                                       const char *Account /* [in] [unique,charset(UTF16)] */,
+                                       const char *Password /* [in] [unique,charset(UTF16)] */,
+                                       enum wkssvc_NetValidateNameType name_type /* [in]  */,
+                                       WERROR *werror)
+{
+       struct wkssvc_NetrValidateName r;
+       NTSTATUS status;
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.name = name;
+       r.in.Account = Account;
+       r.in.Password = Password;
+       r.in.name_type = name_type;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wkssvc,
+                               NDR_WKSSVC_NETRVALIDATENAME,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_wkssvc_NetrGetJoinInformation_state {
+       struct wkssvc_NetrGetJoinInformation orig;
+       struct wkssvc_NetrGetJoinInformation tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrGetJoinInformation_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                            const char **_name_buffer /* [in,out] [ref,charset(UTF16)] */,
+                                                            enum wkssvc_NetJoinStatus *_name_type /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrGetJoinInformation_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrGetJoinInformation_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.name_buffer = _name_buffer;
+
+       /* Out parameters */
+       state->orig.out.name_buffer = _name_buffer;
+       state->orig.out.name_type = _name_type;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrGetJoinInformation_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_wkssvc,
+                                   NDR_WKSSVC_NETRGETJOININFORMATION,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinInformation_done, req);
+       return req;
 }
 
-NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx,
-                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
-                                       const char *name /* [in] [ref,charset(UTF16)] */,
-                                       const char *Account /* [in] [unique,charset(UTF16)] */,
-                                       const char *Password /* [in] [unique,charset(UTF16)] */,
-                                       enum wkssvc_NetValidateNameType name_type /* [in]  */,
-                                       WERROR *werror)
+static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq)
 {
-       struct wkssvc_NetrValidateName r;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
        NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
 
-       /* In parameters */
-       r.in.server_name = server_name;
-       r.in.name = name;
-       r.in.Account = Account;
-       r.in.Password = Password;
-       r.in.name_type = name_type;
-
-       if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r);
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_wkssvc,
-                               NDR_WKSSVC_NETRVALIDATENAME,
-                               &r);
-
+       status = state->dispatch_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+       *state->orig.out.name_buffer = *state->tmp.out.name_buffer;
+       *state->orig.out.name_type = *state->tmp.out.name_type;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r);
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrGetJoinInformation_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result)
+{
+       struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
@@ -1054,6 +3642,137 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrGetJoinableOus_state {
+       struct wkssvc_NetrGetJoinableOus orig;
+       struct wkssvc_NetrGetJoinableOus tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                        const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_unknown /* [in] [unique,charset(UTF16)] */,
+                                                        uint32_t *_num_ous /* [in,out] [ref] */,
+                                                        const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrGetJoinableOus_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrGetJoinableOus_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.domain_name = _domain_name;
+       state->orig.in.Account = _Account;
+       state->orig.in.unknown = _unknown;
+       state->orig.in.num_ous = _num_ous;
+
+       /* Out parameters */
+       state->orig.out.num_ous = _num_ous;
+       state->orig.out.ous = _ous;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrGetJoinableOus_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_wkssvc,
+                                   NDR_WKSSVC_NETRGETJOINABLEOUS,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrGetJoinableOus_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.num_ous = *state->tmp.out.num_ous;
+       *state->orig.out.ous = *state->tmp.out.ous;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrGetJoinableOus_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result)
+{
+       struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrGetJoinableOus_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_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1108,6 +3827,128 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrJoinDomain2_state {
+       struct wkssvc_NetrJoinDomain2 orig;
+       struct wkssvc_NetrJoinDomain2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrJoinDomain2_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                     const char *_account_ou /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_admin_account /* [in] [unique,charset(UTF16)] */,
+                                                     struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
+                                                     uint32_t _join_flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrJoinDomain2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrJoinDomain2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.domain_name = _domain_name;
+       state->orig.in.account_ou = _account_ou;
+       state->orig.in.admin_account = _admin_account;
+       state->orig.in.encrypted_password = _encrypted_password;
+       state->orig.in.join_flags = _join_flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRJOINDOMAIN2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain2_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrJoinDomain2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrJoinDomain2_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result)
+{
+       struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrJoinDomain2_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_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1161,6 +4002,124 @@ NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrUnjoinDomain2_state {
+       struct wkssvc_NetrUnjoinDomain2 orig;
+       struct wkssvc_NetrUnjoinDomain2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_account /* [in] [unique,charset(UTF16)] */,
+                                                       struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
+                                                       uint32_t _unjoin_flags /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrUnjoinDomain2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrUnjoinDomain2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.account = _account;
+       state->orig.in.encrypted_password = _encrypted_password;
+       state->orig.in.unjoin_flags = _unjoin_flags;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRUNJOINDOMAIN2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain2_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUnjoinDomain2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrUnjoinDomain2_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_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1210,6 +4169,126 @@ NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrRenameMachineInDomain2_state {
+       struct wkssvc_NetrRenameMachineInDomain2 orig;
+       struct wkssvc_NetrRenameMachineInDomain2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain2_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                uint32_t _RenameOptions /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.NewMachineName = _NewMachineName;
+       state->orig.in.Account = _Account;
+       state->orig.in.EncryptedPassword = _EncryptedPassword;
+       state->orig.in.RenameOptions = _RenameOptions;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain2_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_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_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1223,42 +4302,162 @@ NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
        NTSTATUS status;
 
        /* In parameters */
-       r.in.server_name = server_name;
-       r.in.NewMachineName = NewMachineName;
-       r.in.Account = Account;
-       r.in.EncryptedPassword = EncryptedPassword;
-       r.in.RenameOptions = RenameOptions;
+       r.in.server_name = server_name;
+       r.in.NewMachineName = NewMachineName;
+       r.in.Account = Account;
+       r.in.EncryptedPassword = EncryptedPassword;
+       r.in.RenameOptions = RenameOptions;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
+       }
+
+       status = cli->dispatch(cli,
+                               mem_ctx,
+                               &ndr_table_wkssvc,
+                               NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
+                               &r);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
+       }
+
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
+       /* Return variables */
+
+       /* Return result */
+       if (werror) {
+               *werror = r.out.result;
+       }
+
+       return werror_to_ntstatus(r.out.result);
+}
+
+struct rpccli_wkssvc_NetrValidateName2_state {
+       struct wkssvc_NetrValidateName2 orig;
+       struct wkssvc_NetrValidateName2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrValidateName2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_name /* [in] [ref,charset(UTF16)] */,
+                                                       const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                       struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                       enum wkssvc_NetValidateNameType _name_type /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrValidateName2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrValidateName2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.name = _name;
+       state->orig.in.Account = _Account;
+       state->orig.in.EncryptedPassword = _EncryptedPassword;
+       state->orig.in.name_type = _name_type;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &state->orig);
        }
 
-       status = cli->dispatch(cli,
-                               mem_ctx,
-                               &ndr_table_wkssvc,
-                               NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
-                               &r);
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRVALIDATENAME2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName2_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrValidateName2_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)) {
-               return status;
+               tevent_req_nterror(req, status);
+               return;
        }
 
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &state->orig);
        }
 
-       if (NT_STATUS_IS_ERR(status)) {
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrValidateName2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result)
+{
+       struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrValidateName2_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
                return status;
        }
 
-       /* Return variables */
+       /* Steal possbile out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
+       *result = state->orig.out.result;
 
-       return werror_to_ntstatus(r.out.result);
+       tevent_req_received(req);
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
@@ -1312,6 +4511,137 @@ NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrGetJoinableOus2_state {
+       struct wkssvc_NetrGetJoinableOus2 orig;
+       struct wkssvc_NetrGetJoinableOus2 tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus2_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                         const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                         const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                         struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                         uint32_t *_num_ous /* [in,out] [ref] */,
+                                                         const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrGetJoinableOus2_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrGetJoinableOus2_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.domain_name = _domain_name;
+       state->orig.in.Account = _Account;
+       state->orig.in.EncryptedPassword = _EncryptedPassword;
+       state->orig.in.num_ous = _num_ous;
+
+       /* Out parameters */
+       state->orig.out.num_ous = _num_ous;
+       state->orig.out.ous = _ous;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrGetJoinableOus2_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_wkssvc,
+                                   NDR_WKSSVC_NETRGETJOINABLEOUS2,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus2_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrGetJoinableOus2_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.num_ous = *state->tmp.out.num_ous;
+       *state->orig.out.ous = *state->tmp.out.ous;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result)
+{
+       struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrGetJoinableOus2_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_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1366,6 +4696,126 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrAddAlternateComputerName_state {
+       struct wkssvc_NetrAddAlternateComputerName orig;
+       struct wkssvc_NetrAddAlternateComputerName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrAddAlternateComputerName_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                  const char *_NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
+                                                                  const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                  struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                  uint32_t _Reserved /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.NewAlternateMachineName = _NewAlternateMachineName;
+       state->orig.in.Account = _Account;
+       state->orig.in.EncryptedPassword = _EncryptedPassword;
+       state->orig.in.Reserved = _Reserved;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrAddAlternateComputerName_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrAddAlternateComputerName_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result)
+{
+       struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrAddAlternateComputerName_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_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1417,6 +4867,126 @@ NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state {
+       struct wkssvc_NetrRemoveAlternateComputerName orig;
+       struct wkssvc_NetrRemoveAlternateComputerName tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrRemoveAlternateComputerName_send(TALLOC_CTX *mem_ctx,
+                                                                     struct tevent_context *ev,
+                                                                     struct rpc_pipe_client *cli,
+                                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                     const char *_AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
+                                                                     const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                     struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                     uint32_t _Reserved /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.AlternateMachineNameToRemove = _AlternateMachineNameToRemove;
+       state->orig.in.Account = _Account;
+       state->orig.in.EncryptedPassword = _EncryptedPassword;
+       state->orig.in.Reserved = _Reserved;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRemoveAlternateComputerName_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName_recv(struct tevent_req *req,
+                                                           TALLOC_CTX *mem_ctx,
+                                                           WERROR *result)
+{
+       struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_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_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli,
                                                       TALLOC_CTX *mem_ctx,
                                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1468,6 +5038,126 @@ NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *c
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrSetPrimaryComputername_state {
+       struct wkssvc_NetrSetPrimaryComputername orig;
+       struct wkssvc_NetrSetPrimaryComputername tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrSetPrimaryComputername_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_primary_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                uint32_t _Reserved /* [in]  */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.primary_name = _primary_name;
+       state->orig.in.Account = _Account;
+       state->orig.in.EncryptedPassword = _EncryptedPassword;
+       state->orig.in.Reserved = _Reserved;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &state->orig);
+       }
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = cli->dispatch_send(state, ev, cli,
+                                   &ndr_table_wkssvc,
+                                   NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrSetPrimaryComputername_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrSetPrimaryComputername_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 */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrSetPrimaryComputername_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_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -1519,6 +5209,131 @@ NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
        return werror_to_ntstatus(r.out.result);
 }
 
+struct rpccli_wkssvc_NetrEnumerateComputerNames_state {
+       struct wkssvc_NetrEnumerateComputerNames orig;
+       struct wkssvc_NetrEnumerateComputerNames tmp;
+       TALLOC_CTX *out_mem_ctx;
+       NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wkssvc_NetrEnumerateComputerNames_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                enum wkssvc_ComputerNameType _name_type /* [in]  */,
+                                                                uint32_t _Reserved /* [in]  */,
+                                                                struct wkssvc_ComputerNamesCtr **_ctr /* [out] [ref] */)
+{
+       struct tevent_req *req;
+       struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+       state->dispatch_recv = cli->dispatch_recv;
+
+       /* In parameters */
+       state->orig.in.server_name = _server_name;
+       state->orig.in.name_type = _name_type;
+       state->orig.in.Reserved = _Reserved;
+
+       /* Out parameters */
+       state->orig.out.ctr = _ctr;
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &state->orig);
+       }
+
+       state->out_mem_ctx = talloc_named_const(state, 0,
+                            "rpccli_wkssvc_NetrEnumerateComputerNames_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_wkssvc,
+                                   NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
+                                   &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, rpccli_wkssvc_NetrEnumerateComputerNames_done, req);
+       return req;
+}
+
+static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrEnumerateComputerNames_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.ctr = *state->tmp.out.ctr;
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &state->orig);
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result)
+{
+       struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
+               req, struct rpccli_wkssvc_NetrEnumerateComputerNames_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_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
index 2427099f0ec5448bd155452f19e4cad67ee47b35..1d3165f4396dac3e5d4d3ae03851a8c49a0d644a 100644 (file)
@@ -1,12 +1,31 @@
 #include "../librpc/gen_ndr/ndr_wkssvc.h"
 #ifndef __CLI_WKSSVC__
 #define __CLI_WKSSVC__
+struct tevent_req *rpccli_wkssvc_NetWkstaGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union wkssvc_NetWkstaInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_wkssvc_NetWkstaGetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
                                       uint32_t level /* [in]  */,
                                       union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetWkstaSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     uint32_t _level /* [in]  */,
+                                                     union wkssvc_NetWkstaInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                     uint32_t *_parm_error /* [in,out] [ref] */);
+NTSTATUS rpccli_wkssvc_NetWkstaSetInfo_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -14,6 +33,17 @@ NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
                                       union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */,
                                       uint32_t *parm_error /* [in,out] [ref] */,
                                       WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetWkstaEnumUsers_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       struct wkssvc_NetWkstaEnumUsersInfo *_info /* [in,out] [ref] */,
+                                                       uint32_t _prefmaxlen /* [in]  */,
+                                                       uint32_t *_entries_read /* [out] [ref] */,
+                                                       uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -22,12 +52,31 @@ NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
                                         uint32_t *entries_read /* [out] [ref] */,
                                         uint32_t *resume_handle /* [in,out] [unique] */,
                                         WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrWkstaUserGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_unknown /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _level /* [in]  */,
+                                                          union wkssvc_NetrWkstaUserInfo *_info /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *unknown /* [in] [unique,charset(UTF16)] */,
                                            uint32_t level /* [in]  */,
                                            union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrWkstaUserSetInfo_send(TALLOC_CTX *mem_ctx,
+                                                          struct tevent_context *ev,
+                                                          struct rpc_pipe_client *cli,
+                                                          const char *_unknown /* [in] [unique,charset(UTF16)] */,
+                                                          uint32_t _level /* [in]  */,
+                                                          union wkssvc_NetrWkstaUserInfo *_info /* [in] [ref,switch_is(level)] */,
+                                                          uint32_t *_parm_err /* [in,out] [unique] */);
+NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo_recv(struct tevent_req *req,
+                                                TALLOC_CTX *mem_ctx,
+                                                WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            const char *unknown /* [in] [unique,charset(UTF16)] */,
@@ -35,6 +84,17 @@ NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
                                            union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */,
                                            uint32_t *parm_err /* [in,out] [unique] */,
                                            WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetWkstaTransportEnum_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           struct wkssvc_NetWkstaTransportInfo *_info /* [in,out] [ref] */,
+                                                           uint32_t _max_buffer /* [in]  */,
+                                                           uint32_t *_total_entries /* [out] [ref] */,
+                                                           uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -43,6 +103,16 @@ NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
                                             uint32_t *total_entries /* [out] [ref] */,
                                             uint32_t *resume_handle /* [in,out] [unique] */,
                                             WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrWkstaTransportAdd_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           uint32_t _level /* [in]  */,
+                                                           struct wkssvc_NetWkstaTransportInfo0 *_info0 /* [in] [ref] */,
+                                                           uint32_t *_parm_err /* [in,out] [unique] */);
+NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -50,12 +120,31 @@ NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
                                             struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */,
                                             uint32_t *parm_err /* [in,out] [unique] */,
                                             WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrWkstaTransportDel_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           const char *_transport_name /* [in] [unique,charset(UTF16)] */,
+                                                           uint32_t _unknown3 /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
                                             const char *transport_name /* [in] [unique,charset(UTF16)] */,
                                             uint32_t unknown3 /* [in]  */,
                                             WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrUseAdd_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                uint32_t _level /* [in]  */,
+                                                union wkssvc_NetrUseGetInfoCtr *_ctr /* [in] [ref,switch_is(level)] */,
+                                                uint32_t *_parm_err /* [in,out] [unique] */);
+NTSTATUS rpccli_wkssvc_NetrUseAdd_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -63,6 +152,16 @@ NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
                                  union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */,
                                  uint32_t *parm_err /* [in,out] [unique] */,
                                  WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrUseGetInfo_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_use_name /* [in] [ref,charset(UTF16)] */,
+                                                    uint32_t _level /* [in]  */,
+                                                    union wkssvc_NetrUseGetInfoCtr *_ctr /* [out] [ref,switch_is(level)] */);
+NTSTATUS rpccli_wkssvc_NetrUseGetInfo_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -70,12 +169,32 @@ NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
                                      uint32_t level /* [in]  */,
                                      union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */,
                                      WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrUseDel_send(TALLOC_CTX *mem_ctx,
+                                                struct tevent_context *ev,
+                                                struct rpc_pipe_client *cli,
+                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                const char *_use_name /* [in] [ref,charset(UTF16)] */,
+                                                uint32_t _force_cond /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrUseDel_recv(struct tevent_req *req,
+                                      TALLOC_CTX *mem_ctx,
+                                      WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
                                  TALLOC_CTX *mem_ctx,
                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
                                  const char *use_name /* [in] [ref,charset(UTF16)] */,
                                  uint32_t force_cond /* [in]  */,
                                  WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrUseEnum_send(TALLOC_CTX *mem_ctx,
+                                                 struct tevent_context *ev,
+                                                 struct rpc_pipe_client *cli,
+                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                 struct wkssvc_NetrUseEnumInfo *_info /* [in,out] [ref] */,
+                                                 uint32_t _prefmaxlen /* [in]  */,
+                                                 uint32_t *_entries_read /* [out] [ref] */,
+                                                 uint32_t *_resume_handle /* [in,out] [unique] */);
+NTSTATUS rpccli_wkssvc_NetrUseEnum_recv(struct tevent_req *req,
+                                       TALLOC_CTX *mem_ctx,
+                                       WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
                                   TALLOC_CTX *mem_ctx,
                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -84,6 +203,17 @@ NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
                                   uint32_t *entries_read /* [out] [ref] */,
                                   uint32_t *resume_handle /* [in,out] [unique] */,
                                   WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrMessageBufferSend_send(TALLOC_CTX *mem_ctx,
+                                                           struct tevent_context *ev,
+                                                           struct rpc_pipe_client *cli,
+                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                           const char *_message_name /* [in] [ref,charset(UTF16)] */,
+                                                           const char *_message_sender_name /* [in] [unique,charset(UTF16)] */,
+                                                           uint8_t *_message_buffer /* [in] [ref,size_is(message_size)] */,
+                                                           uint32_t _message_size /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrMessageBufferSend_recv(struct tevent_req *req,
+                                                 TALLOC_CTX *mem_ctx,
+                                                 WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -92,6 +222,17 @@ NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
                                             uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */,
                                             uint32_t message_size /* [in]  */,
                                             WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrWorkstationStatisticsGet_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                  const char *_unknown2 /* [in] [unique,charset(UTF16)] */,
+                                                                  uint32_t _unknown3 /* [in]  */,
+                                                                  uint32_t _unknown4 /* [in]  */,
+                                                                  struct wkssvc_NetrWorkstationStatistics **_info /* [out] [ref] */);
+NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -100,14 +241,40 @@ NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
                                                    uint32_t unknown4 /* [in]  */,
                                                    struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */,
                                                    WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameAdd_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_domain_name /* [in] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *domain_name /* [in] [ref,charset(UTF16)] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameDel_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_domain_name /* [in] [ref,charset(UTF16)] */);
+NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *domain_name /* [in] [ref,charset(UTF16)] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrJoinDomain_send(TALLOC_CTX *mem_ctx,
+                                                    struct tevent_context *ev,
+                                                    struct rpc_pipe_client *cli,
+                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                    const char *_account_ou /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                    const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                    uint32_t _join_flags /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrJoinDomain_recv(struct tevent_req *req,
+                                          TALLOC_CTX *mem_ctx,
+                                          WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
                                      TALLOC_CTX *mem_ctx,
                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -117,6 +284,16 @@ NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
                                      const char *password /* [in] [unique,charset(UTF16)] */,
                                      uint32_t join_flags /* [in]  */,
                                      WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                      uint32_t _unjoin_flags /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrUnjoinDomain_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -124,6 +301,17 @@ NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
                                        const char *password /* [in] [unique,charset(UTF16)] */,
                                        uint32_t unjoin_flags /* [in]  */,
                                        WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain_send(TALLOC_CTX *mem_ctx,
+                                                               struct tevent_context *ev,
+                                                               struct rpc_pipe_client *cli,
+                                                               const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                               const char *_password /* [in] [unique,charset(UTF16)] */,
+                                                               uint32_t _RenameOptions /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain_recv(struct tevent_req *req,
+                                                     TALLOC_CTX *mem_ctx,
+                                                     WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -132,6 +320,17 @@ NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
                                                 const char *password /* [in] [unique,charset(UTF16)] */,
                                                 uint32_t RenameOptions /* [in]  */,
                                                 WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrValidateName_send(TALLOC_CTX *mem_ctx,
+                                                      struct tevent_context *ev,
+                                                      struct rpc_pipe_client *cli,
+                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_name /* [in] [ref,charset(UTF16)] */,
+                                                      const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                      const char *_Password /* [in] [unique,charset(UTF16)] */,
+                                                      enum wkssvc_NetValidateNameType _name_type /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrValidateName_recv(struct tevent_req *req,
+                                            TALLOC_CTX *mem_ctx,
+                                            WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -140,12 +339,33 @@ NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
                                        const char *Password /* [in] [unique,charset(UTF16)] */,
                                        enum wkssvc_NetValidateNameType name_type /* [in]  */,
                                        WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrGetJoinInformation_send(TALLOC_CTX *mem_ctx,
+                                                            struct tevent_context *ev,
+                                                            struct rpc_pipe_client *cli,
+                                                            const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                            const char **_name_buffer /* [in,out] [ref,charset(UTF16)] */,
+                                                            enum wkssvc_NetJoinStatus *_name_type /* [out] [ref] */);
+NTSTATUS rpccli_wkssvc_NetrGetJoinInformation_recv(struct tevent_req *req,
+                                                  TALLOC_CTX *mem_ctx,
+                                                  WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
                                              TALLOC_CTX *mem_ctx,
                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
                                              const char **name_buffer /* [in,out] [ref,charset(UTF16)] */,
                                              enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */,
                                              WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus_send(TALLOC_CTX *mem_ctx,
+                                                        struct tevent_context *ev,
+                                                        struct rpc_pipe_client *cli,
+                                                        const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                        const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                        const char *_unknown /* [in] [unique,charset(UTF16)] */,
+                                                        uint32_t *_num_ous /* [in,out] [ref] */,
+                                                        const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */);
+NTSTATUS rpccli_wkssvc_NetrGetJoinableOus_recv(struct tevent_req *req,
+                                              TALLOC_CTX *mem_ctx,
+                                              WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
                                          TALLOC_CTX *mem_ctx,
                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -155,6 +375,18 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
                                          uint32_t *num_ous /* [in,out] [ref] */,
                                          const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
                                          WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrJoinDomain2_send(TALLOC_CTX *mem_ctx,
+                                                     struct tevent_context *ev,
+                                                     struct rpc_pipe_client *cli,
+                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                     const char *_account_ou /* [in] [unique,charset(UTF16)] */,
+                                                     const char *_admin_account /* [in] [unique,charset(UTF16)] */,
+                                                     struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
+                                                     uint32_t _join_flags /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrJoinDomain2_recv(struct tevent_req *req,
+                                           TALLOC_CTX *mem_ctx,
+                                           WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx,
                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -164,6 +396,16 @@ NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
                                       struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
                                       uint32_t join_flags /* [in]  */,
                                       WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_account /* [in] [unique,charset(UTF16)] */,
+                                                       struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
+                                                       uint32_t _unjoin_flags /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -171,6 +413,17 @@ NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
                                         struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
                                         uint32_t unjoin_flags /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain2_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                uint32_t _RenameOptions /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -179,6 +432,17 @@ NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
                                                  struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
                                                  uint32_t RenameOptions /* [in]  */,
                                                  WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrValidateName2_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct rpc_pipe_client *cli,
+                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                       const char *_name /* [in] [ref,charset(UTF16)] */,
+                                                       const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                       struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                       enum wkssvc_NetValidateNameType _name_type /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrValidateName2_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -187,6 +451,18 @@ NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
                                         struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
                                         enum wkssvc_NetValidateNameType name_type /* [in]  */,
                                         WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus2_send(TALLOC_CTX *mem_ctx,
+                                                         struct tevent_context *ev,
+                                                         struct rpc_pipe_client *cli,
+                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                         const char *_domain_name /* [in] [ref,charset(UTF16)] */,
+                                                         const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                         struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                         uint32_t *_num_ous /* [in,out] [ref] */,
+                                                         const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */);
+NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2_recv(struct tevent_req *req,
+                                               TALLOC_CTX *mem_ctx,
+                                               WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
                                           TALLOC_CTX *mem_ctx,
                                           const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -196,6 +472,17 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
                                           uint32_t *num_ous /* [in,out] [ref] */,
                                           const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
                                           WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrAddAlternateComputerName_send(TALLOC_CTX *mem_ctx,
+                                                                  struct tevent_context *ev,
+                                                                  struct rpc_pipe_client *cli,
+                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                  const char *_NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
+                                                                  const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                  struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                  uint32_t _Reserved /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName_recv(struct tevent_req *req,
+                                                        TALLOC_CTX *mem_ctx,
+                                                        WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
                                                    TALLOC_CTX *mem_ctx,
                                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -204,6 +491,17 @@ NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
                                                    struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
                                                    uint32_t Reserved /* [in]  */,
                                                    WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrRemoveAlternateComputerName_send(TALLOC_CTX *mem_ctx,
+                                                                     struct tevent_context *ev,
+                                                                     struct rpc_pipe_client *cli,
+                                                                     const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                     const char *_AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
+                                                                     const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                     struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                     uint32_t _Reserved /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName_recv(struct tevent_req *req,
+                                                           TALLOC_CTX *mem_ctx,
+                                                           WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli,
                                                       TALLOC_CTX *mem_ctx,
                                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -212,6 +510,17 @@ NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *c
                                                       struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
                                                       uint32_t Reserved /* [in]  */,
                                                       WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrSetPrimaryComputername_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_primary_name /* [in] [unique,charset(UTF16)] */,
+                                                                const char *_Account /* [in] [unique,charset(UTF16)] */,
+                                                                struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
+                                                                uint32_t _Reserved /* [in]  */);
+NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -220,6 +529,16 @@ NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
                                                  struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
                                                  uint32_t Reserved /* [in]  */,
                                                  WERROR *werror);
+struct tevent_req *rpccli_wkssvc_NetrEnumerateComputerNames_send(TALLOC_CTX *mem_ctx,
+                                                                struct tevent_context *ev,
+                                                                struct rpc_pipe_client *cli,
+                                                                const char *_server_name /* [in] [unique,charset(UTF16)] */,
+                                                                enum wkssvc_ComputerNameType _name_type /* [in]  */,
+                                                                uint32_t _Reserved /* [in]  */,
+                                                                struct wkssvc_ComputerNamesCtr **_ctr /* [out] [ref] */);
+NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames_recv(struct tevent_req *req,
+                                                      TALLOC_CTX *mem_ctx,
+                                                      WERROR *result);
 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli,
                                                  TALLOC_CTX *mem_ctx,
                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,