mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
Merging Gerry's spoolss changes.
Jeremy.
This commit is contained in:
parent
5932471a03
commit
6b4a70cd82
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,6 @@
|
||||
/* spoolss pipe: this are the calls which are not implemented ...
|
||||
#define SPOOLSS_OPENPRINTER 0x01
|
||||
#define SPOOLSS_GETPRINTERDRIVER 0x0b
|
||||
#define SPOOLSS_ADDPRINTPROCESSOR 0x0e
|
||||
#define SPOOLSS_GETPRINTPROCESSORDIRECTORY 0x10
|
||||
#define SPOOLSS_READPRINTER 0x16
|
||||
#define SPOOLSS_WAITFORPRINTERCHANGE 0x1c
|
||||
@ -74,6 +73,7 @@
|
||||
#define SPOOLSS_ENUMPRINTERDRIVERS 0x0a
|
||||
#define SPOOLSS_GETPRINTERDRIVERDIRECTORY 0x0c
|
||||
#define SPOOLSS_DELETEPRINTERDRIVER 0x0d
|
||||
#define SPOOLSS_ADDPRINTPROCESSOR 0x0e
|
||||
#define SPOOLSS_ENUMPRINTPROCESSORS 0x0f
|
||||
#define SPOOLSS_STARTDOCPRINTER 0x11
|
||||
#define SPOOLSS_STARTPAGEPRINTER 0x12
|
||||
@ -1575,6 +1575,23 @@ typedef struct spool_r_getprinterdriverdirectory
|
||||
}
|
||||
SPOOL_R_GETPRINTERDRIVERDIR;
|
||||
|
||||
typedef struct spool_q_addprintprocessor
|
||||
{
|
||||
uint32 server_ptr;
|
||||
UNISTR2 server;
|
||||
UNISTR2 environment;
|
||||
UNISTR2 path;
|
||||
UNISTR2 name;
|
||||
}
|
||||
SPOOL_Q_ADDPRINTPROCESSOR;
|
||||
|
||||
typedef struct spool_r_addprintprocessor
|
||||
{
|
||||
uint32 status;
|
||||
}
|
||||
SPOOL_R_ADDPRINTPROCESSOR;
|
||||
|
||||
|
||||
typedef struct spool_q_enumprintprocessors
|
||||
{
|
||||
uint32 name_ptr;
|
||||
|
@ -5255,6 +5255,57 @@ BOOL spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q
|
||||
/*******************************************************************
|
||||
********************************************************************/
|
||||
|
||||
BOOL spoolss_io_q_addprintprocessor(char *desc, SPOOL_Q_ADDPRINTPROCESSOR *q_u, prs_struct *ps, int depth)
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_q_addprintprocessor");
|
||||
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 (!prs_align(ps))
|
||||
return False;
|
||||
if (!smb_io_unistr2("environment", &q_u->environment, True, ps, depth))
|
||||
return False;
|
||||
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
if (!smb_io_unistr2("path", &q_u->path, True, ps, depth))
|
||||
return False;
|
||||
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
if (!smb_io_unistr2("name", &q_u->name, True, ps, depth))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
********************************************************************/
|
||||
|
||||
BOOL spoolss_io_r_addprintprocessor(char *desc, SPOOL_R_ADDPRINTPROCESSOR *r_u, prs_struct *ps, int depth)
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_addprintproicessor");
|
||||
depth++;
|
||||
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if (!prs_uint32("status", ps, depth, &r_u->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
********************************************************************/
|
||||
|
||||
BOOL spoolss_io_r_enumprintprocdatatypes(char *desc, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u, prs_struct *ps, int depth)
|
||||
{
|
||||
prs_debug(ps, depth, desc, "spoolss_io_r_enumprintprocdatatypes");
|
||||
@ -5494,12 +5545,14 @@ BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_st
|
||||
case 0x3:
|
||||
case 0x4:
|
||||
case 0x7:
|
||||
if (q_u->max_len) {
|
||||
if (UNMARSHALLING(ps))
|
||||
q_u->data=(uint8 *)prs_alloc_mem(ps, q_u->max_len * sizeof(uint8));
|
||||
if(q_u->data == NULL)
|
||||
return False;
|
||||
if(!prs_uint8s(False,"data", ps, depth, q_u->data, q_u->max_len))
|
||||
return False;
|
||||
}
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
break;
|
||||
|
@ -1091,6 +1091,38 @@ static BOOL api_spoolss_enumprintprocessors(pipes_struct *p)
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
static BOOL api_spoolss_addprintprocessor(pipes_struct *p)
|
||||
{
|
||||
SPOOL_Q_ADDPRINTPROCESSOR q_u;
|
||||
SPOOL_R_ADDPRINTPROCESSOR 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_addprintprocessor("", &q_u, data, 0)) {
|
||||
DEBUG(0,("spoolss_io_q_addprintprocessor: unable to unmarshall SPOOL_Q_ADDPRINTPROCESSOR.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
/* for now, just indicate success and ignore the add. We'll
|
||||
automatically set the winprint processor for printer
|
||||
entries later. Used to debug the LexMark Optra S 1855 PCL
|
||||
driver --jerry */
|
||||
r_u.status = NT_STATUS_NO_PROBLEMO;
|
||||
|
||||
if(!spoolss_io_r_addprintprocessor("", &r_u, rdata, 0)) {
|
||||
DEBUG(0,("spoolss_io_r_addprintprocessor: unable to marshall SPOOL_R_ADDPRINTPROCESSOR.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
static BOOL api_spoolss_enumprintprocdatatypes(pipes_struct *p)
|
||||
{
|
||||
SPOOL_Q_ENUMPRINTPROCDATATYPES q_u;
|
||||
@ -1210,6 +1242,7 @@ struct api_struct api_spoolss_cmds[] =
|
||||
{"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 },
|
||||
|
Loading…
x
Reference in New Issue
Block a user