s4-smbtorture: fix test_EnumPrinterDataEx.
authorGünther Deschner <gd@samba.org>
Fri, 6 Feb 2009 12:44:44 +0000 (13:44 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 6 Feb 2009 13:59:22 +0000 (14:59 +0100)
Guenther

source4/torture/rpc/spoolss.c
source4/torture/rpc/spoolss_win.c

index 6c0126ed7bbee89c909feef445049366d7ac8d93..d0252d8d69f959891b4eac50d455d689a8350374 100644 (file)
@@ -1242,17 +1242,22 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct spoolss_EnumPrinterDataEx r;
+       uint32_t needed;
+       uint32_t count;
 
        r.in.handle = handle;
        r.in.key_name = "PrinterDriverData";
        r.in.offered = 0;
+       r.out.needed = &needed;
+       r.out.count = &count;
 
        torture_comment(tctx, "Testing EnumPrinterDataEx\n");
 
        status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDataEx failed");
 
-       r.in.offered = r.out.needed;
+       r.in.offered = needed;
+       r.out.buffer = talloc_array(tctx, uint8_t, needed);
 
        status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &r);
 
index cc998cb302ef9fffcb4a062aa6945d231701069f..24a8dbc7e936c6b5eb747352f98fe7409a1d8659 100644 (file)
@@ -378,17 +378,22 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct spoolss_EnumPrinterDataEx epde;
+       uint32_t needed;
+       uint32_t count;
 
        torture_comment(tctx, "Testing EnumPrinterDataEx(%s)\n", key);
 
        epde.in.handle = handle;
        epde.in.key_name = talloc_strdup(tctx, key);
        epde.in.offered = 0;
+       epde.out.needed = &needed;
+       epde.out.count = &count;
 
        status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &epde);
        torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDataEx failed.");
        if (W_ERROR_EQUAL(epde.out.result, WERR_MORE_DATA)) {
-               epde.in.offered = epde.out.needed;
+               epde.in.offered = needed;
+               epde.out.buffer = talloc_array(tctx, uint8_t, needed);
                status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &epde);
                torture_assert_ntstatus_ok(tctx, status,
                                "EnumPrinterDataEx failed.");