summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h3
-rwxr-xr-xsource3/include/rpc_spoolss.h2
-rw-r--r--source3/rpc_parse/parse_spoolss.c9
-rwxr-xr-xsource3/rpc_server/srv_spoolss.c5
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c11
5 files changed, 24 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e782507cf7..5f07214402 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3130,7 +3130,8 @@ uint32 _spoolss_setprinter(POLICY_HND *handle, uint32 level,
uint32 command, pipes_struct *p);
uint32 _spoolss_fcpn(POLICY_HND *handle);
uint32 _spoolss_addjob(POLICY_HND *handle, uint32 level,
- NEW_BUFFER *buffer, uint32 offered);
+ NEW_BUFFER *buffer, uint32 offered,
+ uint32 *needed);
uint32 _spoolss_enumjobs( POLICY_HND *handle, uint32 firstjob, uint32 numofjobs, uint32 level,
NEW_BUFFER *buffer, uint32 offered,
uint32 *needed, uint32 *returned);
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 1e0a53d9e0..cb6b29cab3 100755
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -958,6 +958,8 @@ SPOOL_Q_ADDJOB;
typedef struct spool_r_addjob
{
+ NEW_BUFFER *buffer;
+ uint32 needed;
uint32 status;
}
SPOOL_R_ADDJOB;
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 5598c619a9..54794a7343 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -3291,6 +3291,15 @@ BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int de
if(!prs_align(ps))
return False;
+ if(!new_spoolss_io_buffer("", ps, depth, r_u->buffer))
+ return False;
+
+ if(!prs_align(ps))
+ return False;
+
+ if(!prs_uint32("needed", ps, depth, &r_u->needed))
+ return False;
+
if(!prs_uint32("status", ps, depth, &r_u->status))
return False;
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 8b431551b5..5a1592e4fb 100755
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -591,10 +591,11 @@ static BOOL api_spoolss_addjob(pipes_struct *p)
return False;
}
- /* that's only an [in] buffer ! */
+ /* that's an [in out] buffer (despite appearences to the contrary) */
+ new_spoolss_move_buffer(q_u.buffer, &r_u.buffer);
r_u.status = _spoolss_addjob(&q_u.handle, q_u.level,
- q_u.buffer, q_u.offered);
+ r_u.buffer, q_u.offered, &r_u.needed);
if(!spoolss_io_r_addjob("",&r_u,rdata,0)) {
DEBUG(0,("spoolss_io_r_addjob: unable to marshall SPOOL_R_ADDJOB.\n"));
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 36a8a1697c..b118b7c933 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -3342,9 +3342,14 @@ uint32 _spoolss_fcpn(POLICY_HND *handle)
/****************************************************************************
****************************************************************************/
uint32 _spoolss_addjob(POLICY_HND *handle, uint32 level,
- NEW_BUFFER *buffer, uint32 offered)
-{
- return NT_STATUS_NO_PROBLEMO;
+ NEW_BUFFER *buffer, uint32 offered,
+ uint32 *needed)
+{
+ *needed = 0;
+ return ERROR_INVALID_PARAMETER; /* this is what a NT server
+ returns for AddJob. AddJob
+ must fail on non-local
+ printers */
}
/****************************************************************************