pidl "\treturn false;";
pidl "}";
pidl "";
- pidl "pull = ndr_pull_init_blob(&blob, r, NULL);";
+ pidl "pull = ndr_pull_init_blob(&blob, r);";
pidl "if (pull == NULL) {";
pidl "\ttalloc_free(r);";
pidl "\treturn false;";
pidl "}";
pidl "";
pidl "pull->flags |= LIBNDR_FLAG_REF_ALLOC;";
+ pidl "if (p->endian) {";
+ pidl "\tpull->flags |= LIBNDR_FLAG_BIGENDIAN;";
+ pidl "}";
pidl "ndr_err = call->ndr_pull(pull, NDR_IN, r);";
pidl "if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {";
pidl "\ttalloc_free(r);";
pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, r);";
pidl "}";
pidl "";
- pidl "push = ndr_push_init_ctx(r, NULL);";
+ pidl "push = ndr_push_init_ctx(r);";
pidl "if (push == NULL) {";
pidl "\ttalloc_free(r);";
pidl "\treturn false;";
pidl "";
}
-sub ParseDispatchFunction($)
-{
- my ($if) = @_;
-
- pidl_hdr "NTSTATUS rpc_$if->{NAME}_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r);";
- pidl "NTSTATUS rpc_$if->{NAME}_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)";
- pidl "{";
- indent;
- pidl "if (cli->pipes_struct == NULL) {";
- pidl "\treturn NT_STATUS_INVALID_PARAMETER;";
- pidl "}";
- pidl "";
- pidl "switch (opnum)";
- pidl "{";
- indent;
- foreach my $fn (@{$if->{FUNCTIONS}}) {
- next if ($fn->{PROPERTIES}{noopnum});
- my $op = "NDR_".uc($fn->{NAME});
- pidl "case $op: {";
- indent;
- pidl "struct $fn->{NAME} *r = (struct $fn->{NAME} *)_r;";
- CallWithStruct("cli->pipes_struct", "mem_ctx", $fn,
- sub { pidl "\treturn NT_STATUS_NO_MEMORY;"; });
- pidl "return NT_STATUS_OK;";
- deindent;
- pidl "}";
- pidl "";
- }
-
- pidl "default:";
- pidl "\treturn NT_STATUS_NOT_IMPLEMENTED;";
- deindent;
- pidl "}";
- deindent;
- pidl "}";
-
- pidl "";
-}
-
sub ParseInterface($)
{
my $if = shift;
pidl "}";
pidl "";
- ParseDispatchFunction($if);
-
- pidl_hdr "NTSTATUS rpc_$if->{NAME}_init(void);";
- pidl "NTSTATUS rpc_$if->{NAME}_init(void)";
- pidl "{";
- pidl "\treturn rpc_srv_register(SMB_RPC_INTERFACE_VERSION, \"$if->{NAME}\", \"$if->{NAME}\", \&ndr_table_$if->{NAME}, api_$if->{NAME}_cmds, sizeof(api_$if->{NAME}_cmds) / sizeof(struct api_struct));";
- pidl "}";
-
+ if (not has_property($if, "no_srv_register")) {
+ pidl_hdr "NTSTATUS rpc_$if->{NAME}_init(void);";
+ pidl "NTSTATUS rpc_$if->{NAME}_init(void)";
+ pidl "{";
+ pidl "\treturn rpc_srv_register(SMB_RPC_INTERFACE_VERSION, \"$if->{NAME}\", \"$if->{NAME}\", \&ndr_table_$if->{NAME}, api_$if->{NAME}_cmds, sizeof(api_$if->{NAME}_cmds) / sizeof(struct api_struct));";
+ pidl "}";
+ }
pidl_hdr "#endif /* __SRV_$uif\__ */";
}