summaryrefslogtreecommitdiff
path: root/source4/ntptr
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-06-26 18:31:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:32 -0500
commitb22ddfd61d5a3e477ea4401b3800d44709d56f82 (patch)
tree1099a6630d7c827cd154681566cfb1d7656c6b22 /source4/ntptr
parent9b161bcb71d9a2faf91d9e45e8ecc1ad95e1abd2 (diff)
downloadsamba-b22ddfd61d5a3e477ea4401b3800d44709d56f82.tar.gz
samba-b22ddfd61d5a3e477ea4401b3800d44709d56f82.tar.bz2
samba-b22ddfd61d5a3e477ea4401b3800d44709d56f82.zip
r16523: pass spoolss_XcvData calls to the ntptr backends...
I wrote this code last year and found it in a working tree... metze (This used to be commit 9a685c5beff6936d354d541e875899d33b735ba9)
Diffstat (limited to 'source4/ntptr')
-rw-r--r--source4/ntptr/ntptr.h13
-rw-r--r--source4/ntptr/ntptr_interface.c51
-rw-r--r--source4/ntptr/simple_ldb/ntptr_simple_ldb.c6
3 files changed, 65 insertions, 5 deletions
diff --git a/source4/ntptr/ntptr.h b/source4/ntptr/ntptr.h
index 6dace6031d..ce5e3e01ae 100644
--- a/source4/ntptr/ntptr.h
+++ b/source4/ntptr/ntptr.h
@@ -74,6 +74,7 @@ struct spoolss_EnumPrinters;
struct spoolss_EnumForms;
struct spoolss_EnumPorts;
struct spoolss_EnumPrintProcessors;
+struct spoolss_XcvData;
/* the ntptr operations structure - contains function pointers to
the backend implementations of each operation */
@@ -88,6 +89,8 @@ struct ntptr_ops {
struct spoolss_OpenPrinterEx *r,
const char *printer_name,
struct ntptr_GenericHandle **server);
+ WERROR (*XcvDataPrintServer)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r);
/* PrintServer PrinterData functions */
WERROR (*EnumPrintServerData)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
@@ -125,8 +128,10 @@ struct ntptr_ops {
WERROR (*OpenPort)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
struct spoolss_OpenPrinterEx *r,
const char *port_name,
- struct ntptr_GenericHandle **prt);
-
+ struct ntptr_GenericHandle **port);
+ WERROR (*XcvDataPort)(struct ntptr_GenericHandle *port, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r);
+
/* Monitor functions */
WERROR (*EnumMonitors)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
struct spoolss_EnumMonitors *r);
@@ -134,6 +139,8 @@ struct ntptr_ops {
struct spoolss_OpenPrinterEx *r,
const char *monitor_name,
struct ntptr_GenericHandle **monitor);
+ WERROR (*XcvDataMonitor)(struct ntptr_GenericHandle *monitor, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r);
/* PrintProcessor functions */
WERROR (*EnumPrintProcessors)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
@@ -155,6 +162,8 @@ struct ntptr_ops {
struct spoolss_SetPrinter *r);
WERROR (*DeletePrinter)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
struct spoolss_DeletePrinter *r);
+ WERROR (*XcvDataPrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r);
/* Printer Driver functions */
WERROR (*GetPrinterDriver)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
diff --git a/source4/ntptr/ntptr_interface.c b/source4/ntptr/ntptr_interface.c
index 1920b37f21..56c3a61659 100644
--- a/source4/ntptr/ntptr_interface.c
+++ b/source4/ntptr/ntptr_interface.c
@@ -36,6 +36,18 @@ WERROR ntptr_OpenPrintServer(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
return ntptr->ops->OpenPrintServer(ntptr, mem_ctx, r, printer_name, server);
}
+WERROR ntptr_XcvDataPrintServer(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r)
+{
+ if (server->type != NTPTR_HANDLE_SERVER) {
+ return WERR_FOOBAR;
+ }
+ if (!server->ntptr->ops->XcvDataPrintServer) {
+ return WERR_NOT_SUPPORTED;
+ }
+ return server->ntptr->ops->XcvDataPrintServer(server, mem_ctx, r);
+}
+
/* PrintServer PrinterData functions */
WERROR ntptr_EnumPrintServerData(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
@@ -188,14 +200,25 @@ WERROR ntptr_EnumPorts(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
WERROR ntptr_OpenPort(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
struct spoolss_OpenPrinterEx *r,
const char *port_name,
- struct ntptr_GenericHandle **prt)
+ struct ntptr_GenericHandle **port)
{
if (!ntptr->ops->OpenPort) {
return WERR_NOT_SUPPORTED;
}
- return ntptr->ops->OpenPort(ntptr, mem_ctx, r, port_name, prt);
+ return ntptr->ops->OpenPort(ntptr, mem_ctx, r, port_name, port);
}
+WERROR ntptr_XcvDataPort(struct ntptr_GenericHandle *port, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r)
+{
+ if (port->type != NTPTR_HANDLE_PORT) {
+ return WERR_FOOBAR;
+ }
+ if (!port->ntptr->ops->XcvDataPort) {
+ return WERR_NOT_SUPPORTED;
+ }
+ return port->ntptr->ops->XcvDataPort(port, mem_ctx, r);
+}
/* Monitor functions */
WERROR ntptr_EnumMonitors(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
@@ -218,6 +241,18 @@ WERROR ntptr_OpenMonitor(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
return ntptr->ops->OpenMonitor(ntptr, mem_ctx, r, monitor_name, monitor);
}
+WERROR ntptr_XcvDataMonitor(struct ntptr_GenericHandle *monitor, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r)
+{
+ if (monitor->type != NTPTR_HANDLE_MONITOR) {
+ return WERR_FOOBAR;
+ }
+ if (!monitor->ntptr->ops->XcvDataMonitor) {
+ return WERR_NOT_SUPPORTED;
+ }
+ return monitor->ntptr->ops->XcvDataMonitor(monitor, mem_ctx, r);
+}
+
/* PrintProcessor functions */
WERROR ntptr_EnumPrintProcessors(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
@@ -288,6 +323,18 @@ WERROR ntptr_DeletePrinter(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
return ntptr->ops->DeletePrinter(ntptr, mem_ctx, r);
}
+WERROR ntptr_XcvDataPrinter(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
+ struct spoolss_XcvData *r)
+{
+ if (printer->type != NTPTR_HANDLE_PRINTER) {
+ return WERR_FOOBAR;
+ }
+ if (!printer->ntptr->ops->XcvDataPrinter) {
+ return WERR_NOT_SUPPORTED;
+ }
+ return printer->ntptr->ops->XcvDataPrinter(printer, mem_ctx, r);
+}
+
/* Printer Driver functions */
WERROR ntptr_GetPrinterDriver(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
index c9b6a700aa..136dae352a 100644
--- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
+++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
@@ -761,7 +761,8 @@ static const struct ntptr_ops ntptr_simple_ldb_ops = {
/* PrintServer functions */
.OpenPrintServer = sptr_OpenPrintServer,
-
+/* .XcvDataPrintServer = sptr_XcvDataPrintServer,
+*/
/* PrintServer PrinterData functions */
/* .EnumPrintServerData = sptr_EnumPrintServerData,
*/ .GetPrintServerData = sptr_GetPrintServerData,
@@ -783,10 +784,12 @@ static const struct ntptr_ops ntptr_simple_ldb_ops = {
/* Port functions */
.EnumPorts = sptr_EnumPorts,
/* .OpenPort = sptr_OpenPort,
+ .XcvDataPort = sptr_XcvDataPort,
*/
/* Monitor functions */
.EnumMonitors = sptr_EnumMonitors,
/* .OpenMonitor = sptr_OpenMonitor,
+ .XcvDataMonitor = sptr_XcvDataMonitor,
*/
/* PrintProcessor functions */
/* .EnumPrintProcessors = sptr_EnumPrintProcessors,
@@ -798,6 +801,7 @@ static const struct ntptr_ops ntptr_simple_ldb_ops = {
.GetPrinter = sptr_GetPrinter,
.SetPrinter = sptr_SetPrinter,
.DeletePrinter = sptr_DeletePrinter,
+ .XcvDataPrinter = sptr_XcvDataPrinter,
*/
/* Printer Driver functions */
/* .GetPrinterDriver = sptr_GetPrinterDriver,