diff options
author | Günther Deschner <gd@samba.org> | 2009-02-06 13:53:16 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-02-06 14:59:22 +0100 |
commit | 33d2507ba2374afabeaff455c08896fa45babbe8 (patch) | |
tree | 6d454e1729e23b589b3a7d824ceea423b424f062 /source4/torture | |
parent | 88aaac39fa2a38997c11d4f545f3e223129a5a6a (diff) | |
download | samba-33d2507ba2374afabeaff455c08896fa45babbe8.tar.gz samba-33d2507ba2374afabeaff455c08896fa45babbe8.tar.bz2 samba-33d2507ba2374afabeaff455c08896fa45babbe8.zip |
s4-smbtorture: fix test_EnumPrinterKey.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/spoolss_win.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/torture/rpc/spoolss_win.c b/source4/torture/rpc/spoolss_win.c index 24a8dbc7e9..647f13e9bc 100644 --- a/source4/torture/rpc/spoolss_win.c +++ b/source4/torture/rpc/spoolss_win.c @@ -347,14 +347,16 @@ static bool test_EnumPrinterKey(struct torture_context *tctx, epk.in.handle = handle; epk.in.key_name = talloc_strdup(tctx, key); - epk.in.needed = needed; + epk.in.key_buffer_size = 0; + epk.out.needed = &needed; status = dcerpc_spoolss_EnumPrinterKey(p, tctx, &epk); torture_assert_ntstatus_ok(tctx, status, "EnumPrinterKey failed"); if (W_ERROR_EQUAL(epk.out.result, WERR_MORE_DATA)) { - epk.in.needed = epk.out.needed; + epk.in.key_buffer_size = needed; + epk.out.key_buffer = talloc_array(tctx, uint16_t, needed/2); status = dcerpc_spoolss_EnumPrinterKey(p, tctx, &epk); torture_assert_ntstatus_ok(tctx, status, "EnumPrinterKey failed"); @@ -363,7 +365,7 @@ static bool test_EnumPrinterKey(struct torture_context *tctx, torture_assert_werr_ok(tctx, epk.out.result, "EnumPrinterKey failed"); convert_string_talloc_convenience(ctx, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, - CH_UNIX, epk.out.key_buffer, epk.out.needed, + CH_UNIX, epk.out.key_buffer, *epk.out.needed, (void**)&ctx->printer_keys); return true; |