mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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 7106f21de8
)
This commit is contained in:
parent
3953335420
commit
3e1fb13024
@ -90,7 +90,7 @@ sub ParseFunction($$)
|
||||
pidl "const struct ndr_interface_call *call;";
|
||||
pidl "struct ndr_pull *pull;";
|
||||
pidl "struct ndr_push *push;";
|
||||
pidl "NTSTATUS status;";
|
||||
pidl "enum ndr_err_code ndr_err;";
|
||||
pidl "DATA_BLOB blob;";
|
||||
pidl "struct $fn->{NAME} *r;";
|
||||
pidl "";
|
||||
@ -113,8 +113,8 @@ sub ParseFunction($$)
|
||||
pidl "}";
|
||||
pidl "";
|
||||
pidl "pull->flags |= LIBNDR_FLAG_REF_ALLOC;";
|
||||
pidl "status = call->ndr_pull(pull, NDR_IN, r);";
|
||||
pidl "if (NT_STATUS_IS_ERR(status)) {";
|
||||
pidl "ndr_err = call->ndr_pull(pull, NDR_IN, r);";
|
||||
pidl "if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {";
|
||||
pidl "\ttalloc_free(r);";
|
||||
pidl "\treturn False;";
|
||||
pidl "}";
|
||||
@ -171,8 +171,8 @@ sub ParseFunction($$)
|
||||
pidl "\treturn False;";
|
||||
pidl "}";
|
||||
pidl "";
|
||||
pidl "status = call->ndr_push(push, NDR_OUT, r);";
|
||||
pidl "if (NT_STATUS_IS_ERR(status)) {";
|
||||
pidl "ndr_err = call->ndr_push(push, NDR_OUT, r);";
|
||||
pidl "if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {";
|
||||
pidl "\ttalloc_free(r);";
|
||||
pidl "\treturn False;";
|
||||
pidl "}";
|
||||
|
@ -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("");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ test_samba4_ndr('align-uint8-uint16',
|
||||
r.x = 13;
|
||||
r.y = 0xbeef;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
@ -49,7 +49,7 @@ test_samba4_ndr('align-uint8-uint32',
|
||||
r.x = 13;
|
||||
r.y = 0xbeefbeef;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
@ -76,7 +76,7 @@ test_samba4_ndr('align-uint8-hyper',
|
||||
r.x = 13;
|
||||
r.y = 0xbeefbeefbeefbeefLLU;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
@ -103,7 +103,7 @@ test_samba4_ndr('noalignflag-uint8-uint16',
|
||||
r.x = 13;
|
||||
r.y = 0xbeef;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
@ -133,7 +133,7 @@ test_samba4_ndr('align-blob-align2',
|
||||
r.data.data = data;
|
||||
r.data.length = 2;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_blie(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_blie(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
|
@ -23,7 +23,7 @@ test_samba4_ndr("alloc-scalar",
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestAlloc r;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.foo.x == NULL)
|
||||
@ -47,7 +47,7 @@ test_samba4_ndr("alloc-buffer",
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestAlloc r;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.foo.x == NULL)
|
||||
@ -69,7 +69,7 @@ test_samba4_ndr("ref-noalloc-null",
|
||||
struct TestAlloc r;
|
||||
r.in.t = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
'
|
||||
);
|
||||
@ -86,7 +86,7 @@ test_samba4_ndr("ref-noalloc",
|
||||
uint8_t x;
|
||||
r.in.t = &x;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (*r.in.t != 0x03)
|
||||
@ -106,7 +106,7 @@ test_samba4_ndr("ref-alloc",
|
||||
ndr->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||
r.in.t = NULL;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.t == NULL)
|
||||
|
@ -25,7 +25,7 @@ test_samba4_ndr(
|
||||
b.length = 10;
|
||||
ndr = ndr_pull_init_blob(&b, mem_ctx);
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_Test(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_Test(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 10)
|
||||
|
@ -23,7 +23,7 @@ test_samba4_ndr("fullptr-push-dup",
|
||||
r.in.x = &v;
|
||||
r.in.y = &v;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestFull(ndr, NDR_IN, &r))) {
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestFull(ndr, NDR_IN, &r))) {
|
||||
fprintf(stderr, "push failed\n");
|
||||
return 1;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ test_samba4_ndr("noptr-push",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo.x = v;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r))) {
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r))) {
|
||||
fprintf(stderr, "push failed\n");
|
||||
return 1;
|
||||
}
|
||||
@ -52,7 +52,7 @@ test_samba4_ndr("ptr-embedded-push",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo.x = &v;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 6)
|
||||
@ -78,7 +78,7 @@ test_samba4_ndr("ptr-embedded-push-null",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo.x = NULL;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 4)
|
||||
@ -103,7 +103,7 @@ test_samba4_ndr("refptr-embedded-push",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo.x = &v;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 6)
|
||||
@ -130,7 +130,7 @@ test_samba4_ndr("refptr-embedded-push-null",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo.x = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
');
|
||||
@ -150,7 +150,7 @@ test_samba4_ndr("ptr-top-push",
|
||||
s.x = 13;
|
||||
r.in.foo = &s;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 2)
|
||||
@ -173,7 +173,7 @@ test_samba4_ndr("ptr-top-push-null",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
@ -195,7 +195,7 @@ test_samba4_ndr("refptr-top-push",
|
||||
s.x = 13;
|
||||
r.in.foo = &s;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 2)
|
||||
@ -218,7 +218,7 @@ test_samba4_ndr("refptr-top-push-null",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
@ -239,7 +239,7 @@ test_samba4_ndr("uniqueptr-top-push",
|
||||
s.x = 13;
|
||||
r.in.foo = &s;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 6)
|
||||
@ -265,7 +265,7 @@ test_samba4_ndr("uniqueptr-top-push-null",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo = NULL;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 4)
|
||||
@ -294,7 +294,7 @@ test_samba4_ndr("ptr-top-out-pull",
|
||||
|
||||
r.out.foo = &s;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
return 1;
|
||||
|
||||
if (!r.out.foo)
|
||||
@ -320,7 +320,7 @@ test_samba4_ndr("ptr-top-out-pull-null",
|
||||
|
||||
r.out.foo = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
return 1;
|
||||
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
@ -344,7 +344,7 @@ test_samba4_ndr("refptr-top-out-pull",
|
||||
|
||||
r.out.foo = &s;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
return 1;
|
||||
|
||||
if (!r.out.foo)
|
||||
@ -370,7 +370,7 @@ test_samba4_ndr("refptr-top-out-pull-null",
|
||||
|
||||
r.out.foo = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_pull_echo_TestRef(ndr, NDR_OUT, &r)))
|
||||
return 1;
|
||||
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
@ -387,7 +387,7 @@ test_samba4_ndr("ptr-top-push-double",
|
||||
uint16_t *pv = &v;
|
||||
r.in.foo = &pv;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 6)
|
||||
@ -413,7 +413,7 @@ test_samba4_ndr("ptr-top-push-double-sndnull",
|
||||
uint16_t *pv = NULL;
|
||||
r.in.foo = &pv;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 4)
|
||||
@ -433,7 +433,7 @@ test_samba4_ndr("ptr-top-push-double-fstnull",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
@ -451,7 +451,7 @@ test_samba4_ndr("refptr-top-push-double",
|
||||
uint16_t *pv = &v;
|
||||
r.in.foo = &pv;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 6)
|
||||
@ -478,7 +478,7 @@ test_samba4_ndr("refptr-top-push-double-sndnull",
|
||||
uint16_t *pv = NULL;
|
||||
r.in.foo = &pv;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 4)
|
||||
@ -498,7 +498,7 @@ test_samba4_ndr("refptr-top-push-double-fstnull",
|
||||
struct echo_TestRef r;
|
||||
r.in.foo = NULL;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
/* Windows gives [client runtime error 0x6f4] */
|
||||
@ -517,7 +517,7 @@ test_samba4_ndr("ignore-ptr",
|
||||
r.in.foo = &v;
|
||||
r.in.bar = &v;
|
||||
|
||||
if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (ndr->offset != 4)
|
||||
|
@ -18,25 +18,23 @@ test_samba4_ndr('represent_as-simple',
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&in_blob, NULL);
|
||||
struct bla r;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.x != 13)
|
||||
return 2;
|
||||
',
|
||||
'
|
||||
#include <libcli/util/ntstatus.h>
|
||||
|
||||
NTSTATUS ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
|
||||
enum ndr_err_code ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
|
||||
{
|
||||
*to = from;
|
||||
return NT_STATUS_OK;
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
|
||||
enum ndr_err_code ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
|
||||
{
|
||||
*to = from;
|
||||
return NT_STATUS_OK;
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
'
|
||||
);
|
||||
@ -51,26 +49,23 @@ test_samba4_ndr('transmit_as-simple',
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&in_blob, NULL);
|
||||
struct bla r;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.x != 13)
|
||||
return 2;
|
||||
',
|
||||
'
|
||||
#include <libcli/util/ntstatus.h>
|
||||
|
||||
NTSTATUS ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
|
||||
enum ndr_err_code ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
|
||||
{
|
||||
*to = from;
|
||||
return NT_STATUS_OK;
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
|
||||
enum ndr_err_code ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
|
||||
{
|
||||
*to = from;
|
||||
return NT_STATUS_OK;
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
'
|
||||
);
|
||||
|
||||
|
@ -20,7 +20,7 @@ test_samba4_ndr("simple", "void Test(); ",
|
||||
b.length = 1;
|
||||
ndr = ndr_pull_init_blob(&b, mem_ctx);
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_uint8(ndr, NDR_SCALARS, &result)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_uint8(ndr, NDR_SCALARS, &result)))
|
||||
return 1;
|
||||
|
||||
if (result != 0x02)
|
||||
|
@ -18,7 +18,7 @@ test_samba4_ndr("string-pull-empty",
|
||||
struct TestString r;
|
||||
r.in.data = NULL;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestString(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestString(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.data == NULL)
|
||||
@ -40,7 +40,7 @@ test_samba4_ndr("string-ascii-pull",
|
||||
struct TestString r;
|
||||
r.in.data = NULL;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestString(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestString(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.in.data == NULL)
|
||||
@ -69,7 +69,7 @@ test_samba4_ndr("string-out",
|
||||
char *str = NULL;
|
||||
r.out.data = &str;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_pull_TestString(ndr, NDR_IN, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestString(ndr, NDR_IN, &r)))
|
||||
return 1;
|
||||
|
||||
if (r.out.data == NULL)
|
||||
|
@ -17,7 +17,7 @@ test_samba4_ndr('struct-notypedef', '[public] struct bla { uint8 x; }; ',
|
||||
DATA_BLOB result_blob;
|
||||
r.x = 13;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_STRUCT_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_STRUCT_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
@ -36,7 +36,7 @@ test_samba4_ndr('struct-notypedef-used', '[public] struct bla { uint8 x; };
|
||||
DATA_BLOB result_blob;
|
||||
fn.in.r.x = 13;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_myfn(ndr, NDR_IN, &fn)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_myfn(ndr, NDR_IN, &fn)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
@ -56,7 +56,7 @@ test_samba4_ndr('struct-notypedef-embedded', 'struct bla { uint8 x; };
|
||||
DATA_BLOB result_blob;
|
||||
st.r.x = 13;
|
||||
|
||||
if (!NT_STATUS_IS_OK(ndr_push_STRUCT_myst(ndr, NDR_IN, &st)))
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_STRUCT_myst(ndr, NDR_IN, &st)))
|
||||
return 1;
|
||||
|
||||
result_blob = ndr_push_blob(ndr);
|
||||
|
Loading…
Reference in New Issue
Block a user