mirror of
https://github.com/samba-team/samba.git
synced 2025-03-04 16:58:42 +03:00
r1226: Return dummy information for two printers. Note that ndr_push_array()
can be used here - neat! (This used to be commit 5d0013438e6f838da44e6c7e74e4c49d477da3f1)
This commit is contained in:
parent
c400f86707
commit
a38429269e
@ -32,17 +32,24 @@ static WERROR spoolss_EnumPrinters(struct dcesrv_call_state *dce_call, TALLOC_CT
|
||||
struct spoolss_EnumPrinters *r)
|
||||
{
|
||||
struct ndr_push *buf;
|
||||
struct spoolss_PrinterInfo1 info;
|
||||
struct spoolss_PrinterInfo1 info[2];
|
||||
WERROR result;
|
||||
|
||||
info.flags = 0;
|
||||
info.name = "p";
|
||||
info.description = "a printer";
|
||||
info.comment = "a comment";
|
||||
info[0].flags = 0x80;
|
||||
info[0].name = "p";
|
||||
info[0].description = "a printer";
|
||||
info[0].comment = "a comment";
|
||||
|
||||
info[1].flags = 0x80;
|
||||
info[1].name = "p2";
|
||||
info[1].description = "spottyfoot";
|
||||
info[1].comment = "the doggy";
|
||||
|
||||
buf = ndr_push_init();
|
||||
|
||||
ndr_push_spoolss_PrinterInfo1(buf, NDR_SCALARS|NDR_BUFFERS, &info);
|
||||
ndr_push_array(buf, NDR_SCALARS|NDR_BUFFERS, info,
|
||||
sizeof(struct spoolss_PrinterInfo1), 2,
|
||||
(ndr_push_const_fn_t)ndr_push_spoolss_PrinterInfo1);
|
||||
|
||||
if (*r->in.buf_size < buf->offset) {
|
||||
*r->out.buf_size = buf->offset;
|
||||
@ -59,7 +66,7 @@ static WERROR spoolss_EnumPrinters(struct dcesrv_call_state *dce_call, TALLOC_CT
|
||||
|
||||
*r->out.buffer = data_blob_talloc(mem_ctx, buf->data, buf->offset);
|
||||
|
||||
r->out.count = 1;
|
||||
r->out.count = 2;
|
||||
*r->out.buf_size = buf->offset;
|
||||
|
||||
result = WERR_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user