diff options
author | Tim Potter <tpot@samba.org> | 2003-11-18 05:54:14 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-11-18 05:54:14 +0000 |
commit | 30daed2f7cc4baa69a31f139aaa5b5b260febc15 (patch) | |
tree | 9fd793b1298078891619dbb714ffd134b6048855 /source4/torture/rpc | |
parent | 06d0f61aa43c0ab08dc122c9a3b41f9fc453fcbc (diff) | |
download | samba-30daed2f7cc4baa69a31f139aaa5b5b260febc15.tar.gz samba-30daed2f7cc4baa69a31f139aaa5b5b260febc15.tar.bz2 samba-30daed2f7cc4baa69a31f139aaa5b5b260febc15.zip |
Working on EnumPrinterData. There appears to be an alignment problem
after reading a non-empty DATA_BLOB in the reply.
(This used to be commit 3165bf532f6b5a074f20f38a9af56325eedbb1c2)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 53e25a3e14..9009c8e99a 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -87,6 +87,47 @@ BOOL test_ClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct spoolss_EnumPrinterData r; + + r.in.handle = handle; + r.in.enum_index = 0; + + do { + uint32 data_size; + + r.in.value_offered = 0; + data_size = 0; + r.in.data_size = &data_size; + r.out.data_size = &data_size; + + printf("Testing EnumPrinterData\n"); + + status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("EnumPrinterData failed - %s\n", nt_errstr(status)); + return False; + } + + r.in.value_offered = r.out.value_needed; + + status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("EnumPrinterData failed - %s\n", nt_errstr(status)); + return False; + } + + r.in.enum_index++; + } while (1); + + return True; +} + static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, const char *name) { @@ -170,6 +211,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_EnumPrinterData(p, mem_ctx, &handle)) { + ret = False; + } + if (!test_ClosePrinter(p, mem_ctx, &handle)) { ret = False; } |