summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2012-04-19 14:00:36 +0200
committerAndreas Schneider <asn@samba.org>2012-04-25 14:23:03 +0200
commitd14ca5d07abfc46c20bc87fc66314e9ede29b0ac (patch)
treedddecc9b72952fe0cf3baea0ace721999e4d5f33
parent4eb4f75371aa16bf19474090b1dbef042e9a0446 (diff)
downloadsamba-d14ca5d07abfc46c20bc87fc66314e9ede29b0ac.tar.gz
samba-d14ca5d07abfc46c20bc87fc66314e9ede29b0ac.tar.bz2
samba-d14ca5d07abfc46c20bc87fc66314e9ede29b0ac.zip
s3:registry: remove usage of reg_objects from cmd_spoolss.c
Signed-off-by: Andreas Schneider <asn@samba.org>
-rw-r--r--source3/rpcclient/cmd_spoolss.c43
1 files changed, 14 insertions, 29 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index b7451fc0ee..2733aa3265 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -27,7 +27,6 @@
#include "../librpc/gen_ndr/ndr_spoolss_c.h"
#include "rpc_client/cli_spoolss.h"
#include "rpc_client/init_spoolss.h"
-#include "registry/reg_objects.h"
#include "nt_printing.h"
#include "../libcli/security/display_sec.h"
#include "../libcli/security/security_descriptor.h"
@@ -764,25 +763,26 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
/****************************************************************************
****************************************************************************/
-static void display_reg_value(struct regval_blob *value)
+static void display_reg_value(const char *name, enum winreg_Type type, DATA_BLOB blob)
{
const char *text = NULL;
- DATA_BLOB blob;
- switch(regval_type(value)) {
+ switch(type) {
case REG_DWORD:
- printf("%s: REG_DWORD: 0x%08x\n", regval_name(value),
- *((uint32_t *) regval_data_p(value)));
+ if (blob.length == sizeof(uint32)) {
+ printf("%s: REG_DWORD: 0x%08x\n", name, IVAL(blob.data,0));
+ } else {
+ printf("%s: REG_DWORD: <invalid>\n", name);
+ }
break;
case REG_SZ:
- blob = data_blob_const(regval_data_p(value), regval_size(value));
pull_reg_sz(talloc_tos(), &blob, &text);
- printf("%s: REG_SZ: %s\n", regval_name(value), text ? text : "");
+ printf("%s: REG_SZ: %s\n", name, text ? text : "");
break;
case REG_BINARY: {
- char *hex = hex_encode_talloc(NULL, regval_data_p(value), regval_size(value));
+ char *hex = hex_encode_talloc(NULL, blob.data, blob.length);
size_t i, len;
- printf("%s: REG_BINARY:", regval_name(value));
+ printf("%s: REG_BINARY:", name);
len = strlen(hex);
for (i=0; i<len; i++) {
if (hex[i] == '\0') {
@@ -800,14 +800,13 @@ static void display_reg_value(struct regval_blob *value)
case REG_MULTI_SZ: {
uint32_t i;
const char **values;
- blob = data_blob_const(regval_data_p(value), regval_size(value));
if (!pull_reg_multi_sz(NULL, &blob, &values)) {
d_printf("pull_reg_multi_sz failed\n");
break;
}
- printf("%s: REG_MULTI_SZ: \n", regval_name(value));
+ printf("%s: REG_MULTI_SZ: \n", name);
for (i=0; values[i] != NULL; i++) {
d_printf("%s\n", values[i]);
}
@@ -815,7 +814,7 @@ static void display_reg_value(struct regval_blob *value)
break;
}
default:
- printf("%s: unknown type %d\n", regval_name(value), regval_type(value));
+ printf("%s: unknown type %d\n", name, type);
}
}
@@ -3043,22 +3042,8 @@ static WERROR cmd_spoolss_enum_data(struct rpc_pipe_client *cli,
r.in.enum_index++;
- {
- struct regval_blob *v;
-
- v = regval_compose(talloc_tos(),
- r.out.value_name,
- *r.out.type,
- r.out.data,
- r.in.data_offered);
- if (v == NULL) {
- result = WERR_NOMEM;
- goto done;
- }
-
- display_reg_value(v);
- talloc_free(v);
- }
+ display_reg_value(r.out.value_name, *r.out.type,
+ data_blob_const(r.out.data, r.in.data_offered));
} while (W_ERROR_IS_OK(r.out.result));