5331
|
1 |
/*
|
|
2 |
* CDDL HEADER START
|
|
3 |
*
|
|
4 |
* The contents of this file are subject to the terms of the
|
|
5 |
* Common Development and Distribution License (the "License").
|
|
6 |
* You may not use this file except in compliance with the License.
|
|
7 |
*
|
|
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
9 |
* or http://www.opensolaris.org/os/licensing.
|
|
10 |
* See the License for the specific language governing permissions
|
|
11 |
* and limitations under the License.
|
|
12 |
*
|
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each
|
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
15 |
* If applicable, add the following below this CDDL HEADER, with the
|
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
18 |
*
|
|
19 |
* CDDL HEADER END
|
|
20 |
*/
|
|
21 |
/*
|
|
22 |
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
|
23 |
* Use is subject to license terms.
|
|
24 |
*/
|
|
25 |
|
|
26 |
#pragma ident "%Z%%M% %I% %E% SMI"
|
|
27 |
|
|
28 |
/*
|
|
29 |
* Printing and Spooling RPC interface definition.
|
|
30 |
* A stub to resolve RPC requests to this service.
|
|
31 |
*/
|
|
32 |
|
|
33 |
#include <smbsrv/ndl/spoolss.ndl>
|
|
34 |
#include <smbsrv/mlsvc_util.h>
|
|
35 |
#include <smbsrv/ntstatus.h>
|
|
36 |
#include <smbsrv/nmpipes.h>
|
|
37 |
|
|
38 |
static mlrpc_stub_table_t spoolss_stub_table[];
|
|
39 |
|
|
40 |
static mlrpc_service_t spoolss_service = {
|
|
41 |
"SPOOLSS", /* name */
|
|
42 |
"Print Spool Service", /* desc */
|
|
43 |
"\\spoolss", /* endpoint */
|
|
44 |
PIPE_SPOOLSS, /* sec_addr_port */
|
|
45 |
"12345678-1234-abcd-ef000123456789ab", 1, /* abstract */
|
|
46 |
"8a885d04-1ceb-11c9-9fe808002b104860", 2, /* transfer */
|
|
47 |
0, /* no bind_instance_size */
|
|
48 |
0, /* no bind_req() */
|
|
49 |
0, /* no unbind_and_close() */
|
|
50 |
0, /* use generic_call_stub() */
|
|
51 |
&TYPEINFO(spoolss_interface), /* interface ti */
|
|
52 |
spoolss_stub_table /* stub_table */
|
|
53 |
};
|
|
54 |
|
|
55 |
/*
|
|
56 |
* spoolss_initialize
|
|
57 |
*
|
|
58 |
* This function registers the SPOOLSS RPC interface with the RPC
|
|
59 |
* runtime library. It must be called in order to use either the
|
|
60 |
* client side or the server side functions.
|
|
61 |
*/
|
|
62 |
void
|
|
63 |
spoolss_initialize(void)
|
|
64 |
{
|
|
65 |
(void) mlrpc_register_service(&spoolss_service);
|
|
66 |
}
|
|
67 |
|
|
68 |
/*
|
|
69 |
* spoolss_s_OpenPrinter
|
|
70 |
*
|
|
71 |
* We don't offer print spooling support. It should be okay to
|
|
72 |
* set the status to access denied and return MLRPC_DRC_OK.
|
|
73 |
*/
|
|
74 |
static int
|
|
75 |
spoolss_s_OpenPrinter(void *arg, struct mlrpc_xaction *mxa)
|
|
76 |
{
|
|
77 |
struct spoolss_OpenPrinter *param = arg;
|
|
78 |
|
|
79 |
bzero(param, sizeof (struct spoolss_OpenPrinter));
|
|
80 |
param->status = NT_SC_ERROR(NT_STATUS_ACCESS_DENIED);
|
|
81 |
|
|
82 |
return (MLRPC_DRC_OK);
|
|
83 |
}
|
|
84 |
|
|
85 |
|
|
86 |
/*
|
|
87 |
* spoolss_s_stub
|
|
88 |
*/
|
|
89 |
static int
|
|
90 |
spoolss_s_stub(void *arg, struct mlrpc_xaction *mxa)
|
|
91 |
{
|
|
92 |
return (MLRPC_DRC_FAULT_PARAM_0_UNIMPLEMENTED);
|
|
93 |
}
|
|
94 |
|
|
95 |
static mlrpc_stub_table_t spoolss_stub_table[] = {
|
|
96 |
{ spoolss_s_OpenPrinter, SPOOLSS_OPNUM_OpenPrinter },
|
|
97 |
{ spoolss_s_stub, SPOOLSS_OPNUM_GetJob },
|
|
98 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePrinter },
|
|
99 |
{ spoolss_s_stub, SPOOLSS_OPNUM_GetPrinterDriver },
|
|
100 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePrinterDriver },
|
|
101 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddPrintProcessor },
|
|
102 |
{ spoolss_s_stub, SPOOLSS_OPNUM_GetPrintProcessorDirectory },
|
|
103 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AbortPrinter },
|
|
104 |
{ spoolss_s_stub, SPOOLSS_OPNUM_ReadPrinter },
|
|
105 |
{ spoolss_s_stub, SPOOLSS_OPNUM_WaitForPrinterChange },
|
|
106 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddForm },
|
|
107 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeleteForm },
|
|
108 |
{ spoolss_s_stub, SPOOLSS_OPNUM_GetForm },
|
|
109 |
{ spoolss_s_stub, SPOOLSS_OPNUM_SetForm },
|
|
110 |
{ spoolss_s_stub, SPOOLSS_OPNUM_EnumMonitors },
|
|
111 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddPort },
|
|
112 |
{ spoolss_s_stub, SPOOLSS_OPNUM_ConfigurePort },
|
|
113 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePort },
|
|
114 |
{ spoolss_s_stub, SPOOLSS_OPNUM_CreatePrinterIc },
|
|
115 |
{ spoolss_s_stub, SPOOLSS_OPNUM_PlayDescriptionPrinterIc },
|
|
116 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePrinterIc },
|
|
117 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddPrinterConnection },
|
|
118 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePrinterConnection },
|
|
119 |
{ spoolss_s_stub, SPOOLSS_OPNUM_PrinterMessageBox },
|
|
120 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddMonitor },
|
|
121 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeleteMonitor },
|
|
122 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePrintProcessor },
|
|
123 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddPrintProvider },
|
|
124 |
{ spoolss_s_stub, SPOOLSS_OPNUM_DeletePrintProvider },
|
|
125 |
{ spoolss_s_stub, SPOOLSS_OPNUM_ResetPrinter },
|
|
126 |
{ spoolss_s_stub, SPOOLSS_OPNUM_FindFirstChangeNotify },
|
|
127 |
{ spoolss_s_stub, SPOOLSS_OPNUM_FindNextChangeNotify },
|
|
128 |
{ spoolss_s_stub, SPOOLSS_OPNUM_RouterFindFirstNotify },
|
|
129 |
{ spoolss_s_stub, SPOOLSS_OPNUM_ReplyOpenPrinter },
|
|
130 |
{ spoolss_s_stub, SPOOLSS_OPNUM_RouterReplyPrinter },
|
|
131 |
{ spoolss_s_stub, SPOOLSS_OPNUM_ReplyClosePrinter },
|
|
132 |
{ spoolss_s_stub, SPOOLSS_OPNUM_AddPortEx },
|
|
133 |
{ spoolss_s_stub, SPOOLSS_OPNUM_RemoteFindFirstChangeNotify },
|
|
134 |
{ spoolss_s_stub, SPOOLSS_OPNUM_SpoolerInitialize },
|
|
135 |
{ spoolss_s_stub, SPOOLSS_OPNUM_ResetPrinterEx },
|
|
136 |
{ spoolss_s_stub, SPOOLSS_OPNUM_RouterRefreshChangeNotify },
|
|
137 |
{ spoolss_s_OpenPrinter, SPOOLSS_OPNUM_OpenPrinter2 },
|
|
138 |
{0}
|
|
139 |
};
|