summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-04 15:39:59 +0100
committerGünther Deschner <gd@samba.org>2010-03-05 15:18:00 +0100
commitfbb6d00eed6bca960aa53a5967a2dea426cacfe2 (patch)
tree1e57d4dfcde1c9120a1249cadfb564fa30dbcaa3 /source3/rpc_server
parent63c0821b0b5c79afcff62e52891641cf42386e90 (diff)
downloadsamba-fbb6d00eed6bca960aa53a5967a2dea426cacfe2.tar.gz
samba-fbb6d00eed6bca960aa53a5967a2dea426cacfe2.tar.bz2
samba-fbb6d00eed6bca960aa53a5967a2dea426cacfe2.zip
s3-spoolss: fix _spoolss_GetPrinterDataEx after IDL change.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index a756eb64cc..a97ecdecaf 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8685,11 +8685,29 @@ WERROR _spoolss_GetPrinterDataEx(pipes_struct *p,
if (Printer->printer_type == SPLHND_SERVER) {
+ union spoolss_PrinterData data;
+
result = getprinterdata_printer_server(p->mem_ctx,
r->in.value_name,
r->out.type,
- r->out.data);
- goto done;
+ &data);
+ if (!W_ERROR_IS_OK(result)) {
+ goto done;
+ }
+
+ result = push_spoolss_PrinterData(p->mem_ctx, &blob,
+ *r->out.type, &data);
+ if (!W_ERROR_IS_OK(result)) {
+ goto done;
+ }
+
+ *r->out.needed = blob.length;
+
+ if (r->in.offered >= *r->out.needed) {
+ memcpy(r->out.data, blob.data, blob.length);
+ }
+
+ return SPOOLSS_BUFFER_OK(WERR_OK, WERR_MORE_DATA);
}
if (!get_printer_snum(p, r->in.handle, &snum, NULL)) {
@@ -8714,8 +8732,10 @@ WERROR _spoolss_GetPrinterDataEx(pipes_struct *p,
strequal(r->in.value_name, "ChangeId")) {
*r->out.type = REG_DWORD;
*r->out.needed = 4;
- r->out.data->value = printer->info_2->changeid;
- result = WERR_OK;
+ if (r->in.offered >= *r->out.needed) {
+ SIVAL(r->out.data, 0, printer->info_2->changeid);
+ result = WERR_OK;
+ }
goto done;
}
@@ -8736,12 +8756,9 @@ WERROR _spoolss_GetPrinterDataEx(pipes_struct *p,
*r->out.needed = regval_size(val);
*r->out.type = regval_type(val);
- blob = data_blob_const(regval_data_p(val), regval_size(val));
-
- result = pull_spoolss_PrinterData(p->mem_ctx, &blob,
- r->out.data,
- *r->out.type);
-
+ if (r->in.offered >= *r->out.needed) {
+ memcpy(r->out.data, regval_data_p(val), regval_size(val));
+ }
done:
if (printer) {
free_a_printer(&printer, 2);
@@ -8751,7 +8768,6 @@ WERROR _spoolss_GetPrinterDataEx(pipes_struct *p,
return result;
}
- *r->out.needed = ndr_size_spoolss_PrinterData(r->out.data, *r->out.type, NULL, 0);
*r->out.type = SPOOLSS_BUFFER_OK(*r->out.type, REG_NONE);
r->out.data = SPOOLSS_BUFFER_OK(r->out.data, r->out.data);