From d26016c19854142c1e5fbb5a3bfc40e7e4b1c616 Mon Sep 17 00:00:00 2001 From: ronnie sahlberg Date: Tue, 6 Oct 2009 17:49:59 +1100 Subject: PIDL fix for using external types with wireshark backend List, Please review this patch to pidl. Basically, we need to process the wireshark conformance file BEFORE we process the idl file since this file may define external types and set the alignment for them (using the TYPE directive). Otherwise pidl will default all external types to use 4byte alignment which breaks (much more often) on NDR64 regards ronnie sahlberg From 8f86903fc353d0906bd82e72ce19c5af09beb001 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 5 Oct 2009 15:22:43 +1100 Subject: [PATCH] In the PIDL wireshark backend, we define external types in the conformance file using the TYPE directive. If we declare external types here, we must parse this file before we process the IDL file, or else these external types will all default to 4byte padding (pidl assumes all unknown types are 4byte aligned). Make sure we read the conformance file and create these new types before we parse the idl file. Signed-off-by: Ronnie Sahlberg --- pidl/pidl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pidl/pidl') diff --git a/pidl/pidl b/pidl/pidl index bc0bb3524b..d0623a0690 100755 --- a/pidl/pidl +++ b/pidl/pidl @@ -653,7 +653,18 @@ sub process_file($) $pidl = Parse::Pidl::ODL::ODL2IDL($pidl, dirname($idl_file), \@opt_incdirs); - if (defined($opt_ws_parser) or + if (defined($opt_ws_parser)) { + require Parse::Pidl::Wireshark::NDR; + + my $cnffile = $idl_file; + $cnffile =~ s/\.idl$/\.cnf/; + + my $generator = new Parse::Pidl::Wireshark::NDR(); + $generator->Initialize($cnffile); + } + + + if (defined($opt_ws_parser) or defined($opt_client) or defined($opt_server) or defined($opt_header) or -- cgit