[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-417-gb217dd6
Günther Deschner
gd at samba.org
Tue Mar 25 09:58:17 GMT 2008
The branch, v3-2-test has been updated
via b217dd674e22b6a7cc492f1a84a37ddc4ddca663 (commit)
via 1570e1c597b43d83318860590b58e32143275f82 (commit)
via 0dac766109a0f76fd27832f5344460f1afdb2046 (commit)
from 36f8bafbd3dee66a869aa26cfc2eb4aa62019325 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit b217dd674e22b6a7cc492f1a84a37ddc4ddca663
Author: Günther Deschner <gd at samba.org>
Date: Tue Mar 25 10:11:47 2008 +0100
Fix _winreg_QueryValue().
Guenther
commit 1570e1c597b43d83318860590b58e32143275f82
Author: Günther Deschner <gd at samba.org>
Date: Mon Mar 24 11:48:16 2008 +0100
Re-run make idl.
Guenther
commit 0dac766109a0f76fd27832f5344460f1afdb2046
Author: Günther Deschner <gd at samba.org>
Date: Mon Mar 24 11:46:51 2008 +0100
Fix IDL for winreg_QueryValue.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/librpc/gen_ndr/cli_winreg.c | 2 +-
source/librpc/gen_ndr/cli_winreg.h | 2 +-
source/librpc/gen_ndr/ndr_winreg.c | 19 ++++++++++++++++---
source/librpc/gen_ndr/winreg.h | 2 +-
source/librpc/idl/winreg.idl | 2 +-
source/rpc_server/srv_winreg_nt.c | 14 +++++++-------
6 files changed, 27 insertions(+), 14 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/librpc/gen_ndr/cli_winreg.c b/source/librpc/gen_ndr/cli_winreg.c
index 1c691e3..38083a2 100644
--- a/source/librpc/gen_ndr/cli_winreg.c
+++ b/source/librpc/gen_ndr/cli_winreg.c
@@ -887,7 +887,7 @@ NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
- struct winreg_String value_name,
+ struct winreg_String *value_name,
enum winreg_Type *type,
uint8_t *data,
uint32_t *data_size,
diff --git a/source/librpc/gen_ndr/cli_winreg.h b/source/librpc/gen_ndr/cli_winreg.h
index 9ba4688..361fcff 100644
--- a/source/librpc/gen_ndr/cli_winreg.h
+++ b/source/librpc/gen_ndr/cli_winreg.h
@@ -124,7 +124,7 @@ NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
- struct winreg_String value_name,
+ struct winreg_String *value_name,
enum winreg_Type *type,
uint8_t *data,
uint32_t *data_size,
diff --git a/source/librpc/gen_ndr/ndr_winreg.c b/source/librpc/gen_ndr/ndr_winreg.c
index cd16a14..3301dd3 100644
--- a/source/librpc/gen_ndr/ndr_winreg.c
+++ b/source/librpc/gen_ndr/ndr_winreg.c
@@ -2470,7 +2470,10 @@ static enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int fl
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
- NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value_name));
+ if (r->in.value_name == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type));
if (r->in.type) {
NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type));
@@ -2523,6 +2526,7 @@ static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int fl
uint32_t _ptr_data_size;
uint32_t _ptr_value_length;
TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_value_name_0;
TALLOC_CTX *_mem_save_type_0;
TALLOC_CTX *_mem_save_data_0;
TALLOC_CTX *_mem_save_data_size_0;
@@ -2537,7 +2541,13 @@ static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int fl
NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value_name));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.value_name);
+ }
+ _mem_save_value_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.value_name, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_name_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type));
if (_ptr_type) {
NDR_PULL_ALLOC(ndr, r->in.type);
@@ -2683,7 +2693,10 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
ndr->depth++;
ndr_print_policy_handle(ndr, "handle", r->in.handle);
ndr->depth--;
- ndr_print_winreg_String(ndr, "value_name", &r->in.value_name);
+ ndr_print_ptr(ndr, "value_name", r->in.value_name);
+ ndr->depth++;
+ ndr_print_winreg_String(ndr, "value_name", r->in.value_name);
+ ndr->depth--;
ndr_print_ptr(ndr, "type", r->in.type);
ndr->depth++;
if (r->in.type) {
diff --git a/source/librpc/gen_ndr/winreg.h b/source/librpc/gen_ndr/winreg.h
index 5570b31..e765890 100644
--- a/source/librpc/gen_ndr/winreg.h
+++ b/source/librpc/gen_ndr/winreg.h
@@ -381,7 +381,7 @@ struct winreg_QueryInfoKey {
struct winreg_QueryValue {
struct {
struct policy_handle *handle;/* [ref] */
- struct winreg_String value_name;
+ struct winreg_String *value_name;/* [ref] */
enum winreg_Type *type;/* [unique] */
uint8_t *data;/* [unique,length_is(*value_length),size_is(*data_size)] */
uint32_t *data_size;/* [unique] */
diff --git a/source/librpc/idl/winreg.idl b/source/librpc/idl/winreg.idl
index f7a61ec..2183a2c 100644
--- a/source/librpc/idl/winreg.idl
+++ b/source/librpc/idl/winreg.idl
@@ -242,7 +242,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/* Function: 0x11 */
WERROR winreg_QueryValue(
[in,ref] policy_handle *handle,
- [in] winreg_String value_name,
+ [in,ref] winreg_String *value_name,
[in,out,unique] winreg_Type *type,
[in,out,unique,size_is(*data_size),length_is(*value_length)] uint8 *data,
[in,out,unique] uint32 *data_size,
diff --git a/source/rpc_server/srv_winreg_nt.c b/source/rpc_server/srv_winreg_nt.c
index 6e076ea..bf28ba6 100644
--- a/source/rpc_server/srv_winreg_nt.c
+++ b/source/rpc_server/srv_winreg_nt.c
@@ -238,7 +238,7 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
/* Handle QueryValue calls on HKEY_PERFORMANCE_DATA */
if(regkey->key->type == REG_KEY_HKPD)
{
- if(strequal(r->in.value_name.name, "Global")) {
+ if (strequal(r->in.value_name->name, "Global")) {
if (!prs_init(&prs_hkpd, *r->in.data_size, p->mem_ctx, MARSHALL))
return WERR_NOMEM;
status = reg_perfcount_get_hkpd(
@@ -246,32 +246,32 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
outbuf = (uint8_t *)prs_hkpd.data_p;
free_prs = True;
}
- else if(strequal(r->in.value_name.name, "Counter 009")) {
+ else if (strequal(r->in.value_name->name, "Counter 009")) {
outbuf_size = reg_perfcount_get_counter_names(
reg_perfcount_get_base_index(),
(char **)(void *)&outbuf);
free_buf = True;
}
- else if(strequal(r->in.value_name.name, "Explain 009")) {
+ else if (strequal(r->in.value_name->name, "Explain 009")) {
outbuf_size = reg_perfcount_get_counter_help(
reg_perfcount_get_base_index(),
(char **)(void *)&outbuf);
free_buf = True;
}
- else if(isdigit(r->in.value_name.name[0])) {
+ else if (isdigit(r->in.value_name->name[0])) {
/* we probably have a request for a specific object
* here */
if (!prs_init(&prs_hkpd, *r->in.data_size, p->mem_ctx, MARSHALL))
return WERR_NOMEM;
status = reg_perfcount_get_hkpd(
&prs_hkpd, *r->in.data_size, &outbuf_size,
- r->in.value_name.name);
+ r->in.value_name->name);
outbuf = (uint8_t *)prs_hkpd.data_p;
free_prs = True;
}
else {
DEBUG(3,("Unsupported key name [%s] for HKPD.\n",
- r->in.value_name.name));
+ r->in.value_name->name));
return WERR_BADFILE;
}
@@ -280,7 +280,7 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
else {
struct registry_value *val;
- status = reg_queryvalue(p->mem_ctx, regkey, r->in.value_name.name,
+ status = reg_queryvalue(p->mem_ctx, regkey, r->in.value_name->name,
&val);
if (!W_ERROR_IS_OK(status)) {
if (r->out.data_size) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list