diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 661 |
1 files changed, 0 insertions, 661 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 78c041f863..337121d70d 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -829,52 +829,6 @@ bool smb_io_printer_info_7(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_7 } /******************************************************************* - Parse a PORT_INFO_1 structure. -********************************************************************/ - -bool smb_io_port_info_1(const char *desc, RPC_BUFFER *buffer, PORT_INFO_1 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_port_info_1"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (!smb_io_relstr("port_name", buffer, depth, &info->port_name)) - return False; - - return True; -} - -/******************************************************************* - Parse a PORT_INFO_2 structure. -********************************************************************/ - -bool smb_io_port_info_2(const char *desc, RPC_BUFFER *buffer, PORT_INFO_2 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_port_info_2"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (!smb_io_relstr("port_name", buffer, depth, &info->port_name)) - return False; - if (!smb_io_relstr("monitor_name", buffer, depth, &info->monitor_name)) - return False; - if (!smb_io_relstr("description", buffer, depth, &info->description)) - return False; - if (!prs_uint32("port_type", ps, depth, &info->port_type)) - return False; - if (!prs_uint32("reserved", ps, depth, &info->reserved)) - return False; - - return True; -} - -/******************************************************************* Parse a DRIVER_INFO_1 structure. ********************************************************************/ @@ -1136,162 +1090,6 @@ bool smb_io_job_info_2(const char *desc, RPC_BUFFER *buffer, JOB_INFO_2 *info, i } /******************************************************************* -********************************************************************/ - -bool smb_io_form_1(const char *desc, RPC_BUFFER *buffer, FORM_1 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_form_1"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (!prs_uint32("flag", ps, depth, &info->flag)) - return False; - - if (!smb_io_relstr("name", buffer, depth, &info->name)) - return False; - - if (!prs_uint32("width", ps, depth, &info->width)) - return False; - if (!prs_uint32("length", ps, depth, &info->length)) - return False; - if (!prs_uint32("left", ps, depth, &info->left)) - return False; - if (!prs_uint32("top", ps, depth, &info->top)) - return False; - if (!prs_uint32("right", ps, depth, &info->right)) - return False; - if (!prs_uint32("bottom", ps, depth, &info->bottom)) - return False; - - return True; -} - -/******************************************************************* - Parse a PORT_INFO_1 structure. -********************************************************************/ - -bool smb_io_port_1(const char *desc, RPC_BUFFER *buffer, PORT_INFO_1 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_port_1"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if(!smb_io_relstr("port_name", buffer, depth, &info->port_name)) - return False; - - return True; -} - -/******************************************************************* - Parse a PORT_INFO_2 structure. -********************************************************************/ - -bool smb_io_port_2(const char *desc, RPC_BUFFER *buffer, PORT_INFO_2 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_port_2"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if(!smb_io_relstr("port_name", buffer, depth, &info->port_name)) - return False; - if(!smb_io_relstr("monitor_name", buffer, depth, &info->monitor_name)) - return False; - if(!smb_io_relstr("description", buffer, depth, &info->description)) - return False; - if(!prs_uint32("port_type", ps, depth, &info->port_type)) - return False; - if(!prs_uint32("reserved", ps, depth, &info->reserved)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool smb_io_printprocessor_info_1(const char *desc, RPC_BUFFER *buffer, PRINTPROCESSOR_1 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_printprocessor_info_1"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (smb_io_relstr("name", buffer, depth, &info->name)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool smb_io_printprocdatatype_info_1(const char *desc, RPC_BUFFER *buffer, PRINTPROCDATATYPE_1 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_printprocdatatype_info_1"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (smb_io_relstr("name", buffer, depth, &info->name)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool smb_io_printmonitor_info_1(const char *desc, RPC_BUFFER *buffer, PRINTMONITOR_1 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_printmonitor_info_1"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (!smb_io_relstr("name", buffer, depth, &info->name)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool smb_io_printmonitor_info_2(const char *desc, RPC_BUFFER *buffer, PRINTMONITOR_2 *info, int depth) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "smb_io_printmonitor_info_2"); - depth++; - - buffer->struct_start=prs_offset(ps); - - if (!smb_io_relstr("name", buffer, depth, &info->name)) - return False; - if (!smb_io_relstr("environment", buffer, depth, &info->environment)) - return False; - if (!smb_io_relstr("dll_name", buffer, depth, &info->dll_name)) - return False; - - return True; -} - -/******************************************************************* return the size required by a struct in the stream ********************************************************************/ @@ -1646,81 +1444,6 @@ uint32 spoolss_size_job_info_2(JOB_INFO_2 *info) /******************************************************************* return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_form_1(FORM_1 *info) -{ - int size=0; - - size+=size_of_uint32( &info->flag ); - size+=size_of_relative_string( &info->name ); - size+=size_of_uint32( &info->width ); - size+=size_of_uint32( &info->length ); - size+=size_of_uint32( &info->left ); - size+=size_of_uint32( &info->top ); - size+=size_of_uint32( &info->right ); - size+=size_of_uint32( &info->bottom ); - - return size; -} - -/******************************************************************* -return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_port_info_1(PORT_INFO_1 *info) -{ - int size=0; - - size+=size_of_relative_string( &info->port_name ); - - return size; -} - -/******************************************************************* -return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_port_info_2(PORT_INFO_2 *info) -{ - int size=0; - - size+=size_of_relative_string( &info->port_name ); - size+=size_of_relative_string( &info->monitor_name ); - size+=size_of_relative_string( &info->description ); - - size+=size_of_uint32( &info->port_type ); - size+=size_of_uint32( &info->reserved ); - - return size; -} - -/******************************************************************* -return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_printprocessor_info_1(PRINTPROCESSOR_1 *info) -{ - int size=0; - size+=size_of_relative_string( &info->name ); - - return size; -} - -/******************************************************************* -return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_printprocdatatype_info_1(PRINTPROCDATATYPE_1 *info) -{ - int size=0; - size+=size_of_relative_string( &info->name ); - - return size; -} - -/******************************************************************* -return the size required by a struct in the stream ********************************************************************/ uint32 spoolss_size_printer_enum_values(PRINTER_ENUM_VALUES *p) { @@ -1739,32 +1462,6 @@ uint32 spoolss_size_printer_enum_values(PRINTER_ENUM_VALUES *p) } /******************************************************************* -return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_printmonitor_info_1(PRINTMONITOR_1 *info) -{ - int size=0; - size+=size_of_relative_string( &info->name ); - - return size; -} - -/******************************************************************* -return the size required by a struct in the stream -********************************************************************/ - -uint32 spoolss_size_printmonitor_info_2(PRINTMONITOR_2 *info) -{ - int size=0; - size+=size_of_relative_string( &info->name); - size+=size_of_relative_string( &info->environment); - size+=size_of_relative_string( &info->dll_name); - - return size; -} - -/******************************************************************* * read a structure. * called from spoolss_getprinterdriver2 (srv_spoolss.c) ********************************************************************/ @@ -1862,24 +1559,6 @@ bool make_spoolss_q_enumprinters( } /******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_enumports(SPOOL_Q_ENUMPORTS *q_u, - fstring servername, uint32 level, - RPC_BUFFER *buffer, uint32 offered) -{ - q_u->name_ptr = (servername != NULL) ? 1 : 0; - init_buf_unistr2(&q_u->name, &q_u->name_ptr, servername); - - q_u->level=level; - q_u->buffer=buffer; - q_u->offered=offered; - - return True; -} - -/******************************************************************* * read a structure. * called from spoolss_enumprinters (srv_spoolss.c) ********************************************************************/ @@ -2182,124 +1861,6 @@ bool spoolss_io_q_enumprinterdrivers(const char *desc, SPOOL_Q_ENUMPRINTERDRIVER } /******************************************************************* -********************************************************************/ - -bool spoolss_io_q_enumforms(const char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth) -{ - - prs_debug(ps, depth, desc, "spoolss_io_q_enumforms"); - depth++; - - if (!prs_align(ps)) - return False; - if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - if (!prs_uint32("level", ps, depth, &q_u->level)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &q_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - if (!prs_uint32("offered", ps, depth, &q_u->offered)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_enumforms(const char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_enumforms"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &r_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("size of buffer needed", ps, depth, &r_u->needed)) - return False; - - if (!prs_uint32("numofforms", ps, depth, &r_u->numofforms)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - Parse a SPOOL_R_ENUMPORTS structure. -********************************************************************/ - -bool spoolss_io_r_enumports(const char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_enumports"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &r_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("needed", ps, depth, &r_u->needed)) - return False; - - if (!prs_uint32("returned", ps, depth, &r_u->returned)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_enumports(const char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, ""); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("", ps, depth, &q_u->name_ptr)) - return False; - if (!smb_io_unistr2("", &q_u->name,True,ps,depth)) - return False; - - if (!prs_align(ps)) - return False; - if (!prs_uint32("level", ps, depth, &q_u->level)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &q_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - if (!prs_uint32("offered", ps, depth, &q_u->offered)) - return False; - - return True; -} - -/******************************************************************* make a BUFFER5 struct from a uint16* ******************************************************************/ @@ -2326,212 +1887,6 @@ bool make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16 /******************************************************************* ********************************************************************/ -bool spoolss_io_r_enumprintprocessors(const char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_enumprintprocessors"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &r_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("needed", ps, depth, &r_u->needed)) - return False; - - if (!prs_uint32("returned", ps, depth, &r_u->returned)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_enumprintprocessors(const char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_enumprintprocessors"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("name_ptr", ps, depth, &q_u->name_ptr)) - return False; - if (!smb_io_unistr2("name", &q_u->name, True, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("", ps, depth, &q_u->environment_ptr)) - return False; - if (!smb_io_unistr2("", &q_u->environment, q_u->environment_ptr, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("level", ps, depth, &q_u->level)) - return False; - - if(!prs_rpcbuffer_p("", ps, depth, &q_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("offered", ps, depth, &q_u->offered)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_enumprintprocdatatypes(const char *desc, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_enumprintprocdatatypes"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &r_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("needed", ps, depth, &r_u->needed)) - return False; - - if (!prs_uint32("returned", ps, depth, &r_u->returned)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_enumprintprocdatatypes(const char *desc, SPOOL_Q_ENUMPRINTPROCDATATYPES *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_enumprintprocdatatypes"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("name_ptr", ps, depth, &q_u->name_ptr)) - return False; - if (!smb_io_unistr2("name", &q_u->name, True, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("processor_ptr", ps, depth, &q_u->processor_ptr)) - return False; - if (!smb_io_unistr2("processor", &q_u->processor, q_u->processor_ptr, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("level", ps, depth, &q_u->level)) - return False; - - if(!prs_rpcbuffer_p("buffer", ps, depth, &q_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("offered", ps, depth, &q_u->offered)) - return False; - - return True; -} - -/******************************************************************* - Parse a SPOOL_Q_ENUMPRINTMONITORS structure. -********************************************************************/ - -bool spoolss_io_q_enumprintmonitors(const char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_enumprintmonitors"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("name_ptr", ps, depth, &q_u->name_ptr)) - return False; - if (!smb_io_unistr2("name", &q_u->name, True, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("level", ps, depth, &q_u->level)) - return False; - - if(!prs_rpcbuffer_p("", ps, depth, &q_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("offered", ps, depth, &q_u->offered)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_enumprintmonitors(const char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_enumprintmonitors"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_rpcbuffer_p("", ps, depth, &r_u->buffer)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("needed", ps, depth, &r_u->needed)) - return False; - - if (!prs_uint32("returned", ps, depth, &r_u->returned)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - bool spoolss_io_r_enumprinterdata(const char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_enumprinterdata"); @@ -3083,19 +2438,3 @@ bool spoolss_io_r_enumprinterdataex(const char *desc, SPOOL_R_ENUMPRINTERDATAEX return False; return True; } - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_enumforms(SPOOL_Q_ENUMFORMS *q_u, POLICY_HND *handle, - uint32 level, RPC_BUFFER *buffer, - uint32 offered) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - q_u->level = level; - q_u->buffer=buffer; - q_u->offered=offered; - - return True; -} |