summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-11-22 16:55:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:24 -0500
commit41848fea6fb3cea36caf0790302f7460b03d17c9 (patch)
tree9d3f3897ba6eba28e5cc17aa4b252f4efb3cf699
parentef9e094d848cee3dd61cf6521458d946df2e24d7 (diff)
downloadsamba-41848fea6fb3cea36caf0790302f7460b03d17c9.tar.gz
samba-41848fea6fb3cea36caf0790302f7460b03d17c9.tar.bz2
samba-41848fea6fb3cea36caf0790302f7460b03d17c9.zip
r19844: Fix warnings and errors in epmapper IDL.
(This used to be commit 0221d5b6c4250a3a2c86c623c534996d7decb1f6)
-rw-r--r--source4/gtk/tools/gepdump.c4
-rw-r--r--source4/librpc/idl/epmapper.idl11
-rw-r--r--source4/librpc/rpc/dcerpc_util.c4
-rw-r--r--source4/rpc_server/epmapper/rpc_epmapper.c8
-rw-r--r--source4/torture/rpc/epmapper.c14
5 files changed, 22 insertions, 19 deletions
diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c
index ccfcf1f5a6..4fd7eecdda 100644
--- a/source4/gtk/tools/gepdump.c
+++ b/source4/gtk/tools/gepdump.c
@@ -146,13 +146,13 @@ static void refresh_eps(void)
if (!NT_STATUS_IS_OK(status) || r.out.result != 0) {
break;
}
- for (i=0;i<r.out.num_ents;i++) {
+ for (i=0;i<*r.out.num_ents;i++) {
add_epm_entry(mem_ctx, r.out.entries[i].annotation, &r.out.entries[i].tower->tower);
}
} while (NT_STATUS_IS_OK(status) &&
r.out.result == 0 &&
- r.out.num_ents == r.in.max_ents);
+ *r.out.num_ents == r.in.max_ents);
if (!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, "Error adding endpoint mapper entry", status);
diff --git a/source4/librpc/idl/epmapper.idl b/source4/librpc/idl/epmapper.idl
index 223883c366..c94842bedd 100644
--- a/source4/librpc/idl/epmapper.idl
+++ b/source4/librpc/idl/epmapper.idl
@@ -14,8 +14,7 @@ http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: bindin
endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]",
"ncalrpc:[EPMAPPER]"),
helpstring("EndPoint Mapper"),
- pointer_default_top(sptr),
- pointer_default(sptr)
+ pointer_default(ptr)
]
interface epmapper
{
@@ -254,8 +253,8 @@ interface epmapper
[in] uint32 vers_option,
[in,out,ref] policy_handle *entry_handle,
[in] uint32 max_ents,
- [out] uint32 num_ents,
- [out, length_is(num_ents), size_is(max_ents)] epm_entry_t entries[]
+ [out] uint32 *num_ents,
+ [out, length_is(*num_ents), size_is(max_ents)] epm_entry_t entries[]
);
@@ -271,8 +270,8 @@ interface epmapper
[in] epm_twr_t *map_tower,
[in,out,ref] policy_handle *entry_handle,
[in] uint32 max_towers,
- [out] uint32 num_towers,
- [out, length_is(num_towers), size_is(max_towers)] epm_twr_p_t towers[]
+ [out] uint32 *num_towers,
+ [out, length_is(*num_towers), size_is(max_towers)] epm_twr_p_t towers[]
);
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index bdc0f8f6c5..978cc5cd3e 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -797,6 +797,8 @@ static void continue_epm_recv_binding(struct composite_context *ctx)
c->status = dcerpc_pipe_connect_b_recv(ctx, c, &s->pipe);
if (!composite_is_ok(c)) return;
+ s->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
+
/* prepare requested binding parameters */
s->binding->object = s->table->syntax_id;
@@ -833,7 +835,7 @@ static void continue_epm_map(struct rpc_request *req)
if (!composite_is_ok(c)) return;
/* check the details */
- if (s->r.out.result != 0 || s->r.out.num_towers != 1) {
+ if (s->r.out.result != 0 || *s->r.out.num_towers != 1) {
composite_error(c, NT_STATUS_PORT_UNREACHABLE);
return;
}
diff --git a/source4/rpc_server/epmapper/rpc_epmapper.c b/source4/rpc_server/epmapper/rpc_epmapper.c
index 2c8b56b893..8c238ebe71 100644
--- a/source4/rpc_server/epmapper/rpc_epmapper.c
+++ b/source4/rpc_server/epmapper/rpc_epmapper.c
@@ -131,7 +131,8 @@ static error_status_t epm_Lookup(struct dcesrv_call_state *dce_call, TALLOC_CTX
}
*r->out.entry_handle = h->wire_handle;
- r->out.num_ents = num_ents;
+ r->out.num_ents = talloc(mem_ctx, uint32_t);
+ *r->out.num_ents = num_ents;
if (num_ents == 0) {
r->out.entries = NULL;
@@ -179,7 +180,8 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
count = build_ep_list(mem_ctx, dce_call->conn->dce_ctx->endpoint_list, &eps);
ZERO_STRUCT(*r->out.entry_handle);
- r->out.num_towers = 1;
+ r->out.num_towers = talloc(mem_ctx, uint32_t);
+ *r->out.num_towers = 1;
r->out.towers = talloc(mem_ctx, struct epm_twr_p_t);
if (!r->out.towers) {
return EPMAPPER_STATUS_NO_MEMORY;
@@ -230,7 +232,7 @@ static error_status_t epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
failed:
- r->out.num_towers = 0;
+ *r->out.num_towers = 0;
r->out.towers->twr = NULL;
return EPMAPPER_STATUS_NO_MORE_ENTRIES;
diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c
index e0abdcff0b..51914aa614 100644
--- a/source4/torture/rpc/epmapper.c
+++ b/source4/torture/rpc/epmapper.c
@@ -78,7 +78,7 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
- for (i=0;i<r.out.num_towers;i++) {
+ for (i=0;i<*r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
}
@@ -91,7 +91,7 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
- for (i=0;i<r.out.num_towers;i++) {
+ for (i=0;i<*r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
}
@@ -104,7 +104,7 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
- for (i=0;i<r.out.num_towers;i++) {
+ for (i=0;i<*r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
}
@@ -121,7 +121,7 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
- for (i=0;i<r.out.num_towers;i++) {
+ for (i=0;i<*r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
}
@@ -163,9 +163,9 @@ static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
printf("epm_Lookup returned %d events GUID %s\n",
- r.out.num_ents, GUID_string(mem_ctx, &handle.uuid));
+ *r.out.num_ents, GUID_string(mem_ctx, &handle.uuid));
- for (i=0;i<r.out.num_ents;i++) {
+ for (i=0;i<*r.out.num_ents;i++) {
printf("\nFound '%s'\n", r.out.entries[i].annotation);
display_tower(mem_ctx, &r.out.entries[i].tower->tower);
if (r.out.entries[i].tower->tower.num_floors == 5) {
@@ -174,7 +174,7 @@ static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
} while (NT_STATUS_IS_OK(status) &&
r.out.result == 0 &&
- r.out.num_ents == r.in.max_ents &&
+ *r.out.num_ents == r.in.max_ents &&
!policy_handle_empty(&handle));
if (!NT_STATUS_IS_OK(status)) {