*/
#include "includes.h"
+#include "lib/talloc/talloc.h"
+#include "lib/tevent/tevent.h"
+#include "lib/async_req/async_req.h"
+#include "lib/async_req/async_sock.h"
+#include <fcntl.h>
+
+#ifndef TALLOC_FREE
+#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
+#endif
/**
* Discriminator for async_syscall_state
struct async_syscall_state {
enum async_syscall_type syscall_type;
- struct fd_event *fde;
+ struct tevent_fd *fde;
union {
struct param_send {
*/
static struct async_req *async_syscall_new(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
+ struct tevent_context *ev,
enum async_syscall_type type,
struct async_syscall_state **pstate)
{
* @param[in] ev The event context to work from
* @param[in] type Which syscall will this be
* @param[in] fd The file descriptor we work on
- * @param[in] fde_flags EVENT_FD_READ/WRITE -- what are we interested in?
+ * @param[in] fde_flags TEVENT_FD_READ/WRITE -- what are we interested in?
* @param[in] fde_cb The callback function for the file descriptor event
* @param[in] pstate Where to put the newly created private_data state
* @retval The new request
static struct async_req *async_fde_syscall_new(
TALLOC_CTX *mem_ctx,
- struct event_context *ev,
+ struct tevent_context *ev,
enum async_syscall_type type,
int fd,
uint16_t fde_flags,
- void (*fde_cb)(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+ void (*fde_cb)(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv),
struct async_syscall_state **pstate)
{
return NULL;
}
- state->fde = event_add_fd(ev, state, fd, fde_flags, fde_cb, result);
+ state->fde = tevent_add_fd(ev, state, fd, fde_flags, fde_cb, result);
if (state->fde == NULL) {
TALLOC_FREE(result);
return NULL;
* fde event handler for the "send" syscall
* @param[in] ev The event context that sent us here
* @param[in] fde The file descriptor event associated with the send
- * @param[in] flags Can only be EVENT_FD_WRITE here
+ * @param[in] flags Can only be TEVENT_FD_WRITE here
* @param[in] priv private data, "struct async_req *" in this case
*/
-static void async_send_callback(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+static void async_send_callback(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv)
{
struct async_req *req = talloc_get_type_abort(
struct param_send *p = &state->param.param_send;
if (state->syscall_type != ASYNC_SYSCALL_SEND) {
- async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
* This function is a direct counterpart of send(2)
*/
-struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *async_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
int fd, const void *buffer, size_t length,
int flags)
{
result = async_fde_syscall_new(
mem_ctx, ev, ASYNC_SYSCALL_SEND,
- fd, EVENT_FD_WRITE, async_send_callback,
+ fd, TEVENT_FD_WRITE, async_send_callback,
&state);
if (result == NULL) {
return NULL;
* fde event handler for the "sendall" syscall group
* @param[in] ev The event context that sent us here
* @param[in] fde The file descriptor event associated with the send
- * @param[in] flags Can only be EVENT_FD_WRITE here
+ * @param[in] flags Can only be TEVENT_FD_WRITE here
* @param[in] priv private data, "struct async_req *" in this case
*/
-static void async_sendall_callback(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+static void async_sendall_callback(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv)
{
struct async_req *req = talloc_get_type_abort(
struct param_sendall *p = &state->param.param_sendall;
if (state->syscall_type != ASYNC_SYSCALL_SENDALL) {
- async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
- state->result.result_ssize_t = send(p->fd, (char *)p->buffer + p->sent,
+ state->result.result_ssize_t = send(p->fd,
+ (const char *)p->buffer + p->sent,
p->length - p->sent, p->flags);
state->sys_errno = errno;
if (state->result.result_ssize_t == -1) {
- async_req_error(req, map_nt_error_from_unix(state->sys_errno));
+ async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
return;
}
if (state->result.result_ssize_t == 0) {
- async_req_error(req, NT_STATUS_END_OF_FILE);
+ async_req_nterror(req, NT_STATUS_END_OF_FILE);
return;
}
p->sent += state->result.result_ssize_t;
if (p->sent > p->length) {
- async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
* "length" bytes
*/
-struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
int fd, const void *buffer, size_t length,
int flags)
{
result = async_fde_syscall_new(
mem_ctx, ev, ASYNC_SYSCALL_SENDALL,
- fd, EVENT_FD_WRITE, async_sendall_callback,
+ fd, TEVENT_FD_WRITE, async_sendall_callback,
&state);
if (result == NULL) {
return NULL;
NTSTATUS sendall_recv(struct async_req *req)
{
- return async_req_simple_recv(req);
+ return async_req_simple_recv_ntstatus(req);
}
/**
* fde event handler for the "recv" syscall
* @param[in] ev The event context that sent us here
* @param[in] fde The file descriptor event associated with the recv
- * @param[in] flags Can only be EVENT_FD_READ here
+ * @param[in] flags Can only be TEVENT_FD_READ here
* @param[in] priv private data, "struct async_req *" in this case
*/
-static void async_recv_callback(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+static void async_recv_callback(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv)
{
struct async_req *req = talloc_get_type_abort(
struct param_recv *p = &state->param.param_recv;
if (state->syscall_type != ASYNC_SYSCALL_RECV) {
- async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
* This function is a direct counterpart of recv(2)
*/
-struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
int fd, void *buffer, size_t length,
int flags)
{
result = async_fde_syscall_new(
mem_ctx, ev, ASYNC_SYSCALL_RECV,
- fd, EVENT_FD_READ, async_recv_callback,
+ fd, TEVENT_FD_READ, async_recv_callback,
&state);
if (result == NULL) {
* fde event handler for the "recvall" syscall group
* @param[in] ev The event context that sent us here
* @param[in] fde The file descriptor event associated with the recv
- * @param[in] flags Can only be EVENT_FD_READ here
+ * @param[in] flags Can only be TEVENT_FD_READ here
* @param[in] priv private data, "struct async_req *" in this case
*/
-static void async_recvall_callback(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+static void async_recvall_callback(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv)
{
struct async_req *req = talloc_get_type_abort(
struct param_recvall *p = &state->param.param_recvall;
if (state->syscall_type != ASYNC_SYSCALL_RECVALL) {
- async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
state->sys_errno = errno;
if (state->result.result_ssize_t == -1) {
- async_req_error(req, map_nt_error_from_unix(state->sys_errno));
+ async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
return;
}
if (state->result.result_ssize_t == 0) {
- async_req_error(req, NT_STATUS_END_OF_FILE);
+ async_req_nterror(req, NT_STATUS_END_OF_FILE);
return;
}
p->received += state->result.result_ssize_t;
if (p->received > p->length) {
- async_req_error(req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}
* async_recvall will call recv(2) until "length" bytes are received
*/
-struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
int fd, void *buffer, size_t length,
int flags)
{
result = async_fde_syscall_new(
mem_ctx, ev, ASYNC_SYSCALL_RECVALL,
- fd, EVENT_FD_READ, async_recvall_callback,
+ fd, TEVENT_FD_READ, async_recvall_callback,
&state);
if (result == NULL) {
return NULL;
NTSTATUS recvall_recv(struct async_req *req)
{
- return async_req_simple_recv(req);
+ return async_req_simple_recv_ntstatus(req);
}
struct async_connect_state {
long old_sockflags;
};
-static void async_connect_connected(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+static void async_connect_connected(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv);
/**
*/
struct async_req *async_connect_send(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
+ struct tevent_context *ev,
int fd, const struct sockaddr *address,
socklen_t address_len)
{
struct async_req *result;
struct async_connect_state *state;
- struct fd_event *fde;
+ struct tevent_fd *fde;
NTSTATUS status;
if (!async_req_setup(mem_ctx, &result, &state,
state->fd = fd;
state->sys_errno = 0;
- state->old_sockflags = sys_fcntl_long(fd, F_GETFL, 0);
+ state->old_sockflags = fcntl(fd, F_GETFL, 0);
if (state->old_sockflags == -1) {
goto post_errno;
}
goto post_errno;
}
- fde = event_add_fd(ev, state, fd, EVENT_FD_READ | EVENT_FD_WRITE,
+ fde = tevent_add_fd(ev, state, fd, TEVENT_FD_READ | TEVENT_FD_WRITE,
async_connect_connected, result);
if (fde == NULL) {
status = NT_STATUS_NO_MEMORY;
state->sys_errno = errno;
status = map_nt_error_from_unix(state->sys_errno);
post_status:
- sys_fcntl_long(fd, F_SETFL, state->old_sockflags);
- if (!async_post_status(result, ev, status)) {
+ fcntl(fd, F_SETFL, state->old_sockflags);
+ if (!async_post_ntstatus(result, ev, status)) {
goto fail;
}
return result;
* @param[in] priv private data, "struct async_req *" in this case
*/
-static void async_connect_connected(struct event_context *ev,
- struct fd_event *fde, uint16_t flags,
+static void async_connect_connected(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
void *priv)
{
struct async_req *req = talloc_get_type_abort(
* successful connect, the socket is only writable. Upon an
* error, it's both readable and writable.
*/
- if ((flags & (EVENT_FD_READ|EVENT_FD_WRITE))
- == (EVENT_FD_READ|EVENT_FD_WRITE)) {
+ if ((flags & (TEVENT_FD_READ|TEVENT_FD_WRITE))
+ == (TEVENT_FD_READ|TEVENT_FD_WRITE)) {
int sockerr;
socklen_t err_len = sizeof(sockerr);
DEBUG(10, ("connect returned %s\n", strerror(errno)));
- sys_fcntl_long(state->fd, F_SETFL, state->old_sockflags);
- async_req_error(req, map_nt_error_from_unix(state->sys_errno));
+ fcntl(state->fd, F_SETFL, state->old_sockflags);
+ async_req_nterror(req, map_nt_error_from_unix(state->sys_errno));
return;
}
req->private_data, struct async_connect_state);
NTSTATUS status;
- sys_fcntl_long(state->fd, F_SETFL, state->old_sockflags);
+ fcntl(state->fd, F_SETFL, state->old_sockflags);
*perrno = state->sys_errno;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
if (state->sys_errno == 0) {
--- /dev/null
+/*
+ * Unix SMB/CIFS implementation.
+ * client auto-generated by pidl. DO NOT MODIFY!
+ */
+
+#include "includes.h"
+#include "../librpc/gen_ndr/cli_spoolss.h"
+
+NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ uint32_t flags /* [in] */,
+ const char *server /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumPrinters r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.flags = flags;
+ r.in.server = server;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumPrinters, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMPRINTERS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinters, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *printername /* [in] [unique,charset(UTF16)] */,
+ const char *datatype /* [in] [unique,charset(UTF16)] */,
+ struct spoolss_DevmodeContainer devmode_ctr /* [in] */,
+ uint32_t access_mask /* [in] */,
+ struct policy_handle *handle /* [out] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_OpenPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.printername = printername;
+ r.in.datatype = datatype;
+ r.in.devmode_ctr = devmode_ctr;
+ r.in.access_mask = access_mask;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_OpenPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_OPENPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ *handle = *r.out.handle;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetJob(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t job_id /* [in] */,
+ struct spoolss_JobInfoContainer *ctr /* [in] [unique] */,
+ enum spoolss_JobControl command /* [in] */,
+ WERROR *werror)
+{
+ struct spoolss_SetJob r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.job_id = job_id;
+ r.in.ctr = ctr;
+ r.in.command = command;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_SetJob, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_SETJOB,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_SetJob, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetJob(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t job_id /* [in] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_JobInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+ uint32_t needed /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_GetJob r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.job_id = job_id;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetJob, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETJOB,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetJob, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ *info = *r.out.info;
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t firstjob /* [in] */,
+ uint32_t numjobs /* [in] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumJobs r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.firstjob = firstjob;
+ r.in.numjobs = numjobs;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumJobs, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMJOBS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumJobs, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_DeletePrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t level /* [in] */,
+ union spoolss_SetPrinterInfo info /* [in] [switch_is(level)] */,
+ struct spoolss_DevmodeContainer devmode_ctr /* [in] */,
+ struct sec_desc_buf secdesc_ctr /* [in] */,
+ enum spoolss_PrinterControl command /* [in] */,
+ WERROR *werror)
+{
+ struct spoolss_SetPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.level = level;
+ r.in.info = info;
+ r.in.devmode_ctr = devmode_ctr;
+ r.in.secdesc_ctr = secdesc_ctr;
+ r.in.command = command;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_SetPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_SETPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_SetPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_PrinterInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+ uint32_t needed /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_GetPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ *info = *r.out.info;
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterDriver(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddPrinterDriver r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPrinterDriver, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPRINTERDRIVER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterDriver, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *server /* [in] [unique,charset(UTF16)] */,
+ const char *environment /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumPrinterDrivers r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.server = server;
+ r.in.environment = environment;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterDrivers, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMPRINTERDRIVERS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumPrinterDrivers, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_GetPrinterDriver r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETPRINTERDRIVER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriverDirectory(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *server /* [in] [unique,charset(UTF16)] */,
+ const char *environment /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_DriverDirectoryInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+ uint32_t needed /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_GetPrinterDriverDirectory r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.server = server;
+ r.in.environment = environment;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverDirectory, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ *info = *r.out.info;
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterDriver(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *server /* [in] [unique,charset(UTF16)] */,
+ const char *architecture /* [in] [charset(UTF16)] */,
+ const char *driver /* [in] [charset(UTF16)] */,
+ WERROR *werror)
+{
+ struct spoolss_DeletePrinterDriver r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.server = server;
+ r.in.architecture = architecture;
+ r.in.driver = driver;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterDriver, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPRINTERDRIVER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterDriver, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrintProcessor(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddPrintProcessor r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPrintProcessor, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPRINTPROCESSOR,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProcessor, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *servername /* [in] [unique,charset(UTF16)] */,
+ const char *environment /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumPrintProcessors r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.servername = servername;
+ r.in.environment = environment;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcessors, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMPRINTPROCESSORS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcessors, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_GetPrintProcessorDirectory r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetPrintProcessorDirectory, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_StartDocPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t level /* [in] */,
+ union spoolss_DocumentInfo info /* [in] [switch_is(level)] */,
+ uint32_t job_id /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_StartDocPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.level = level;
+ r.in.info = info;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_StartDocPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_STARTDOCPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_StartDocPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_StartPagePrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_StartPagePrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_StartPagePrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_STARTPAGEPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_StartPagePrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_WritePrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ DATA_BLOB data /* [in] */,
+ uint32_t _data_size /* [in] [value(r->in.data.length)] */,
+ uint32_t num_written /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_WritePrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.data = data;
+ r.in._data_size = _data_size;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_WritePrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_WRITEPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_WritePrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EndPagePrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_EndPagePrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EndPagePrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENDPAGEPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EndPagePrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AbortPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_AbortPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AbortPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ABORTPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AbortPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ReadPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t data_size /* [in] */,
+ DATA_BLOB data /* [out] */,
+ uint32_t _data_size /* [out] [value(r->out.data.length)] */,
+ WERROR *werror)
+{
+ struct spoolss_ReadPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.data_size = data_size;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ReadPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_READPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ReadPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EndDocPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_EndDocPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EndDocPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENDDOCPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EndDocPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddJob(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddJob r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddJob, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDJOB,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddJob, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ScheduleJob(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_ScheduleJob r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ScheduleJob, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_SCHEDULEJOB,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ScheduleJob, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *value_name /* [in] [charset(UTF16)] */,
+ uint32_t offered /* [in] */,
+ enum spoolss_PrinterDataType type /* [out] */,
+ union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(type)] */,
+ uint32_t needed /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_GetPrinterData r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.value_name = value_name;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetPrinterData, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETPRINTERDATA,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterData, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *value_name /* [in] [charset(UTF16)] */,
+ enum spoolss_PrinterDataType type /* [in] */,
+ union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */,
+ uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */,
+ WERROR *werror)
+{
+ struct spoolss_SetPrinterData r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.value_name = value_name;
+ r.in.type = type;
+ r.in.data = data;
+ r.in._offered = _offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_SetPrinterData, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_SETPRINTERDATA,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_SetPrinterData, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_WaitForPrinterChange(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_WaitForPrinterChange r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_WaitForPrinterChange, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_WAITFORPRINTERCHANGE,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_WaitForPrinterChange, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ClosePrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in,out] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_ClosePrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ClosePrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_CLOSEPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ClosePrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ *handle = *r.out.handle;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddForm(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t level /* [in] */,
+ union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
+ WERROR *werror)
+{
+ struct spoolss_AddForm r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.level = level;
+ r.in.info = info;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddForm, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDFORM,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddForm, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeleteForm(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *form_name /* [in] [charset(UTF16)] */,
+ WERROR *werror)
+{
+ struct spoolss_DeleteForm r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.form_name = form_name;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeleteForm, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEFORM,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeleteForm, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetForm(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *form_name /* [in] [charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_FormInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */,
+ uint32_t needed /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_GetForm r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.form_name = form_name;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetForm, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETFORM,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetForm, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ *info = *r.out.info;
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SetForm(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *form_name /* [in] [charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ union spoolss_AddFormInfo info /* [in] [switch_is(level)] */,
+ WERROR *werror)
+{
+ struct spoolss_SetForm r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.form_name = form_name;
+ r.in.level = level;
+ r.in.info = info;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_SetForm, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_SETFORM,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_SetForm, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumForms r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumForms, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMFORMS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumForms, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *servername /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumPorts r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.servername = servername;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumPorts, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMPORTS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumPorts, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *servername /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(count)] */,
+ uint32_t needed /* [out] */,
+ uint32_t count /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_EnumMonitors r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.servername = servername;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumMonitors, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMMONITORS,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumMonitors, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ memcpy(info, r.out.info, count * sizeof(*info));
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *server_name /* [in] [unique,charset(UTF16)] */,
+ uint32_t unknown /* [in] */,
+ const char *monitor_name /* [in] [charset(UTF16)] */,
+ WERROR *werror)
+{
+ struct spoolss_AddPort r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.server_name = server_name;
+ r.in.unknown = unknown;
+ r.in.monitor_name = monitor_name;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPort, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPORT,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPort, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ConfigurePort(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_ConfigurePort r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ConfigurePort, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_CONFIGUREPORT,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ConfigurePort, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_DeletePort r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePort, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPORT,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePort, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_CreatePrinterIC r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_CREATEPRINTERIC,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_CreatePrinterIC, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_PlayGDIScriptOnPrinterIC r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_PlayGDIScriptOnPrinterIC, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_DeletePrinterIC r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPRINTERIC,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterIC, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddPrinterConnection r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPrinterConnection, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPRINTERCONNECTION,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterConnection, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrinterConnection(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_DeletePrinterConnection r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterConnection, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPRINTERCONNECTION,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePrinterConnection, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_PrinterMessageBox(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_PrinterMessageBox r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_PrinterMessageBox, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_PRINTERMESSAGEBOX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_PrinterMessageBox, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddMonitor(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddMonitor r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddMonitor, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDMONITOR,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddMonitor, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeleteMonitor(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_DeleteMonitor r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeleteMonitor, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEMONITOR,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeleteMonitor, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrintProcessor(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_DeletePrintProcessor r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProcessor, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPRINTPROCESSOR,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProcessor, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrintProvidor(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddPrintProvidor r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPrintProvidor, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPRINTPROVIDOR,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPrintProvidor, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_DeletePrintProvidor r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_DeletePrintProvidor, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_DELETEPRINTPROVIDOR,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_DeletePrintProvidor, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_EnumPrintProcDataTypes r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ENUMPRINTPROCDATATYPES,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_EnumPrintProcDataTypes, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_ResetPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ResetPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_RESETPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ const char *architecture /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ DATA_BLOB *buffer /* [in] [unique] */,
+ uint32_t offered /* [in] */,
+ uint32_t client_major_version /* [in] */,
+ uint32_t client_minor_version /* [in] */,
+ DATA_BLOB *info /* [out] [unique] */,
+ uint32_t needed /* [out] */,
+ uint32_t server_major_version /* [out] */,
+ uint32_t server_minor_version /* [out] */,
+ WERROR *werror)
+{
+ struct spoolss_GetPrinterDriver2 r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.architecture = architecture;
+ r.in.level = level;
+ r.in.buffer = buffer;
+ r.in.offered = offered;
+ r.in.client_major_version = client_major_version;
+ r.in.client_minor_version = client_minor_version;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver2, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_GETPRINTERDRIVER2,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriver2, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ if (info && r.out.info) {
+ *info = *r.out.info;
+ }
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+ return NT_STATUS_NOT_SUPPORTED;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_FindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_FindFirstPrinterChangeNotification r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_FindFirstPrinterChangeNotification, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_FindNextPrinterChangeNotification(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_FindNextPrinterChangeNotification r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_FindNextPrinterChangeNotification, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_FindClosePrinterNotify(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_FindClosePrinterNotify r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_FindClosePrinterNotify, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_FindClosePrinterNotify, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotificationOld(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_RouterFindFirstPrinterChangeNotificationOld r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotificationOld, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *server_name /* [in] [charset(UTF16)] */,
+ uint32_t printer_local /* [in] */,
+ enum winreg_Type type /* [in] */,
+ uint32_t unknown1 /* [in] */,
+ uint32_t unknown2 /* [in] */,
+ struct policy_handle *handle /* [out] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_ReplyOpenPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.server_name = server_name;
+ r.in.printer_local = printer_local;
+ r.in.type = type;
+ r.in.unknown1 = unknown1;
+ r.in.unknown2 = unknown2;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_REPLYOPENPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ *handle = *r.out.handle;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_RouterReplyPrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ROUTERREPLYPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ReplyClosePrinter(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in,out] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_ReplyClosePrinter r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_REPLYCLOSEPRINTER,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ *handle = *r.out.handle;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPortEx(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_AddPortEx r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPortEx, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPORTEX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPortEx, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterFindFirstPrinterChangeNotification(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_RouterFindFirstPrinterChangeNotification r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_RouterFindFirstPrinterChangeNotification, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_SpoolerInit(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_SpoolerInit r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_SpoolerInit, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_SPOOLERINIT,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_SpoolerInit, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_ResetPrinterEx(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_ResetPrinterEx r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_ResetPrinterEx, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_RESETPRINTEREX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_ResetPrinterEx, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t flags /* [in] */,
+ uint32_t options /* [in] */,
+ const char *str /* [in] [unique,charset(UTF16)] */,
+ uint32_t printer_local /* [in] */,
+ struct spoolss_NotifyOptionsContainer *t1 /* [in] [unique] */,
+ WERROR *werror)
+{
+ struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.flags = flags;
+ r.in.options = options;
+ r.in.str = str;
+ r.in.printer_local = printer_local;
+ r.in.t1 = t1;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindFirstPrinterChangeNotifyEx, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotification(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_RouterRefreshPrinterChangeNotification r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_RemoteFindNextPrinterChangeNotifyEx(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ uint32_t change_low /* [in] */,
+ struct spoolss_NotifyOptionsContainer *container /* [in] [unique] */,
+ struct spoolss_NotifyInfo **info /* [out] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_RemoteFindNextPrinterChangeNotifyEx r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.handle = handle;
+ r.in.change_low = change_low;
+ r.in.container = container;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ *info = *r.out.info;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_44(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_44 r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_44, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_44,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_44, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_OpenPrinterEx(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *printername /* [in] [unique,charset(UTF16)] */,
+ const char *datatype /* [in] [unique,charset(UTF16)] */,
+ struct spoolss_DevmodeContainer devmode_ctr /* [in] */,
+ uint32_t access_mask /* [in] */,
+ uint32_t level /* [in] */,
+ union spoolss_UserLevel userlevel /* [in] [switch_is(level)] */,
+ struct policy_handle *handle /* [out] [ref] */,
+ WERROR *werror)
+{
+ struct spoolss_OpenPrinterEx r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.printername = printername;
+ r.in.datatype = datatype;
+ r.in.devmode_ctr = devmode_ctr;
+ r.in.access_mask = access_mask;
+ r.in.level = level;
+ r.in.userlevel = userlevel;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_OpenPrinterEx, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_OPENPRINTEREX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_OpenPrinterEx, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+ *handle = *r.out.handle;
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_AddPrinterEx(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *server /* [in] [unique,charset(UTF16)] */,
+ uint32_t level /* [in] */,
+ union spoolss_PrinterInfo *info /* [in] [unique,switch_is(level)] */,
+ struct spoolss_DevmodeContainer devmode_ctr /* [in] */,
+ struct security_descriptor *secdesc /* [in] [unique] */,
+ uint32_t ulevel /* [in] */,
+ union spoolss_UserLevel userlevel /* [in] [switch_is(ulevel)] */,
+ WERROR *werror)
+{
+ struct spoolss_AddPrinterEx r;
+ NTSTATUS status;
+
+ /* In parameters */
+ r.in.server = server;
+ r.in.level = level;
+ r.in.info = info;
+ r.in.devmode_ctr = devmode_ctr;
+ r.in.secdesc = secdesc;
+ r.in.ulevel = ulevel;
+ r.in.userlevel = userlevel;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_ADDPRINTEREX,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_AddPrinterEx, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_ntstatus(r.out.result);
+}
+
+NTSTATUS rpccli_spoolss_47(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
+{
+ struct spoolss_47 r;
+ NTSTATUS status;
+
+ /* In parameters */
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(spoolss_47, &r);
+ }
+
+ status = cli->dispatch(cli,
+ mem_ctx,
+ &ndr_table_spoolss,
+ NDR_SPOOLSS_47,
+ &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(spoolss_47, &r);
+ }
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ /* Return variables */
+
+ /* Return result */
+ if (werror) {
+ *werror = r.out.result;
+ }
+
+ return werror_to_nt