summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-11-27 20:55:13 +0000
committerTim Potter <tpot@samba.org>2003-11-27 20:55:13 +0000
commitabff8aac56b2481de2223bf43ae2098cc7ab2391 (patch)
treec19ae74a74c3c5010dea9838f7ae5ede00ce722f
parent6aee8274ef8623ef6a374feae248c0e5e9a10a49 (diff)
downloadsamba-abff8aac56b2481de2223bf43ae2098cc7ab2391.tar.gz
samba-abff8aac56b2481de2223bf43ae2098cc7ab2391.tar.bz2
samba-abff8aac56b2481de2223bf43ae2098cc7ab2391.zip
Implemented SetForm RPC.
(This used to be commit bdb0dfc370b4deb9e7f5a381092538c3e502f191)
-rw-r--r--source4/librpc/idl/spoolss.idl6
-rw-r--r--source4/torture/rpc/spoolss.c27
2 files changed, 29 insertions, 4 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 99db12b34d..2d70372125 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -347,7 +347,11 @@
/******************/
/* 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 {
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 468484e471..c355b8d9bc 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -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,