diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-06-16 19:53:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:17 -0500 |
commit | 19c9f032fd65b67529c8b49763a7413899ff5da4 (patch) | |
tree | 838cb3afd389be2d7592eefd8872fe4bba10426c /source4/rpc_server | |
parent | 8f85427d6d8fa7e6bfd76ed5335c8dbe7dd14afe (diff) | |
download | samba-19c9f032fd65b67529c8b49763a7413899ff5da4.tar.gz samba-19c9f032fd65b67529c8b49763a7413899ff5da4.tar.bz2 samba-19c9f032fd65b67529c8b49763a7413899ff5da4.zip |
r7644: - remove some dublicate structures SetForm and AddForm uses the same struct
- fix some typos in EnumPrintServerForms()/GetPrintServerForms()
- add AddPrintServerForms()/SetPrintServerForms() and DeletePrintServerForms
metze
(This used to be commit 73906388421beebb34f2a00c9e0d1fc8b400a42a)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/spoolss/dcesrv_spoolss.c | 66 |
1 files changed, 63 insertions, 3 deletions
diff --git a/source4/rpc_server/spoolss/dcesrv_spoolss.c b/source4/rpc_server/spoolss/dcesrv_spoolss.c index 7689f084a9..f8a0ab5efa 100644 --- a/source4/rpc_server/spoolss/dcesrv_spoolss.c +++ b/source4/rpc_server/spoolss/dcesrv_spoolss.c @@ -581,7 +581,27 @@ static WERROR spoolss_ClosePrinter(struct dcesrv_call_state *dce_call, TALLOC_CT static WERROR spoolss_AddForm(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct spoolss_AddForm *r) { - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); + struct ntptr_GenericHandle *handle; + struct dcesrv_handle *h; + WERROR status; + + DCESRV_PULL_HANDLE_WERR(h, r->in.handle, DCESRV_HANDLE_ANY); + handle = talloc_get_type(h->data, struct ntptr_GenericHandle); + + switch (handle->type) { + case NTPTR_HANDLE_SERVER: + status = ntptr_AddPrintServerForm(handle, mem_ctx, r); + W_ERROR_NOT_OK_RETURN(status); + break; + case NTPTR_HANDLE_PRINTER: + status = ntptr_AddPrinterForm(handle, mem_ctx, r); + W_ERROR_NOT_OK_RETURN(status); + break; + default: + return WERR_FOOBAR; + } + + return WERR_OK; } @@ -591,7 +611,27 @@ static WERROR spoolss_AddForm(struct dcesrv_call_state *dce_call, TALLOC_CTX *me static WERROR spoolss_DeleteForm(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct spoolss_DeleteForm *r) { - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); + struct ntptr_GenericHandle *handle; + struct dcesrv_handle *h; + WERROR status; + + DCESRV_PULL_HANDLE_WERR(h, r->in.handle, DCESRV_HANDLE_ANY); + handle = talloc_get_type(h->data, struct ntptr_GenericHandle); + + switch (handle->type) { + case NTPTR_HANDLE_SERVER: + status = ntptr_DeletePrintServerForm(handle, mem_ctx, r); + W_ERROR_NOT_OK_RETURN(status); + break; + case NTPTR_HANDLE_PRINTER: + status = ntptr_DeletePrinterForm(handle, mem_ctx, r); + W_ERROR_NOT_OK_RETURN(status); + break; + default: + return WERR_FOOBAR; + } + + return WERR_OK; } @@ -633,7 +673,27 @@ static WERROR spoolss_GetForm(struct dcesrv_call_state *dce_call, TALLOC_CTX *me static WERROR spoolss_SetForm(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct spoolss_SetForm *r) { - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); + struct ntptr_GenericHandle *handle; + struct dcesrv_handle *h; + WERROR status; + + DCESRV_PULL_HANDLE_WERR(h, r->in.handle, DCESRV_HANDLE_ANY); + handle = talloc_get_type(h->data, struct ntptr_GenericHandle); + + switch (handle->type) { + case NTPTR_HANDLE_SERVER: + status = ntptr_SetPrintServerForm(handle, mem_ctx, r); + W_ERROR_NOT_OK_RETURN(status); + break; + case NTPTR_HANDLE_PRINTER: + status = ntptr_SetPrinterForm(handle, mem_ctx, r); + W_ERROR_NOT_OK_RETURN(status); + break; + default: + return WERR_FOOBAR; + } + + return WERR_OK; } |