summaryrefslogtreecommitdiff
path: root/pidl/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-27 15:52:16 +0200
committerStefan Metzmacher <metze@samba.org>2009-07-27 17:51:32 +0200
commit7ccc9a6ef563cc855752b4e74152420b9be5af43 (patch)
treeeeef8cf5ee5bc648b79c7dbf9eee903dac2ce39b /pidl/lib
parentb7c003c09c06ef5a23beb0928affaba75f65587c (diff)
downloadsamba-7ccc9a6ef563cc855752b4e74152420b9be5af43.tar.gz
samba-7ccc9a6ef563cc855752b4e74152420b9be5af43.tar.bz2
samba-7ccc9a6ef563cc855752b4e74152420b9be5af43.zip
pidl: add support for [string] on fixed size arrays.
midl also supports this: struct { long l1; [string] wchar_t str[16]; long l2; }; Where the wire size of str is encoded like a length_is() header: 4-byte offset == 0; 4-byte array length; The strings are zero terminated. metze
Diffstat (limited to 'pidl/lib')
-rw-r--r--pidl/lib/Parse/Pidl/NDR.pm7
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm2
2 files changed, 8 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm
index 95cd4b9dc3..8440f0183d 100644
--- a/pidl/lib/Parse/Pidl/NDR.pm
+++ b/pidl/lib/Parse/Pidl/NDR.pm
@@ -142,6 +142,13 @@ sub GetElementLevelTable($$)
$is_fixed = 1 if (not $is_conformant and Parse::Pidl::Util::is_constant($size));
$is_inline = 1 if (not $is_conformant and not Parse::Pidl::Util::is_constant($size));
+ if ($i == 0 and $is_fixed and has_property($e, "string")) {
+ $is_fixed = 0;
+ $is_varying = 1;
+ $is_string = 1;
+ delete($e->{PROPERTIES}->{string});
+ }
+
push (@$order, {
TYPE => "ARRAY",
SIZE_IS => $size,
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 7ce9708e14..d93661c491 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -326,7 +326,7 @@ sub ParseArrayPullHeader($$$$$$)
if ($l->{IS_CONFORMANT}) {
$length = $size = "ndr_get_array_size($ndr, " . get_pointer_to($var_name) . ")";
- } elsif ($l->{IS_ZERO_TERMINATED}) { # Noheader arrays
+ } elsif ($l->{IS_ZERO_TERMINATED} and $l->{SIZE_IS} == 0 and $l->{LENGTH_IS} == 0) { # Noheader arrays
$length = $size = "ndr_get_string_size($ndr, sizeof(*$var_name))";
} else {
$length = $size = ParseExprExt($l->{SIZE_IS}, $env, $e->{ORIGINAL},