diff options
author | Jim McDonough <jmcd@samba.org> | 2003-10-20 21:10:18 +0000 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2003-10-20 21:10:18 +0000 |
commit | 6fe9423fc69f3c1a79d0e45ac47d0b3228e4d4d6 (patch) | |
tree | e7438665f59799f7d6286d78035759f7feb867d4 /source3/rpc_parse | |
parent | 5fad0208ad386c35c2cb370d93808d3903d3fc8a (diff) | |
download | samba-6fe9423fc69f3c1a79d0e45ac47d0b3228e4d4d6.tar.gz samba-6fe9423fc69f3c1a79d0e45ac47d0b3228e4d4d6.tar.bz2 samba-6fe9423fc69f3c1a79d0e45ac47d0b3228e4d4d6.zip |
Update structures after ethereal showed some marshalling/unmarshalling
errors.
(This used to be commit 9d0f322a851f487cea320e57076213435e5c6481)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_epmapper.c | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/source3/rpc_parse/parse_epmapper.c b/source3/rpc_parse/parse_epmapper.c index 2bdb755deb..02340430ec 100644 --- a/source3/rpc_parse/parse_epmapper.c +++ b/source3/rpc_parse/parse_epmapper.c @@ -23,6 +23,9 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_PARSE +static uint32 internal_referent_id = 0; + + /******************************************************************* Reads or writes a handle. ********************************************************************/ @@ -211,7 +214,6 @@ BOOL epm_io_floor(const char *desc, EPM_FLOOR *floor, NTSTATUS init_epm_tower(TALLOC_CTX *ctx, EPM_TOWER *tower, const EPM_FLOOR *floors, int num_floors) { - static uint32 internal_referent_id = 0; int size = 0; int i; @@ -224,7 +226,6 @@ NTSTATUS init_epm_tower(TALLOC_CTX *ctx, EPM_TOWER *tower, size += floors[i].rhs.length; } - tower->referent_id = ++internal_referent_id; tower->max_length = tower->length = size; tower->num_floors = num_floors; tower->floors = talloc(ctx, sizeof(EPM_FLOOR) * num_floors); @@ -248,8 +249,9 @@ BOOL epm_io_tower(const char *desc, EPM_TOWER *tower, prs_debug(ps, depth, desc, "epm_io_tower"); depth++; - if (!prs_uint32("referent_id", ps, depth, &tower->referent_id)) + if (!prs_align(ps)) return False; + if (!prs_uint32("max_length", ps, depth, &tower->max_length)) return False; if (!prs_uint32("length", ps, depth, &tower->length)) @@ -278,9 +280,18 @@ BOOL epm_io_tower(const char *desc, EPM_TOWER *tower, NTSTATUS init_epm_tower_array(TALLOC_CTX *ctx, EPM_TOWER_ARRAY *array, const EPM_TOWER *towers, int num_towers) { + int i; + array->max_count = num_towers; array->offset = 0; array->count = num_towers; + array->tower_ref_ids = talloc(ctx, sizeof(uint32) * num_towers); + if (!array->tower_ref_ids) { + return NT_STATUS_NO_MEMORY; + } + for (i=0;i<num_towers;i++) + array->tower_ref_ids[i] = ++internal_referent_id; + array->towers = talloc(ctx, sizeof(EPM_TOWER) * num_towers); if (!array->towers) { return NT_STATUS_NO_MEMORY; @@ -308,6 +319,18 @@ BOOL epm_io_tower_array(const char *desc, EPM_TOWER_ARRAY *array, if (!prs_uint32("count", ps, depth, &array->count)) return False; + + if (UNMARSHALLING(ps)) { + array->tower_ref_ids = talloc(ps->mem_ctx, + sizeof(uint32) * array->count); + if (!array->tower_ref_ids) { + return False; + } + } + for (i=0; i < array->count; i++) + if (!prs_uint32("ref_id", ps, depth, &array->tower_ref_ids[i])) + return False; + if (!prs_set_offset(ps, prs_offset(ps) + array->offset)) return False; @@ -376,6 +399,8 @@ NTSTATUS init_epm_q_map(TALLOC_CTX *ctx, EPM_Q_MAP *q_map, /* For now let's not take more than 4 towers per result */ q_map->max_towers = num_towers * 4; + q_map->tower_ref_id = ++internal_referent_id; + handle++; return NT_STATUS_OK; @@ -393,6 +418,9 @@ BOOL epm_io_q_map(const char *desc, EPM_Q_MAP *io_map, prs_struct *ps, if (!epm_io_handle("handle", &io_map->handle, ps, depth)) return False; + if (!prs_uint32("max_towers", ps, 0, &io_map->tower_ref_id)) + return False; + /* HACK: We need a more elegant way of doing this */ if (UNMARSHALLING(ps)) { io_map->tower = talloc(ps->mem_ctx, sizeof(EPM_TOWER)); @@ -416,8 +444,6 @@ BOOL epm_io_q_map(const char *desc, EPM_Q_MAP *io_map, prs_struct *ps, BOOL epm_io_r_map(const char *desc, EPM_R_MAP *io_map, prs_struct *ps, int depth) { - int i; - prs_debug(ps, depth, desc, "epm_io_r_map"); depth++; @@ -433,11 +459,11 @@ BOOL epm_io_r_map(const char *desc, EPM_R_MAP *io_map, if (!io_map->results) return False; } - for (i = 0; i < io_map->num_results; i++) { - if (!epm_io_tower_array("results", io_map->results + i, - ps, depth)) + if (!epm_io_tower_array("results", io_map->results, ps, depth)) return False; - } + + if (!prs_align(ps)) + return False; if (!prs_uint32("status", ps, depth, &io_map->status)) return False; |