1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

added the "subcontext" attribute for auto-handling of user-marshalled

sub-context buffers
(This used to be commit 01cc199d78da9e60aa8a279b37fbf8298cf61004)
This commit is contained in:
Andrew Tridgell 2003-11-16 05:59:05 +00:00
parent 4d48e84ffa
commit 3d7524c7ae
2 changed files with 13 additions and 0 deletions

View File

@ -103,6 +103,7 @@ property: 'unique'
| 'struct_len'
| 'context_handle'
| 'string'
| 'subcontext'
| 'byte_count_pointer' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
| 'size_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}
| 'length_is' '(' expression ')' {{ "$item[1]" => "$item{expression}" }}

View File

@ -291,6 +291,12 @@ sub ParseElementPullScalar($$$)
# no scalar component
} elsif (my $switch = util::has_property($e, "switch_is")) {
ParseElementPullSwitch($e, $var_prefix, $ndr_flags, $switch);
} elsif (util::has_property($e, "subcontext")) {
if (util::is_builtin_type($e->{TYPE})) {
$res .= "\tNDR_CHECK(ndr_pull_subcontext_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_fn_t) ndr_pull_$e->{TYPE}));\n";
} else {
$res .= "\tNDR_CHECK(ndr_pull_subcontext_flags_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_flags_fn_t) ndr_pull_$e->{TYPE}));\n";
}
} elsif (util::is_builtin_type($e->{TYPE})) {
$res .= "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $cprefix$var_prefix$e->{NAME}));\n";
} else {
@ -391,6 +397,12 @@ sub ParseElementPullBuffer($$$)
} else {
ParseElementPullSwitch($e, $var_prefix, "NDR_BUFFERS", $switch);
}
} elsif (util::has_property($e, "subcontext")) {
if (util::is_builtin_type($e->{TYPE})) {
$res .= "\tNDR_CHECK(ndr_pull_subcontext_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_fn_t) ndr_pull_$e->{TYPE}));\n";
} else {
$res .= "\tNDR_CHECK(ndr_pull_subcontext_flags_fn(ndr, $cprefix$var_prefix$e->{NAME}, (ndr_pull_flags_fn_t) ndr_pull_$e->{TYPE}));\n";
}
} elsif (util::is_builtin_type($e->{TYPE})) {
$res .= "\t\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $cprefix$var_prefix$e->{NAME}));\n";
} elsif ($e->{POINTERS}) {