diff options
author | Jeremy Allison <jra@samba.org> | 2000-08-31 19:04:51 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-08-31 19:04:51 +0000 |
commit | fa810d4c8001c10bddce452b4ab1178eb80dee87 (patch) | |
tree | 59edc49534184b4b766e65e416630a2a2763f16d /source3/rpc_server | |
parent | 288ea15a564e0931f8002cfb2ca3b4064bb4c227 (diff) | |
download | samba-fa810d4c8001c10bddce452b4ab1178eb80dee87.tar.gz samba-fa810d4c8001c10bddce452b4ab1178eb80dee87.tar.bz2 samba-fa810d4c8001c10bddce452b4ab1178eb80dee87.zip |
Implemented DELETEFORM tested using Gerald's Win32 test code :-).
Jeremy.
(This used to be commit 596c21a2af0309ce43a5e52a343a671036d05ebf)
Diffstat (limited to 'source3/rpc_server')
-rwxr-xr-x | source3/rpc_server/srv_spoolss.c | 28 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 25 |
2 files changed, 53 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c index e6a0f3ae6d..1e5ef1c673 100755 --- a/source3/rpc_server/srv_spoolss.c +++ b/source3/rpc_server/srv_spoolss.c @@ -1057,6 +1057,33 @@ static BOOL api_spoolss_addform(pipes_struct *p) /**************************************************************************** ****************************************************************************/ +static BOOL api_spoolss_deleteform(pipes_struct *p) +{ + SPOOL_Q_DELETEFORM q_u; + SPOOL_R_DELETEFORM r_u; + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if(!spoolss_io_q_deleteform("", &q_u, data, 0)) { + DEBUG(0,("spoolss_io_q_deleteform: unable to unmarshall SPOOL_Q_DELETEFORM.\n")); + return False; + } + + r_u.status = _spoolss_deleteform(&q_u.handle, &q_u.name); + + if(!spoolss_io_r_deleteform("", &r_u, rdata, 0)) { + DEBUG(0,("spoolss_io_r_deleteform: unable to marshall SPOOL_R_DELETEFORM.\n")); + return False; + } + + return True; +} + +/**************************************************************************** +****************************************************************************/ static BOOL api_spoolss_setform(pipes_struct *p) { SPOOL_Q_SETFORM q_u; @@ -1265,6 +1292,7 @@ struct api_struct api_spoolss_cmds[] = {"SPOOLSS_ENUMPRINTERDATA", SPOOLSS_ENUMPRINTERDATA, api_spoolss_enumprinterdata }, {"SPOOLSS_SETPRINTERDATA", SPOOLSS_SETPRINTERDATA, api_spoolss_setprinterdata }, {"SPOOLSS_ADDFORM", SPOOLSS_ADDFORM, api_spoolss_addform }, + {"SPOOLSS_DELETEFORM", SPOOLSS_DELETEFORM, api_spoolss_deleteform }, {"SPOOLSS_SETFORM", SPOOLSS_SETFORM, api_spoolss_setform }, {"SPOOLSS_ENUMPRINTPROCESSORS", SPOOLSS_ENUMPRINTPROCESSORS, api_spoolss_enumprintprocessors }, {"SPOOLSS_ENUMMONITORS", SPOOLSS_ENUMMONITORS, api_spoolss_enumprintmonitors }, diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 8f58f72d73..0938b37ab3 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4615,6 +4615,31 @@ uint32 _spoolss_addform( POLICY_HND *handle, /**************************************************************************** ****************************************************************************/ +uint32 _spoolss_deleteform( POLICY_HND *handle, UNISTR2 *form_name) +{ + int count=0; + uint32 ret = 0; + nt_forms_struct *list=NULL; + Printer_entry *Printer = find_printer_index_by_hnd(handle); + + DEBUG(5,("spoolss_deleteform\n")); + + if (!OPEN_HANDLE(Printer)) { + DEBUG(0,("_spoolss_deleteform: Invalid handle (%s).\n", OUR_HANDLE(handle))); + return ERROR_INVALID_HANDLE; + } + + count = get_ntforms(&list); + if(!delete_a_form(&list, form_name, &count, &ret)) + return ERROR_INVALID_PARAMETER; + + safe_free(list); + + return ret; +} + +/**************************************************************************** +****************************************************************************/ uint32 _spoolss_setform( POLICY_HND *handle, const UNISTR2 *uni_name, uint32 level, |