s3-spoolss: add rpccli_spoolss_enumprinterkey convenience wrapper.
authorGünther Deschner <gd@samba.org>
Mon, 16 Mar 2009 20:41:11 +0000 (21:41 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 11:18:28 +0000 (12:18 +0100)
Guenther

source3/include/proto.h
source3/rpc_client/cli_spoolss.c

index e73237daff35ee76b7afc497698f140d56aa7c1f..4b9582226322f91e392b3315d7578ff1dbf5a3ce 100644 (file)
@@ -5540,6 +5540,12 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli,
                                     uint32_t offered,
                                     enum winreg_Type *type,
                                     union spoolss_PrinterData *data);
                                     uint32_t offered,
                                     enum winreg_Type *type,
                                     union spoolss_PrinterData *data);
+WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle,
+                                    const char *key_name,
+                                    const char ***key_buffer,
+                                    uint32_t offered);
 WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                                     POLICY_HND *hnd, const char *keyname, 
                                     REGVAL_CTR *ctr);
 WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                                     POLICY_HND *hnd, const char *keyname, 
                                     REGVAL_CTR *ctr);
index 66e760c6f3d499379e79fd5c793dadf38f7b5060..696fcd10589a6d83b99433a272d086d54d1caf76 100644 (file)
@@ -746,6 +746,45 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli,
        return werror;
 }
 
        return werror;
 }
 
+/**********************************************************************
+ convencience wrapper around rpccli_spoolss_EnumPrinterKey
+**********************************************************************/
+
+WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle,
+                                    const char *key_name,
+                                    const char ***key_buffer,
+                                    uint32_t offered)
+{
+       NTSTATUS status;
+       WERROR werror;
+       uint32_t needed;
+
+       status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx,
+                                              handle,
+                                              key_name,
+                                              key_buffer,
+                                              offered,
+                                              &needed,
+                                              &werror);
+
+       if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) {
+               offered = needed;
+
+               status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx,
+                                                      handle,
+                                                      key_name,
+                                                      key_buffer,
+                                                      offered,
+                                                      &needed,
+                                                      &werror);
+       }
+
+       return werror;
+}
+
+
 /*********************************************************************
  Decode various spoolss rpc's and info levels
  ********************************************************************/
 /*********************************************************************
  Decode various spoolss rpc's and info levels
  ********************************************************************/