diff options
author | Tim Potter <tpot@samba.org> | 2003-11-28 11:50:33 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-11-28 11:50:33 +0000 |
commit | 2bb7ff5915bf349e1420152b2be7f297424c7ec6 (patch) | |
tree | 60858a605bf50ead1871a7288cc283f85b4f46f2 /source4 | |
parent | d55fc1c9f28414a0182e571d5b5d60b4a3d2b1d9 (diff) | |
download | samba-2bb7ff5915bf349e1420152b2be7f297424c7ec6.tar.gz samba-2bb7ff5915bf349e1420152b2be7f297424c7ec6.tar.bz2 samba-2bb7ff5915bf349e1420152b2be7f297424c7ec6.zip |
GetPrinterDataEx, SetPrinterDataEx, DeletePrinterDataEx.
(This used to be commit e8367f57356bc3da78a6217158f9d639ba4ca5fa)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/idl/spoolss.idl | 24 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss.c | 41 |
2 files changed, 61 insertions, 4 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl index 15d1d12da0..69d929561b 100644 --- a/source4/librpc/idl/spoolss.idl +++ b/source4/librpc/idl/spoolss.idl @@ -671,17 +671,30 @@ /******************/ /* Function: 0x4d */ - WERROR spoolss_4d( + WERROR spoolss_SetPrinterDataEx( + [in,ref] policy_handle *handle, + [in] unistr key_name, + [in] unistr value_name, + [in] uint32 type, + [in] DATA_BLOB buffer, + [in,out,ref] uint32 *buf_size ); /******************/ /* Function: 0x4e */ - WERROR spoolss_4e( + WERROR spoolss_GetPrinterDataEx( + [in,ref] policy_handle *handle, + [in] unistr key_name, + [in] unistr value_name, + [out] uint32 type, + [out] DATA_BLOB buffer, + [in,out,ref] uint32 *buf_size ); /******************/ /* Function: 0x4f */ - WERROR spoolss_4f( + WERROR spoolss_EnumPrinterDataEx( + [in,ref] policy_handle *handle ); /******************/ @@ -691,7 +704,10 @@ /******************/ /* Function: 0x51 */ - WERROR spoolss_51( + WERROR spoolss_DeletePrinterDataEx( + [in,ref] policy_handle *handle, + [in] unistr key_name, + [in] unistr value_name ); /******************/ diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index bd89663c57..802671c8e8 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -438,6 +438,43 @@ BOOL test_GetPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +BOOL test_GetPrinterDataEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, char *key_name, + char *value_name) +{ + NTSTATUS status; + struct spoolss_GetPrinterDataEx r; + uint32 buf_size; + + r.in.handle = handle; + r.in.key_name = key_name; + r.in.value_name = value_name; + buf_size = 0; + r.in.buf_size = r.out.buf_size = &buf_size; + + printf("Testing GetPrinterDataEx\n"); + + status = dcerpc_spoolss_GetPrinterDataEx(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("GetPrinterDataEx failed - %s\n", nt_errstr(status)); + return False; + } + + if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) { + + status = dcerpc_spoolss_GetPrinterDataEx(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { + printf("GetPrinterDataEx failed - %s/%s\n", + nt_errstr(status), win_errstr(r.out.result)); + return False; + } + } + + return True; +} + BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -475,6 +512,10 @@ BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, test_GetPrinterData(p, mem_ctx, handle, r.out.value_name); + test_GetPrinterDataEx( + p, mem_ctx, handle, "PrinterDriverData", + r.out.value_name); + r.in.enum_index++; } while (W_ERROR_IS_OK(r.out.result)); |