summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-11-18 05:54:14 +0000
committerTim Potter <tpot@samba.org>2003-11-18 05:54:14 +0000
commit30daed2f7cc4baa69a31f139aaa5b5b260febc15 (patch)
tree9fd793b1298078891619dbb714ffd134b6048855
parent06d0f61aa43c0ab08dc122c9a3b41f9fc453fcbc (diff)
downloadsamba-30daed2f7cc4baa69a31f139aaa5b5b260febc15.tar.gz
samba-30daed2f7cc4baa69a31f139aaa5b5b260febc15.tar.bz2
samba-30daed2f7cc4baa69a31f139aaa5b5b260febc15.zip
Working on EnumPrinterData. There appears to be an alignment problem
after reading a non-empty DATA_BLOB in the reply. (This used to be commit 3165bf532f6b5a074f20f38a9af56325eedbb1c2)
-rw-r--r--source4/librpc/idl/spoolss.idl9
-rw-r--r--source4/torture/rpc/spoolss.c45
2 files changed, 49 insertions, 5 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 1d33274f93..362e692aaf 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -533,16 +533,15 @@
/******************/
/* Function: 0x48 */
- NTSTATUS spoolss_EnumPrinterData(
+ WERROR spoolss_EnumPrinterData(
[in,ref] policy_handle *handle,
[in] uint32 enum_index,
[in] uint32 value_offered,
- [out] uint32 value_len,
- [out] unistr *value_name,
+ [out] DATA_BLOB value,
[out] uint32 value_needed,
[out] uint32 printerdata_type,
- [in,out] DATA_BLOB *buffer,
- [in,out,ref] uint32 *buf_size
+ [out] DATA_BLOB data,
+ [in,out,ref] uint32 *data_size
);
/******************/
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 53e25a3e14..9009c8e99a 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -87,6 +87,47 @@ BOOL test_ClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
+BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct spoolss_EnumPrinterData r;
+
+ r.in.handle = handle;
+ r.in.enum_index = 0;
+
+ do {
+ uint32 data_size;
+
+ r.in.value_offered = 0;
+ data_size = 0;
+ r.in.data_size = &data_size;
+ r.out.data_size = &data_size;
+
+ printf("Testing EnumPrinterData\n");
+
+ status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("EnumPrinterData failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ r.in.value_offered = r.out.value_needed;
+
+ status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("EnumPrinterData failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ r.in.enum_index++;
+ } while (1);
+
+ return True;
+}
+
static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
const char *name)
{
@@ -170,6 +211,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
+ if (!test_EnumPrinterData(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_ClosePrinter(p, mem_ctx, &handle)) {
ret = False;
}