diff options
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 4 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm | 9 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Util.pm | 16 |
3 files changed, 22 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index bb9d32487a..2247fcbf81 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -9,7 +9,7 @@ package Parse::Pidl::Samba4::NDR::Parser; use strict; use Parse::Pidl::Typelist qw(hasType getType mapType); -use Parse::Pidl::Util qw(has_property ParseExpr); +use Parse::Pidl::Util qw(has_property ParseExpr print_uuid); use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred); use vars qw($VERSION); @@ -2218,7 +2218,7 @@ sub FunctionTable($) pidl "\nconst struct dcerpc_interface_table dcerpc_table_$interface->{NAME} = {"; pidl "\t.name\t\t= \"$interface->{NAME}\","; - pidl "\t.uuid\t\t= DCERPC_$uname\_UUID,"; + pidl "\t.uuid\t\t= ". print_uuid($interface->{UUID}) .","; pidl "\t.if_version\t= DCERPC_$uname\_VERSION,"; pidl "\t.helpstring\t= DCERPC_$uname\_HELPSTRING,"; pidl "\t.num_calls\t= $count,"; diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm index 585209b733..8710f08cc7 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm @@ -7,6 +7,7 @@ package Parse::Pidl::Samba4::NDR::Server; use strict; +use Parse::Pidl::Util; use vars qw($VERSION); $VERSION = '0.01'; @@ -76,7 +77,7 @@ sub Boilerplate_Iface($) my($interface) = shift; my $name = $interface->{NAME}; my $uname = uc $name; - my $uuid = Parse::Pidl::Util::make_str(lc($interface->{PROPERTIES}->{uuid})); + my $uuid = lc($interface->{PROPERTIES}->{uuid}); my $if_version = $interface->{PROPERTIES}->{version}; pidl " @@ -187,7 +188,7 @@ static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_C static const struct dcesrv_interface $name\_interface = { .name = \"$name\", - .uuid = $uuid, + .uuid = ".print_uuid($uuid).", .if_version = $if_version, .bind = $name\__op_bind, .unbind = $name\__op_unbind, @@ -227,10 +228,10 @@ static NTSTATUS $name\__op_init_server(struct dcesrv_context *dce_ctx, const str return NT_STATUS_OK; } -static BOOL $name\__op_interface_by_uuid(struct dcesrv_interface *iface, const char *uuid, uint32_t if_version) +static BOOL $name\__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version) { if ($name\_interface.if_version == if_version && - strcmp($name\_interface.uuid, uuid)==0) { + GUID_equal(\&$name\_interface.uuid, uuid)) { memcpy(iface,&$name\_interface, sizeof(*iface)); return True; } diff --git a/source4/pidl/lib/Parse/Pidl/Util.pm b/source4/pidl/lib/Parse/Pidl/Util.pm index ec6a1420ab..ff615a21ba 100644 --- a/source4/pidl/lib/Parse/Pidl/Util.pm +++ b/source4/pidl/lib/Parse/Pidl/Util.pm @@ -6,7 +6,7 @@ package Parse::Pidl::Util; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(has_property property_matches ParseExpr is_constant make_str); +@EXPORT = qw(has_property property_matches ParseExpr is_constant make_str print_uuid); use vars qw($VERSION); $VERSION = '0.01'; @@ -75,6 +75,20 @@ sub make_str($) return "\"" . $str . "\""; } +sub print_uuid($) +{ + my ($uuid) = @_; + $uuid =~ s/"//g; + my ($time_low,$time_mid,$time_hi,$clock_seq,$node) = split /-/, $uuid; + + my @clock_seq = $clock_seq =~ /(..)/g; + my @node = $node =~ /(..)/g; + + return "{0x$time_low,0x$time_mid,0x$time_hi," . + "{".join(',', map {"0x$_"} @clock_seq)."}," . + "{".join(',', map {"0x$_"} @node)."}}"; +} + # a hack to build on platforms that don't like negative enum values my $useUintEnums = 0; sub setUseUintEnums($) |