diff options
author | Gerald Carter <jerry@samba.org> | 2006-09-26 19:37:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:14:47 -0500 |
commit | 5935ea9da149b10f6969d892a238564894f478f4 (patch) | |
tree | 6db9fb56cdf74b3c0067f225efbe2ed3bdba39a8 /source3/rpc_server | |
parent | 16fecf78755d5be403e0bbd540d97378c0320ddf (diff) | |
download | samba-5935ea9da149b10f6969d892a238564894f478f4.tar.gz samba-5935ea9da149b10f6969d892a238564894f478f4.tar.bz2 samba-5935ea9da149b10f6969d892a238564894f478f4.zip |
r18929: * Clarify QueryValue IDL and regenerate code
* Fix server _winreg_Query_Value() implementation so that
usrmgr.exe starts now
(This used to be commit 435d7bfc37f430c462fcb53bf3a82fcddc809771)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_winreg_nt.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c index 91435fc87e..b874c5e5d1 100644 --- a/source3/rpc_server/srv_winreg_nt.c +++ b/source3/rpc_server/srv_winreg_nt.c @@ -350,7 +350,7 @@ WERROR _winreg_OpenKey(pipes_struct *p, struct policy_handle *parent_handle, str reg_reply_info ********************************************************************/ -WERROR _winreg_QueryValue(pipes_struct *p, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type *type, uint8_t *data, uint32_t *size, uint32_t *length) +WERROR _winreg_QueryValue(pipes_struct *p, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length) { WERROR status = WERR_BADFILE; char *name; @@ -362,7 +362,7 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct policy_handle *handle, struct if ( !regkey ) return WERR_BADFID; - *size = *length = *type = 0; + *value_length = *type = 0; DEBUG(7,("_reg_info: policy key name = [%s]\n", regkey->name)); DEBUG(7,("_reg_info: policy key type = [%08x]\n", regkey->type)); @@ -383,8 +383,8 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct policy_handle *handle, struct { uint32 outbuf_len; prs_struct prs_hkpd; - prs_init(&prs_hkpd, *size, p->mem_ctx, MARSHALL); - status = reg_perfcount_get_hkpd(&prs_hkpd, *size, &outbuf_len, NULL); + prs_init(&prs_hkpd, *data_size, p->mem_ctx, MARSHALL); + status = reg_perfcount_get_hkpd(&prs_hkpd, *data_size, &outbuf_len, NULL); regval_ctr_addvalue(regvals, "HKPD", REG_BINARY, prs_hkpd.data_p, outbuf_len); val = dup_registry_value(regval_ctr_specific_value(regvals, 0)); @@ -435,8 +435,8 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct policy_handle *handle, struct /* we probably have a request for a specific object here */ uint32 outbuf_len; prs_struct prs_hkpd; - prs_init(&prs_hkpd, *size, p->mem_ctx, MARSHALL); - status = reg_perfcount_get_hkpd(&prs_hkpd, *size, &outbuf_len, name); + prs_init(&prs_hkpd, *data_size, p->mem_ctx, MARSHALL); + status = reg_perfcount_get_hkpd(&prs_hkpd, *data_size, &outbuf_len, name); regval_ctr_addvalue(regvals, "HKPD", REG_BINARY, prs_hkpd.data_p, outbuf_len); @@ -465,17 +465,20 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct policy_handle *handle, struct } } + /* if we have a value then copy it to the output */ + if ( val ) { - *size = regval_size( val ); - *length = regval_size( val ); + *value_length = regval_size( val ); + *type = val->type; -#if 0 - if ( (*data = talloc_memdup( p->mem_ctx, regval_data_p(val), *size )) == NULL ) { - status = WERR_NOMEM; + if ( *data_size == 0 ) { + status = WERR_OK; + } else if ( *value_length > *data_size ) { + status = WERR_MORE_DATA; + } else { + memcpy( data, regval_data_p(val), *value_length ); + status = WERR_OK; } -#endif - - *type = val->type; } TALLOC_FREE( regvals ); |