diff options
-rw-r--r-- | source4/librpc/idl/drsuapi.idl | 36 | ||||
-rw-r--r-- | source4/torture/rpc/drsuapi.c | 49 | ||||
-rw-r--r-- | source4/torture/rpc/dssync.c | 25 |
3 files changed, 60 insertions, 50 deletions
diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl index b0fb583ed4..f89d9e1f39 100644 --- a/source4/librpc/idl/drsuapi.idl +++ b/source4/librpc/idl/drsuapi.idl @@ -808,9 +808,10 @@ interface drsuapi [todo] WERROR drsuapi_DsGetMemberships( [in] policy_handle *bind_handle, - [in,out] int32 level, - [in] [switch_is(level)] drsuapi_DsGetMembershipsRequest req, - [out] [switch_is(level)] drsuapi_DsGetMembershipsCtr ctr + [in] int32 level, + [in,ref] [switch_is(level)] drsuapi_DsGetMembershipsRequest *req, + [out,ref] int32 *level_out, + [out,ref] [switch_is(*level_out)] drsuapi_DsGetMembershipsCtr *ctr ); /*****************/ @@ -850,9 +851,10 @@ interface drsuapi [todo] WERROR drsuapi_DsGetNT4ChangeLog( [in] policy_handle *bind_handle, - [in,out] uint32 level, - [in] [switch_is(level)] drsuapi_DsGetNT4ChangeLogRequest req, - [out] [switch_is(level)] drsuapi_DsGetNT4ChangeLogInfo info + [in] uint32 level, + [in,ref] [switch_is(level)] drsuapi_DsGetNT4ChangeLogRequest *req, + [out,ref] uint32 *level_out, + [out,ref] [switch_is(*level_out)] drsuapi_DsGetNT4ChangeLogInfo *info ); /*****************/ @@ -1356,7 +1358,7 @@ interface drsuapi typedef [switch_type(drsuapi_DsReplicaOpType)] union { [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] drsuapi_DsReplicaSyncOptions sync; [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] drsuapi_DsReplicaAddOptions add; - [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] drsuapi_DsReplicaDeleteOptions delete; + [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] drsuapi_DsReplicaDeleteOptions op_delete; [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] drsuapi_DsReplicaModifyOptions modify; [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] drsuapi_DsReplicaUpdateRefsOptions update_refs; [default] uint32 unknown; @@ -1511,9 +1513,9 @@ interface drsuapi WERROR drsuapi_DsReplicaGetInfo( [in] policy_handle *bind_handle, [in] drsuapi_DsReplicaGetInfoLevel level, - [in,switch_is(level)] drsuapi_DsReplicaGetInfoRequest req, - [out] drsuapi_DsReplicaInfoType info_type, - [out,switch_is(info_type)] drsuapi_DsReplicaInfo info + [in,ref,switch_is(level)] drsuapi_DsReplicaGetInfoRequest *req, + [out,ref] drsuapi_DsReplicaInfoType *info_type, + [out,ref,switch_is(*info_type)] drsuapi_DsReplicaInfo *info ); /*****************/ @@ -1543,12 +1545,12 @@ interface drsuapi WERROR drsuapi_DsGetMemberships2( [in] policy_handle *bind_handle, - [in,out] int32 level, - [in] [switch_is(level)] drsuapi_DsGetMemberships2Request req, - [out] [switch_is(level)] drsuapi_DsGetMemberships2Ctr ctr + [in] int32 level, + [in,ref] [switch_is(level)] drsuapi_DsGetMemberships2Request *req, + [out,ref] int32 *level_out, + [out,ref] [switch_is(*level_out)] drsuapi_DsGetMemberships2Ctr *ctr ); - /*****************/ /* Function 0x16 */ [todo] WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS(); @@ -1588,8 +1590,8 @@ interface drsuapi WERROR drsuapi_QuerySitesByCost( [in] policy_handle *bind_handle, [in] int32 level, - [in] [switch_is(level)] drsuapi_QuerySitesByCostRequest req, - [out] int32 level_out, - [out] [switch_is(level_out)] drsuapi_QuerySitesByCostCtr ctr + [in,ref] [switch_is(level)] drsuapi_QuerySitesByCostRequest *req, + [out,ref] int32 *level_out, + [out,ref] [switch_is(*level_out)] drsuapi_QuerySitesByCostCtr *ctr ); } diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c index e5cb3d7ddf..da04c64b39 100644 --- a/source4/torture/rpc/drsuapi.c +++ b/source4/torture/rpc/drsuapi.c @@ -237,6 +237,7 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, struct torture_context { NTSTATUS status; struct drsuapi_DsReplicaGetInfo r; + union drsuapi_DsReplicaGetInfoRequest req; bool ret = true; int i; struct { @@ -325,20 +326,21 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, struct torture_context r.in.level = array[i].level; switch(r.in.level) { case DRSUAPI_DS_REPLICA_GET_INFO: - r.in.req.req1.info_type = array[i].infotype; - r.in.req.req1.object_dn = object_dn; - ZERO_STRUCT(r.in.req.req1.guid1); + req.req1.info_type = array[i].infotype; + req.req1.object_dn = object_dn; + ZERO_STRUCT(req.req1.guid1); break; case DRSUAPI_DS_REPLICA_GET_INFO2: - r.in.req.req2.info_type = array[i].infotype; - r.in.req.req2.object_dn = object_dn; - ZERO_STRUCT(r.in.req.req1.guid1); - r.in.req.req2.unknown1 = 0; - r.in.req.req2.string1 = NULL; - r.in.req.req2.string2 = NULL; - r.in.req.req2.unknown2 = 0; + req.req2.info_type = array[i].infotype; + req.req2.object_dn = object_dn; + ZERO_STRUCT(req.req1.guid1); + req.req2.unknown1 = 0; + req.req2.string1 = NULL; + req.req2.string2 = NULL; + req.req2.unknown2 = 0; break; } + r.in.req = &req; status = dcerpc_drsuapi_DsReplicaGetInfo(p, tctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -611,20 +613,23 @@ bool test_QuerySitesByCost(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct drsuapi_QuerySitesByCost r; + union drsuapi_QuerySitesByCostRequest req; bool ret = true; const char *my_site = "Default-First-Site-Name"; const char *remote_site1 = "smbtorture-nonexisting-site1"; const char *remote_site2 = "smbtorture-nonexisting-site2"; + req.req1.site_from = talloc_strdup(mem_ctx, my_site); + req.req1.num_req = 2; + req.req1.site_to = talloc_zero_array(mem_ctx, const char *, 2); + req.req1.site_to[0] = talloc_strdup(mem_ctx, remote_site1); + req.req1.site_to[1] = talloc_strdup(mem_ctx, remote_site2); + req.req1.flags = 0; + r.in.bind_handle = &priv->bind_handle; r.in.level = 1; - r.in.req.req1.site_from = talloc_strdup(mem_ctx, my_site); - r.in.req.req1.num_req = 2; - r.in.req.req1.site_to = talloc_zero_array(mem_ctx, const char *, r.in.req.req1.num_req); - r.in.req.req1.site_to[0] = talloc_strdup(mem_ctx, remote_site1); - r.in.req.req1.site_to[1] = talloc_strdup(mem_ctx, remote_site2); - r.in.req.req1.flags = 0; + r.in.req = &req; status = dcerpc_drsuapi_QuerySitesByCost(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -641,17 +646,17 @@ bool test_QuerySitesByCost(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (W_ERROR_IS_OK(r.out.result)) { - if (!W_ERROR_EQUAL(r.out.ctr.ctr1.info[0].error_code, WERR_DS_OBJ_NOT_FOUND) || - !W_ERROR_EQUAL(r.out.ctr.ctr1.info[1].error_code, WERR_DS_OBJ_NOT_FOUND)) { + if (!W_ERROR_EQUAL(r.out.ctr->ctr1.info[0].error_code, WERR_DS_OBJ_NOT_FOUND) || + !W_ERROR_EQUAL(r.out.ctr->ctr1.info[1].error_code, WERR_DS_OBJ_NOT_FOUND)) { printf("expected error_code WERR_DS_OBJ_NOT_FOUND, got %s\n", - win_errstr(r.out.ctr.ctr1.info[0].error_code)); + win_errstr(r.out.ctr->ctr1.info[0].error_code)); ret = false; } - if ((r.out.ctr.ctr1.info[0].site_cost != (uint32_t) -1) || - (r.out.ctr.ctr1.info[1].site_cost != (uint32_t) -1)) { + if ((r.out.ctr->ctr1.info[0].site_cost != (uint32_t) -1) || + (r.out.ctr->ctr1.info[1].site_cost != (uint32_t) -1)) { printf("expected site_cost %d, got %d\n", - (uint32_t) -1, r.out.ctr.ctr1.info[0].site_cost); + (uint32_t) -1, r.out.ctr->ctr1.info[0].site_cost); ret = false; } } diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 41bb168619..185e8ef0d4 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -809,6 +809,7 @@ static bool test_FetchNT4Data(struct torture_context *tctx, NTSTATUS status; bool ret = true; struct drsuapi_DsGetNT4ChangeLog r; + union drsuapi_DsGetNT4ChangeLogRequest req; struct GUID null_guid; struct dom_sid null_sid; DATA_BLOB cookie; @@ -821,12 +822,14 @@ static bool test_FetchNT4Data(struct torture_context *tctx, r.in.bind_handle = &ctx->new_dc.drsuapi.bind_handle; r.in.level = 1; - r.in.req.req1.unknown1 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-1", 3); - r.in.req.req1.unknown2 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-2", 0x00004000); + req.req1.unknown1 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-1", 3); + req.req1.unknown2 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-2", 0x00004000); while (1) { - r.in.req.req1.length = cookie.length; - r.in.req.req1.data = cookie.data; + req.req1.length = cookie.length; + req.req1.data = cookie.data; + + r.in.req = &req; status = dcerpc_drsuapi_DsGetNT4ChangeLog(ctx->new_dc.drsuapi.pipe, ctx, &r); if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) { @@ -845,16 +848,16 @@ static bool test_FetchNT4Data(struct torture_context *tctx, } else if (!W_ERROR_IS_OK(r.out.result)) { printf("DsGetNT4ChangeLog failed - %s\n", win_errstr(r.out.result)); ret = false; - } else if (r.out.level != 1) { - printf("DsGetNT4ChangeLog unknown level - %u\n", r.out.level); + } else if (*r.out.level_out != 1) { + printf("DsGetNT4ChangeLog unknown level - %u\n", *r.out.level_out); ret = false; - } else if (NT_STATUS_IS_OK(r.out.info.info1.status)) { - } else if (NT_STATUS_EQUAL(r.out.info.info1.status, STATUS_MORE_ENTRIES)) { - cookie.length = r.out.info.info1.length1; - cookie.data = r.out.info.info1.data1; + } else if (NT_STATUS_IS_OK(r.out.info->info1.status)) { + } else if (NT_STATUS_EQUAL(r.out.info->info1.status, STATUS_MORE_ENTRIES)) { + cookie.length = r.out.info->info1.length1; + cookie.data = r.out.info->info1.data1; continue; } else { - printf("DsGetNT4ChangeLog failed - %s\n", nt_errstr(r.out.info.info1.status)); + printf("DsGetNT4ChangeLog failed - %s\n", nt_errstr(r.out.info->info1.status)); ret = false; } |