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:
parent
4d48e84ffa
commit
3d7524c7ae
@ -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}" }}
|
||||
|
@ -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}) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user