s4-rpc_server: split out DCERPC_SHARE as a separate subsystem
[abartlet/samba.git/.git] / source4 / ntvfs / ipc / rap_server.c
index 2bc07c3e7b31da91bb8b25c99edc981b0793178e..dbd1fccfea8bcce877bebfb19c23af945dfa58ea 100644 (file)
 
 #include "includes.h"
 #include "param/share.h"
-#include "libcli/rap/rap.h"
+#include "../librpc/gen_ndr/rap.h"
 #include "libcli/raw/interfaces.h"
 #include "librpc/gen_ndr/srvsvc.h"
 #include "rpc_server/common/common.h"
+#include "rpc_server/common/share.h"
 #include "param/param.h"
 #include "ntvfs/ipc/ipc.h"
 #include "ntvfs/ipc/proto.h"
@@ -46,7 +47,7 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
        r->out.available = 0;
        r->out.info = NULL;
 
-       nterr = share_get_context_by_name(mem_ctx, lp_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx);
+       nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx);
        if (!NT_STATUS_IS_OK(nterr)) {
                return nterr;
        }
@@ -58,18 +59,18 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
 
        r->out.available = count;
        r->out.info = talloc_array(mem_ctx,
-                                  union rap_shareenum_info, r->out.available);
+                                  union rap_share_info, r->out.available);
 
        for (i = 0, j = 0; i < r->out.available; i++) {
                if (!NT_STATUS_IS_OK(share_get_config(mem_ctx, sctx, snames[i], &scfg))) {
                        DEBUG(3, ("WARNING: Service [%s] disappeared after enumeration!\n", snames[i]));
                        continue;
                }
-               strncpy(r->out.info[j].info1.name,
+               strncpy((char *)r->out.info[j].info1.share_name,
                        snames[i],
-                       sizeof(r->out.info[0].info1.name));
-               r->out.info[i].info1.pad = 0;
-               r->out.info[i].info1.type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg);
+                       sizeof(r->out.info[0].info1.share_name));
+               r->out.info[i].info1.reserved1 = 0;
+               r->out.info[i].info1.share_type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg);
                r->out.info[i].info1.comment = talloc_strdup(mem_ctx, share_string_option(scfg, SHARE_COMMENT, ""));
                talloc_free(scfg);
                j++;