Implemented SetForm RPC.
authorTim Potter <tpot@samba.org>
Thu, 27 Nov 2003 20:55:13 +0000 (20:55 +0000)
committerTim Potter <tpot@samba.org>
Thu, 27 Nov 2003 20:55:13 +0000 (20:55 +0000)
source/librpc/idl/spoolss.idl
source/torture/rpc/spoolss.c

index 99db12b34d6ec78170315daf65c5f8d9ad638d1d..2d70372125860575f6d54b3d1edd6bdd8410391d 100644 (file)
 
        /******************/
        /* Function: 0x21 */
-       WERROR spoolss_21(
+       WERROR spoolss_SetForm(
+               [in,ref] policy_handle *handle,
+               [in] unistr form_name,
+               [in] uint32 level,
+               [in,switch_is(level)] spoolss_AddFormInfo info
        );
 
        typedef [nodiscriminant,public] union {
index 468484e471fca309ddda7bf652c2d8c266c86e72..c355b8d9bc7c3b66aa79f091c6503e9ce1a86506 100644 (file)
@@ -216,6 +216,7 @@ BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        struct spoolss_AddFormInfo1 form;
        NTSTATUS status;
        char *formname = "testform3";
+       BOOL ret = True;
 
        r.in.handle = handle;
        r.in.level = 1;
@@ -238,15 +239,35 @@ BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
        if (!W_ERROR_IS_OK(r.out.result)) {
                printf("AddForm failed - %s\n", nt_errstr(status));
-               /* Fall through to delete form */
+               goto done;
        }
 
+       {
+               struct spoolss_SetForm sf;
+
+               sf.in.handle = handle;
+               sf.in.form_name = formname;
+               sf.in.level = 1;
+               sf.in.info.info1 = &form;
+               form.width = 1234;
+
+               status = dcerpc_spoolss_SetForm(p, mem_ctx, &sf);
+
+               if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
+                       printf("SetForm failed - %s/%s\n", 
+                              nt_errstr(status), win_errstr(r.out.result));
+                       ret = False;
+                       /* Fall through to delete */
+               }
+       }
+
+ done:
        if (!test_DeleteForm(p, mem_ctx, handle, formname)) {
                printf("DeleteForm failed\n");
-               return False;
+               ret = False;
        }
 
-       return True;
+       return ret;
 }
 
 BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,