parse_spoolss.c

来自「samba-3.0.22.tar.gz 编译smb服务器的源码」· C语言 代码 · 共 2,230 行 · 第 1/5 页

C
2,230
字号
	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) ********************************************************************/BOOL spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth){	if (r_u == NULL)		return False;	prs_debug(ps, depth, desc, "spoolss_io_r_getprinterdata");	depth++;	if (!prs_align(ps))		return False;	if (!prs_uint32("type", ps, depth, &r_u->type))		return False;	if (!prs_uint32("size", ps, depth, &r_u->size))		return False;		if (UNMARSHALLING(ps) && r_u->size) {		r_u->data = PRS_ALLOC_MEM(ps, unsigned char, r_u->size);		if(!r_u->data)			return False;	}	if (!prs_uint8s( False, "data", ps, depth, r_u->data, r_u->size ))		return False;			if (!prs_align(ps))		return False;		if (!prs_uint32("needed", ps, depth, &r_u->needed))		return False;	if (!prs_werror("status", ps, depth, &r_u->status))		return False;			return True;}/******************************************************************* * 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) ********************************************************************/BOOL spoolss_io_q_startdocprinter(const char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth){	if (q_u == NULL) return False;	prs_debug(ps, depth, desc, "spoolss_io_q_startdocprinter");	depth++;	if(!prs_align(ps))		return False;	if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth))		return False;		if(!smb_io_doc_info_container("",&q_u->doc_info_container, ps, depth))		return False;	return True;}/******************************************************************* * write a structure. * called from spoolss_r_startdocprinter (srv_spoolss.c) ********************************************************************/BOOL spoolss_io_r_startdocprinter(const char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth){	prs_debug(ps, depth, desc, "spoolss_io_r_startdocprinter");	depth++;	if(!prs_uint32("jobid", ps, depth, &r_u->jobid))		return False;	if(!prs_werror("status", ps, depth, &r_u->status))		return False;	return True;}/******************************************************************* * 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;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?