mdssvc.idl: pass policy_handle as pointer
authorRalph Boehme <slow@samba.org>
Fri, 23 Aug 2019 16:43:02 +0000 (18:43 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 9 Oct 2019 15:52:55 +0000 (15:52 +0000)
No change in behaviour, this just changes all functions to take the
policy_handle argument as pointer instead of passing it by value.
This is how all other IDLs pass it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Ralph B√∂hme <slow@samba.org>
Autobuild-Date(master): Wed Oct  9 15:52:55 UTC 2019 on sn-devel-184

librpc/idl/mdssvc.idl
source3/rpc_client/cli_mdssvc.c
source3/rpc_server/mdssvc/srv_mdssvc_nt.c
source3/rpcclient/cmd_spotlight.c
source4/torture/rpc/mdssvc.c

index 43447961b0dcb6683a625816266a2807c1202c4d..e7004f074195223191ac4d7c6f132276b500aef0 100644 (file)
@@ -18,7 +18,7 @@ interface mdssvc
        );
 
        void mdssvc_unknown1(
-               [in]        policy_handle   handle,
+               [in]        policy_handle   *handle,
                [in]        uint32          unkn1, /* always 0, some status ? */
                [in]        uint32          device_id,
                [in]        uint32          unkn3, /* = mdssvc_open.unkn2 ? */
@@ -37,7 +37,7 @@ interface mdssvc
        } mdssvc_blob;
 
        void mdssvc_cmd(
-               [in]        policy_handle   handle,
+               [in]        policy_handle   *handle,
                [in]        uint32          unkn1, /* always 0, status ? */
                [in]        uint32          device_id,
                [in]        uint32          unkn3, /* = mdssvc_open.unkn2 ? */
@@ -57,7 +57,7 @@ interface mdssvc
        );
 
        void mdssvc_close(
-               [in]        policy_handle   in_handle,
+               [in]        policy_handle   *in_handle,
                [in]        uint32          unkn1, /* always 0, some status ? */
                [in]        uint32          device_id,
                [in]        uint32          unkn2, /* = mdssvc_open.unkn2 ? */
index 76cceb42fe0e32e8820264d74c1babd0e61ebae4..82d14372fe45938accad71842fb9cfe38a280ce2 100644 (file)
@@ -124,7 +124,7 @@ static void mdscli_connect_open_done(struct tevent_req *subreq)
                        state,
                        state->ev,
                        mdscli_ctx->bh,
-                       mdscli_ctx->ph,
+                       &mdscli_ctx->ph,
                        0,
                        mdscli_ctx->dev,
                        mdscli_ctx->mdscmd_open.unkn2,
@@ -288,7 +288,7 @@ struct tevent_req *mdscli_search_send(TALLOC_CTX *mem_ctx,
        subreq = dcerpc_mdssvc_cmd_send(state,
                                        ev,
                                        mdscli_ctx->bh,
-                                       mdscli_ctx->ph,
+                                       &mdscli_ctx->ph,
                                        0,
                                        mdscli_ctx->dev,
                                        mdscli_ctx->mdscmd_open.unkn2,
@@ -469,7 +469,7 @@ struct tevent_req *mdscli_get_results_send(
        subreq = dcerpc_mdssvc_cmd_send(state,
                                        ev,
                                        mdscli_ctx->bh,
-                                       mdscli_ctx->ph,
+                                       &mdscli_ctx->ph,
                                        0,
                                        mdscli_ctx->dev,
                                        mdscli_ctx->mdscmd_open.unkn2,
@@ -693,7 +693,7 @@ struct tevent_req *mdscli_get_path_send(TALLOC_CTX *mem_ctx,
        subreq = dcerpc_mdssvc_cmd_send(state,
                                        ev,
                                        mdscli_ctx->bh,
-                                       mdscli_ctx->ph,
+                                       &mdscli_ctx->ph,
                                        0,
                                        mdscli_ctx->dev,
                                        mdscli_ctx->mdscmd_open.unkn2,
@@ -864,7 +864,7 @@ struct tevent_req *mdscli_close_search_send(TALLOC_CTX *mem_ctx,
        subreq = dcerpc_mdssvc_cmd_send(state,
                                        ev,
                                        mdscli_ctx->bh,
-                                       mdscli_ctx->ph,
+                                       &mdscli_ctx->ph,
                                        0,
                                        mdscli_ctx->dev,
                                        mdscli_ctx->mdscmd_open.unkn2,
@@ -968,7 +968,7 @@ struct tevent_req *mdscli_disconnect_send(TALLOC_CTX *mem_ctx,
        subreq = dcerpc_mdssvc_close_send(state,
                                          ev,
                                          mdscli_ctx->bh,
-                                         mdscli_ctx->ph,
+                                         &mdscli_ctx->ph,
                                          0,
                                          mdscli_ctx->dev,
                                          mdscli_ctx->mdscmd_open.unkn2,
index 0977c12e98d387c5729f17cde1f1c01dff3b68d2..81114ce6513fe342ef22e2833bd22152bd92b977 100644 (file)
@@ -211,8 +211,8 @@ void _mdssvc_unknown1(struct pipes_struct *p, struct mdssvc_unknown1 *r)
 {
        struct mds_ctx *mds_ctx;
 
-       if (!find_policy_by_hnd(p, &r->in.handle, (void **)(void *)&mds_ctx)) {
-               if (is_zero_policy_handle(&r->in.handle)) {
+       if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&mds_ctx)) {
+               if (is_zero_policy_handle(r->in.handle)) {
                        p->fault_state = 0;
                } else {
                        p->fault_state = DCERPC_NCA_S_PROTO_ERROR;
@@ -238,8 +238,8 @@ void _mdssvc_cmd(struct pipes_struct *p, struct mdssvc_cmd *r)
        char *rbuf;
        struct mds_ctx *mds_ctx;
 
-       if (!find_policy_by_hnd(p, &r->in.handle, (void **)(void *)&mds_ctx)) {
-               if (is_zero_policy_handle(&r->in.handle)) {
+       if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&mds_ctx)) {
+               if (is_zero_policy_handle(r->in.handle)) {
                        p->fault_state = 0;
                } else {
                        p->fault_state = DCERPC_NCA_S_PROTO_ERROR;
@@ -313,10 +313,10 @@ void _mdssvc_close(struct pipes_struct *p, struct mdssvc_close *r)
        struct mds_ctx *mds_ctx;
        bool ok;
 
-       ok = find_policy_by_hnd(p, &r->in.in_handle, (void **)(void *)&mds_ctx);
+       ok = find_policy_by_hnd(p, r->in.in_handle, (void **)(void *)&mds_ctx);
        if (!ok) {
                DBG_WARNING("invalid handle\n");
-               if (is_zero_policy_handle(&r->in.in_handle)) {
+               if (is_zero_policy_handle(r->in.in_handle)) {
                        p->fault_state = 0;
                } else {
                        p->fault_state = DCERPC_NCA_S_PROTO_ERROR;
@@ -327,8 +327,8 @@ void _mdssvc_close(struct pipes_struct *p, struct mdssvc_close *r)
        DBG_DEBUG("Close mdssvc handle for path: %s\n", mds_ctx->spath);
        TALLOC_FREE(mds_ctx);
 
-       *r->out.out_handle = r->in.in_handle;
-       close_policy_hnd(p, &r->in.in_handle);
+       *r->out.out_handle = *r->in.in_handle;
+       close_policy_hnd(p, r->in.in_handle);
 
        *r->out.status = 0;
 
index f8bf75edde459ff7f1d9664bcf2d02e2bc41ccdd..5bc5eb1088891dbe3f114e35f87d3370bab30c2d 100644 (file)
@@ -70,7 +70,7 @@ static NTSTATUS cmd_mdssvc_fetch_properties(
        }
 
        status = dcerpc_mdssvc_unknown1(b, mem_ctx,
-                                       share_handle,
+                                       &share_handle,
                                        0,
                                        device_id,
                                        unkn1,
@@ -160,7 +160,7 @@ static NTSTATUS cmd_mdssvc_fetch_properties(
        request_blob.size = len;
 
        status =  dcerpc_mdssvc_cmd(b, mem_ctx,
-                                   share_handle,
+                                   &share_handle,
                                    0,
                                    device_id,
                                    23,
@@ -248,7 +248,7 @@ static NTSTATUS cmd_mdssvc_fetch_attributes(
        }
 
        status = dcerpc_mdssvc_unknown1(b, mem_ctx,
-                                       share_handle,
+                                       &share_handle,
                                        0,
                                        device_id,
                                        unkn1,
@@ -386,7 +386,7 @@ static NTSTATUS cmd_mdssvc_fetch_attributes(
        request_blob.size = len;
 
        status = dcerpc_mdssvc_cmd(b, mem_ctx,
-                                  share_handle,
+                                  &share_handle,
                                   0,
                                   device_id,
                                   23,
index 9fd7278c8e8625e17c6b8a3ec7c0cf02c5c33e27..afdb4d5c03e10bfdac3a7d5f8481ca612fb0d99f 100644 (file)
@@ -128,7 +128,7 @@ static bool torture_rpc_mdssvc_open(struct torture_context *tctx,
 
        status = dcerpc_mdssvc_unknown1(b,
                                        state,
-                                       state->ph,
+                                       &state->ph,
                                        0,
                                        state->dev,
                                        state->mdscmd_open.unkn2,
@@ -145,7 +145,7 @@ done:
        if (!ok) {
                (void)dcerpc_mdssvc_close(b,
                                          state,
-                                         state->ph,
+                                         &state->ph,
                                          0,
                                          state->dev,
                                          state->mdscmd_open.unkn2,
@@ -170,7 +170,7 @@ static bool torture_rpc_mdssvc_close(struct torture_context *tctx,
 
        status = dcerpc_mdssvc_close(b,
                                     state,
-                                    state->ph,
+                                    &state->ph,
                                     0,
                                     state->dev,
                                     state->mdscmd_open.unkn2,
@@ -368,7 +368,7 @@ static bool test_mdssvc_close(struct torture_context *tctx,
 
        status = dcerpc_mdssvc_close(b,
                                     tctx,
-                                    ph,
+                                    &ph,
                                     0,
                                     device_id,
                                     unkn2,
@@ -395,7 +395,7 @@ static bool test_mdssvc_close(struct torture_context *tctx,
        ZERO_STRUCT(ph);
        status = dcerpc_mdssvc_close(b,
                                     tctx,
-                                    ph,
+                                    &ph,
                                     0,
                                     device_id,
                                     unkn2,
@@ -438,7 +438,7 @@ static bool test_mdssvc_null_ph(struct torture_context *tctx,
 
        status = dcerpc_mdssvc_unknown1(b,
                                        tctx,
-                                       ph,
+                                       &ph,
                                        0,
                                        device_id,
                                        unkn2,
@@ -484,7 +484,7 @@ static bool test_mdssvc_invalid_ph_unknown1(struct torture_context *tctx,
 
        status = dcerpc_mdssvc_unknown1(b,
                                        tctx,
-                                       ph,
+                                       &ph,
                                        0,
                                        device_id,
                                        unkn2,
@@ -546,7 +546,7 @@ static bool test_mdssvc_invalid_ph_cmd(struct torture_context *tctx,
 
        status =  dcerpc_mdssvc_cmd(b,
                                    state,
-                                   ph,
+                                   &ph,
                                    0,
                                    device_id,
                                    unkn2,
@@ -592,7 +592,7 @@ static bool test_mdssvc_invalid_ph_close(struct torture_context *tctx,
 
        status = dcerpc_mdssvc_close(b,
                                     state,
-                                    ph,
+                                    &ph,
                                     0,
                                     device_id,
                                     unkn2,
@@ -716,7 +716,7 @@ static bool test_mdssvc_fetch_attr_unknown_cnid(struct torture_context *tctx,
 
        status =  dcerpc_mdssvc_cmd(b,
                                    state,
-                                   state->ph,
+                                   &state->ph,
                                    0,
                                    state->dev,
                                    state->mdscmd_open.unkn2,