summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-25 20:50:34 +0100
committerGünther Deschner <gd@samba.org>2009-02-25 21:18:10 +0100
commitd86cb9b52d8cdaa03f856665f56278836e6336d3 (patch)
treef7bee6622ec2466fd152e840b1a39d60edc930b4 /source3/rpcclient
parent03efdcb7cb55f61d2b8cf419b25ed6d1eac1d3af (diff)
downloadsamba-d86cb9b52d8cdaa03f856665f56278836e6336d3.tar.gz
samba-d86cb9b52d8cdaa03f856665f56278836e6336d3.tar.bz2
samba-d86cb9b52d8cdaa03f856665f56278836e6336d3.zip
s3-rpcclient: support level 2 in spoolss_addform.
Guenther
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c54
1 files changed, 42 insertions, 12 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 51fcaaa54c..79cde704d2 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1814,11 +1814,13 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
const char *printername;
union spoolss_AddFormInfo info;
struct spoolss_AddFormInfo1 info1;
+ struct spoolss_AddFormInfo2 info2;
+ uint32_t level = 1;
/* Parse the command arguments */
- if (argc != 3) {
- printf ("Usage: %s <printer> <formname>\n", argv[0]);
+ if (argc < 3 || argc > 5) {
+ printf ("Usage: %s <printer> <formname> [level]\n", argv[0]);
return WERR_OK;
}
@@ -1835,23 +1837,51 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Dummy up some values for the form data */
- info1.flags = FORM_USER;
- info1.form_name = argv[2];
- info1.size.width = 100;
- info1.size.height = 100;
- info1.area.left = 0;
- info1.area.top = 10;
- info1.area.right = 20;
- info1.area.bottom = 30;
+ if (argc == 4) {
+ level = atoi(argv[3]);
+ }
- info.info1 = &info1;
+ switch (level) {
+ case 1:
+ info1.flags = FORM_USER;
+ info1.form_name = argv[2];
+ info1.size.width = 100;
+ info1.size.height = 100;
+ info1.area.left = 0;
+ info1.area.top = 10;
+ info1.area.right = 20;
+ info1.area.bottom = 30;
+
+ info.info1 = &info1;
+
+ break;
+ case 2:
+ info2.flags = FORM_USER;
+ info2.form_name = argv[2];
+ info2.size.width = 100;
+ info2.size.height = 100;
+ info2.area.left = 0;
+ info2.area.top = 10;
+ info2.area.right = 20;
+ info2.area.bottom = 30;
+ info2.keyword = argv[2];
+ info2.string_type = SPOOLSS_FORM_STRING_TYPE_NONE;
+ info2.mui_dll = NULL;
+ info2.ressource_id = 0;
+ info2.display_name = argv[2];
+ info2.lang_id = 0;
+
+ info.info2 = &info2;
+
+ break;
+ }
/* Add the form */
status = rpccli_spoolss_AddForm(cli, mem_ctx,
&handle,
- 1,
+ level,
info,
&werror);