s3-netapi: add libnetapi_get_binding_handle().
authorGünther Deschner <gd@samba.org>
Wed, 6 Apr 2011 12:21:30 +0000 (14:21 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 12 Apr 2011 10:20:43 +0000 (12:20 +0200)
Guenther

source3/lib/netapi/cm.c
source3/lib/netapi/netapi_private.h

index 0b8220675daa2adf2d3365477ca53fdc178d7515..290194ba2d9d75d4518aa84872c1ab8cd0c6ab0e 100644 (file)
@@ -253,3 +253,26 @@ WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
 
        return WERR_OK;
 }
+
+/********************************************************************
+********************************************************************/
+
+WERROR libnetapi_get_binding_handle(struct libnetapi_ctx *ctx,
+                                   const char *server_name,
+                                   const struct ndr_syntax_id *interface,
+                                   struct dcerpc_binding_handle **binding_handle)
+{
+       struct rpc_pipe_client *pipe_cli;
+       WERROR result;
+
+       *binding_handle = NULL;
+
+       result = libnetapi_open_pipe(ctx, server_name, interface, &pipe_cli);
+       if (!W_ERROR_IS_OK(result)) {
+               return result;
+       }
+
+       *binding_handle = pipe_cli->binding_handle;
+
+       return WERR_OK;
+}
index fe8d72ec0f448bad000b683c7966c7ce285b00fe..7559c615647fe6b280400e106c7e08a447d24bba 100644 (file)
@@ -60,6 +60,10 @@ WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
                           const char *server_name,
                           const struct ndr_syntax_id *interface,
                           struct rpc_pipe_client **presult);
+WERROR libnetapi_get_binding_handle(struct libnetapi_ctx *ctx,
+                                   const char *server_name,
+                                   const struct ndr_syntax_id *interface,
+                                   struct dcerpc_binding_handle **binding_handle);
 WERROR libnetapi_samr_open_domain(struct libnetapi_ctx *mem_ctx,
                                  struct rpc_pipe_client *pipe_cli,
                                  uint32_t connect_mask,