diff options
Diffstat (limited to 'source3/rpc_parse/parse_spoolss.c')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 1001 |
1 files changed, 0 insertions, 1001 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 3fe0c3a416..84b764eeab 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -1232,60 +1232,6 @@ bool spoolss_io_r_open_printer_ex(const char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u } /******************************************************************* - * init a structure. - ********************************************************************/ -bool make_spoolss_q_deleteprinterdriverex( TALLOC_CTX *mem_ctx, - SPOOL_Q_DELETEPRINTERDRIVEREX *q_u, - const char *server, - const char* arch, - const char* driver, - int version) -{ - DEBUG(5,("make_spoolss_q_deleteprinterdriverex\n")); - - q_u->server_ptr = (server!=NULL)?1:0; - q_u->delete_flags = DPD_DELETE_UNUSED_FILES; - - /* these must be NULL terminated or else NT4 will - complain about invalid parameters --jerry */ - init_unistr2(&q_u->server, server, UNI_STR_TERMINATE); - init_unistr2(&q_u->arch, arch, UNI_STR_TERMINATE); - init_unistr2(&q_u->driver, driver, UNI_STR_TERMINATE); - - if (version >= 0) { - q_u->delete_flags |= DPD_DELETE_SPECIFIC_VERSION; - q_u->version = version; - } - - return True; -} - - -/******************************************************************* - * init a structure. - ********************************************************************/ -bool make_spoolss_q_deleteprinterdriver( - TALLOC_CTX *mem_ctx, - SPOOL_Q_DELETEPRINTERDRIVER *q_u, - const char *server, - const char* arch, - const char* driver -) -{ - DEBUG(5,("make_spoolss_q_deleteprinterdriver\n")); - - q_u->server_ptr = (server!=NULL)?1:0; - - /* these must be NULL terminated or else NT4 will - complain about invalid parameters --jerry */ - init_unistr2(&q_u->server, server, UNI_STR_TERMINATE); - init_unistr2(&q_u->arch, arch, UNI_STR_TERMINATE); - init_unistr2(&q_u->driver, driver, UNI_STR_TERMINATE); - - return True; -} - -/******************************************************************* * make a structure. ********************************************************************/ @@ -1355,88 +1301,6 @@ bool spoolss_io_q_getprinterdata(const char *desc, SPOOL_Q_GETPRINTERDATA *q_u, } /******************************************************************* - * read a structure. - * called from spoolss_q_deleteprinterdata (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_deleteprinterdata(const char *desc, SPOOL_Q_DELETEPRINTERDATA *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdata"); - depth++; - - if (!prs_align(ps)) - return False; - if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - if (!prs_align(ps)) - return False; - if (!smb_io_unistr2("valuename", &q_u->valuename,True,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_deleteprinterdata (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_deleteprinterdata(const char *desc, SPOOL_R_DELETEPRINTERDATA *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdata"); - depth++; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. - * called from spoolss_q_deleteprinterdataex (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_deleteprinterdataex(const char *desc, SPOOL_Q_DELETEPRINTERDATAEX *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdataex"); - depth++; - - if (!prs_align(ps)) - return False; - if (!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth)) - return False; - - if (!smb_io_unistr2("keyname ", &q_u->keyname, True, ps, depth)) - return False; - if (!smb_io_unistr2("valuename", &q_u->valuename, True, ps, depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_deleteprinterdataex (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_deleteprinterdataex(const char *desc, SPOOL_R_DELETEPRINTERDATAEX *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdataex"); - depth++; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* * write a structure. * called from spoolss_r_getprinterdata (srv_spoolss.c) ********************************************************************/ @@ -1477,256 +1341,6 @@ bool spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u, } /******************************************************************* - * make a structure. - ********************************************************************/ - -bool make_spoolss_q_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, POLICY_HND *hnd) -{ - if (q_u == NULL) return False; - - DEBUG(5,("make_spoolss_q_closeprinter\n")); - - memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); - - return True; -} - -/******************************************************************* - * read a structure. - * called from static spoolss_q_abortprinter (srv_spoolss.c) - * called from spoolss_abortprinter (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_abortprinter(const char *desc, SPOOL_Q_ABORTPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_abortprinter"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_abortprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_abortprinter(const char *desc, SPOOL_R_ABORTPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_abortprinter"); - depth++; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. - * called from static spoolss_q_deleteprinter (srv_spoolss.c) - * called from spoolss_deleteprinter (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_deleteprinter(const char *desc, SPOOL_Q_DELETEPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinter"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from static spoolss_r_deleteprinter (srv_spoolss.c) - * called from spoolss_deleteprinter (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_deleteprinter(const char *desc, SPOOL_R_DELETEPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinter"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth)) - return False; - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - - -/******************************************************************* - * read a structure. - * called from api_spoolss_deleteprinterdriver (srv_spoolss.c) - * called from spoolss_deleteprinterdriver (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_deleteprinterdriver(const char *desc, SPOOL_Q_DELETEPRINTERDRIVER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdriver"); - depth++; - - if (!prs_align(ps)) - return False; - - if(!prs_uint32("server_ptr", ps, depth, &q_u->server_ptr)) - return False; - if(!smb_io_unistr2("server", &q_u->server, q_u->server_ptr, ps, depth)) - return False; - if(!smb_io_unistr2("arch", &q_u->arch, True, ps, depth)) - return False; - if(!smb_io_unistr2("driver", &q_u->driver, True, ps, depth)) - return False; - - - return True; -} - - -/******************************************************************* - * write a structure. - ********************************************************************/ -bool spoolss_io_r_deleteprinterdriver(const char *desc, SPOOL_R_DELETEPRINTERDRIVER *r_u, prs_struct *ps, int depth) -{ - if (r_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdriver"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - - -/******************************************************************* - * read a structure. - * called from api_spoolss_deleteprinterdriver (srv_spoolss.c) - * called from spoolss_deleteprinterdriver (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_deleteprinterdriverex(const char *desc, SPOOL_Q_DELETEPRINTERDRIVEREX *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdriverex"); - depth++; - - if (!prs_align(ps)) - return False; - - if(!prs_uint32("server_ptr", ps, depth, &q_u->server_ptr)) - return False; - if(!smb_io_unistr2("server", &q_u->server, q_u->server_ptr, ps, depth)) - return False; - if(!smb_io_unistr2("arch", &q_u->arch, True, ps, depth)) - return False; - if(!smb_io_unistr2("driver", &q_u->driver, True, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if(!prs_uint32("delete_flags ", ps, depth, &q_u->delete_flags)) - return False; - if(!prs_uint32("version ", ps, depth, &q_u->version)) - return False; - - - return True; -} - - -/******************************************************************* - * write a structure. - ********************************************************************/ -bool spoolss_io_r_deleteprinterdriverex(const char *desc, SPOOL_R_DELETEPRINTERDRIVEREX *r_u, prs_struct *ps, int depth) -{ - if (r_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdriverex"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - - - -/******************************************************************* - * read a structure. - * called from static spoolss_q_closeprinter (srv_spoolss.c) - * called from spoolss_closeprinter (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_closeprinter(const char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_closeprinter"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from static spoolss_r_closeprinter (srv_spoolss.c) - * called from spoolss_closeprinter (cli_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_closeprinter(const char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_closeprinter"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth)) - return False; - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* * read a structure. * called from spoolss_q_startdocprinter (srv_spoolss.c) ********************************************************************/ @@ -1769,168 +1383,6 @@ bool spoolss_io_r_startdocprinter(const char *desc, SPOOL_R_STARTDOCPRINTER *r_u /******************************************************************* * read a structure. - * called from spoolss_q_enddocprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_enddocprinter(const char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_enddocprinter"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_enddocprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_enddocprinter(const char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_enddocprinter"); - depth++; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. - * called from spoolss_q_startpageprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_startpageprinter(const char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_startpageprinter"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_startpageprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_startpageprinter(const char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_startpageprinter"); - depth++; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. - * called from spoolss_q_endpageprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_endpageprinter(const char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_endpageprinter"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_endpageprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_endpageprinter(const char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_endpageprinter"); - depth++; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. - * called from spoolss_q_writeprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_writeprinter(const char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return False; - - prs_debug(ps, depth, desc, "spoolss_io_q_writeprinter"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - if(!prs_uint32("buffer_size", ps, depth, &q_u->buffer_size)) - return False; - - if (q_u->buffer_size!=0) - { - if (UNMARSHALLING(ps)) - q_u->buffer=PRS_ALLOC_MEM(ps, uint8, q_u->buffer_size); - if(q_u->buffer == NULL) - return False; - if(!prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size)) - return False; - } - if(!prs_align(ps)) - return False; - if(!prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_writeprinter (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_writeprinter(const char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_writeprinter"); - depth++; - if(!prs_uint32("buffer_written", ps, depth, &r_u->buffer_written)) - return False; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. * called from spoolss_q_rffpcnex (srv_spoolss.c) ********************************************************************/ @@ -3997,42 +3449,6 @@ bool spoolss_io_q_setprinter(const char *desc, SPOOL_Q_SETPRINTER *q_u, prs_stru /******************************************************************* ********************************************************************/ -bool spoolss_io_r_fcpn(const char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_fcpn"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_fcpn(const char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth) -{ - - prs_debug(ps, depth, desc, "spoolss_io_q_fcpn"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - return True; -} - - -/******************************************************************* -********************************************************************/ - bool spoolss_io_r_addjob(const char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); @@ -4398,65 +3814,6 @@ bool spoolss_io_r_enumforms(const char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct } /******************************************************************* -********************************************************************/ - -bool spoolss_io_q_getform(const char *desc, SPOOL_Q_GETFORM *q_u, prs_struct *ps, int depth) -{ - - prs_debug(ps, depth, desc, "spoolss_io_q_getform"); - depth++; - - if (!prs_align(ps)) - return False; - if (!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - if (!smb_io_unistr2("", &q_u->formname,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_getform(const char *desc, SPOOL_R_GETFORM *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_getform"); - 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_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* Parse a SPOOL_R_ENUMPORTS structure. ********************************************************************/ @@ -6087,172 +5444,6 @@ bool spoolss_io_r_resetprinter(const char *desc, SPOOL_R_RESETPRINTER *r_u, prs_ } /******************************************************************* -********************************************************************/ - -static bool spoolss_io_addform(const char *desc, FORM *f, uint32 ptr, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_addform"); - depth++; - if(!prs_align(ps)) - return False; - - if (ptr!=0) - { - if(!prs_uint32("flags", ps, depth, &f->flags)) - return False; - if(!prs_uint32("name_ptr", ps, depth, &f->name_ptr)) - return False; - if(!prs_uint32("size_x", ps, depth, &f->size_x)) - return False; - if(!prs_uint32("size_y", ps, depth, &f->size_y)) - return False; - if(!prs_uint32("left", ps, depth, &f->left)) - return False; - if(!prs_uint32("top", ps, depth, &f->top)) - return False; - if(!prs_uint32("right", ps, depth, &f->right)) - return False; - if(!prs_uint32("bottom", ps, depth, &f->bottom)) - return False; - - if(!smb_io_unistr2("", &f->name, f->name_ptr, ps, depth)) - return False; - } - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_deleteform(const char *desc, SPOOL_Q_DELETEFORM *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_deleteform"); - depth++; - - if(!prs_align(ps)) - return False; - if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth)) - return False; - if(!smb_io_unistr2("form name", &q_u->name, True, ps, depth)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_deleteform(const char *desc, SPOOL_R_DELETEFORM *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_deleteform"); - depth++; - - if(!prs_align(ps)) - return False; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_addform(const char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth) -{ - uint32 useless_ptr=1; - prs_debug(ps, depth, desc, "spoolss_io_q_addform"); - 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_uint32("level2", ps, depth, &q_u->level2)) - return False; - - if (q_u->level==1) - { - if(!prs_uint32("useless_ptr", ps, depth, &useless_ptr)) - return False; - if(!spoolss_io_addform("", &q_u->form, useless_ptr, ps, depth)) - return False; - } - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_addform(const char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_addform"); - depth++; - - if(!prs_align(ps)) - return False; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_q_setform(const char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth) -{ - uint32 useless_ptr=1; - prs_debug(ps, depth, desc, "spoolss_io_q_setform"); - depth++; - - if(!prs_align(ps)) - return False; - if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth)) - 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_uint32("level2", ps, depth, &q_u->level2)) - return False; - - if (q_u->level==1) - { - if(!prs_uint32("useless_ptr", ps, depth, &useless_ptr)) - return False; - if(!spoolss_io_addform("", &q_u->form, useless_ptr, ps, depth)) - return False; - } - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_setform(const char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_setform"); - depth++; - - if(!prs_align(ps)) - return False; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* Parse a SPOOL_R_GETJOB structure. ********************************************************************/ @@ -6939,60 +6130,6 @@ bool spoolss_io_r_enumprinterkey(const char *desc, SPOOL_R_ENUMPRINTERKEY *r_u, * read a structure. ********************************************************************/ -bool make_spoolss_q_deleteprinterkey(SPOOL_Q_DELETEPRINTERKEY *q_u, - POLICY_HND *hnd, char *keyname) -{ - DEBUG(5,("make_spoolss_q_deleteprinterkey\n")); - - memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); - init_unistr2(&q_u->keyname, keyname, UNI_STR_TERMINATE); - - return True; -} - -/******************************************************************* - * read a structure. - ********************************************************************/ - -bool spoolss_io_q_deleteprinterkey(const char *desc, SPOOL_Q_DELETEPRINTERKEY *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterkey"); - depth++; - - if(!prs_align(ps)) - return False; - if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth)) - return False; - - if(!smb_io_unistr2("", &q_u->keyname, True, ps, depth)) - return False; - - return True; -} - -/******************************************************************* - * write a structure. - ********************************************************************/ - -bool spoolss_io_r_deleteprinterkey(const char *desc, SPOOL_R_DELETEPRINTERKEY *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterkey"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - - -/******************************************************************* - * read a structure. - ********************************************************************/ - bool spoolss_io_q_enumprinterdataex(const char *desc, SPOOL_Q_ENUMPRINTERDATAEX *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_enumprinterdataex"); @@ -7302,66 +6439,6 @@ bool smb_io_printprocessordirectory_1(const char *desc, RPC_BUFFER *buffer, PRIN * init a structure. ********************************************************************/ -bool make_spoolss_q_addform(SPOOL_Q_ADDFORM *q_u, POLICY_HND *handle, - int level, FORM *form) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - q_u->level = level; - q_u->level2 = level; - memcpy(&q_u->form, form, sizeof(FORM)); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_setform(SPOOL_Q_SETFORM *q_u, POLICY_HND *handle, - int level, const char *form_name, FORM *form) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - q_u->level = level; - q_u->level2 = level; - memcpy(&q_u->form, form, sizeof(FORM)); - init_unistr2(&q_u->name, form_name, UNI_STR_TERMINATE); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_deleteform(SPOOL_Q_DELETEFORM *q_u, POLICY_HND *handle, - const char *form) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - init_unistr2(&q_u->name, form, UNI_STR_TERMINATE); - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_getform(SPOOL_Q_GETFORM *q_u, POLICY_HND *handle, - const char *formname, uint32 level, - RPC_BUFFER *buffer, uint32 offered) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - q_u->level = level; - init_unistr2(&q_u->formname, formname, UNI_STR_TERMINATE); - q_u->buffer=buffer; - q_u->offered=offered; - - 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) @@ -7414,30 +6491,6 @@ bool make_spoolss_q_getjob(SPOOL_Q_GETJOB *q_u, POLICY_HND *handle, * init a structure. ********************************************************************/ -bool make_spoolss_q_startpageprinter(SPOOL_Q_STARTPAGEPRINTER *q_u, - POLICY_HND *handle) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_endpageprinter(SPOOL_Q_ENDPAGEPRINTER *q_u, - POLICY_HND *handle) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - bool make_spoolss_q_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u, POLICY_HND *handle, uint32 level, char *docname, char *outputfile, @@ -7478,60 +6531,6 @@ bool make_spoolss_q_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u, * init a structure. ********************************************************************/ -bool make_spoolss_q_enddocprinter(SPOOL_Q_ENDDOCPRINTER *q_u, - POLICY_HND *handle) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_writeprinter(SPOOL_Q_WRITEPRINTER *q_u, - POLICY_HND *handle, uint32 data_size, - char *data) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - q_u->buffer_size = q_u->buffer_size2 = data_size; - q_u->buffer = (unsigned char *)data; - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_deleteprinterdata(SPOOL_Q_DELETEPRINTERDATA *q_u, - POLICY_HND *handle, char *valuename) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - init_unistr2(&q_u->valuename, valuename, UNI_STR_TERMINATE); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_deleteprinterdataex(SPOOL_Q_DELETEPRINTERDATAEX *q_u, - POLICY_HND *handle, char *key, - char *value) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - init_unistr2(&q_u->valuename, value, UNI_STR_TERMINATE); - init_unistr2(&q_u->keyname, key, UNI_STR_TERMINATE); - - return True; -} - -/******************************************************************* - * init a structure. - ********************************************************************/ - bool make_spoolss_q_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, POLICY_HND *handle, uint32 flags, uint32 options, const char *localmachine, uint32 printerlocal, SPOOL_NOTIFY_OPTION *option) |