diff options
author | Günther Deschner <gd@samba.org> | 2010-04-29 02:39:44 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-29 12:05:42 +0200 |
commit | 2b1dae366217528dde13757fa64cf6b9d408a342 (patch) | |
tree | afe5d669bd880865a294e241c24125a8d3bc26bc /source4 | |
parent | 1467b0e6f6162e67087374d0f78e16a38794a41a (diff) | |
download | samba-2b1dae366217528dde13757fa64cf6b9d408a342.tar.gz samba-2b1dae366217528dde13757fa64cf6b9d408a342.tar.bz2 samba-2b1dae366217528dde13757fa64cf6b9d408a342.zip |
s4-smbtorture: implement and test level 3 and 5 of PrintQEnum RAP.
Guenther
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rap/printing.c | 2 | ||||
-rw-r--r-- | source4/torture/rap/rap.c | 47 |
2 files changed, 46 insertions, 3 deletions
diff --git a/source4/torture/rap/printing.c b/source4/torture/rap/printing.c index b57151aee1..7030c39436 100644 --- a/source4/torture/rap/printing.c +++ b/source4/torture/rap/printing.c @@ -68,7 +68,7 @@ static bool test_netprintqenum(struct torture_context *tctx, { struct rap_NetPrintQEnum r; int i, q; - uint16_t levels[] = { 0, 1 }; + uint16_t levels[] = { 0, 1, 3, 5 }; NTSTATUS status; for (i=0; i < ARRAY_SIZE(levels); i++) { diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c index 49d55b1162..a81516af6c 100644 --- a/source4/torture/rap/rap.c +++ b/source4/torture/rap/rap.c @@ -582,7 +582,7 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree, NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.count)); NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.available)); - r->out.info = talloc_array(mem_ctx, union rap_printq_info, r->out.count); + r->out.info = talloc_zero_array(mem_ctx, union rap_printq_info, r->out.count); if (r->out.info == NULL) { result = NT_STATUS_NO_MEMORY; @@ -625,8 +625,51 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree, NDR_SCALARS, &r->out.info[i].info1.PrintQStatus)); NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data, NDR_SCALARS, &r->out.info[i].info1.PrintJobCount)); - break; + case 3: + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.PrintQueueName)); + NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data, + NDR_SCALARS, &r->out.info[i].info3.Priority)); + NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data, + NDR_SCALARS, &r->out.info[i].info3.StartTime)); + NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data, + NDR_SCALARS, &r->out.info[i].info3.UntilTime)); + NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data, + NDR_SCALARS, &r->out.info[i].info3.Pad)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.SeparatorPageFilename)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.PrintProcessorDllName)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.PrintParameterString)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.CommentString)); + NDR_GOTO(ndr_pull_rap_PrintQStatusCode(call->ndr_pull_data, + NDR_SCALARS, &r->out.info[i].info3.PrintQStatus)); + NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data, + NDR_SCALARS, &r->out.info[i].info3.PrintJobCount)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.Printers)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.DriverName)); + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info3.PrintDriverData)); + break; + case 5: + RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data, + r->out.convert, + &r->out.info[i].info5.PrintQueueName)); + break; + } } |