s3-netapi: use libnetapi_get_binding_handle().
[ira/wip.git] / source3 / lib / netapi / shutdown.c
index 199325b17011f621c8091d948ff5023ba7be24a2..78bc2fce6b9ac47d287bda32931aaa43b576d5d6 100644 (file)
@@ -34,19 +34,16 @@ WERROR NetShutdownInit_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct rpc_pipe_client *pipe_cli = NULL;
        struct lsa_StringLarge message;
        struct dcerpc_binding_handle *b;
 
-       werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_initshutdown.syntax_id,
-                                  &pipe_cli);
+       werr = libnetapi_get_binding_handle(ctx, r->in.server_name,
+                                           &ndr_table_initshutdown.syntax_id,
+                                           &b);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
        }
 
-       b = pipe_cli->binding_handle;
-
        init_lsa_StringLarge(&message, r->in.message);
 
        status = dcerpc_initshutdown_Init(b, talloc_tos(),
@@ -82,18 +79,15 @@ WERROR NetShutdownAbort_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct rpc_pipe_client *pipe_cli = NULL;
        struct dcerpc_binding_handle *b;
 
-       werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_initshutdown.syntax_id,
-                                  &pipe_cli);
+       werr = libnetapi_get_binding_handle(ctx, r->in.server_name,
+                                           &ndr_table_initshutdown.syntax_id,
+                                           &b);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
        }
 
-       b = pipe_cli->binding_handle;
-
        status = dcerpc_initshutdown_Abort(b, talloc_tos(),
                                           NULL,
                                           &werr);