r20676: Add ref pointer to fix warning.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 11 Jan 2007 04:12:35 +0000 (04:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:40:19 +0000 (14:40 -0500)
(This used to be commit 1afcf850679b6752935455a8f9198679649922b8)

source4/libnet/libnet_become_dc.c
source4/librpc/idl/drsuapi.idl
source4/torture/rpc/drsuapi.c
source4/torture/rpc/dssync.c

index 97be186f727843007c973667de9bd785beba00b6..afc02c729c8c4628b16d45381669f74a03792951 100644 (file)
@@ -1618,13 +1618,15 @@ static void becomeDC_drsuapi_pull_partition_send(struct libnet_BecomeDC_state *s
        struct composite_context *c = s->creq;
        struct rpc_request *req;
        struct drsuapi_DsGetNCChanges *r;
+       int32_t level;
 
        r = talloc(s, struct drsuapi_DsGetNCChanges);
        if (composite_nomem(r, c)) return;
 
+       r->in.level = &level;
        r->in.bind_handle       = &drsuapi_h->bind_handle;
        if (drsuapi_h->remote_info28.supported_extensions & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) {
-               r->in.level                             = 8;
+               level                           = 8;
                r->in.req.req8.destination_dsa_guid     = partition->destination_dsa_guid;
                r->in.req.req8.source_dsa_invocation_id = partition->source_dsa_invocation_id;
                r->in.req.req8.naming_context           = &partition->nc;
@@ -1640,7 +1642,7 @@ static void becomeDC_drsuapi_pull_partition_send(struct libnet_BecomeDC_state *s
                r->in.req.req8.mapping_ctr.num_mappings = 0;
                r->in.req.req8.mapping_ctr.mappings     = NULL;
        } else {
-               r->in.level                             = 5;
+               level                           = 5;
                r->in.req.req5.destination_dsa_guid     = partition->destination_dsa_guid;
                r->in.req.req5.source_dsa_invocation_id = partition->source_dsa_invocation_id;
                r->in.req.req5.naming_context           = &partition->nc;
@@ -1679,16 +1681,16 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state
                return r->out.result;
        }
 
-       if (r->out.level == 1) {
+       if (*r->out.level == 1) {
                ctr_level = 1;
                ctr1 = &r->out.ctr.ctr1;
-       } else if (r->out.level == 2) {
+       } else if (*r->out.level == 2) {
                ctr_level = 1;
                ctr1 = r->out.ctr.ctr2.ctr.mszip1.ctr1;
-       } else if (r->out.level == 6) {
+       } else if (*r->out.level == 6) {
                ctr_level = 6;
                ctr6 = &r->out.ctr.ctr6;
-       } else if (r->out.level == 7 &&
+       } else if (*r->out.level == 7 &&
                   r->out.ctr.ctr7.level == 6 &&
                   r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP) {
                ctr_level = 6;
index 5974506e60d803e584c3f4863b7fbaf80a66d5ec..4ce2154edb16c6532055b82580a6be97cfc56737 100644 (file)
@@ -623,9 +623,9 @@ interface drsuapi
 
        WERROR drsuapi_DsGetNCChanges(
                [in] policy_handle *bind_handle,
-               [in,out] int32 level,
-               [in,switch_is(level)] drsuapi_DsGetNCChangesRequest req,
-               [out,switch_is(level)] drsuapi_DsGetNCChangesCtr ctr
+               [in,out,ref] int32 *level,
+               [in,switch_is(*level)] drsuapi_DsGetNCChangesRequest req,
+               [out,switch_is(*level)] drsuapi_DsGetNCChangesCtr ctr
                );
 
        /*****************/
index 619c0c29704210ff391824b127164d3fd03b62df..0f849e5586580b0a0b4cbab361e0c5cbaba8730d 100644 (file)
@@ -569,9 +569,9 @@ static BOOL test_DsGetNCChanges(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                        array[i].level);
 
                r.in.bind_handle        = &priv->bind_handle;
-               r.in.level              = array[i].level;
+               r.in.level              = &array[i].level;
 
-               switch (r.in.level) {
+               switch (*r.in.level) {
                case 5:
                        nc.guid = null_guid;
                        nc.sid  = null_sid;
index a4167b3dc35e1fee438e12283d2e880a9a9e1bc2..b86b74681661d393b8a1070741c99d9dbeaf9e79 100644 (file)
@@ -412,9 +412,9 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
                        array[i].level);
 
                r.in.bind_handle        = &ctx->new_dc.drsuapi.bind_handle;
-               r.in.level              = array[i].level;
+               r.in.level              = &array[i].level;
 
-               switch (r.in.level) {
+               switch (*r.in.level) {
                case 5:
                        nc.guid = null_guid;
                        nc.sid  = null_sid;
@@ -487,13 +487,13 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
                for (y=0; ;y++) {
                        ZERO_STRUCT(r.out);
 
-                       if (r.in.level == 5) {
+                       if (*r.in.level == 5) {
                                DEBUG(0,("start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",y,
                                        (long long)r.in.req.req5.highwatermark.tmp_highest_usn,
                                        (long long)r.in.req.req5.highwatermark.highest_usn));
                        }
 
-                       if (r.in.level == 8) {
+                       if (*r.in.level == 8) {
                                DEBUG(0,("start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",y,
                                        (long long)r.in.req.req8.highwatermark.tmp_highest_usn,
                                        (long long)r.in.req.req8.highwatermark.highest_usn));
@@ -512,10 +512,10 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
                                ret = False;
                        }
 
-                       if (ret == True && r.out.level == 1) {
+                       if (ret == True && *r.out.level == 1) {
                                out_level = 1;
                                ctr1 = &r.out.ctr.ctr1;
-                       } else if (ret == True && r.out.level == 2) {
+                       } else if (ret == True && *r.out.level == 2) {
                                out_level = 1;
                                ctr1 = r.out.ctr.ctr2.ctr.mszip1.ctr1;
                        }
@@ -533,10 +533,10 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
                                }
                        }
 
-                       if (ret == True && r.out.level == 6) {
+                       if (ret == True && *r.out.level == 6) {
                                out_level = 6;
                                ctr6 = &r.out.ctr.ctr6;
-                       } else if (ret == True && r.out.level == 7
+                       } else if (ret == True && *r.out.level == 7
                                   && r.out.ctr.ctr7.level == 6
                                   && r.out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP) {
                                out_level = 6;