2000-02-07 19:17:59 +03:00
/*
2002-01-30 09:08:46 +03:00
* Unix SMB / CIFS implementation .
2000-02-07 19:17:59 +03:00
* RPC Pipe client / server routines
* Copyright ( C ) Andrew Tridgell 1992 - 2000 ,
* Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 2000 ,
2003-02-14 03:48:28 +03:00
* Copyright ( C ) Jean Fran <EFBFBD> ois Micouleau 1998 - 2000 ,
* Copyright ( C ) Jeremy Allison 2001 ,
* Copyright ( C ) Gerald Carter 2001 - 2002 ,
2003-08-01 19:30:44 +04:00
* Copyright ( C ) Jim McDonough < jmcd @ us . ibm . com > 2003.
2000-02-07 19:17:59 +03:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2007-07-09 23:25:36 +04:00
* the Free Software Foundation ; either version 3 of the License , or
2000-02-07 19:17:59 +03:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2007-07-10 09:23:25 +04:00
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
2000-02-07 19:17:59 +03:00
*/
# include "includes.h"
2002-07-15 14:35:28 +04:00
# undef DBGC_CLASS
# define DBGC_CLASS DBGC_RPC_SRV
2008-11-14 23:30:59 +03:00
/*******************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static bool proxy_spoolss_call ( pipes_struct * p , uint8_t opnum )
{
struct api_struct * fns ;
int n_fns ;
2009-02-06 21:23:55 +03:00
spoolss_get_pipe_fns ( & fns , & n_fns ) ;
2008-11-14 23:30:59 +03:00
if ( opnum > = n_fns ) {
return false ;
}
if ( fns [ opnum ] . opnum ! = opnum ) {
smb_panic ( " SPOOLSS function table not sorted " ) ;
}
return fns [ opnum ] . fn ( p ) ;
}
2002-03-26 06:15:30 +03:00
/********************************************************************
* api_spoolss_open_printer_ex ( rarely seen - older call )
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_open_printer ( pipes_struct * p )
2002-03-26 06:15:30 +03:00
{
2009-02-10 03:48:18 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_OPENPRINTER ) ;
2002-03-26 06:15:30 +03:00
}
2000-02-07 19:17:59 +03:00
/********************************************************************
* api_spoolss_open_printer_ex
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_open_printer_ex ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-10 03:43:25 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_OPENPRINTEREX ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_getprinterdata
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getprinterdata ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-14 03:29:56 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETPRINTERDATA ) ;
2000-02-07 19:17:59 +03:00
}
2000-09-09 04:19:35 +04:00
/********************************************************************
* api_spoolss_deleteprinterdata
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteprinterdata ( pipes_struct * p )
2000-09-09 04:19:35 +04:00
{
2009-02-09 03:17:57 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEPRINTERDATA ) ;
2000-09-09 04:19:35 +04:00
}
2000-02-07 19:17:59 +03:00
/********************************************************************
* api_spoolss_closeprinter
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_closeprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2008-11-15 01:36:11 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_CLOSEPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
2000-08-30 04:45:59 +04:00
/********************************************************************
* api_spoolss_abortprinter
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_abortprinter ( pipes_struct * p )
2000-08-30 04:45:59 +04:00
{
2008-11-15 02:53:08 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ABORTPRINTER ) ;
2000-08-30 04:45:59 +04:00
}
2000-05-02 19:31:55 +04:00
/********************************************************************
* api_spoolss_deleteprinter
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteprinter ( pipes_struct * p )
2000-05-02 19:31:55 +04:00
{
2008-11-15 01:43:30 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEPRINTER ) ;
2000-05-02 19:31:55 +04:00
}
2001-05-18 08:11:17 +04:00
/********************************************************************
* api_spoolss_deleteprinterdriver
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteprinterdriver ( pipes_struct * p )
2001-05-18 08:11:17 +04:00
{
2009-02-09 03:49:19 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEPRINTERDRIVER ) ;
2001-05-18 08:11:17 +04:00
}
2000-02-07 19:17:59 +03:00
/********************************************************************
* api_spoolss_rffpcnex
* ReplyFindFirstPrinterChangeNotifyEx
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_rffpcnex ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-17 01:33:10 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_rfnpcnex
* ReplyFindNextPrinterChangeNotifyEx
* called from the spoolss dispatcher
2001-03-11 03:32:10 +03:00
* Note - this is the * ONLY * function that breaks the RPC call
* symmetry in all the other calls . We need to do this to fix
* the massive memory allocation problem with thousands of jobs . . .
* JRA .
2000-02-07 19:17:59 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_rfnpcnex ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-12 16:18:28 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_enumprinters
* called from the spoolss dispatcher
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:24:55 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprinters ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-10 02:51:38 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPRINTERS ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_getprinter
* called from the spoolss dispatcher
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 04:38:12 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-12 12:57:13 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_getprinter
* called from the spoolss dispatcher
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:03:02 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getprinterdriver2 ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-09 23:21:15 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETPRINTERDRIVER2 ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_getprinter
* called from the spoolss dispatcher
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:03:02 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_startpageprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-06 23:38:43 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_STARTPAGEPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
* api_spoolss_getprinter
* called from the spoolss dispatcher
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:03:02 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_endpageprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2008-11-15 02:49:00 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENDPAGEPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
2000-02-21 04:58:13 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:03:02 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_startdocprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-10 01:28:34 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_STARTDOCPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
2000-02-21 04:58:13 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enddocprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2008-11-15 02:58:36 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENDDOCPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/********************************************************************
2000-02-21 04:58:13 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_writeprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2008-11-15 03:27:44 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_WRITEPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
2000-02-21 04:58:13 +03:00
2000-02-07 19:17:59 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_setprinter ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-13 02:10:10 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_SETPRINTER ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_fcpn ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-09 15:03:07 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_addjob ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-10 00:12:15 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ADDJOB ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumjobs ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-08 01:53:11 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMJOBS ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_schedulejob ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-10 00:30:23 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_SCHEDULEJOB ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-28 05:38:09 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_setjob ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-10 02:21:26 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_SETJOB ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprinterdrivers ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-09 20:23:40 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPRINTERDRIVERS ) ;
2000-02-07 19:17:59 +03:00
}
2000-09-06 00:56:09 +04:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getform ( pipes_struct * p )
2000-09-06 00:56:09 +04:00
{
2009-02-09 01:12:25 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETFORM ) ;
2000-09-06 00:56:09 +04:00
}
2000-02-07 19:17:59 +03:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumforms ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-06 14:01:14 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMFORMS ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumports ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-07 01:38:57 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPORTS ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_addprinterex ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-11 01:35:19 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ADDPRINTEREX ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_addprinterdriver ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-18 20:59:43 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ADDPRINTERDRIVER ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getprinterdriverdirectory ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-19 03:46:17 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprinterdata ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-16 16:58:55 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPRINTERDATA ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_setprinterdata ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-14 04:24:47 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_SETPRINTERDATA ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_reset_printer ( pipes_struct * p )
2002-03-15 11:14:10 +03:00
{
2009-02-17 06:28:54 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_RESETPRINTER ) ;
2002-03-15 11:14:10 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_addform ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-08 02:04:27 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ADDFORM ) ;
2000-02-07 19:17:59 +03:00
}
2000-08-31 23:04:51 +04:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteform ( pipes_struct * p )
2000-08-31 23:04:51 +04:00
{
2008-11-17 12:56:32 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEFORM ) ;
2000-08-31 23:04:51 +04:00
}
2000-02-07 19:17:59 +03:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_setform ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-02-08 21:19:57 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_SETFORM ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprintprocessors ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-06 22:22:17 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPRINTPROCESSORS ) ;
2000-02-07 19:17:59 +03:00
}
2000-02-27 02:01:02 +03:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_addprintprocessor ( pipes_struct * p )
2001-06-21 21:46:14 +04:00
{
2009-02-09 17:31:35 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ADDPRINTPROCESSOR ) ;
2001-06-21 21:46:14 +04:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprintprocdatatypes ( pipes_struct * p )
2000-02-27 02:01:02 +03:00
{
2009-03-06 23:51:12 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPRINTPROCDATATYPES ) ;
2000-02-27 02:01:02 +03:00
}
2000-02-07 19:17:59 +03:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprintmonitors ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-07 02:04:05 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMMONITORS ) ;
2000-02-07 19:17:59 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getjob ( pipes_struct * p )
2000-02-07 19:17:59 +03:00
{
2009-03-09 14:24:45 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETJOB ) ;
2000-02-07 19:17:59 +03:00
}
2001-11-05 09:15:02 +03:00
/********************************************************************
* api_spoolss_getprinterdataex
*
* called from the spoolss dispatcher
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getprinterdataex ( pipes_struct * p )
2001-11-05 09:15:02 +03:00
{
2009-02-12 21:42:57 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETPRINTERDATAEX ) ;
2001-11-05 09:15:02 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_setprinterdataex ( pipes_struct * p )
2001-11-05 09:15:02 +03:00
{
2009-02-13 00:23:04 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_SETPRINTERDATAEX ) ;
2001-11-05 09:15:02 +03:00
}
2001-11-22 08:56:09 +03:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprinterkey ( pipes_struct * p )
2001-11-22 08:56:09 +03:00
{
2009-03-17 01:09:15 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ENUMPRINTERKEY ) ;
2001-11-22 08:56:09 +03:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_enumprinterdataex ( pipes_struct * p )
2001-11-22 08:56:09 +03:00
{
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 ;
}
2001-12-10 08:03:17 +03:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_getprintprocessordirectory ( pipes_struct * p )
2001-12-10 08:03:17 +03:00
{
2009-02-19 12:42:49 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY ) ;
2001-12-10 08:03:17 +03:00
}
2002-07-15 14:35:28 +04:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteprinterdataex ( pipes_struct * p )
2002-07-15 14:35:28 +04:00
{
2009-02-09 03:11:18 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEPRINTERDATAEX ) ;
2002-07-15 14:35:28 +04:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteprinterkey ( pipes_struct * p )
2002-07-15 14:35:28 +04:00
{
2009-02-09 03:33:00 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEPRINTERKEY ) ;
2002-07-15 14:35:28 +04:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_addprinterdriverex ( pipes_struct * p )
2002-07-15 14:35:28 +04:00
{
2009-02-18 20:59:43 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_ADDPRINTERDRIVEREX ) ;
2002-07-15 14:35:28 +04:00
}
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_deleteprinterdriverex ( pipes_struct * p )
2002-07-15 14:35:28 +04:00
{
2009-02-09 13:13:10 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_DELETEPRINTERDRIVEREX ) ;
2002-07-15 14:35:28 +04:00
}
2002-08-17 19:34:15 +04:00
/****************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_spoolss_xcvdataport ( pipes_struct * p )
2002-08-17 19:34:15 +04:00
{
2009-02-17 16:23:56 +03:00
return proxy_spoolss_call ( p , NDR_SPOOLSS_XCVDATA ) ;
2002-08-17 19:34:15 +04:00
}
2000-02-07 19:17:59 +03:00
/*******************************************************************
\ pipe \ spoolss commands
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-01 00:19:31 +03:00
2003-02-14 03:48:28 +03:00
struct api_struct api_spoolss_cmds [ ] =
{
2002-03-26 06:15:30 +03:00
{ " SPOOLSS_OPENPRINTER " , SPOOLSS_OPENPRINTER , api_spoolss_open_printer } ,
2000-02-07 19:17:59 +03:00
{ " SPOOLSS_OPENPRINTEREX " , SPOOLSS_OPENPRINTEREX , api_spoolss_open_printer_ex } ,
{ " SPOOLSS_GETPRINTERDATA " , SPOOLSS_GETPRINTERDATA , api_spoolss_getprinterdata } ,
{ " SPOOLSS_CLOSEPRINTER " , SPOOLSS_CLOSEPRINTER , api_spoolss_closeprinter } ,
2000-05-02 19:31:55 +04:00
{ " SPOOLSS_DELETEPRINTER " , SPOOLSS_DELETEPRINTER , api_spoolss_deleteprinter } ,
2000-08-30 04:45:59 +04:00
{ " SPOOLSS_ABORTPRINTER " , SPOOLSS_ABORTPRINTER , api_spoolss_abortprinter } ,
2000-02-07 19:17:59 +03:00
{ " 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 } ,
2001-05-18 08:11:17 +04:00
{ " SPOOLSS_DELETEPRINTERDRIVER " , SPOOLSS_DELETEPRINTERDRIVER , api_spoolss_deleteprinterdriver } ,
2000-02-07 19:17:59 +03:00
{ " SPOOLSS_GETPRINTERDRIVERDIRECTORY " , SPOOLSS_GETPRINTERDRIVERDIRECTORY , api_spoolss_getprinterdriverdirectory } ,
{ " SPOOLSS_ENUMPRINTERDATA " , SPOOLSS_ENUMPRINTERDATA , api_spoolss_enumprinterdata } ,
{ " SPOOLSS_SETPRINTERDATA " , SPOOLSS_SETPRINTERDATA , api_spoolss_setprinterdata } ,
2002-03-15 11:14:10 +03:00
{ " SPOOLSS_RESETPRINTER " , SPOOLSS_RESETPRINTER , api_spoolss_reset_printer } ,
2000-09-09 04:19:35 +04:00
{ " SPOOLSS_DELETEPRINTERDATA " , SPOOLSS_DELETEPRINTERDATA , api_spoolss_deleteprinterdata } ,
2000-02-07 19:17:59 +03:00
{ " SPOOLSS_ADDFORM " , SPOOLSS_ADDFORM , api_spoolss_addform } ,
2000-08-31 23:04:51 +04:00
{ " SPOOLSS_DELETEFORM " , SPOOLSS_DELETEFORM , api_spoolss_deleteform } ,
2000-09-06 00:56:09 +04:00
{ " SPOOLSS_GETFORM " , SPOOLSS_GETFORM , api_spoolss_getform } ,
2000-02-07 19:17:59 +03:00
{ " SPOOLSS_SETFORM " , SPOOLSS_SETFORM , api_spoolss_setform } ,
2001-06-21 21:46:14 +04:00
{ " SPOOLSS_ADDPRINTPROCESSOR " , SPOOLSS_ADDPRINTPROCESSOR , api_spoolss_addprintprocessor } ,
2000-02-07 19:17:59 +03:00
{ " SPOOLSS_ENUMPRINTPROCESSORS " , SPOOLSS_ENUMPRINTPROCESSORS , api_spoolss_enumprintprocessors } ,
{ " SPOOLSS_ENUMMONITORS " , SPOOLSS_ENUMMONITORS , api_spoolss_enumprintmonitors } ,
{ " SPOOLSS_GETJOB " , SPOOLSS_GETJOB , api_spoolss_getjob } ,
2000-02-27 02:01:02 +03:00
{ " SPOOLSS_ENUMPRINTPROCDATATYPES " , SPOOLSS_ENUMPRINTPROCDATATYPES , api_spoolss_enumprintprocdatatypes } ,
2001-11-09 23:59:18 +03:00
{ " SPOOLSS_GETPRINTERDATAEX " , SPOOLSS_GETPRINTERDATAEX , api_spoolss_getprinterdataex } ,
{ " SPOOLSS_SETPRINTERDATAEX " , SPOOLSS_SETPRINTERDATAEX , api_spoolss_setprinterdataex } ,
2002-07-15 14:35:28 +04:00
{ " SPOOLSS_DELETEPRINTERDATAEX " , SPOOLSS_DELETEPRINTERDATAEX , api_spoolss_deleteprinterdataex } ,
2001-11-22 08:56:09 +03:00
{ " SPOOLSS_ENUMPRINTERDATAEX " , SPOOLSS_ENUMPRINTERDATAEX , api_spoolss_enumprinterdataex } ,
2002-07-15 14:35:28 +04:00
{ " SPOOLSS_ENUMPRINTERKEY " , SPOOLSS_ENUMPRINTERKEY , api_spoolss_enumprinterkey } ,
{ " SPOOLSS_DELETEPRINTERKEY " , SPOOLSS_DELETEPRINTERKEY , api_spoolss_deleteprinterkey } ,
2001-12-10 08:03:17 +03:00
{ " SPOOLSS_GETPRINTPROCESSORDIRECTORY " , SPOOLSS_GETPRINTPROCESSORDIRECTORY , api_spoolss_getprintprocessordirectory } ,
2002-07-15 14:35:28 +04:00
{ " SPOOLSS_ADDPRINTERDRIVEREX " , SPOOLSS_ADDPRINTERDRIVEREX , api_spoolss_addprinterdriverex } ,
{ " SPOOLSS_DELETEPRINTERDRIVEREX " , SPOOLSS_DELETEPRINTERDRIVEREX , api_spoolss_deleteprinterdriverex } ,
2006-03-03 19:44:30 +03:00
{ " SPOOLSS_XCVDATAPORT " , SPOOLSS_XCVDATAPORT , api_spoolss_xcvdataport } ,
} ;
2003-08-15 01:14:28 +04:00
2008-11-14 23:30:59 +03:00
void spoolss2_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
2003-08-15 01:14:28 +04:00
{
* fns = api_spoolss_cmds ;
* n_fns = sizeof ( api_spoolss_cmds ) / sizeof ( struct api_struct ) ;
}
2008-11-14 23:30:59 +03:00
NTSTATUS rpc_spoolss2_init ( void )
2003-08-15 01:14:28 +04:00
{
2009-01-07 01:37:09 +03:00
return rpc_srv_register (
SMB_RPC_INTERFACE_VERSION , " spoolss " , " spoolss " ,
& ndr_table_spoolss ,
api_spoolss_cmds ,
sizeof ( api_spoolss_cmds ) / sizeof ( struct api_struct ) ) ;
2000-02-07 19:17:59 +03:00
}