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

source4/torture/rpc/spoolss.c

index a2965ad05f1ea53255ed1f86e7aad8cb8612956f..3c5fcabbd2c93f4576de57acfb0088068ff0d6e1 100644 (file)
@@ -191,6 +191,7 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx,
                }
        };
        int i;
                }
        };
        int i;
+       uint32_t needed;
 
        for (i=0;i<ARRAY_SIZE(levels);i++) {
                int level = levels[i].level;
 
        for (i=0;i<ARRAY_SIZE(levels);i++) {
                int level = levels[i].level;
@@ -201,6 +202,7 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx,
                r.in.level              = level;
                r.in.buffer             = NULL;
                r.in.offered            = 0;
                r.in.level              = level;
                r.in.buffer             = NULL;
                r.in.offered            = 0;
+               r.out.needed            = &needed;
 
                torture_comment(tctx, "Testing GetPrinterDriverDirectory level %u\n", r.in.level);
 
 
                torture_comment(tctx, "Testing GetPrinterDriverDirectory level %u\n", r.in.level);
 
@@ -210,10 +212,10 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx,
                torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER, 
                        "GetPrinterDriverDirectory unexpected return code");
 
                torture_assert_werr_equal(tctx, r.out.result, WERR_INSUFFICIENT_BUFFER, 
                        "GetPrinterDriverDirectory unexpected return code");
 
-               blob = data_blob_talloc(ctx, NULL, r.out.needed);
+               blob = data_blob_talloc(ctx, NULL, needed);
                data_blob_clear(&blob);
                r.in.buffer = &blob;
                data_blob_clear(&blob);
                r.in.buffer = &blob;
-               r.in.offered = r.out.needed;
+               r.in.offered = needed;
 
                status = dcerpc_spoolss_GetPrinterDriverDirectory(p, ctx, &r);
                torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_GetPrinterDriverDirectory failed");
 
                status = dcerpc_spoolss_GetPrinterDriverDirectory(p, ctx, &r);
                torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_GetPrinterDriverDirectory failed");