summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-18 11:25:15 +0100
committerGünther Deschner <gd@samba.org>2009-03-18 11:55:54 +0100
commitef0234256296451517b65113d9f5cfcffa95d736 (patch)
tree14da5f9cc58aaaa2ae9f08b996ba7ce1a1f71a39
parentf68334129409d1e194877689bb6a691ac4025dc9 (diff)
downloadsamba-ef0234256296451517b65113d9f5cfcffa95d736.tar.gz
samba-ef0234256296451517b65113d9f5cfcffa95d736.tar.bz2
samba-ef0234256296451517b65113d9f5cfcffa95d736.zip
s3-spoolss: add registry_value_to_printer_enum_value.
Guenther
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index c9cb5d11ad..97223c90ff 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8982,6 +8982,37 @@ WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
return status;
}
+/****************************************************************
+****************************************************************/
+
+static WERROR registry_value_to_printer_enum_value(TALLOC_CTX *mem_ctx,
+ REGISTRY_VALUE *v,
+ struct spoolss_PrinterEnumValues *r)
+{
+ WERROR result;
+
+ r->data = TALLOC_ZERO_P(mem_ctx, union spoolss_PrinterData);
+ W_ERROR_HAVE_NO_MEMORY(r->data);
+
+ r->value_name = talloc_strdup(mem_ctx, regval_name(v));
+ W_ERROR_HAVE_NO_MEMORY(r->value_name);
+
+ r->type = regval_type(v);
+ r->data_length = regval_size(v);
+
+ if (r->data_length) {
+ DATA_BLOB blob = data_blob_const(regval_data_p(v),
+ regval_size(v));
+ result = pull_spoolss_PrinterData(mem_ctx, &blob,
+ r->data,
+ r->type);
+ if (!W_ERROR_IS_OK(result)) {
+ return result;
+ }
+ }
+
+ return WERR_OK;
+}
/********************************************************************
* spoolss_enumprinterdataex