summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/spoolss.idl22
-rw-r--r--source4/librpc/ndr/ndr_spoolss_buf.c21
2 files changed, 43 insertions, 0 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 74bfd2ea9f..72ce7d5ffc 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -464,9 +464,31 @@
[out] uint32 count
);
+ typedef [flag(RELATIVE_CURRENT)] struct {
+ [relative] nstring *port_name;
+ } spoolss_PortInfo1;
+
+ typedef struct {
+ [relative] nstring *port_name;
+ [relative] nstring *monitor_name;
+ [relative] nstring *description;
+ uint32 port_type;
+ uint32 reserved;
+ } spoolss_PortInfo2;
+
+ typedef [nondiscriminant,public] union {
+ [case(1)] spoolss_PortInfo1 info1;
+ [case(2)] spoolss_PortInfo2 info2;
+ } spoolss_PortInfo;
+
/******************/
/* Function: 0x23 */
WERROR spoolss_EnumPorts(
+ [in] unistr *servername,
+ [in] uint32 level,
+ [in,out] DATA_BLOB *buffer,
+ [in,out,ref] uint32 *buf_size,
+ [out] uint32 count
);
/******************/
diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c
index aa91a27ab7..9b68ec7883 100644
--- a/source4/librpc/ndr/ndr_spoolss_buf.c
+++ b/source4/librpc/ndr/ndr_spoolss_buf.c
@@ -36,6 +36,8 @@ NTSTATUS pull_spoolss_PrinterInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
}
NDR_ALLOC_N(ndr, *info, count);
for (i=0;i<count;i++) {
+ ndr->data += ndr->offset;
+ ndr->offset = 0;
NDR_CHECK(ndr_pull_spoolss_PrinterInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
}
return NT_STATUS_OK;
@@ -91,3 +93,22 @@ NTSTATUS pull_spoolss_DriverInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
}
return NT_STATUS_OK;
}
+
+NTSTATUS pull_spoolss_PortInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
+ uint32_t level, uint32_t count,
+ union spoolss_PortInfo **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<count;i++) {
+ ndr->data += ndr->offset;
+ ndr->offset = 0;
+ NDR_CHECK(ndr_pull_spoolss_PortInfo(ndr, NDR_SCALARS|NDR_BUFFERS, level, &(*info)[i]));
+ }
+ return NT_STATUS_OK;
+}