summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-16 16:52:37 +0100
committerGünther Deschner <gd@samba.org>2009-03-17 10:53:24 +0100
commit9a8f19672de6ec00bbd95a1a72e6ef2a79ed7d81 (patch)
tree907cf2b64c43e231d7338a2860f37a930640576b
parent88ca3e17432c3a9efe30b122eea491400de4bdfc (diff)
downloadsamba-9a8f19672de6ec00bbd95a1a72e6ef2a79ed7d81.tar.gz
samba-9a8f19672de6ec00bbd95a1a72e6ef2a79ed7d81.tar.bz2
samba-9a8f19672de6ec00bbd95a1a72e6ef2a79ed7d81.zip
s3-spoolss: add pull_spoolss_PrinterData().
Guenther
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/rpc_client/init_spoolss.c18
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c16
3 files changed, 38 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c4f57afedd..615cb16649 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5554,6 +5554,10 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *me
bool init_systemtime(struct spoolss_Time *r,
struct tm *unixtime);
+WERROR pull_spoolss_PrinterData(TALLOC_CTX *mem_ctx,
+ const DATA_BLOB *blob,
+ union spoolss_PrinterData *data,
+ enum winreg_Type type);
/* The following definitions come from rpc_client/init_lsa.c */
diff --git a/source3/rpc_client/init_spoolss.c b/source3/rpc_client/init_spoolss.c
index a6255adf3d..ddf0118429 100644
--- a/source3/rpc_client/init_spoolss.c
+++ b/source3/rpc_client/init_spoolss.c
@@ -40,3 +40,21 @@ bool init_systemtime(struct spoolss_Time *r,
return true;
}
+
+/*******************************************************************
+ ********************************************************************/
+
+WERROR pull_spoolss_PrinterData(TALLOC_CTX *mem_ctx,
+ const DATA_BLOB *blob,
+ union spoolss_PrinterData *data,
+ enum winreg_Type type)
+{
+ enum ndr_err_code ndr_err;
+ ndr_err = ndr_pull_union_blob(blob, mem_ctx, NULL, data, type,
+ (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterData);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return WERR_GENERAL_FAILURE;
+ }
+ return WERR_OK;
+}
+
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 950dc013b2..8ce0b28db0 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -2461,6 +2461,22 @@ WERROR set_printer_dataex( NT_PRINTER_INFO_LEVEL *printer, const char *key, cons
return add_printer_data( printer->info_2, key, value, type, data, real_len );
}
+/*******************************************************************
+ ********************************************************************/
+
+static WERROR push_spoolss_PrinterData(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
+ enum winreg_Type type,
+ union spoolss_PrinterData *data)
+{
+ enum ndr_err_code ndr_err;
+ ndr_err = ndr_push_union_blob(blob, mem_ctx, NULL, data, type,
+ (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return WERR_GENERAL_FAILURE;
+ }
+ return WERR_OK;
+}
+
/********************************************************************
GetPrinterData on a printer server Handle.
********************************************************************/