summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-16 11:36:59 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-16 11:36:59 +0000
commitea266c0625e04a2dc10d25c2fee7b685965fcd3e (patch)
tree3db57fa36d79ab2df9adf6d7faa37f7d644b83b7 /source4/torture/rpc
parent0c5759a4b2615b9c57ee7de04275ced1fc7d19cb (diff)
downloadsamba-ea266c0625e04a2dc10d25c2fee7b685965fcd3e.tar.gz
samba-ea266c0625e04a2dc10d25c2fee7b685965fcd3e.tar.bz2
samba-ea266c0625e04a2dc10d25c2fee7b685965fcd3e.zip
added support for level1 of EnumPrinters in spoolss. This uses a
number of "magic" add-ons to IDL to make it less painful, hopefully this will make IDL generation useful for horrible systems like spoolss (This used to be commit e18dba7d5a957ef82e8f91733a0bf95d579dcd7a)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/spoolss.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index e83e63eea4..e0aa429ae7 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -25,34 +25,37 @@ static BOOL test_EnumPrinters(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
struct spoolss_EnumPrinters r;
NTSTATUS status;
+ uint32 needed = 0;
r.in.flags = 0x02;
- r.in.server = "\\\\movingforward";
+ r.in.server = "";
r.in.level = 1;
- r.in.buffer = NULL;
- r.in.offered = 0;
+ r.in.buf = NULL;
+ r.in.offered = needed;
+ r.out.needed = &needed;
status = dcerpc_spoolss_EnumPrinters(p, mem_ctx, &r);
-
if (NT_STATUS_IS_ERR(status)) {
- printf("OpenPrinter failed - %s\n", nt_errstr(status));
+ printf("EnumPrinters failed - %s\n", nt_errstr(status));
return False;
}
if (NT_STATUS_V(status) == 0x0000007a) {
- struct uint8_buf buffer;
-
- r.in.offered = r.out.needed;
- buffer.size = r.out.needed;
- buffer.data = talloc(mem_ctx, buffer.size);
- memset(buffer.data, 0xfe, buffer.size);
- r.in.buffer = &buffer;
+ r.in.buf = talloc(mem_ctx, needed);
+ if (!r.in.buf) {
+ return False;
+ }
+ memset(r.in.buf, 0xfe, needed);
+ r.in.offered = needed;
status = dcerpc_spoolss_EnumPrinters(p, mem_ctx, &r);
}
if (!NT_STATUS_IS_OK(status)) {
- printf("OpenPrinter failed - %s\n", nt_errstr(status));
- return False;
+ printf("EnumPrinters failed - %s\n", nt_errstr(status));
+ }
+
+ if (r.out.info) {
+ NDR_PRINT_UNION_DEBUG(spoolss_PrinterEnum, r.in.level, r.out.info);
}
return True;