summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-11-28 06:39:06 +0000
committerTim Potter <tpot@samba.org>2003-11-28 06:39:06 +0000
commitb0ba0462a4e85a26c45a4e763655d5b3885a147f (patch)
tree7e37df5e7712d012c5b92cae9ee379d97bd6780e /source4
parent606514b0774c42c9f95a726cfa2d68a2a3c2ba32 (diff)
downloadsamba-b0ba0462a4e85a26c45a4e763655d5b3885a147f.tar.gz
samba-b0ba0462a4e85a26c45a4e763655d5b3885a147f.tar.bz2
samba-b0ba0462a4e85a26c45a4e763655d5b3885a147f.zip
Fix bug in EnumPrinterData test.
Implement GetPrinterData RPC. (This used to be commit 270c4fe389fb67ccbe0b9174267b40738ca43052)
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/spoolss.idl11
-rw-r--r--source4/torture/rpc/spoolss.c40
2 files changed, 47 insertions, 4 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index f8afdfd84e..29b114b577 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -326,12 +326,17 @@
/******************/
/* Function: 0x1a */
- WERROR spoolss_1a(
+ WERROR spoolss_GetPrinterData(
+ [in,ref] policy_handle *handle,
+ [in] unistr value_name,
+ [out] uint32 type,
+ [out] DATA_BLOB buffer,
+ [in,out,ref] uint32 *buf_size
);
/******************/
/* Function: 0x1b */
- WERROR spoolss_1b(
+ WERROR spoolss_SetPrinterData(
);
/******************/
@@ -630,7 +635,7 @@
[in,ref] policy_handle *handle,
[in] uint32 enum_index,
[in] uint32 value_offered,
- [out] lstring value,
+ [out] lstring value_name,
[out] uint32 value_needed,
[out] uint32 printerdata_type,
[out] DATA_BLOB data,
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index b32250f22e..4d729fdf89 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -403,6 +403,41 @@ BOOL test_EnumJobs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
+BOOL test_GetPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle, char *value_name)
+{
+ NTSTATUS status;
+ struct spoolss_GetPrinterData r;
+ uint32 buf_size;
+
+ r.in.handle = handle;
+ r.in.value_name = value_name;
+ buf_size = 0;
+ r.in.buf_size = r.out.buf_size = &buf_size;
+
+ printf("Testing GetPrinterData\n");
+
+ status = dcerpc_spoolss_GetPrinterData(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("GetPrinterData failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
+
+ status = dcerpc_spoolss_GetPrinterData(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
+ printf("GetPrinterData failed - %s/%s\n",
+ nt_errstr(status), win_errstr(r.out.result));
+ return False;
+ }
+ }
+
+ return True;
+}
+
BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
{
@@ -438,8 +473,11 @@ BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
+ test_GetPrinterData(p, mem_ctx, handle, r.out.value_name);
+
r.in.enum_index++;
- } while (!W_ERROR_IS_OK(r.out.result));
+
+ } while (W_ERROR_IS_OK(r.out.result));
return True;
}