s3-spoolss: add pull_spoolss_PrinterData().
authorGünther Deschner <gd@samba.org>
Mon, 16 Mar 2009 15:52:37 +0000 (16:52 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 09:53:24 +0000 (10:53 +0100)
Guenther

source3/include/proto.h
source3/rpc_client/init_spoolss.c
source3/rpc_server/srv_spoolss_nt.c

index c4f57afeddb9561b21d67eb281d7360512854add..615cb1664905d6a2eb33c123a1121f2a5ff244ac 100644 (file)
@@ -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  */
 
index a6255adf3d833dad3e362257060acfefb2875513..ddf011842914ed745809c67f8d0818da0c660345 100644 (file)
@@ -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;
+}
+
index 950dc013b2dd079df17ddd2e19a326b0f8fd3ecf..8ce0b28db04aad39a678943403ddd480854a115d 100644 (file)
@@ -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.
 ********************************************************************/