1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-29 02:50:28 +03:00

r10868: make flag(NDR_PAHEX) possible to use and show the union level in hex

metze
(This used to be commit 7efb92adc057ad8a993eb9de66c3806608747104)
This commit is contained in:
Stefan Metzmacher 2005-10-10 11:47:23 +00:00 committed by Gerald (Jerry) Carter
parent b0e342e389
commit b94fcbd306
2 changed files with 10 additions and 4 deletions

View File

@ -711,7 +711,11 @@ void ndr_print_time_t(struct ndr_print *ndr, const char *name, time_t t)
void ndr_print_union(struct ndr_print *ndr, const char *name, int level, const char *type)
{
ndr->print(ndr, "%-25s: union %s(case %d)", name, type, level);
if (ndr->flags & LIBNDR_PRINT_ARRAY_HEX) {
ndr->print(ndr, "%-25s: union %s(case 0x%X)", name, type, level);
} else {
ndr->print(ndr, "%-25s: union %s(case %d)", name, type, level);
}
}
void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16_t level)

View File

@ -1624,15 +1624,17 @@ sub ParseUnionPrint($$)
my ($e,$name) = @_;
my $have_default = 0;
pidl "int level = ndr_print_get_switch_value(ndr, r);";
pidl "int level;";
foreach my $el (@{$e->{ELEMENTS}}) {
DeclareArrayVariables($el);
}
pidl "ndr_print_union(ndr, name, level, \"$name\");";
start_flags($e);
pidl "level = ndr_print_get_switch_value(ndr, r);";
pidl "ndr_print_union(ndr, name, level, \"$name\");";
pidl "switch (level) {";
indent;
foreach my $el (@{$e->{ELEMENTS}}) {