00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "includes.h"
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 WERROR rpccli_spoolss_reply_open_printer(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00040 const char *printer, uint32 printerlocal, uint32 type,
00041 POLICY_HND *handle)
00042 {
00043 prs_struct qbuf, rbuf;
00044 SPOOL_Q_REPLYOPENPRINTER q;
00045 SPOOL_R_REPLYOPENPRINTER r;
00046 WERROR result = W_ERROR(ERRgeneral);
00047
00048
00049
00050 make_spoolss_q_replyopenprinter(&q, printer, printerlocal, type);
00051
00052
00053
00054 CLI_DO_RPC_WERR( cli, mem_ctx, PI_SPOOLSS, SPOOLSS_REPLYOPENPRINTER,
00055 q, r,
00056 qbuf, rbuf,
00057 spoolss_io_q_replyopenprinter,
00058 spoolss_io_r_replyopenprinter,
00059 WERR_GENERAL_FAILURE );
00060
00061
00062
00063 memcpy(handle, &r.handle, sizeof(r.handle));
00064 result = r.status;
00065
00066 return result;
00067 }
00068
00069
00070
00071 WERROR rpccli_spoolss_reply_close_printer(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00072 POLICY_HND *handle)
00073 {
00074 prs_struct qbuf, rbuf;
00075 SPOOL_Q_REPLYCLOSEPRINTER q;
00076 SPOOL_R_REPLYCLOSEPRINTER r;
00077 WERROR result = W_ERROR(ERRgeneral);
00078
00079
00080
00081 make_spoolss_q_reply_closeprinter(&q, handle);
00082
00083
00084
00085 CLI_DO_RPC_WERR( cli, mem_ctx, PI_SPOOLSS, SPOOLSS_REPLYCLOSEPRINTER,
00086 q, r,
00087 qbuf, rbuf,
00088 spoolss_io_q_replycloseprinter,
00089 spoolss_io_r_replycloseprinter,
00090 WERR_GENERAL_FAILURE );
00091
00092
00093
00094 result = r.status;
00095 return result;
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105 WERROR rpccli_spoolss_routerreplyprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00106 POLICY_HND *pol, uint32 condition, uint32 change_id)
00107 {
00108 prs_struct qbuf, rbuf;
00109 SPOOL_Q_ROUTERREPLYPRINTER q;
00110 SPOOL_R_ROUTERREPLYPRINTER r;
00111 WERROR result = W_ERROR(ERRgeneral);
00112
00113
00114
00115 make_spoolss_q_routerreplyprinter(&q, pol, condition, change_id);
00116
00117
00118
00119 CLI_DO_RPC_WERR( cli, mem_ctx, PI_SPOOLSS, SPOOLSS_ROUTERREPLYPRINTER,
00120 q, r,
00121 qbuf, rbuf,
00122 spoolss_io_q_routerreplyprinter,
00123 spoolss_io_r_routerreplyprinter,
00124 WERR_GENERAL_FAILURE );
00125
00126
00127
00128 result = r.status;
00129 return result;
00130 }
00131
00132
00133
00134
00135
00136
00137
00138
00139 WERROR rpccli_spoolss_rrpcn(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00140 POLICY_HND *pol, uint32 notify_data_len,
00141 SPOOL_NOTIFY_INFO_DATA *notify_data,
00142 uint32 change_low, uint32 change_high)
00143 {
00144 prs_struct qbuf, rbuf;
00145 SPOOL_Q_REPLY_RRPCN q;
00146 SPOOL_R_REPLY_RRPCN r;
00147 WERROR result = W_ERROR(ERRgeneral);
00148 SPOOL_NOTIFY_INFO notify_info;
00149
00150 ZERO_STRUCT(q);
00151 ZERO_STRUCT(r);
00152
00153 ZERO_STRUCT(notify_info);
00154
00155
00156
00157 notify_info.version = 0x2;
00158 notify_info.flags = 0x00020000;
00159 notify_info.count = notify_data_len;
00160 notify_info.data = notify_data;
00161
00162
00163
00164
00165 make_spoolss_q_reply_rrpcn(&q, pol, change_low, change_high,
00166 ¬ify_info);
00167
00168
00169
00170 CLI_DO_RPC_WERR( cli, mem_ctx, PI_SPOOLSS, SPOOLSS_RRPCN,
00171 q, r,
00172 qbuf, rbuf,
00173 spoolss_io_q_reply_rrpcn,
00174 spoolss_io_r_reply_rrpcn,
00175 WERR_GENERAL_FAILURE );
00176
00177 if (r.unknown0 == 0x00080000)
00178 DEBUG(8,("cli_spoolss_reply_rrpcn: I think the spooler resonded that the notification was ignored.\n"));
00179 else if ( r.unknown0 != 0x0 )
00180 DEBUG(8,("cli_spoolss_reply_rrpcn: unknown0 is non-zero [0x%x]\n", r.unknown0));
00181
00182 result = r.status;
00183 return result;
00184 }
00185
00186
00187
00188
00189 WERROR rpccli_spoolss_rffpcnex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00190 POLICY_HND *pol, uint32 flags, uint32 options,
00191 const char *localmachine, uint32 printerlocal,
00192 SPOOL_NOTIFY_OPTION *option)
00193 {
00194 prs_struct qbuf, rbuf;
00195 SPOOL_Q_RFFPCNEX q;
00196 SPOOL_R_RFFPCNEX r;
00197 WERROR result = W_ERROR(ERRgeneral);
00198
00199 ZERO_STRUCT(q);
00200 ZERO_STRUCT(r);
00201
00202
00203
00204 make_spoolss_q_rffpcnex(
00205 &q, pol, flags, options, localmachine, printerlocal,
00206 option);
00207
00208
00209
00210 CLI_DO_RPC_WERR( cli, mem_ctx, PI_SPOOLSS, SPOOLSS_RFFPCNEX,
00211 q, r,
00212 qbuf, rbuf,
00213 spoolss_io_q_rffpcnex,
00214 spoolss_io_r_rffpcnex,
00215 WERR_GENERAL_FAILURE );
00216
00217 result = r.status;
00218 return result;
00219 }