summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-28 13:09:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:10 -0500
commitf1d492d11f4da7bbff883fefc3d8fcb71f08f67b (patch)
treefab610f3306c1c7ae3b8f88b603dfc1cdf3235f9
parent7ef185fae7fc43b566dedb267023cf8d346baee2 (diff)
downloadsamba-f1d492d11f4da7bbff883fefc3d8fcb71f08f67b.tar.gz
samba-f1d492d11f4da7bbff883fefc3d8fcb71f08f67b.tar.bz2
samba-f1d492d11f4da7bbff883fefc3d8fcb71f08f67b.zip
r19930: Revert the winreg idl changes. At least enumkey does not work anymore today.
With more than 5 different trees I can't swear that I did test this properly yesterday. Sorry for the noise. Volker (This used to be commit 978a6196bf0a2280c7f74b4a6d9fa7941c3aa049)
-rw-r--r--source3/librpc/gen_ndr/cli_winreg.c12
-rw-r--r--source3/librpc/gen_ndr/ndr_winreg.c219
-rw-r--r--source3/librpc/gen_ndr/srv_winreg.h4
-rw-r--r--source3/librpc/gen_ndr/winreg.h12
-rw-r--r--source3/librpc/idl/winreg.idl6
-rw-r--r--source3/rpc_server/srv_winreg_nt.c19
6 files changed, 120 insertions, 152 deletions
diff --git a/source3/librpc/gen_ndr/cli_winreg.c b/source3/librpc/gen_ndr/cli_winreg.c
index b11000bd7e..7ace36ca52 100644
--- a/source3/librpc/gen_ndr/cli_winreg.c
+++ b/source3/librpc/gen_ndr/cli_winreg.c
@@ -209,7 +209,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
r.in.options = options;
r.in.access_mask = access_mask;
r.in.secdesc = secdesc;
- r.in.action_taken = action_taken;
+ r.in.action_taken = *action_taken;
if (DEBUGLEVEL >= 10)
NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r);
@@ -229,7 +229,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
/* Return variables */
*new_handle = *r.out.new_handle;
- *action_taken = *r.out.action_taken;
+ *action_taken = r.out.action_taken;
/* Return result */
return werror_to_ntstatus(r.out.result);
@@ -306,8 +306,8 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
r.in.handle = handle;
r.in.enum_index = enum_index;
r.in.name = name;
- r.in.keyclass = keyclass;
- r.in.last_changed_time = last_changed_time;
+ r.in.keyclass = *keyclass;
+ r.in.last_changed_time = *last_changed_time;
if (DEBUGLEVEL >= 10)
NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r);
@@ -327,8 +327,8 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
/* Return variables */
*name = *r.out.name;
- *keyclass = *r.out.keyclass;
- *last_changed_time = *r.out.last_changed_time;
+ *keyclass = r.out.keyclass;
+ *last_changed_time = r.out.last_changed_time;
/* Return result */
return werror_to_ntstatus(r.out.result);
diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c
index 8aaa571c3f..bc931dafe8 100644
--- a/source3/librpc/gen_ndr/ndr_winreg.c
+++ b/source3/librpc/gen_ndr/ndr_winreg.c
@@ -1019,18 +1019,18 @@ NTSTATUS ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct
if (r->in.secdesc) {
NDR_CHECK(ndr_push_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc));
}
- if (r->in.action_taken == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- if (*r->in.action_taken == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_ref_ptr(ndr));
- NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, **r->in.action_taken));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.action_taken));
+ if (r->in.action_taken) {
+ NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->in.action_taken));
+ }
}
if (flags & NDR_OUT) {
if (r->out.new_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_handle));
- if (r->out.action_taken == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- if (*r->out.action_taken == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_ref_ptr(ndr));
- NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, **r->out.action_taken));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.action_taken));
+ if (r->out.action_taken) {
+ NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->out.action_taken));
+ }
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
@@ -1044,7 +1044,6 @@ NTSTATUS ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winre
TALLOC_CTX *_mem_save_secdesc_0;
TALLOC_CTX *_mem_save_new_handle_0;
TALLOC_CTX *_mem_save_action_taken_0;
- TALLOC_CTX *_mem_save_action_taken_1;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -1071,24 +1070,20 @@ NTSTATUS ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winre
NDR_CHECK(ndr_pull_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
}
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken));
+ if (_ptr_action_taken) {
NDR_PULL_ALLOC(ndr, r->in.action_taken);
+ } else {
+ r->in.action_taken = NULL;
}
- _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.action_taken, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_action_taken));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, *r->in.action_taken);
+ if (r->in.action_taken) {
+ _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.action_taken, 0);
+ NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->in.action_taken));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0);
}
- _mem_save_action_taken_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, *r->in.action_taken, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, *r->in.action_taken));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_1, LIBNDR_FLAG_REF_ALLOC);
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, LIBNDR_FLAG_REF_ALLOC);
NDR_PULL_ALLOC(ndr, r->out.new_handle);
ZERO_STRUCTP(r->out.new_handle);
- NDR_PULL_ALLOC(ndr, r->out.action_taken);
- *r->out.action_taken = *r->in.action_taken;
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -1098,20 +1093,18 @@ NTSTATUS ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winre
NDR_PULL_SET_MEM_CTX(ndr, r->out.new_handle, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_handle_0, LIBNDR_FLAG_REF_ALLOC);
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken));
+ if (_ptr_action_taken) {
NDR_PULL_ALLOC(ndr, r->out.action_taken);
+ } else {
+ r->out.action_taken = NULL;
}
- _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.action_taken, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_action_taken));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, *r->out.action_taken);
+ if (r->out.action_taken) {
+ _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.action_taken, 0);
+ NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->out.action_taken));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0);
}
- _mem_save_action_taken_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, *r->out.action_taken, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, *r->out.action_taken));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_1, LIBNDR_FLAG_REF_ALLOC);
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
@@ -1143,10 +1136,9 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name
ndr->depth--;
ndr_print_ptr(ndr, "action_taken", r->in.action_taken);
ndr->depth++;
- ndr_print_ptr(ndr, "action_taken", *r->in.action_taken);
- ndr->depth++;
- ndr_print_winreg_CreateAction(ndr, "action_taken", **r->in.action_taken);
- ndr->depth--;
+ if (r->in.action_taken) {
+ ndr_print_winreg_CreateAction(ndr, "action_taken", *r->in.action_taken);
+ }
ndr->depth--;
ndr->depth--;
}
@@ -1159,10 +1151,9 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name
ndr->depth--;
ndr_print_ptr(ndr, "action_taken", r->out.action_taken);
ndr->depth++;
- ndr_print_ptr(ndr, "action_taken", *r->out.action_taken);
- ndr->depth++;
- ndr_print_winreg_CreateAction(ndr, "action_taken", **r->out.action_taken);
- ndr->depth--;
+ if (r->out.action_taken) {
+ ndr_print_winreg_CreateAction(ndr, "action_taken", *r->out.action_taken);
+ }
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;
@@ -1294,26 +1285,26 @@ NTSTATUS ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct w
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index));
if (r->in.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
- if (r->in.keyclass == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- if (*r->in.keyclass == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_ref_ptr(ndr));
- NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.keyclass));
- if (r->in.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- if (*r->in.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_ref_ptr(ndr));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, **r->in.last_changed_time));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyclass));
+ if (r->in.keyclass) {
+ NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass));
+ }
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.last_changed_time));
+ if (r->in.last_changed_time) {
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->in.last_changed_time));
+ }
}
if (flags & NDR_OUT) {
if (r->out.name == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
- if (r->out.keyclass == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- if (*r->out.keyclass == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_ref_ptr(ndr));
- NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.keyclass));
- if (r->out.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- if (*r->out.last_changed_time == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_ref_ptr(ndr));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, **r->out.last_changed_time));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.keyclass));
+ if (r->out.keyclass) {
+ NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass));
+ }
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.last_changed_time));
+ if (r->out.last_changed_time) {
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
+ }
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NT_STATUS_OK;
@@ -1326,9 +1317,7 @@ NTSTATUS ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_name_0;
TALLOC_CTX *_mem_save_keyclass_0;
- TALLOC_CTX *_mem_save_keyclass_1;
TALLOC_CTX *_mem_save_last_changed_time_0;
- TALLOC_CTX *_mem_save_last_changed_time_1;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -1347,40 +1336,32 @@ NTSTATUS ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_
NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass));
+ if (_ptr_keyclass) {
NDR_PULL_ALLOC(ndr, r->in.keyclass);
+ } else {
+ r->in.keyclass = NULL;
}
- _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.keyclass, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_keyclass));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, *r->in.keyclass);
+ if (r->in.keyclass) {
+ _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.keyclass, 0);
+ NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0);
}
- _mem_save_keyclass_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, *r->in.keyclass, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.keyclass));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_1, LIBNDR_FLAG_REF_ALLOC);
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, LIBNDR_FLAG_REF_ALLOC);
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time));
+ if (_ptr_last_changed_time) {
NDR_PULL_ALLOC(ndr, r->in.last_changed_time);
+ } else {
+ r->in.last_changed_time = NULL;
}
- _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.last_changed_time, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_last_changed_time));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, *r->in.last_changed_time);
+ if (r->in.last_changed_time) {
+ _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.last_changed_time, 0);
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->in.last_changed_time));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0);
}
- _mem_save_last_changed_time_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, *r->in.last_changed_time, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, *r->in.last_changed_time));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_1, LIBNDR_FLAG_REF_ALLOC);
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, LIBNDR_FLAG_REF_ALLOC);
NDR_PULL_ALLOC(ndr, r->out.name);
*r->out.name = *r->in.name;
- NDR_PULL_ALLOC(ndr, r->out.keyclass);
- *r->out.keyclass = *r->in.keyclass;
- NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
- *r->out.last_changed_time = *r->in.last_changed_time;
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -1390,34 +1371,30 @@ NTSTATUS ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_
NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass));
+ if (_ptr_keyclass) {
NDR_PULL_ALLOC(ndr, r->out.keyclass);
+ } else {
+ r->out.keyclass = NULL;
}
- _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.keyclass, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_keyclass));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, *r->out.keyclass);
+ if (r->out.keyclass) {
+ _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.keyclass, 0);
+ NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0);
}
- _mem_save_keyclass_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, *r->out.keyclass, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.keyclass));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_1, LIBNDR_FLAG_REF_ALLOC);
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, LIBNDR_FLAG_REF_ALLOC);
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time));
+ if (_ptr_last_changed_time) {
NDR_PULL_ALLOC(ndr, r->out.last_changed_time);
+ } else {
+ r->out.last_changed_time = NULL;
}
- _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_last_changed_time));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, *r->out.last_changed_time);
+ if (r->out.last_changed_time) {
+ _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, 0);
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0);
}
- _mem_save_last_changed_time_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, *r->out.last_changed_time, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_1, LIBNDR_FLAG_REF_ALLOC);
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
return NT_STATUS_OK;
@@ -1444,17 +1421,15 @@ _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
ndr_print_ptr(ndr, "keyclass", r->in.keyclass);
ndr->depth++;
- ndr_print_ptr(ndr, "keyclass", *r->in.keyclass);
- ndr->depth++;
- ndr_print_winreg_StringBuf(ndr, "keyclass", *r->in.keyclass);
- ndr->depth--;
+ if (r->in.keyclass) {
+ ndr_print_winreg_StringBuf(ndr, "keyclass", r->in.keyclass);
+ }
ndr->depth--;
ndr_print_ptr(ndr, "last_changed_time", r->in.last_changed_time);
ndr->depth++;
- ndr_print_ptr(ndr, "last_changed_time", *r->in.last_changed_time);
- ndr->depth++;
- ndr_print_NTTIME(ndr, "last_changed_time", **r->in.last_changed_time);
- ndr->depth--;
+ if (r->in.last_changed_time) {
+ ndr_print_NTTIME(ndr, "last_changed_time", *r->in.last_changed_time);
+ }
ndr->depth--;
ndr->depth--;
}
@@ -1467,17 +1442,15 @@ _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
ndr_print_ptr(ndr, "keyclass", r->out.keyclass);
ndr->depth++;
- ndr_print_ptr(ndr, "keyclass", *r->out.keyclass);
- ndr->depth++;
- ndr_print_winreg_StringBuf(ndr, "keyclass", *r->out.keyclass);
- ndr->depth--;
+ if (r->out.keyclass) {
+ ndr_print_winreg_StringBuf(ndr, "keyclass", r->out.keyclass);
+ }
ndr->depth--;
ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time);
ndr->depth++;
- ndr_print_ptr(ndr, "last_changed_time", *r->out.last_changed_time);
- ndr->depth++;
- ndr_print_NTTIME(ndr, "last_changed_time", **r->out.last_changed_time);
- ndr->depth--;
+ if (r->out.last_changed_time) {
+ ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time);
+ }
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;
diff --git a/source3/librpc/gen_ndr/srv_winreg.h b/source3/librpc/gen_ndr/srv_winreg.h
index f972e09d26..dfa557f90c 100644
--- a/source3/librpc/gen_ndr/srv_winreg.h
+++ b/source3/librpc/gen_ndr/srv_winreg.h
@@ -7,10 +7,10 @@ WERROR _winreg_OpenHKLM(pipes_struct *p, uint16_t *system_name, uint32_t access_
WERROR _winreg_OpenHKPD(pipes_struct *p, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle);
WERROR _winreg_OpenHKU(pipes_struct *p, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle);
WERROR _winreg_CloseKey(pipes_struct *p, struct policy_handle *handle);
-WERROR _winreg_CreateKey(pipes_struct *p, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction **action_taken);
+WERROR _winreg_CreateKey(pipes_struct *p, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction *action_taken);
WERROR _winreg_DeleteKey(pipes_struct *p, struct policy_handle *handle, struct winreg_String key);
WERROR _winreg_DeleteValue(pipes_struct *p, struct policy_handle *handle, struct winreg_String value);
-WERROR _winreg_EnumKey(pipes_struct *p, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf **keyclass, NTTIME **last_changed_time);
+WERROR _winreg_EnumKey(pipes_struct *p, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf *keyclass, NTTIME *last_changed_time);
WERROR _winreg_EnumValue(pipes_struct *p, struct policy_handle *handle, uint32_t enum_index, struct winreg_ValNameBuf *name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length);
WERROR _winreg_FlushKey(pipes_struct *p, struct policy_handle *handle);
WERROR _winreg_GetKeySecurity(pipes_struct *p, struct policy_handle *handle, uint32_t sec_info, struct KeySecurityData *sd);
diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h
index 0a8833acb5..4703c3dc07 100644
--- a/source3/librpc/gen_ndr/winreg.h
+++ b/source3/librpc/gen_ndr/winreg.h
@@ -164,12 +164,12 @@ struct winreg_CreateKey {
uint32_t options;
uint32_t access_mask;
struct winreg_SecBuf *secdesc;/* [unique] */
- enum winreg_CreateAction **action_taken;/* [ref] */
+ enum winreg_CreateAction *action_taken;/* [unique] */
} in;
struct {
struct policy_handle *new_handle;/* [ref] */
- enum winreg_CreateAction **action_taken;/* [ref] */
+ enum winreg_CreateAction *action_taken;/* [unique] */
WERROR result;
} out;
@@ -207,14 +207,14 @@ struct winreg_EnumKey {
struct policy_handle *handle;/* [ref] */
uint32_t enum_index;
struct winreg_StringBuf *name;/* [ref] */
- struct winreg_StringBuf **keyclass;/* [ref] */
- NTTIME **last_changed_time;/* [ref] */
+ struct winreg_StringBuf *keyclass;/* [unique] */
+ NTTIME *last_changed_time;/* [unique] */
} in;
struct {
struct winreg_StringBuf *name;/* [ref] */
- struct winreg_StringBuf **keyclass;/* [ref] */
- NTTIME **last_changed_time;/* [ref] */
+ struct winreg_StringBuf *keyclass;/* [unique] */
+ NTTIME *last_changed_time;/* [unique] */
WERROR result;
} out;
diff --git a/source3/librpc/idl/winreg.idl b/source3/librpc/idl/winreg.idl
index 51476fe75d..c4907a199f 100644
--- a/source3/librpc/idl/winreg.idl
+++ b/source3/librpc/idl/winreg.idl
@@ -114,7 +114,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
[in] winreg_AccessMask access_mask,
[in,unique] winreg_SecBuf *secdesc,
[out,ref] policy_handle *new_handle,
- [in,out,ref] winreg_CreateAction **action_taken
+ [in,out,unique] winreg_CreateAction *action_taken
);
/******************/
@@ -146,8 +146,8 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
[in,ref] policy_handle *handle,
[in] uint32 enum_index,
[in,out,ref] winreg_StringBuf *name,
- [in,out,ref] winreg_StringBuf **keyclass,
- [in,out,ref] NTTIME **last_changed_time
+ [in,out,unique] winreg_StringBuf *keyclass,
+ [in,out,unique] NTTIME *last_changed_time
);
typedef struct {
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c
index 79a2d82ae1..52de236bce 100644
--- a/source3/rpc_server/srv_winreg_nt.c
+++ b/source3/rpc_server/srv_winreg_nt.c
@@ -574,10 +574,7 @@ WERROR _winreg_GetVersion(pipes_struct *p, struct policy_handle *handle, uint32_
Implementation of REG_ENUM_KEY
****************************************************************************/
-WERROR _winreg_EnumKey(pipes_struct *p, struct policy_handle *handle,
- uint32_t enum_index, struct winreg_StringBuf *name,
- struct winreg_StringBuf **keyclass,
- NTTIME **last_changed_time)
+WERROR _winreg_EnumKey(pipes_struct *p, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf *keyclass, NTTIME *last_changed_time)
{
WERROR status = WERR_OK;
struct regkey_info *info = find_regkey_info_by_hnd( p, handle );
@@ -616,12 +613,10 @@ WERROR _winreg_EnumKey(pipes_struct *p, struct policy_handle *handle,
p->mem_ctx, info->subkey_cache->subkeys[enum_index]))) {
status = WERR_NOMEM;
}
- if ( *last_changed_time ) {
- **last_changed_time = 0;
- }
- if ( *keyclass ) {
- (*keyclass)->name = "";
+ if ( last_changed_time ) {
+ *last_changed_time = 0;
}
+ keyclass->name = "";
return status;
}
@@ -1201,7 +1196,7 @@ WERROR _winreg_CreateKey( pipes_struct *p, struct policy_handle *handle,
uint32_t options, uint32_t access_mask,
struct winreg_SecBuf *secdesc,
struct policy_handle *new_handle,
- enum winreg_CreateAction **action_taken )
+ enum winreg_CreateAction *action_taken )
{
struct regkey_info *parent = find_regkey_info_by_hnd(p, handle);
struct regkey_info *newparentinfo, *keyinfo;
@@ -1293,8 +1288,8 @@ WERROR _winreg_CreateKey( pipes_struct *p, struct policy_handle *handle,
/* FIXME: report the truth here */
- if ( *action_taken ) {
- **action_taken = REG_CREATED_NEW_KEY;
+ if ( action_taken ) {
+ *action_taken = REG_CREATED_NEW_KEY;
}
done: