my $count = 0;
my $uname = uc $interface->{NAME};
- $count = $#{$interface->{FUNCTIONS}}+1;
-
- return if ($count == 0);
+ return if ($#{$interface->{FUNCTIONS}}+1 == 0);
return unless defined ($interface->{PROPERTIES}->{uuid});
pidl "static const struct dcerpc_interface_call $interface->{NAME}\_calls[] = {";
- $count = 0;
foreach my $d (@{$interface->{FUNCTIONS}}) {
next if not defined($d->{OPNUM});
pidl "\t{";
pidl "};";
pidl "";
- pidl "static NTSTATUS dcerpc_ndr_$interface->{NAME}_init(void)";
- pidl "{";
- pidl "\treturn librpc_register_interface(&dcerpc_table_$interface->{NAME});";
- pidl "}";
- pidl "";
}
#####################################################################
FunctionTable($interface);
}
-sub RegistrationFunction($$)
-{
- my ($idl,$basename) = @_;
-
- pidl "NTSTATUS dcerpc_$basename\_init(void)";
- pidl "{";
- indent;
- pidl "NTSTATUS status = NT_STATUS_OK;";
- foreach my $interface (@{$idl}) {
- next if $interface->{TYPE} ne "INTERFACE";
-
- my $count = ($#{$interface->{FUNCTIONS}}+1);
-
- next if ($count == 0);
- next unless defined ($interface->{PROPERTIES}->{uuid});
-
- pidl "status = dcerpc_ndr_$interface->{NAME}_init();";
- pidl "if (NT_STATUS_IS_ERR(status)) {";
- pidl "\treturn status;";
- pidl "}";
- pidl "";
- }
- pidl "return status;";
- deindent;
- pidl "}";
- pidl "";
-}
-
#####################################################################
# parse a parsed IDL structure back into an IDL file
sub Parse($$)
($_->{TYPE} eq "INTERFACE") && ParseInterface($_, \%needed);
}
- RegistrationFunction($ndr, $basename);
-
return ($res_hdr, $res);
}