From 822750592cffb175aa7afb268bc7cb47bbab47e4 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 26 Nov 2003 06:26:18 +0000 Subject: [PATCH] Implemented EnumForms and GetForm. --- source/librpc/idl/spoolss.idl | 24 +++++-- source/librpc/ndr/ndr_spoolss_buf.c | 17 +++++ source/torture/rpc/spoolss.c | 106 ++++++++++++++++++++++++++++ 3 files changed, 143 insertions(+), 4 deletions(-) diff --git a/source/librpc/idl/spoolss.idl b/source/librpc/idl/spoolss.idl index 14cb3ed441f..2c318ce4a15 100644 --- a/source/librpc/idl/spoolss.idl +++ b/source/librpc/idl/spoolss.idl @@ -57,6 +57,17 @@ [relative] nstring *comment; } spoolss_PrinterInfo1; + typedef struct { + uint32 flags; + [relative] nstring *name; + uint32 width; + uint32 length; + uint32 left; + uint32 top; + uint32 right; + uint32 bottom; + } spoolss_FormInfo1; + typedef struct { [relative] nstring *servername; [relative] nstring *printername; @@ -309,7 +320,8 @@ [in,ref] policy_handle *handle, [in] unistr formname, [in] uint32 level, - [out,subcontext(4),switch_is(level)] spoolss_PrinterInfo *info, + [in] DATA_BLOB *buffer, + [out,subcontext(4),switch_is(level)] spoolss_FormInfo *info, [in,out,ref] uint32 *buf_size ); @@ -318,14 +330,18 @@ WERROR spoolss_21( ); + typedef [nodiscriminant,public] union { + [case(1)] spoolss_FormInfo1 info1; + } spoolss_FormInfo; + /******************/ /* Function: 0x22 */ WERROR spoolss_EnumForms( [in,ref] policy_handle *handle, [in] uint32 level, - [in] DATA_BLOB *buffer, - [out,subcontext(4),switch_is(level)] spoolss_PrinterInfo *info, - [in,out,ref] uint32 *buf_size + [in,out] DATA_BLOB *buffer, + [in,out,ref] uint32 *buf_size, + [out] uint32 count ); /******************/ diff --git a/source/librpc/ndr/ndr_spoolss_buf.c b/source/librpc/ndr/ndr_spoolss_buf.c index 381093a58f0..6c12ab2ae57 100644 --- a/source/librpc/ndr/ndr_spoolss_buf.c +++ b/source/librpc/ndr/ndr_spoolss_buf.c @@ -40,3 +40,20 @@ NTSTATUS pull_spoolss_PrinterInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, } return NT_STATUS_OK; } + +NTSTATUS pull_spoolss_FormInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, + uint32 level, uint32 count, + union spoolss_FormInfo **info) +{ + int i; + struct ndr_pull *ndr; + ndr = ndr_pull_init_blob(blob, mem_ctx); + if (!ndr) { + return NT_STATUS_NO_MEMORY; + } + NDR_ALLOC_N(ndr, *info, count); + for (i=0;i