diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/idl/spoolss.idl | 11 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss.c | 54 |
2 files changed, 63 insertions, 2 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl index 29b114b577..15d1d12da0 100644 --- a/source4/librpc/idl/spoolss.idl +++ b/source4/librpc/idl/spoolss.idl @@ -336,7 +336,12 @@ /******************/ /* Function: 0x1b */ - WERROR spoolss_SetPrinterData( + WERROR spoolss_SetPrinterData( + [in,ref] policy_handle *handle, + [in] unistr value_name, + [in] uint32 type, + [in] DATA_BLOB buffer, + [in] uint32 real_len ); /******************/ @@ -644,7 +649,9 @@ /******************/ /* Function: 0x49 */ - WERROR spoolss_49( + WERROR spoolss_DeletePrinterData( + [in,ref] policy_handle *handle, + [in] unistr value_name ); /******************/ diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index fc6cbae135..bd89663c57 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -482,6 +482,56 @@ BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +BOOL test_DeletePrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, char *value_name) +{ + NTSTATUS status; + struct spoolss_DeletePrinterData r; + + r.in.handle = handle; + r.in.value_name = value_name; + + printf("Testing DeletePrinterData\n"); + + status = dcerpc_spoolss_DeletePrinterData(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("DeletePrinterData failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} + +BOOL test_SetPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct spoolss_SetPrinterData r; + char *value_name = "spottyfoot"; + + r.in.handle = handle; + r.in.value_name = value_name; + r.in.type = 0; + r.in.buffer = data_blob_talloc(mem_ctx, "dog", 4); + r.in.real_len = 4; + + printf("Testing SetPrinterData\n"); + + status = dcerpc_spoolss_SetPrinterData(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("SetPrinterData failed - %s\n", nt_errstr(status)); + return False; + } + + if (!test_DeletePrinterData(p, mem_ctx, handle, value_name)) { + return False; + } + + return True; +} + static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, const char *name) { @@ -582,6 +632,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_SetPrinterData(p, mem_ctx, &handle)) { + ret = False; + } + if (!test_ClosePrinter(p, mem_ctx, &handle)) { ret = False; } |