diff options
author | Jörg Mayer <jmayer@loplof.de> | 2006-11-03 15:10:17 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2006-11-03 15:10:17 +0000 |
commit | 875767f4cf1e3120ba59b4b44e40e2bcbbd3cce8 (patch) | |
tree | 303fe1e8434add456906866ad714b3c0b0675da4 | |
parent | c256574f2ced5b3fabf46e7d46d35ecb6c2b28e6 (diff) |
Update from samba tree revision 18675 to 19540
============================ Samba log start ============
svn: When specifying working copy paths, only one target may be given
============================ Samba log end ==============
svn path=/trunk/; revision=19783
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/ODL.pm | 4 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 27 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 26 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 4 |
4 files changed, 52 insertions, 9 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/ODL.pm b/tools/pidl/lib/Parse/Pidl/ODL.pm index b5d65b6239..c8d1de3d43 100644 --- a/tools/pidl/lib/Parse/Pidl/ODL.pm +++ b/tools/pidl/lib/Parse/Pidl/ODL.pm @@ -38,8 +38,8 @@ sub FunctionAddObjArgs($) }); unshift(@{$e->{ELEMENTS}}, { 'NAME' => 'ORPCthat', - 'POINTERS' => 0, - 'PROPERTIES' => { 'out' => '1' }, + 'POINTERS' => 1, + 'PROPERTIES' => { 'out' => '1', 'ref' => '1' }, 'TYPE' => 'ORPCTHAT', 'FILE' => $e->{FILE}, 'LINE' => $e->{LINE} diff --git a/tools/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/tools/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index 31ea73f7aa..c939feb1b9 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -52,7 +52,23 @@ sub ParseFunction($$) } } + pidl ""; + pidl "if (DEBUGLEVEL >= 10)"; + pidl "\tNDR_PRINT_IN_DEBUG($fn->{NAME}, &r);"; + pidl ""; pidl "status = cli_do_rpc_ndr(cli, mem_ctx, PI_$uif, $ufn, &r, (ndr_pull_flags_fn_t)ndr_pull_$fn->{NAME}, (ndr_push_flags_fn_t)ndr_push_$fn->{NAME});"; + pidl ""; + + pidl "if ( !NT_STATUS_IS_OK(status) ) {"; + indent; + pidl "return status;"; + deindent; + pidl "}"; + + pidl ""; + pidl "if (DEBUGLEVEL >= 10)"; + pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, &r);"; + pidl ""; pidl "if (NT_STATUS_IS_ERR(status)) {"; pidl "\treturn status;"; pidl "}"; @@ -63,7 +79,16 @@ sub ParseFunction($$) fatal($e, "[out] argument is not a pointer or array") if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY"); - pidl "*$e->{NAME} = *r.out.$e->{NAME};"; + if ( ($e->{LEVELS}[0]->{TYPE} eq "POINTER") && ($e->{LEVELS}[0]->{POINTER_TYPE} eq "unique") ) { + pidl "if ( $e->{NAME} ) {"; + indent; + pidl "*$e->{NAME} = *r.out.$e->{NAME};"; + deindent; + pidl "}"; + } else { + pidl "*$e->{NAME} = *r.out.$e->{NAME};"; + } + } pidl""; diff --git a/tools/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/tools/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index 4d3dba2e0e..a7c81e4e2b 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -38,9 +38,9 @@ sub AllocOutVar($$$$) if ($l->{TYPE} eq "ARRAY") { my $size = ParseExpr($l->{SIZE_IS}, $env); - pidl "$name = talloc_array_size($mem_ctx, sizeof(*$name), $size);"; + pidl "$name = talloc_zero_size($mem_ctx, sizeof(*$name) * $size);"; } else { - pidl "$name = talloc_size($mem_ctx, sizeof(*$name));"; + pidl "$name = talloc_zero_size($mem_ctx, sizeof(*$name));"; } pidl "if ($name == NULL) {"; @@ -70,8 +70,10 @@ sub ParseFunction($$) pidl "}"; pidl ""; pidl "pull = ndr_pull_init_blob(&blob, mem_ctx);"; - pidl "if (pull == NULL)"; + pidl "if (pull == NULL) {"; + pidl "\ttalloc_free(mem_ctx);"; pidl "\treturn False;"; + pidl "}"; pidl ""; pidl "pull->flags |= LIBNDR_FLAG_REF_ALLOC;"; pidl "status = ndr_pull_$fn->{NAME}(pull, NDR_IN, &r);"; @@ -80,13 +82,20 @@ sub ParseFunction($$) pidl "\treturn False;"; pidl "}"; pidl ""; + pidl "if (DEBUGLEVEL >= 10)"; + pidl "\tNDR_PRINT_IN_DEBUG($fn->{NAME}, &r);"; + pidl ""; my %env = (); + my $hasout = 0; foreach (@{$fn->{ELEMENTS}}) { + if (grep(/out/, @{$_->{DIRECTION}})) { $hasout = 1; } next unless (grep (/in/, @{$_->{DIRECTION}})); $env{$_->{NAME}} = "r.in.$_->{NAME}"; } + pidl "ZERO_STRUCT(r.out);" if ($hasout); + my $proto = "_$fn->{NAME}(pipes_struct *p"; my $ret = "_$fn->{NAME}(p"; foreach (@{$fn->{ELEMENTS}}) { @@ -115,6 +124,15 @@ sub ParseFunction($$) pidl "$ret;"; pidl ""; + pidl "if (p->rng_fault_state) {"; + pidl "\ttalloc_free(mem_ctx);"; + pidl "\t/* Return True here, srv_pipe_hnd.c will take care */"; + pidl "\treturn True;"; + pidl "}"; + pidl ""; + pidl "if (DEBUGLEVEL >= 10)"; + pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, &r);"; + pidl ""; pidl "push = ndr_push_init_ctx(mem_ctx);"; pidl "if (push == NULL) {"; pidl "\ttalloc_free(mem_ctx);"; @@ -128,7 +146,7 @@ sub ParseFunction($$) pidl "}"; pidl ""; pidl "blob = ndr_push_blob(push);"; - pidl "if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {"; + pidl "if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {"; pidl "\ttalloc_free(mem_ctx);"; pidl "\treturn False;"; pidl "}"; diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 872a149274..b91ba10e98 100644 --- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -452,7 +452,7 @@ sub Function($$$) } elsif ($fn->{RETURN_TYPE} eq "WERROR") { pidl_code "offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf\_$ifname\_werror, &status);\n"; pidl_code "if (status != 0 && check_col(pinfo->cinfo, COL_INFO))"; - pidl_code "\tcol_append_fstr(pinfo->cinfo, COL_INFO, \", Error: %s\", val_to_str(status, DOS_errors, \"Unknown DOS error 0x%08x\"));\n"; + pidl_code "\tcol_append_fstr(pinfo->cinfo, COL_INFO, \", Error: %s\", val_to_str(status, WERR_errors, \"Unknown DOS error 0x%08x\"));\n"; $hf_used{"hf\_$ifname\_werror"} = 1; } else { @@ -749,7 +749,7 @@ sub ProcessInterface($) } if (defined($hf_used{"hf_$x->{NAME}_werror"})) { - register_hf_field("hf_$x->{NAME}_werror", "Windows Error", "$x->{NAME}.werror", "FT_UINT32", "BASE_HEX", "VALS(DOS_errors)", 0, ""); + register_hf_field("hf_$x->{NAME}_werror", "Windows Error", "$x->{NAME}.werror", "FT_UINT32", "BASE_HEX", "VALS(WERR_errors)", 0, ""); } RegisterInterface($x); |