s4-srvsvc: merge srvsvc_NetSrvGetInfo from s3 idl.
authorGünther Deschner <gd@samba.org>
Wed, 29 Oct 2008 19:39:57 +0000 (20:39 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 31 Oct 2008 01:44:32 +0000 (02:44 +0100)
Guenther

source4/librpc/idl/srvsvc.idl
source4/rpc_server/srvsvc/dcesrv_srvsvc.c
source4/torture/rpc/srvsvc.c

index 1d5a678bbe4e1f04ac156162739a6b9854d434a9..918c8ba0ca30e8b6194a7016912ede2d571f4736 100644 (file)
@@ -1130,7 +1130,7 @@ import "security.idl", "svcctl.idl";
        WERROR srvsvc_NetSrvGetInfo(
                [in,unique]   [string,charset(UTF16)] uint16 *server_unc,
                [in]   uint32 level,
-               [out,switch_is(level)] srvsvc_NetSrvInfo info
+               [out,ref,switch_is(level)] srvsvc_NetSrvInfo *info
                );
 
        /******************/
index f0da2b099d3b4c647e39abb85c5fd2a5667836dc..d14d80b8069bcf4b5b37ece08b792a8d62c7e97b 100644 (file)
@@ -1468,7 +1468,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
 {
        struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
 
-       ZERO_STRUCT(r->out);
+       ZERO_STRUCTP(r->out.info);
 
        switch (r->in.level) {
        case 100:
@@ -1482,7 +1482,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
                info100->server_name    = dcesrv_common_get_server_name(mem_ctx, dce_ctx, r->in.server_unc);
                W_ERROR_HAVE_NO_MEMORY(info100->server_name);
 
-               r->out.info.info100 = info100;
+               r->out.info->info100 = info100;
                return WERR_OK;
        }
        case 101:
@@ -1502,7 +1502,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
                info101->comment        = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx));
                W_ERROR_HAVE_NO_MEMORY(info101->comment);
 
-               r->out.info.info101 = info101;
+               r->out.info->info101 = info101;
                return WERR_OK;
        }
        case 102:
@@ -1531,7 +1531,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
                info102->userpath       = dcesrv_common_get_userpath(mem_ctx, dce_ctx);
                W_ERROR_HAVE_NO_MEMORY(info102->userpath);
 
-               r->out.info.info102 = info102;
+               r->out.info->info102 = info102;
                return WERR_OK;
        }
        default:
index a6536faec7807ee3d78f42a01d7ed8a434d5d13b..8ce2321369e36f3a09846fd9e145bacc75291447 100644 (file)
@@ -766,19 +766,15 @@ static bool test_NetSrvGetInfo(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct srvsvc_NetSrvGetInfo r;
-       struct srvsvc_NetSrvInfo503 i503;
+       union srvsvc_NetSrvInfo info;
        uint32_t levels[] = {100, 101, 102, 502, 503};
        int i;
-       uint32_t resume_handle;
-
-       ZERO_STRUCT(i503);
 
        r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
 
        for (i=0;i<ARRAY_SIZE(levels);i++) {
-               ZERO_STRUCT(r.out);
-               resume_handle = 0;
                r.in.level = levels[i];
+               r.out.info = &info;
                torture_comment(tctx, "testing NetSrvGetInfo level %u\n", r.in.level);
                status = dcerpc_srvsvc_NetSrvGetInfo(p, tctx, &r);
                torture_assert_ntstatus_ok(tctx, status, "NetSrvGetInfo failed");