diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-02-09 16:51:46 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-02-09 16:51:46 +0100 |
commit | 9b366d703210b493aa1389bbdd288a2b00958766 (patch) | |
tree | 12acaf89af2c6bd2610018d267e2d8030d9b4bd6 /source4/torture/rpc/samba3rpc.c | |
parent | 6d139ca4680abcbda5110f2f0886aa038ff62088 (diff) | |
parent | 1dadf17be847e3f93b72988bcc7e8620a8d5908c (diff) | |
download | samba-9b366d703210b493aa1389bbdd288a2b00958766.tar.gz samba-9b366d703210b493aa1389bbdd288a2b00958766.tar.bz2 samba-9b366d703210b493aa1389bbdd288a2b00958766.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source4/torture/rpc/samba3rpc.c')
-rw-r--r-- | source4/torture/rpc/samba3rpc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 5b493db813..5f803b07d3 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2617,12 +2617,14 @@ static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe, struct spoolss_EnumPrinters r; NTSTATUS status; DATA_BLOB blob; + uint32_t needed; r.in.flags = PRINTER_ENUM_LOCAL; r.in.server = talloc_asprintf(mem_ctx, "\\\\%s", servername); r.in.level = level; r.in.buffer = NULL; r.in.offered = 0; + r.out.needed = &needed; status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -2638,14 +2640,14 @@ static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe, return false; } - blob = data_blob_talloc_zero(mem_ctx, r.out.needed); + blob = data_blob_talloc_zero(mem_ctx, needed); if (blob.data == NULL) { d_printf("(%s) data_blob_talloc failed\n", __location__); return false; } r.in.buffer = &blob; - r.in.offered = r.out.needed; + r.in.offered = needed; status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { @@ -2668,6 +2670,7 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe, struct spoolss_GetPrinter r; DATA_BLOB blob; NTSTATUS status; + uint32_t needed; mem_ctx = talloc_new(ctx); if (mem_ctx == NULL) { @@ -2678,6 +2681,7 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe, r.in.level = level; r.in.buffer = NULL; r.in.offered = 0; + r.out.needed = &needed; status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -2697,14 +2701,14 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe, r.in.handle = handle; r.in.level = level; - blob = data_blob_talloc(mem_ctx, NULL, r.out.needed); + blob = data_blob_talloc(mem_ctx, NULL, needed); if (blob.data == NULL) { talloc_free(mem_ctx); return NT_STATUS_NO_MEMORY; } memset(blob.data, 0, blob.length); r.in.buffer = &blob; - r.in.offered = r.out.needed; + r.in.offered = needed; status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { |