s3-spoolss: use rpccli_spoolss_DeleteForm.
authorGünther Deschner <gd@samba.org>
Sat, 15 Nov 2008 21:16:51 +0000 (22:16 +0100)
committerGünther Deschner <gd@samba.org>
Sat, 7 Feb 2009 00:52:28 +0000 (01:52 +0100)
Guenther

source3/include/proto.h
source3/rpc_client/cli_spoolss.c
source3/rpc_parse/parse_spoolss.c
source3/rpcclient/cmd_spoolss.c

index 3aad313..aae8dbf 100644 (file)
@@ -5475,8 +5475,6 @@ WERROR rpccli_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 WERROR rpccli_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                           POLICY_HND *handle, const char *formname, 
                           uint32 level, FORM_1 *form);
-WERROR rpccli_spoolss_deleteform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-                             POLICY_HND *handle, const char *form_name);
 WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                             POLICY_HND *handle, int level, uint32 *num_forms,
                             FORM_1 **forms);
@@ -6116,8 +6114,6 @@ bool make_spoolss_q_addform(SPOOL_Q_ADDFORM *q_u, POLICY_HND *handle,
                            int level, FORM *form);
 bool make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle, 
                            int level, const char *form_name, FORM *form);
-bool make_spoolss_q_deleteform(SPOOL_Q_DELETEFORM *q_u, POLICY_HND *handle, 
-                              const char *form);
 bool make_spoolss_q_getform(SPOOL_Q_GETFORM *q_u, POLICY_HND *handle, 
                             const char *formname, uint32 level, 
                            RPC_BUFFER *buffer, uint32 offered);
index dcf4954..d429315 100644 (file)
@@ -1261,31 +1261,6 @@ WERROR rpccli_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 /**********************************************************************
 **********************************************************************/
 
-WERROR rpccli_spoolss_deleteform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-                             POLICY_HND *handle, const char *form_name)
-{
-       prs_struct qbuf, rbuf;
-       SPOOL_Q_DELETEFORM in;
-       SPOOL_R_DELETEFORM out;
-
-       ZERO_STRUCT(in);
-       ZERO_STRUCT(out);
-
-        make_spoolss_q_deleteform( &in, handle, form_name );
-       
-       CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_DELETEFORM,
-                   in, out, 
-                   qbuf, rbuf,
-                   spoolss_io_q_deleteform,
-                   spoolss_io_r_deleteform, 
-                   WERR_GENERAL_FAILURE );
-                   
-       return out.status;
-}
-
-/**********************************************************************
-**********************************************************************/
-
 WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                             POLICY_HND *handle, int level, uint32 *num_forms,
                             FORM_1 **forms)
index 9d2a7ef..0a77396 100644 (file)
@@ -7079,18 +7079,6 @@ bool make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle,
        return True;
 }
 
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_deleteform(SPOOL_Q_DELETEFORM *q_u, POLICY_HND *handle, 
-                              const char *form)
-{
-       memcpy(&q_u->handle, handle, sizeof(POLICY_HND));
-       init_unistr2(&q_u->name, form, UNI_STR_TERMINATE);
-       return True;
-}
-
 /*******************************************************************
  * init a structure.
  ********************************************************************/
index 057fc25..8003180 100644 (file)
@@ -1869,6 +1869,7 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
 {
        POLICY_HND handle;
        WERROR werror;
+       NTSTATUS status;
        char *servername = NULL, *printername = NULL;
        bool got_handle = False;
        
@@ -1901,7 +1902,13 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
 
        /* Delete the form */
 
-       werror = rpccli_spoolss_deleteform(cli, mem_ctx, &handle, argv[2]);
+       status = rpccli_spoolss_DeleteForm(cli, mem_ctx,
+                                          &handle,
+                                          argv[2],
+                                          &werror);
+       if (!NT_STATUS_IS_OK(status)) {
+               return ntstatus_to_werror(status);
+       }
 
  done:
        if (got_handle)