summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-11-09 19:23:25 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:54 +0100
commit3e1fb13024eec442bfdd0335bc03689f64d50c0e (patch)
tree52b0b4f2822de47bf56453b70947dcf40ae7f3cc /source4/pidl/lib/Parse/Pidl/Samba4
parent3953335420f95c7ac60cd2cbfde7427a6d5b0922 (diff)
downloadsamba-3e1fb13024eec442bfdd0335bc03689f64d50c0e.tar.gz
samba-3e1fb13024eec442bfdd0335bc03689f64d50c0e.tar.bz2
samba-3e1fb13024eec442bfdd0335bc03689f64d50c0e.zip
r25915: ndr/pidl: change NTSTAUS into enum ndr_err_code (pidl code)
Samba4/NDR/Parser.pm Samba4/NDR/Server.pm Samba3/ServerNDR.pm tests/ metze (This used to be commit 7106f21de8dfc472aa0846b49bfdb7543c63b310)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm16
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm12
2 files changed, 14 insertions, 14 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 3ad9231740..1a84ee4f0b 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -2103,7 +2103,7 @@ sub ParseFunctionPush($$)
{
my($self, $fn) = @_;
- $self->fn_declare("push", $fn, "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, const struct $fn->{NAME} *r)") or return;
+ $self->fn_declare("push", $fn, "enum ndr_err_code ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, const struct $fn->{NAME} *r)") or return;
return if has_property($fn, "nopush");
@@ -2146,7 +2146,7 @@ sub ParseFunctionPush($$)
$self->deindent;
$self->pidl("}");
- $self->pidl("return NT_STATUS_OK;");
+ $self->pidl("return NDR_ERR_SUCCESS;");
$self->deindent;
$self->pidl("}");
$self->pidl("");
@@ -2183,7 +2183,7 @@ sub ParseFunctionPull($$)
my($self,$fn) = @_;
# pull function args
- $self->fn_declare("pull", $fn, "NTSTATUS ndr_pull_$fn->{NAME}(struct ndr_pull *ndr, int flags, struct $fn->{NAME} *r)") or return;
+ $self->fn_declare("pull", $fn, "enum ndr_err_code ndr_pull_$fn->{NAME}(struct ndr_pull *ndr, int flags, struct $fn->{NAME} *r)") or return;
$self->pidl("{");
$self->indent;
@@ -2279,7 +2279,7 @@ sub ParseFunctionPull($$)
$self->deindent;
$self->pidl("}");
- $self->pidl("return NT_STATUS_OK;");
+ $self->pidl("return NDR_ERR_SUCCESS;");
$self->deindent;
$self->pidl("}");
$self->pidl("");
@@ -2468,12 +2468,12 @@ sub ParseTypePushFunction($$$)
my ($self, $e, $varname) = @_;
my $args = $typefamily{$e->{TYPE}}->{DECL}->($e, "push", $e->{NAME}, $varname);
- $self->fn_declare("push", $e, "NTSTATUS ".TypeFunctionName("ndr_push", $e)."(struct ndr_push *ndr, int ndr_flags, $args)") or return;
+ $self->fn_declare("push", $e, "enum ndr_err_code ".TypeFunctionName("ndr_push", $e)."(struct ndr_push *ndr, int ndr_flags, $args)") or return;
$self->pidl("{");
$self->indent;
$self->ParseTypePush($e, $varname, 1, 1);
- $self->pidl("return NT_STATUS_OK;");
+ $self->pidl("return NDR_ERR_SUCCESS;");
$self->deindent;
$self->pidl("}");
$self->pidl("");;
@@ -2496,12 +2496,12 @@ sub ParseTypePullFunction($$)
my $args = $typefamily{$e->{TYPE}}->{DECL}->($e, "pull", $e->{NAME}, $varname);
- $self->fn_declare("pull", $e, "NTSTATUS ".TypeFunctionName("ndr_pull", $e)."(struct ndr_pull *ndr, int ndr_flags, $args)") or return;
+ $self->fn_declare("pull", $e, "enum ndr_err_code ".TypeFunctionName("ndr_pull", $e)."(struct ndr_pull *ndr, int ndr_flags, $args)") or return;
$self->pidl("{");
$self->indent;
$self->ParseTypePull($e, $varname, 1, 1);
- $self->pidl("return NT_STATUS_OK;");
+ $self->pidl("return NDR_ERR_SUCCESS;");
$self->deindent;
$self->pidl("}");
$self->pidl("");
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
index ed17fcc0da..e30102b4e1 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
@@ -101,7 +101,7 @@ static void $name\__op_unbind(struct dcesrv_connection_context *context, const s
static NTSTATUS $name\__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
{
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
uint16_t opnum = dce_call->pkt.u.request.opnum;
dce_call->fault_code = 0;
@@ -118,8 +118,8 @@ static NTSTATUS $name\__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_C
NT_STATUS_HAVE_NO_MEMORY(*r);
/* unravel the NDR for the packet */
- status = ndr_table_$name.calls[opnum].ndr_pull(pull, NDR_IN, *r);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_table_$name.calls[opnum].ndr_pull(pull, NDR_IN, *r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
dcerpc_log_packet(&ndr_table_$name, opnum, NDR_IN,
&dce_call->pkt.u.request.stub_and_verifier);
dce_call->fault_code = DCERPC_FAULT_NDR;
@@ -177,11 +177,11 @@ pidl "
static NTSTATUS $name\__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
{
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
uint16_t opnum = dce_call->pkt.u.request.opnum;
- status = ndr_table_$name.calls[opnum].ndr_push(push, NDR_OUT, r);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_table_$name.calls[opnum].ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
dce_call->fault_code = DCERPC_FAULT_NDR;
return NT_STATUS_NET_WRITE_FAULT;
}