summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr/ndr_wkssvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/librpc/gen_ndr/ndr_wkssvc.c')
-rw-r--r--source3/librpc/gen_ndr/ndr_wkssvc.c106
1 files changed, 36 insertions, 70 deletions
diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.c b/source3/librpc/gen_ndr/ndr_wkssvc.c
index 6472fadd70..60bbc857d1 100644
--- a/source3/librpc/gen_ndr/ndr_wkssvc.c
+++ b/source3/librpc/gen_ndr/ndr_wkssvc.c
@@ -2677,24 +2677,18 @@ NTSTATUS ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags,
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
}
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.level));
- if (r->in.level) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level));
- }
+ if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level));
if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, r->in.level));
NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle));
- if (r->in.resume_handle) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
- }
+ if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.level));
- if (r->out.level) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level));
- }
+ if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level));
if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, r->out.level));
NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
@@ -2702,10 +2696,8 @@ NTSTATUS ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags,
if (r->out.totalentries) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.totalentries));
}
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle));
- if (r->out.resume_handle) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
- }
+ if (r->out.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
@@ -2714,9 +2706,7 @@ NTSTATUS ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags,
NTSTATUS ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaTransportEnum *r)
{
uint32_t _ptr_server_name;
- uint32_t _ptr_level;
uint32_t _ptr_totalentries;
- uint32_t _ptr_resume_handle;
TALLOC_CTX *_mem_save_server_name_0;
TALLOC_CTX *_mem_save_level_0;
TALLOC_CTX *_mem_save_ctr_0;
@@ -2743,18 +2733,13 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags,
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_level));
- if (_ptr_level) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.level);
- } else {
- r->in.level = NULL;
- }
- if (r->in.level) {
- _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.level, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.level));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, 0);
}
+ _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.level, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.level));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.ctr);
}
@@ -2764,34 +2749,28 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags,
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
- if (_ptr_resume_handle) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.resume_handle);
- } else {
- r->in.resume_handle = NULL;
- }
- if (r->in.resume_handle) {
- _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
}
+ _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_ALLOC(ndr, r->out.level);
+ *r->out.level = *r->in.level;
NDR_PULL_ALLOC(ndr, r->out.ctr);
*r->out.ctr = *r->in.ctr;
+ NDR_PULL_ALLOC(ndr, r->out.resume_handle);
+ *r->out.resume_handle = *r->in.resume_handle;
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_level));
- if (_ptr_level) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.level);
- } else {
- r->out.level = NULL;
- }
- if (r->out.level) {
- _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.level, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, 0);
}
+ _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.level, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.ctr);
}
@@ -2812,18 +2791,13 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags,
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
- if (_ptr_resume_handle) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.resume_handle);
- } else {
- r->out.resume_handle = NULL;
- }
- if (r->out.resume_handle) {
- _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
}
+ _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
@@ -2847,9 +2821,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, cons
ndr->depth--;
ndr_print_ptr(ndr, "level", r->in.level);
ndr->depth++;
- if (r->in.level) {
- ndr_print_uint32(ndr, "level", *r->in.level);
- }
+ ndr_print_uint32(ndr, "level", *r->in.level);
ndr->depth--;
ndr_print_ptr(ndr, "ctr", r->in.ctr);
ndr->depth++;
@@ -2859,9 +2831,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, cons
ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer);
ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
ndr->depth++;
- if (r->in.resume_handle) {
- ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
- }
+ ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
ndr->depth--;
ndr->depth--;
}
@@ -2870,9 +2840,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, cons
ndr->depth++;
ndr_print_ptr(ndr, "level", r->out.level);
ndr->depth++;
- if (r->out.level) {
- ndr_print_uint32(ndr, "level", *r->out.level);
- }
+ ndr_print_uint32(ndr, "level", *r->out.level);
ndr->depth--;
ndr_print_ptr(ndr, "ctr", r->out.ctr);
ndr->depth++;
@@ -2887,9 +2855,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, cons
ndr->depth--;
ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
ndr->depth++;
- if (r->out.resume_handle) {
- ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
- }
+ ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;