From 0833c9639e3e7fb7e14dc25d90f4a9973e717cbc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 20 Apr 2010 19:29:12 +0200 Subject: s4-smbtorture: add function to get a printserver's environment. Guenther --- source4/torture/rpc/spoolss.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 25fdd7fc76..9203a7251d 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -3284,6 +3284,28 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx, return true; } +static bool test_get_environment(struct torture_context *tctx, + struct dcerpc_binding_handle *b, + struct policy_handle *handle, + const char **architecture) +{ + DATA_BLOB blob; + enum winreg_Type type; + uint8_t *data; + uint32_t needed; + + torture_assert(tctx, + test_GetPrinterData(tctx, b, handle, "Architecture", &type, &data, &needed), + "failed to get Architecture"); + + torture_assert_int_equal(tctx, type, REG_SZ, "unexpected type"); + + blob = data_blob_const(data, needed); + *architecture = reg_val_data_string(tctx, lp_iconv_convenience(tctx->lp_ctx), REG_SZ, blob); + + return true; +} + static bool test_GetPrinterData_list(struct torture_context *tctx, struct dcerpc_pipe *p, struct policy_handle *handle, -- cgit