mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
fixed the handling of value() attributes on scalars in IDL that
reference other elements of the same structure
This commit is contained in:
parent
634ea43720
commit
d8d17be290
@ -334,14 +334,14 @@ sub ParseElementPushScalar($$$)
|
||||
|
||||
start_flags($e);
|
||||
|
||||
if (my $value = util::has_property($e, "value")) {
|
||||
pidl "\t$cprefix$var_prefix$e->{NAME} = $value;\n";
|
||||
}
|
||||
|
||||
if (util::has_property($e, "relative")) {
|
||||
pidl "\tNDR_CHECK(ndr_push_relative(ndr, NDR_SCALARS, $var_prefix$e->{NAME}, (ndr_push_const_fn_t) ndr_push_$e->{TYPE}));\n";
|
||||
} elsif (util::is_inline_array($e)) {
|
||||
ParseArrayPush($e, "r->", "NDR_SCALARS");
|
||||
} elsif (my $value = util::has_property($e, "value")) {
|
||||
pidl "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $value));\n";
|
||||
} elsif (defined $e->{VALUE}) {
|
||||
pidl "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $e->{VALUE}));\n";
|
||||
} elsif (util::need_wire_pointer($e)) {
|
||||
pidl "\tNDR_CHECK(ndr_push_ptr(ndr, $var_prefix$e->{NAME}));\n";
|
||||
} elsif (util::need_alloc($e)) {
|
||||
@ -375,9 +375,7 @@ sub ParseElementPrintScalar($$)
|
||||
return;
|
||||
}
|
||||
|
||||
if (defined $e->{VALUE}) {
|
||||
pidl "\tndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $e->{VALUE});\n";
|
||||
} elsif (util::has_direct_buffers($e)) {
|
||||
if (util::has_direct_buffers($e)) {
|
||||
pidl "\tndr_print_ptr(ndr, \"$e->{NAME}\", $var_prefix$e->{NAME});\n";
|
||||
pidl "\tndr->depth++;\n";
|
||||
ParseElementPrintBuffer($e, $var_prefix);
|
||||
@ -478,8 +476,6 @@ sub ParseElementPullScalar($$$)
|
||||
|
||||
if (util::has_property($e, "relative")) {
|
||||
pidl "\tNDR_CHECK(ndr_pull_relative(ndr, (const void **)&$var_prefix$e->{NAME}, sizeof(*$var_prefix$e->{NAME}), (ndr_pull_flags_fn_t)ndr_pull_$e->{TYPE}));\n";
|
||||
} elsif (defined $e->{VALUE}) {
|
||||
pidl "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $e->{VALUE}));\n";
|
||||
} elsif (util::is_inline_array($e)) {
|
||||
ParseArrayPull($e, "r->", "NDR_SCALARS");
|
||||
} elsif (util::need_wire_pointer($e)) {
|
||||
|
@ -84,17 +84,17 @@ interface dcerpc
|
||||
} dcerpc_pkt_type;
|
||||
|
||||
typedef [nodiscriminant] union {
|
||||
[case(DCERPC_PKT_REQUEST)] dcerpc_request request;
|
||||
[case(DCERPC_PKT_REQUEST)] dcerpc_request request;
|
||||
[case(DCERPC_PKT_RESPONSE)] dcerpc_response response;
|
||||
[case(DCERPC_PKT_BIND)] dcerpc_bind bind;
|
||||
[case(DCERPC_PKT_BIND)] dcerpc_bind bind;
|
||||
[case(DCERPC_PKT_BIND_ACK)] dcerpc_bind_ack bind_ack;
|
||||
[case(DCERPC_PKT_FAULT)] dcerpc_fault fault;
|
||||
[case(DCERPC_PKT_FAULT)] dcerpc_fault fault;
|
||||
} dcerpc_payload;
|
||||
|
||||
|
||||
/* pfc_flags values */
|
||||
const uint8 DCERPC_PFC_FLAG_FIRST = 0x01;
|
||||
const uint8 DCERPC_PFC_FLAG_LAST = 0x02;
|
||||
const uint8 DCERPC_PFC_FLAG_FIRST = 0x01;
|
||||
const uint8 DCERPC_PFC_FLAG_LAST = 0x02;
|
||||
const uint8 DCERPC_PFC_FLAG_NOCALL = 0x20;
|
||||
|
||||
typedef [public] struct {
|
||||
|
@ -62,7 +62,7 @@
|
||||
/* Function: 0x05 */
|
||||
typedef struct {
|
||||
[value(2*strlen_m(r->name))] uint16 name_len;
|
||||
[value(2*strlen_m(r->name))] uint16 name_size;
|
||||
[value(r->name_len)] uint16 name_size;
|
||||
unistr_noterm *name;
|
||||
} samr_Name;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user