⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 srv_spoolss.c

📁 samba-3.0.22.tar.gz 编译smb服务器的源码
💻 C
📖 第 1 页 / 共 4 页
字号:
	SPOOL_R_GETJOB r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_getjob("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_getjob: unable to unmarshall SPOOL_Q_GETJOB.\n"));		return False;	}	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"));		return False;	}			return True;}/******************************************************************** * api_spoolss_getprinterdataex * * called from the spoolss dispatcher ********************************************************************/static BOOL api_spoolss_getprinterdataex(pipes_struct *p){	SPOOL_Q_GETPRINTERDATAEX q_u;	SPOOL_R_GETPRINTERDATAEX r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;	ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);	/* read the stream and fill the struct */	if (!spoolss_io_q_getprinterdataex("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_getprinterdataex: unable to unmarshall SPOOL_Q_GETPRINTERDATAEX.\n"));		return False;	}		r_u.status = _spoolss_getprinterdataex( p, &q_u, &r_u);	if (!spoolss_io_r_getprinterdataex("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_getprinterdataex: unable to marshall SPOOL_R_GETPRINTERDATAEX.\n"));		return False;	}	return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_setprinterdataex(pipes_struct *p){	SPOOL_Q_SETPRINTERDATAEX q_u;	SPOOL_R_SETPRINTERDATAEX r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_setprinterdataex("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_setprinterdataex: unable to unmarshall SPOOL_Q_SETPRINTERDATAEX.\n"));		return False;	}		r_u.status = _spoolss_setprinterdataex(p, &q_u, &r_u);					if(!spoolss_io_r_setprinterdataex("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_setprinterdataex: unable to marshall SPOOL_R_SETPRINTERDATAEX.\n"));		return False;	}	return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_enumprinterkey(pipes_struct *p){	SPOOL_Q_ENUMPRINTERKEY q_u;	SPOOL_R_ENUMPRINTERKEY r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_enumprinterkey("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_setprinterkey: unable to unmarshall SPOOL_Q_ENUMPRINTERKEY.\n"));		return False;	}		r_u.status = _spoolss_enumprinterkey(p, &q_u, &r_u);					if(!spoolss_io_r_enumprinterkey("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_enumprinterkey: unable to marshall SPOOL_R_ENUMPRINTERKEY.\n"));		return False;	}	return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_enumprinterdataex(pipes_struct *p){	SPOOL_Q_ENUMPRINTERDATAEX q_u;	SPOOL_R_ENUMPRINTERDATAEX r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_enumprinterdataex("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_enumprinterdataex: unable to unmarshall SPOOL_Q_ENUMPRINTERDATAEX.\n"));		return False;	}		r_u.status = _spoolss_enumprinterdataex(p, &q_u, &r_u);					if(!spoolss_io_r_enumprinterdataex("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_enumprinterdataex: unable to marshall SPOOL_R_ENUMPRINTERDATAEX.\n"));		return False;	}	return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_getprintprocessordirectory(pipes_struct *p){	SPOOL_Q_GETPRINTPROCESSORDIRECTORY q_u;	SPOOL_R_GETPRINTPROCESSORDIRECTORY r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_getprintprocessordirectory("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_getprintprocessordirectory: unable to unmarshall SPOOL_Q_GETPRINTPROCESSORDIRECTORY.\n"));		return False;	}		r_u.status = _spoolss_getprintprocessordirectory(p, &q_u, &r_u);					if(!spoolss_io_r_getprintprocessordirectory("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_getprintprocessordirectory: unable to marshall SPOOL_R_GETPRINTPROCESSORDIRECTORY.\n"));		return False;	}		return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_deleteprinterdataex(pipes_struct *p){	SPOOL_Q_DELETEPRINTERDATAEX q_u;	SPOOL_R_DELETEPRINTERDATAEX r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_deleteprinterdataex("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_deleteprinterdataex: unable to unmarshall SPOOL_Q_DELETEPRINTERDATAEX.\n"));		return False;	}		r_u.status = _spoolss_deleteprinterdataex(p, &q_u, &r_u);					if(!spoolss_io_r_deleteprinterdataex("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_deleteprinterdataex: unable to marshall SPOOL_R_DELETEPRINTERDATAEX.\n"));		return False;	}		return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_deleteprinterkey(pipes_struct *p){	SPOOL_Q_DELETEPRINTERKEY q_u;	SPOOL_R_DELETEPRINTERKEY r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_deleteprinterkey("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_deleteprinterkey: unable to unmarshall SPOOL_Q_DELETEPRINTERKEY.\n"));		return False;	}		r_u.status = _spoolss_deleteprinterkey(p, &q_u, &r_u);					if(!spoolss_io_r_deleteprinterkey("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_deleteprinterkey: unable to marshall SPOOL_R_DELETEPRINTERKEY.\n"));		return False;	}		return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_addprinterdriverex(pipes_struct *p){	SPOOL_Q_ADDPRINTERDRIVEREX q_u;	SPOOL_R_ADDPRINTERDRIVEREX r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_addprinterdriverex("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_addprinterdriverex: unable to unmarshall SPOOL_Q_ADDPRINTERDRIVEREX.\n"));		return False;	}		r_u.status = _spoolss_addprinterdriverex(p, &q_u, &r_u);					if(!spoolss_io_r_addprinterdriverex("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_addprinterdriverex: unable to marshall SPOOL_R_ADDPRINTERDRIVEREX.\n"));		return False;	}		return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_deleteprinterdriverex(pipes_struct *p){	SPOOL_Q_DELETEPRINTERDRIVEREX q_u;	SPOOL_R_DELETEPRINTERDRIVEREX r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_deleteprinterdriverex("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_deleteprinterdriverex: unable to unmarshall SPOOL_Q_DELETEPRINTERDRIVEREX.\n"));		return False;	}		r_u.status = _spoolss_deleteprinterdriverex(p, &q_u, &r_u);					if(!spoolss_io_r_deleteprinterdriverex("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_deleteprinterdriverex: unable to marshall SPOOL_R_DELETEPRINTERDRIVEREX.\n"));		return False;	}		return True;}#if 0/********************************************************************************************************************************************************/static BOOL api_spoolss_replyopenprinter(pipes_struct *p){	SPOOL_Q_REPLYOPENPRINTER q_u;	SPOOL_R_REPLYOPENPRINTER r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_replyopenprinter("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_replyopenprinter: unable to unmarshall SPOOL_Q_REPLYOPENPRINTER.\n"));		return False;	}		r_u.status = _spoolss_replyopenprinter(p, &q_u, &r_u);					if(!spoolss_io_r_replyopenprinter("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_replyopenprinter: unable to marshall SPOOL_R_REPLYOPENPRINTER.\n"));		return False;	}		return True;}/********************************************************************************************************************************************************/static BOOL api_spoolss_replycloseprinter(pipes_struct *p){	SPOOL_Q_REPLYCLOSEPRINTER q_u;	SPOOL_R_REPLYCLOSEPRINTER r_u;	prs_struct *data = &p->in_data.data;	prs_struct *rdata = &p->out_data.rdata;		ZERO_STRUCT(q_u);	ZERO_STRUCT(r_u);		if(!spoolss_io_q_replycloseprinter("", &q_u, data, 0)) {		DEBUG(0,("spoolss_io_q_replycloseprinter: unable to unmarshall SPOOL_Q_REPLYCLOSEPRINTER.\n"));		return False;	}		r_u.status = _spoolss_replycloseprinter(p, &q_u, &r_u);					if(!spoolss_io_r_replycloseprinter("", &r_u, rdata, 0)) {		DEBUG(0,("spoolss_io_r_replycloseprinter: unable to marshall SPOOL_R_REPLYCLOSEPRINTER.\n"));		return False;	}		return True;}#endif/*******************************************************************\pipe\spoolss commands********************************************************************/  struct api_struct api_spoolss_cmds[] =     { {"SPOOLSS_OPENPRINTER",               SPOOLSS_OPENPRINTER,               api_spoolss_open_printer              }, {"SPOOLSS_OPENPRINTEREX",             SPOOLSS_OPENPRINTEREX,             api_spoolss_open_printer_ex           }, {"SPOOLSS_GETPRINTERDATA",            SPOOLSS_GETPRINTERDATA,            api_spoolss_getprinterdata            }, {"SPOOLSS_CLOSEPRINTER",              SPOOLSS_CLOSEPRINTER,              api_spoolss_closeprinter              }, {"SPOOLSS_DELETEPRINTER",             SPOOLSS_DELETEPRINTER,             api_spoolss_deleteprinter             }, {"SPOOLSS_ABORTPRINTER",              SPOOLSS_ABORTPRINTER,              api_spoolss_abortprinter              }, {"SPOOLSS_RFFPCNEX",                  SPOOLSS_RFFPCNEX,                  api_spoolss_rffpcnex                  }, {"SPOOLSS_RFNPCNEX",                  SPOOLSS_RFNPCNEX,                  api_spoolss_rfnpcnex                  }, {"SPOOLSS_ENUMPRINTERS",              SPOOLSS_ENUMPRINTERS,              api_spoolss_enumprinters              }, {"SPOOLSS_GETPRINTER",                SPOOLSS_GETPRINTER,                api_spoolss_getprinter                }, {"SPOOLSS_GETPRINTERDRIVER2",         SPOOLSS_GETPRINTERDRIVER2,         api_spoolss_getprinterdriver2         },  {"SPOOLSS_STARTPAGEPRINTER",          SPOOLSS_STARTPAGEPRINTER,          api_spoolss_startpageprinter          }, {"SPOOLSS_ENDPAGEPRINTER",            SPOOLSS_ENDPAGEPRINTER,            api_spoolss_endpageprinter            },  {"SPOOLSS_STARTDOCPRINTER",           SPOOLSS_STARTDOCPRINTER,           api_spoolss_startdocprinter           }, {"SPOOLSS_ENDDOCPRINTER",             SPOOLSS_ENDDOCPRINTER,             api_spoolss_enddocprinter             }, {"SPOOLSS_WRITEPRINTER",              SPOOLSS_WRITEPRINTER,              api_spoolss_writeprinter              }, {"SPOOLSS_SETPRINTER",                SPOOLSS_SETPRINTER,                api_spoolss_setprinter                }, {"SPOOLSS_FCPN",                      SPOOLSS_FCPN,                      api_spoolss_fcpn		        }, {"SPOOLSS_ADDJOB",                    SPOOLSS_ADDJOB,                    api_spoolss_addjob                    }, {"SPOOLSS_ENUMJOBS",                  SPOOLSS_ENUMJOBS,                  api_spoolss_enumjobs                  }, {"SPOOLSS_SCHEDULEJOB",               SPOOLSS_SCHEDULEJOB,               api_spoolss_schedulejob               }, {"SPOOLSS_SETJOB",                    SPOOLSS_SETJOB,                    api_spoolss_setjob                    }, {"SPOOLSS_ENUMFORMS",                 SPOOLSS_ENUMFORMS,                 api_spoolss_enumforms                 }, {"SPOOLSS_ENUMPORTS",                 SPOOLSS_ENUMPORTS,                 api_spoolss_enumports                 }, {"SPOOLSS_ENUMPRINTERDRIVERS",        SPOOLSS_ENUMPRINTERDRIVERS,        api_spoolss_enumprinterdrivers        }, {"SPOOLSS_ADDPRINTEREX",              SPOOLSS_ADDPRINTEREX,              api_spoolss_addprinterex              }, {"SPOOLSS_ADDPRINTERDRIVER",          SPOOLSS_ADDPRINTERDRIVER,          api_spoolss_addprinterdriver          }, {"SPOOLSS_DELETEPRINTERDRIVER",       SPOOLSS_DELETEPRINTERDRIVER,       api_spoolss_deleteprinterdriver       }, {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_getprinterdriverdirectory }, {"SPOOLSS_ENUMPRINTERDATA",           SPOOLSS_ENUMPRINTERDATA,           api_spoolss_enumprinterdata           }, {"SPOOLSS_SETPRINTERDATA",            SPOOLSS_SETPRINTERDATA,            api_spoolss_setprinterdata            }, {"SPOOLSS_RESETPRINTER",              SPOOLSS_RESETPRINTER,              api_spoolss_reset_printer             }, {"SPOOLSS_DELETEPRINTERDATA",         SPOOLSS_DELETEPRINTERDATA,         api_spoolss_deleteprinterdata         }, {"SPOOLSS_ADDFORM",                   SPOOLSS_ADDFORM,                   api_spoolss_addform                   }, {"SPOOLSS_DELETEFORM",                SPOOLSS_DELETEFORM,                api_spoolss_deleteform                }, {"SPOOLSS_GETFORM",                   SPOOLSS_GETFORM,                   api_spoolss_getform                   }, {"SPOOLSS_SETFORM",                   SPOOLSS_SETFORM,                   api_spoolss_setform                   }, {"SPOOLSS_ADDPRINTPROCESSOR",         SPOOLSS_ADDPRINTPROCESSOR,         api_spoolss_addprintprocessor         }, {"SPOOLSS_ENUMPRINTPROCESSORS",       SPOOLSS_ENUMPRINTPROCESSORS,       api_spoolss_enumprintprocessors       }, {"SPOOLSS_ENUMMONITORS",              SPOOLSS_ENUMMONITORS,              api_spoolss_enumprintmonitors         }, {"SPOOLSS_GETJOB",                    SPOOLSS_GETJOB,                    api_spoolss_getjob                    }, {"SPOOLSS_ENUMPRINTPROCDATATYPES",    SPOOLSS_ENUMPRINTPROCDATATYPES,    api_spoolss_enumprintprocdatatypes    }, {"SPOOLSS_GETPRINTERDATAEX",          SPOOLSS_GETPRINTERDATAEX,          api_spoolss_getprinterdataex          }, {"SPOOLSS_SETPRINTERDATAEX",          SPOOLSS_SETPRINTERDATAEX,          api_spoolss_setprinterdataex          }, {"SPOOLSS_DELETEPRINTERDATAEX",       SPOOLSS_DELETEPRINTERDATAEX,       api_spoolss_deleteprinterdataex       }, {"SPOOLSS_ENUMPRINTERDATAEX",         SPOOLSS_ENUMPRINTERDATAEX,         api_spoolss_enumprinterdataex         }, {"SPOOLSS_ENUMPRINTERKEY",            SPOOLSS_ENUMPRINTERKEY,            api_spoolss_enumprinterkey            }, {"SPOOLSS_DELETEPRINTERKEY",          SPOOLSS_DELETEPRINTERKEY,          api_spoolss_deleteprinterkey          }, {"SPOOLSS_GETPRINTPROCESSORDIRECTORY",SPOOLSS_GETPRINTPROCESSORDIRECTORY,api_spoolss_getprintprocessordirectory}, {"SPOOLSS_ADDPRINTERDRIVEREX",        SPOOLSS_ADDPRINTERDRIVEREX,        api_spoolss_addprinterdriverex        }, {"SPOOLSS_DELETEPRINTERDRIVEREX",     SPOOLSS_DELETEPRINTERDRIVEREX,     api_spoolss_deleteprinterdriverex     },#if 0 {"SPOOLSS_REPLYOPENPRINTER",          SPOOLSS_REPLYOPENPRINTER,          api_spoolss_replyopenprinter          }, {"SPOOLSS_REPLYCLOSEPRINTER",         SPOOLSS_REPLYCLOSEPRINTER,         api_spoolss_replycloseprinter         }#endif    };void spoolss_get_pipe_fns( struct api_struct **fns, int *n_fns ){	*fns = api_spoolss_cmds;	*n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);}NTSTATUS rpc_spoolss_init(void){  return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss", api_spoolss_cmds,				    sizeof(api_spoolss_cmds) / sizeof(struct api_struct));}

⌨️ 快捷键说明

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