diff options
author | Günther Deschner <gd@samba.org> | 2005-03-02 00:15:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:10:56 -0500 |
commit | 0dcd79b92ac2ad9ba1c60bf0c2cfb4e9e57cf3d1 (patch) | |
tree | f208789d1999ce63a7f5fb03192a95d94e76fe12 | |
parent | 70ae0bb3823b514c43ccf8a52a7b7a465f967fa2 (diff) | |
download | samba-0dcd79b92ac2ad9ba1c60bf0c2cfb4e9e57cf3d1.tar.gz samba-0dcd79b92ac2ad9ba1c60bf0c2cfb4e9e57cf3d1.tar.bz2 samba-0dcd79b92ac2ad9ba1c60bf0c2cfb4e9e57cf3d1.zip |
r5611: Add EnumPrinterDataEx-test (for now just for PrinterDriverData, we need
to enumerate (recursively!) over all keys with EnumPrinterKey later on.
Guenther
(This used to be commit 46ae4010f2293fb1933aacd2da582fcb1c0a5e1d)
-rw-r--r-- | source4/torture/rpc/spoolss.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 94ced04a98..7a9d8c3635 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -571,7 +571,7 @@ static BOOL test_GetPrinterDataEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } static BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - struct policy_handle *handle) + struct policy_handle *handle) { NTSTATUS status; struct spoolss_EnumPrinterData r; @@ -618,6 +618,38 @@ static BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +static BOOL test_EnumPrinterDataEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct spoolss_EnumPrinterDataEx r; + + r.in.handle = handle; + r.in.key_name = "PrinterDriverData"; + r.in.buf_size = 0; + + printf("Testing EnumPrinterDataEx\n"); + + status = dcerpc_spoolss_EnumPrinterDataEx(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("EnumPrinterDataEx failed - %s\n", nt_errstr(status)); + return False; + } + + r.in.buf_size = r.out.buf_size; + + status = dcerpc_spoolss_EnumPrinterDataEx(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("EnumPrinterDataEx failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} + + static BOOL test_DeletePrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *value_name) @@ -907,6 +939,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_EnumPrinterDataEx(p, mem_ctx, &handle)) { + ret = False; + } + if (!test_EnumJobs(p, mem_ctx, &handle)) { ret = False; } |