From cc153fe86f780d4aefe40999064b294b612e92d6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 31 Jan 2013 14:56:17 +0100 Subject: s4-torture: add ndr test for spoolss_RpcSetJobNamedProperty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Signed-off-by: Günther Deschner Reviewed-by: David Disseldorp --- librpc/idl/spoolss.idl | 2 +- source4/torture/ndr/spoolss.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index f0ff2ff53f..6a915c1366 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -3380,7 +3380,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor") /******************/ /* Function: 0x6f */ - WERROR spoolss_RpcSetJobNamedProperty( + [public] WERROR spoolss_RpcSetJobNamedProperty( [in,ref] policy_handle *hPrinter, [in] uint32 JobId, [in,ref] RPC_PrintNamedProperty *pProperty diff --git a/source4/torture/ndr/spoolss.c b/source4/torture/ndr/spoolss.c index 08d3d383c7..5818fdf209 100644 --- a/source4/torture/ndr/spoolss.c +++ b/source4/torture/ndr/spoolss.c @@ -1740,6 +1740,34 @@ static const uint8_t getcoreprinterdrivers_64_req_data[] = { 0x04, 0x00, 0x00, 0x00 }; +static const uint8_t rpcsetjobnamedproperty_req_data[] = { + 0x00, 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x50, 0xdf, 0xe4, 0xce, 0x1a, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x53, 0x00, 0x70, 0x00, + 0x6f, 0x00, 0x6f, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x46, 0x00, 0x69, 0x00, + 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x6e, 0x00, + 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x73, 0x00, 0x00, 0x00, + 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x54, 0x00, 0x59, 0x00, 0x50, 0x00, 0x45, 0x00, 0x5f, 0x00, 0x50, 0x00, + 0x44, 0x00, 0x4c, 0x00, 0x5f, 0x00, 0x55, 0x00, 0x4e, 0x00, 0x4b, 0x00, + 0x4e, 0x00, 0x4f, 0x00, 0x57, 0x00, 0x4e, 0x00, 0x00, 0x00 +}; + +static bool rpcsetjobnamedproperty_req_check(struct torture_context *tctx, + struct spoolss_RpcSetJobNamedProperty *r) +{ + /* FIXME hPrinter */ + torture_assert_int_equal(tctx, r->in.JobId, 0x00000005, "JobId"); + torture_assert(tctx, r->in.pProperty, "pProperty"); + torture_assert_str_equal(tctx, r->in.pProperty->propertyName, SPLFILE_CONTENT_TYPE_PROP_NAME, "propertyName"); + torture_assert_int_equal(tctx, r->in.pProperty->propertyValue.ePropertyType, kRpcPropertyTypeString, "ePropertyType"); + torture_assert_str_equal(tctx, r->in.pProperty->propertyValue.value.propertyString, SPLFILE_CONTENT_TYPE_PDL_UNKNOWN, "propertyString"); + + return true; +} + struct torture_suite *ndr_spoolss_suite(TALLOC_CTX *ctx) { struct torture_suite *suite = torture_suite_create(ctx, "spoolss"); @@ -1801,5 +1829,7 @@ struct torture_suite *ndr_spoolss_suite(TALLOC_CTX *ctx) torture_suite_add_ndr_pull_fn_test_flags(suite, spoolss_GetCorePrinterDrivers, getcoreprinterdrivers_64_req_data, NDR_IN, LIBNDR_FLAG_NDR64, NULL); + torture_suite_add_ndr_pull_fn_test(suite, spoolss_RpcSetJobNamedProperty, rpcsetjobnamedproperty_req_data, NDR_IN, rpcsetjobnamedproperty_req_check); + return suite; } -- cgit