summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_samr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/ndr/ndr_samr.c')
-rw-r--r--source4/librpc/ndr/ndr_samr.c55
1 files changed, 6 insertions, 49 deletions
diff --git a/source4/librpc/ndr/ndr_samr.c b/source4/librpc/ndr/ndr_samr.c
index 2cd69fb819..c98d47b573 100644
--- a/source4/librpc/ndr/ndr_samr.c
+++ b/source4/librpc/ndr/ndr_samr.c
@@ -46,7 +46,7 @@ NTSTATUS ndr_push_samr_Name(struct ndr_push *ndr, int ndr_flags, struct samr_Nam
NDR_CHECK(ndr_push_struct_start(ndr));
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name)));
- NDR_CHECK(ndr_push_uint16(ndr, r->name_len));
+ NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name)));
NDR_CHECK(ndr_push_ptr(ndr, r->name));
ndr_push_struct_end(ndr);
buffers:
@@ -116,10 +116,7 @@ NTSTATUS ndr_push_samr_EnumDomainGroups(struct ndr_push *ndr, struct samr_EnumDo
NTSTATUS ndr_push_samr_CreateUser(struct ndr_push *ndr, struct samr_CreateUser *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
- NDR_CHECK(ndr_push_ptr(ndr, r->in.username));
- if (r->in.username) {
- NDR_CHECK(ndr_push_samr_Name(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.username));
- }
+ NDR_CHECK(ndr_push_samr_Name(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.username));
NDR_CHECK(ndr_push_uint32(ndr, r->in.access_mask));
return NT_STATUS_OK;
@@ -302,10 +299,7 @@ NTSTATUS ndr_push_samr_OpenUser(struct ndr_push *ndr, struct samr_OpenUser *r)
NTSTATUS ndr_push_samr_DeleteUser(struct ndr_push *ndr, struct samr_DeleteUser *r)
{
- NDR_CHECK(ndr_push_ptr(ndr, r->in.handle));
- if (r->in.handle) {
- NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
- }
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
@@ -1050,26 +1044,8 @@ NTSTATUS ndr_pull_samr_EnumDomainGroups(struct ndr_pull *ndr, struct samr_EnumDo
NTSTATUS ndr_pull_samr_CreateUser(struct ndr_pull *ndr, struct samr_CreateUser *r)
{
- uint32 _ptr_acct_handle;
- uint32 _ptr_rid;
- NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_acct_handle));
- if (_ptr_acct_handle) {
- NDR_ALLOC(ndr, r->out.acct_handle);
- } else {
- r->out.acct_handle = NULL;
- }
- if (r->out.acct_handle) {
- NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.acct_handle));
- }
- NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_rid));
- if (_ptr_rid) {
- NDR_ALLOC(ndr, r->out.rid);
- } else {
- r->out.rid = NULL;
- }
- if (r->out.rid) {
- NDR_CHECK(ndr_pull_uint32(ndr, r->out.rid));
- }
+ NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.acct_handle));
+ NDR_CHECK(ndr_pull_uint32(ndr, r->out.rid));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
@@ -1525,16 +1501,7 @@ NTSTATUS ndr_pull_samr_OpenUser(struct ndr_pull *ndr, struct samr_OpenUser *r)
NTSTATUS ndr_pull_samr_DeleteUser(struct ndr_pull *ndr, struct samr_DeleteUser *r)
{
- uint32 _ptr_handle;
- NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_handle));
- if (_ptr_handle) {
- NDR_ALLOC(ndr, r->out.handle);
- } else {
- r->out.handle = NULL;
- }
- if (r->out.handle) {
- NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.handle));
- }
+ NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.handle));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
@@ -2975,9 +2942,7 @@ void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flag
ndr->depth--;
ndr_print_ptr(ndr, "username", r->in.username);
ndr->depth++;
- if (r->in.username) {
ndr_print_samr_Name(ndr, "username", r->in.username);
- }
ndr->depth--;
ndr_print_uint32(ndr, "access_mask", r->in.access_mask);
ndr->depth--;
@@ -2987,15 +2952,11 @@ void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flag
ndr->depth++;
ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle);
ndr->depth++;
- if (r->out.acct_handle) {
ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle);
- }
ndr->depth--;
ndr_print_ptr(ndr, "rid", r->out.rid);
ndr->depth++;
- if (r->out.rid) {
ndr_print_uint32(ndr, "rid", *r->out.rid);
- }
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", &r->out.result);
ndr->depth--;
@@ -3652,9 +3613,7 @@ void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flag
ndr->depth++;
ndr_print_ptr(ndr, "handle", r->in.handle);
ndr->depth++;
- if (r->in.handle) {
ndr_print_policy_handle(ndr, "handle", r->in.handle);
- }
ndr->depth--;
ndr->depth--;
}
@@ -3663,9 +3622,7 @@ void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flag
ndr->depth++;
ndr_print_ptr(ndr, "handle", r->out.handle);
ndr->depth++;
- if (r->out.handle) {
ndr_print_policy_handle(ndr, "handle", r->out.handle);
- }
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", &r->out.result);
ndr->depth--;