diff options
Diffstat (limited to 'source3/rpc_server')
-rwxr-xr-x | source3/rpc_server/srv_spoolss.c | 96 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 218 |
2 files changed, 200 insertions, 114 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c index 685deba2fa..a2bde97865 100755 --- a/source3/rpc_server/srv_spoolss.c +++ b/source3/rpc_server/srv_spoolss.c @@ -716,6 +716,7 @@ static BOOL api_spoolss_enumprinterdrivers(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_getform(pipes_struct *p) { SPOOL_Q_GETFORM q_u; @@ -731,11 +732,7 @@ static BOOL api_spoolss_getform(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_getform(&q_u.handle, q_u.level, - &q_u.formname, r_u.buffer, q_u.offered, &r_u.needed); + r_u.status = _spoolss_getform(p, &q_u, &r_u); if (!new_spoolss_io_r_getform("",&r_u,rdata,0)) { DEBUG(0,("new_spoolss_io_r_getform: unable to marshall SPOOL_R_GETFORM.\n")); @@ -747,6 +744,7 @@ static BOOL api_spoolss_getform(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_enumforms(pipes_struct *p) { SPOOL_Q_ENUMFORMS q_u; @@ -762,12 +760,7 @@ static BOOL api_spoolss_enumforms(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _new_spoolss_enumforms(&q_u.handle, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed, &r_u.numofforms); + r_u.status = _new_spoolss_enumforms(p, &q_u, &r_u); if (!new_spoolss_io_r_enumforms("",&r_u,rdata,0)) { DEBUG(0,("new_spoolss_io_r_enumforms: unable to marshall SPOOL_R_ENUMFORMS.\n")); @@ -777,9 +770,9 @@ static BOOL api_spoolss_enumforms(pipes_struct *p) return True; } - /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_enumports(pipes_struct *p) { SPOOL_Q_ENUMPORTS q_u; @@ -795,12 +788,7 @@ static BOOL api_spoolss_enumports(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_enumports(&q_u.name, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed, &r_u.returned); + r_u.status = _spoolss_enumports(p, &q_u, &r_u); if (!new_spoolss_io_r_enumports("",&r_u,rdata,0)) { DEBUG(0,("new_spoolss_io_r_enumports: unable to marshall SPOOL_R_ENUMPORTS.\n")); @@ -810,9 +798,9 @@ static BOOL api_spoolss_enumports(pipes_struct *p) return True; } - /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_addprinterex(pipes_struct *p) { SPOOL_Q_ADDPRINTEREX q_u; @@ -828,11 +816,7 @@ static BOOL api_spoolss_addprinterex(pipes_struct *p) return False; } - r_u.status = _spoolss_addprinterex(&q_u.server_name, - q_u.level, &q_u.info, - q_u.unk0, q_u.unk1, q_u.unk2, q_u.unk3, - q_u.user_switch, &q_u.user_ctr, - &r_u.handle); + r_u.status = _spoolss_addprinterex(p, &q_u, &r_u); if(!spoolss_io_r_addprinterex("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_addprinterex: unable to marshall SPOOL_R_ADDPRINTEREX.\n")); @@ -844,6 +828,7 @@ static BOOL api_spoolss_addprinterex(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_addprinterdriver(pipes_struct *p) { SPOOL_Q_ADDPRINTERDRIVER q_u; @@ -859,7 +844,7 @@ static BOOL api_spoolss_addprinterdriver(pipes_struct *p) return False; } - r_u.status = _spoolss_addprinterdriver(p, &q_u.server_name, q_u.level, &q_u.info); + r_u.status = _spoolss_addprinterdriver(p, &q_u, &r_u); if(!spoolss_io_r_addprinterdriver("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_addprinterdriver: unable to marshall SPOOL_R_ADDPRINTERDRIVER.\n")); @@ -871,6 +856,7 @@ static BOOL api_spoolss_addprinterdriver(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_getprinterdriverdirectory(pipes_struct *p) { SPOOL_Q_GETPRINTERDRIVERDIR q_u; @@ -886,12 +872,7 @@ static BOOL api_spoolss_getprinterdriverdirectory(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_getprinterdriverdirectory(&q_u.name, &q_u.environment, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed); + r_u.status = _spoolss_getprinterdriverdirectory(p, &q_u, &r_u); if(!spoolss_io_r_getprinterdriverdir("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_getprinterdriverdir: unable to marshall SPOOL_R_GETPRINTERDRIVERDIR.\n")); @@ -903,6 +884,7 @@ static BOOL api_spoolss_getprinterdriverdirectory(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_enumprinterdata(pipes_struct *p) { SPOOL_Q_ENUMPRINTERDATA q_u; @@ -918,10 +900,7 @@ static BOOL api_spoolss_enumprinterdata(pipes_struct *p) return False; } - r_u.status = _spoolss_enumprinterdata(p, &q_u.handle, q_u.index, q_u.valuesize, q_u.datasize, - &r_u.valuesize, &r_u.value, &r_u.realvaluesize, - &r_u.type, - &r_u.datasize, &r_u.data, &r_u.realdatasize); + r_u.status = _spoolss_enumprinterdata(p, &q_u, &r_u); if(!spoolss_io_r_enumprinterdata("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_enumprinterdata: unable to marshall SPOOL_R_ENUMPRINTERDATA.\n")); @@ -933,6 +912,7 @@ static BOOL api_spoolss_enumprinterdata(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_setprinterdata(pipes_struct *p) { SPOOL_Q_SETPRINTERDATA q_u; @@ -948,9 +928,7 @@ static BOOL api_spoolss_setprinterdata(pipes_struct *p) return False; } - r_u.status = _spoolss_setprinterdata(&q_u.handle, - &q_u.value, q_u.type, q_u.max_len, - q_u.data, q_u.real_len, q_u.numeric_data); + r_u.status = _spoolss_setprinterdata(p, &q_u, &r_u); if(!spoolss_io_r_setprinterdata("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_setprinterdata: unable to marshall SPOOL_R_SETPRINTERDATA.\n")); @@ -962,6 +940,7 @@ static BOOL api_spoolss_setprinterdata(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_addform(pipes_struct *p) { SPOOL_Q_ADDFORM q_u; @@ -977,7 +956,7 @@ static BOOL api_spoolss_addform(pipes_struct *p) return False; } - r_u.status = _spoolss_addform(&q_u.handle, q_u.level, &q_u.form); + r_u.status = _spoolss_addform(p, &q_u, &r_u); if(!spoolss_io_r_addform("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_addform: unable to marshall SPOOL_R_ADDFORM.\n")); @@ -989,6 +968,7 @@ static BOOL api_spoolss_addform(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_deleteform(pipes_struct *p) { SPOOL_Q_DELETEFORM q_u; @@ -1004,7 +984,7 @@ static BOOL api_spoolss_deleteform(pipes_struct *p) return False; } - r_u.status = _spoolss_deleteform(&q_u.handle, &q_u.name); + r_u.status = _spoolss_deleteform(p, &q_u, &r_u); if(!spoolss_io_r_deleteform("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_deleteform: unable to marshall SPOOL_R_DELETEFORM.\n")); @@ -1016,6 +996,7 @@ static BOOL api_spoolss_deleteform(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_setform(pipes_struct *p) { SPOOL_Q_SETFORM q_u; @@ -1031,7 +1012,7 @@ static BOOL api_spoolss_setform(pipes_struct *p) return False; } - r_u.status = _spoolss_setform(&q_u.handle, &q_u.name, q_u.level, &q_u.form); + r_u.status = _spoolss_setform(p, &q_u, &r_u); if(!spoolss_io_r_setform("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_setform: unable to marshall SPOOL_R_SETFORM.\n")); @@ -1043,6 +1024,7 @@ static BOOL api_spoolss_setform(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_enumprintprocessors(pipes_struct *p) { SPOOL_Q_ENUMPRINTPROCESSORS q_u; @@ -1058,12 +1040,7 @@ static BOOL api_spoolss_enumprintprocessors(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_enumprintprocessors(&q_u.name, &q_u.environment, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed, &r_u.returned); + r_u.status = _spoolss_enumprintprocessors(p, &q_u, &r_u); if(!spoolss_io_r_enumprintprocessors("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_enumprintprocessors: unable to marshall SPOOL_R_ENUMPRINTPROCESSORS.\n")); @@ -1075,6 +1052,7 @@ static BOOL api_spoolss_enumprintprocessors(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_enumprintprocdatatypes(pipes_struct *p) { SPOOL_Q_ENUMPRINTPROCDATATYPES q_u; @@ -1090,12 +1068,7 @@ static BOOL api_spoolss_enumprintprocdatatypes(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_enumprintprocdatatypes(&q_u.name, &q_u.processor, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed, &r_u.returned); + r_u.status = _spoolss_enumprintprocdatatypes(p, &q_u, &r_u); if(!spoolss_io_r_enumprintprocdatatypes("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_enumprintprocdatatypes: unable to marshall SPOOL_R_ENUMPRINTPROCDATATYPES.\n")); @@ -1107,6 +1080,7 @@ static BOOL api_spoolss_enumprintprocdatatypes(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_enumprintmonitors(pipes_struct *p) { SPOOL_Q_ENUMPRINTMONITORS q_u; @@ -1122,12 +1096,7 @@ static BOOL api_spoolss_enumprintmonitors(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_enumprintmonitors(&q_u.name, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed, &r_u.returned); + r_u.status = _spoolss_enumprintmonitors(p, &q_u, &r_u); if (!spoolss_io_r_enumprintmonitors("", &r_u, rdata, 0)) { DEBUG(0,("spoolss_io_r_enumprintmonitors: unable to marshall SPOOL_R_ENUMPRINTMONITORS.\n")); @@ -1139,6 +1108,7 @@ static BOOL api_spoolss_enumprintmonitors(pipes_struct *p) /**************************************************************************** ****************************************************************************/ + static BOOL api_spoolss_getjob(pipes_struct *p) { SPOOL_Q_GETJOB q_u; @@ -1151,12 +1121,7 @@ static BOOL api_spoolss_getjob(pipes_struct *p) return False; } - /* that's an [in out] buffer */ - new_spoolss_move_buffer(q_u.buffer, &r_u.buffer); - - r_u.status = _spoolss_getjob(&q_u.handle, q_u.jobid, q_u.level, - r_u.buffer, q_u.offered, - &r_u.needed); + r_u.status = _spoolss_getjob(p, &q_u, &r_u); if(!spoolss_io_r_getjob("",&r_u,rdata,0)) { DEBUG(0,("spoolss_io_r_getjob: unable to marshall SPOOL_R_GETJOB.\n")); @@ -1169,6 +1134,7 @@ static BOOL api_spoolss_getjob(pipes_struct *p) /******************************************************************* \pipe\spoolss commands ********************************************************************/ + struct api_struct api_spoolss_cmds[] = { {"SPOOLSS_OPENPRINTEREX", SPOOLSS_OPENPRINTEREX, api_spoolss_open_printer_ex }, diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 1f179a9b1d..8e7e3c28e5 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -5191,6 +5191,7 @@ uint32 _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS /**************************************************************************** ****************************************************************************/ + static void fill_form_1(FORM_1 *form, nt_forms_struct *list) { form->flag=list->flag; @@ -5205,15 +5206,25 @@ static void fill_form_1(FORM_1 *form, nt_forms_struct *list) /**************************************************************************** ****************************************************************************/ -uint32 _new_spoolss_enumforms( POLICY_HND *handle, uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed, uint32 *numofforms) + +uint32 _new_spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u) { +/* POLICY_HND *handle = &q_u->handle; - notused. */ + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + uint32 *numofforms = &r_u->numofforms; + nt_forms_struct *list=NULL; FORM_1 *forms_1; int buffer_size=0; int i; + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(4,("_new_spoolss_enumforms\n")); DEBUGADD(5,("Offered buffer size [%d]\n", offered)); DEBUGADD(5,("Info level [%d]\n", level)); @@ -5275,14 +5286,26 @@ uint32 _new_spoolss_enumforms( POLICY_HND *handle, uint32 level, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getform( POLICY_HND *handle, uint32 level, UNISTR2 *uni_formname, NEW_BUFFER *buffer, uint32 offered, uint32 *needed) + +uint32 _spoolss_getform(pipes_struct *p, SPOOL_Q_GETFORM *q_u, SPOOL_R_GETFORM *r_u) { +/* POLICY_HND *handle = &q_u->handle; - notused. */ + uint32 level = q_u->level; + UNISTR2 *uni_formname = &q_u->formname; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + nt_forms_struct *list=NULL; FORM_1 form_1; fstring form_name; int buffer_size=0; int numofforms, i; + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + unistr2_to_ascii(form_name, uni_formname, sizeof(form_name)-1); DEBUG(4,("_spoolss_getform\n")); @@ -5554,10 +5577,20 @@ static uint32 enumports_level_2(NEW_BUFFER *buffer, uint32 offered, uint32 *need /**************************************************************************** enumports. ****************************************************************************/ -uint32 _spoolss_enumports( UNISTR2 *name, uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed, uint32 *returned) + +uint32 _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUMPORTS *r_u) { +/* UNISTR2 *name = &q_u->name; - notused. */ + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + uint32 *returned = &r_u->returned; + + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(4,("_spoolss_enumports\n")); *returned=0; @@ -5646,12 +5679,20 @@ static uint32 spoolss_addprinterex_level_2( const UNISTR2 *uni_srv_name, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level, - const SPOOL_PRINTER_INFO_LEVEL *info, - uint32 unk0, uint32 unk1, uint32 unk2, uint32 unk3, - uint32 user_switch, const SPOOL_USER_CTR *user, - POLICY_HND *handle) + +uint32 _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u) { + UNISTR2 *uni_srv_name = &q_u->server_name; + uint32 level = q_u->level; + SPOOL_PRINTER_INFO_LEVEL *info = &q_u->info; + uint32 unk0 = q_u->unk0; + uint32 unk1 = q_u->unk1; + uint32 unk2 = q_u->unk2; + uint32 unk3 = q_u->unk3; + uint32 user_switch = q_u->user_switch; + SPOOL_USER_CTR *user = &q_u->user_ctr; + POLICY_HND *handle = &r_u->handle; + switch (level) { case 1: /* we don't handle yet */ @@ -5668,9 +5709,13 @@ uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addprinterdriver(pipes_struct *p, const UNISTR2 *server_name, - uint32 level, const SPOOL_PRINTER_DRIVER_INFO_LEVEL *info) + +uint32 _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u, SPOOL_R_ADDPRINTERDRIVER *r_u) { +/* UNISTR2 *server_name = &q_u->server_name; - notused. */ + uint32 level = q_u->level; + SPOOL_PRINTER_DRIVER_INFO_LEVEL *info = &q_u->info; + uint32 err = NT_STATUS_NO_PROBLEMO; NT_PRINTER_DRIVER_INFO_LEVEL driver; struct current_user user; @@ -5751,10 +5796,20 @@ static uint32 getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environmen /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getprinterdriverdirectory(UNISTR2 *name, UNISTR2 *uni_environment, uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed) + +uint32 _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, SPOOL_R_GETPRINTERDRIVERDIR *r_u) { + UNISTR2 *name = &q_u->name; + UNISTR2 *uni_environment = &q_u->environment; + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(4,("_spoolss_getprinterdriverdirectory\n")); *needed=0; @@ -5769,12 +5824,21 @@ uint32 _spoolss_getprinterdriverdirectory(UNISTR2 *name, UNISTR2 *uni_environmen /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprinterdata(pipes_struct *p, POLICY_HND *handle, uint32 idx, - uint32 in_value_len, uint32 in_data_len, - uint32 *out_max_value_len, uint16 **out_value, uint32 *out_value_len, - uint32 *out_type, - uint32 *out_max_data_len, uint8 **data_out, uint32 *out_data_len) + +uint32 _spoolss_enumprinterdata(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATA *q_u, SPOOL_R_ENUMPRINTERDATA *r_u) { + POLICY_HND *handle = &q_u->handle; + uint32 idx = q_u->index; + uint32 in_value_len = q_u->valuesize; + uint32 in_data_len = q_u->datasize; + uint32 *out_max_value_len = &r_u->valuesize; + uint16 **out_value = &r_u->value; + uint32 *out_value_len = &r_u->realvaluesize; + uint32 *out_type = &r_u->type; + uint32 *out_max_data_len = &r_u->datasize; + uint8 **data_out = &r_u->data; + uint32 *out_data_len = &r_u->realdatasize; + NT_PRINTER_INFO_LEVEL *printer = NULL; fstring value; @@ -5927,14 +5991,17 @@ uint32 _spoolss_enumprinterdata(pipes_struct *p, POLICY_HND *handle, uint32 idx, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_setprinterdata( POLICY_HND *handle, - const UNISTR2 *value, - uint32 type, - uint32 max_len, - const uint8 *data, - uint32 real_len, - uint32 numeric_data) + +uint32 _spoolss_setprinterdata( pipes_struct *p, SPOOL_Q_SETPRINTERDATA *q_u, SPOOL_R_SETPRINTERDATA *r_u) { + POLICY_HND *handle = &q_u->handle; + UNISTR2 *value = &q_u->value; + uint32 type = q_u->type; +/* uint32 max_len = q_u->max_len; - notused. */ + uint8 *data = q_u->data; + uint32 real_len = q_u->real_len; +/* uint32 numeric_data = q_u->numeric_data; - notused. */ + NT_PRINTER_INFO_LEVEL *printer = NULL; NT_PRINTER_PARAM *param = NULL, old_param; int snum=0; @@ -6047,10 +6114,13 @@ uint32 _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_ /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_addform( POLICY_HND *handle, - uint32 level, - const FORM *form) + +uint32 _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM *r_u) { + POLICY_HND *handle = &q_u->handle; +/* uint32 level = q_u->level; - notused. */ + FORM *form = &q_u->form; + int count=0; nt_forms_struct *list=NULL; Printer_entry *Printer = find_printer_index_by_hnd(handle); @@ -6074,8 +6144,12 @@ uint32 _spoolss_addform( POLICY_HND *handle, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_deleteform( POLICY_HND *handle, UNISTR2 *form_name) + +uint32 _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u) { + POLICY_HND *handle = &q_u->handle; + UNISTR2 *form_name = &q_u->name; + int count=0; uint32 ret = 0; nt_forms_struct *list=NULL; @@ -6099,11 +6173,14 @@ uint32 _spoolss_deleteform( POLICY_HND *handle, UNISTR2 *form_name) /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_setform( POLICY_HND *handle, - const UNISTR2 *uni_name, - uint32 level, - const FORM *form) + +uint32 _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u) { + POLICY_HND *handle = &q_u->handle; +/* UNISTR2 *uni_name = &q_u->name; - notused. */ +/* uint32 level = q_u->level; - notused. */ + FORM *form = &q_u->form; + int count=0; nt_forms_struct *list=NULL; Printer_entry *Printer = find_printer_index_by_hnd(handle); @@ -6156,10 +6233,21 @@ static uint32 enumprintprocessors_level_1(NEW_BUFFER *buffer, uint32 offered, ui /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprintprocessors(UNISTR2 *name, UNISTR2 *environment, uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed, uint32 *returned) + +uint32 _spoolss_enumprintprocessors(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, SPOOL_R_ENUMPRINTPROCESSORS *r_u) { +/* UNISTR2 *name = &q_u->name; - notused. */ +/* UNISTR2 *environment = &q_u->environment; - notused. */ + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + uint32 *returned = &r_u->returned; + + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(5,("spoolss_enumprintprocessors\n")); /* @@ -6213,10 +6301,21 @@ static uint32 enumprintprocdatatypes_level_1(NEW_BUFFER *buffer, uint32 offered, /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprintprocdatatypes(UNISTR2 *name, UNISTR2 *processor, uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed, uint32 *returned) + +uint32 _spoolss_enumprintprocdatatypes(pipes_struct *p, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u) { +/* UNISTR2 *name = &q_u->name; - notused. */ +/* UNISTR2 *processor = &q_u->processor; - notused. */ + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + uint32 *returned = &r_u->returned; + + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(5,("_spoolss_enumprintprocdatatypes\n")); *returned=0; @@ -6233,6 +6332,7 @@ uint32 _spoolss_enumprintprocdatatypes(UNISTR2 *name, UNISTR2 *processor, uint32 /**************************************************************************** enumprintmonitors level 1. ****************************************************************************/ + static uint32 enumprintmonitors_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { PRINTMONITOR_1 *info_1=NULL; @@ -6296,10 +6396,20 @@ static uint32 enumprintmonitors_level_2(NEW_BUFFER *buffer, uint32 offered, uint /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_enumprintmonitors(UNISTR2 *name,uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed, uint32 *returned) + +uint32 _spoolss_enumprintmonitors(pipes_struct *p, SPOOL_Q_ENUMPRINTMONITORS *q_u, SPOOL_R_ENUMPRINTMONITORS *r_u) { +/* UNISTR2 *name = &q_u->name; - notused. */ + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + uint32 *returned = &r_u->returned; + + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(5,("spoolss_enumprintmonitors\n")); /* @@ -6431,15 +6541,25 @@ static uint32 getjob_level_2(print_queue_struct *queue, int count, int snum, uin /**************************************************************************** ****************************************************************************/ -uint32 _spoolss_getjob( POLICY_HND *handle, uint32 jobid, uint32 level, - NEW_BUFFER *buffer, uint32 offered, - uint32 *needed) + +uint32 _spoolss_getjob( pipes_struct *p, SPOOL_Q_GETJOB *q_u, SPOOL_R_GETJOB *r_u) { + POLICY_HND *handle = &q_u->handle; + uint32 jobid = q_u->jobid; + uint32 level = q_u->level; + NEW_BUFFER *buffer = NULL; + uint32 offered = q_u->offered; + uint32 *needed = &r_u->needed; + int snum; int count; print_queue_struct *queue=NULL; print_status_struct prt_status; + /* that's an [in out] buffer */ + new_spoolss_move_buffer(q_u->buffer, &r_u->buffer); + buffer = r_u->buffer; + DEBUG(5,("spoolss_getjob\n")); memset(&prt_status, 0, sizeof(prt_status)); |