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
This commit is contained in:
Jörg Mayer 2006-11-03 15:10:17 +00:00
parent c256574f2c
commit 875767f4cf
4 changed files with 52 additions and 9 deletions

View File

@ -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}

View File

@ -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"";

View File

@ -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}}) {
@ -114,6 +123,15 @@ sub ParseFunction($$)
pidl_hdr "$proto";
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) {";
@ -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 "}";

View File

@ -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);