[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-1088-gc1e76d0

Günther Deschner gd at samba.org
Mon Feb 23 15:17:58 GMT 2009


The branch, master has been updated
       via  c1e76d0dd9a1a7134fa3c0012a9cbe8f51f0716c (commit)
       via  b3f6d6910850efaf6240dd01576d3794d8aec170 (commit)
       via  2efa7cf6d9b20fe20a2bd6b0e64625c5082f97f1 (commit)
       via  418691c2e7eae156b10ae29cf443e26cede92e93 (commit)
       via  9b453f9248de2fce117f029240530d199e039ce1 (commit)
       via  9af13015b256e5b0eec74e1c788c13e246cde850 (commit)
       via  5116f50eb82c76bac40c558c00db17be6b56f161 (commit)
       via  6259fac904641cdc191d866e4cd9936cc68df45e (commit)
       via  03a15f2381d467c7c4d2f504297f102806847394 (commit)
      from  00913a73c7c93f410e5e05a1825138a61705ea6e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c1e76d0dd9a1a7134fa3c0012a9cbe8f51f0716c
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 16 23:33:10 2009 +0100

    s3-spoolss: use pidl for _spoolss_RemoteFindFirstPrinterChangeNotifyEx.
    
    Guenther

commit b3f6d6910850efaf6240dd01576d3794d8aec170
Author: Günther Deschner <gd at samba.org>
Date:   Tue Feb 17 00:12:21 2009 +0100

    s3-spoolss: use spoolss_NotifyOption and spoolss_NotifyType instead of SPOOL_NOTIFY_OPTION and SPOOL_NOTIFY_OPTION_TYPE.
    
    Guenther

commit 2efa7cf6d9b20fe20a2bd6b0e64625c5082f97f1
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 23 13:06:04 2009 +0100

    s3-spoolss: add dup_spoolss_NotifyOption.
    
    Guenther

commit 418691c2e7eae156b10ae29cf443e26cede92e93
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 13 12:47:32 2009 +0100

    s3-spoolss: use more idl types in spoolss server.
    
    Guenther

commit 9b453f9248de2fce117f029240530d199e039ce1
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 16:38:13 2009 +0100

    s3-spoolss: fix memleak of spoolss_Notify array in _spoolss_RouterRefreshPrinterChangeNotify.
    
    Guenther

commit 9af13015b256e5b0eec74e1c788c13e246cde850
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 00:40:37 2009 +0100

    s3-spoolss: use rpccli_spoolss_RouterReplyPrinterEx.
    
    Guenther

commit 5116f50eb82c76bac40c558c00db17be6b56f161
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 14:18:28 2009 +0100

    s3-spoolss: use pidl for _spoolss_RouterRefreshPrinterChangeNotify.
    
    Guenther

commit 6259fac904641cdc191d866e4cd9936cc68df45e
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 14:17:53 2009 +0100

    s3-spoolss: use struct spoolss_NotifyInfo instead of SPOOL_NOTIFY_INFO.
    
    Guenther

commit 03a15f2381d467c7c4d2f504297f102806847394
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 13:59:28 2009 +0100

    s3-spoolss: use struct spoolss_Notify instead of SPOOL_NOTIFY_INFO_DATA.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/include/nt_printing.h       |    2 +-
 source3/include/proto.h             |   31 +-
 source3/rpc_server/srv_spoolss.c    |   47 +--
 source3/rpc_server/srv_spoolss_nt.c | 1014 ++++++++++++++---------------------
 4 files changed, 429 insertions(+), 665 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 3bf51f2..43fd363 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -439,7 +439,7 @@ typedef struct _Printer{
 		uint32 options;
 		fstring localmachine;
 		uint32 printerlocal;
-		SPOOL_NOTIFY_OPTION *option;
+		struct spoolss_NotifyOption *option;
 		POLICY_HND client_hnd;
 		bool client_connected;
 		uint32 change;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9dc9719..93b4ca8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6142,72 +6142,75 @@ WERROR set_printer_dataex( NT_PRINTER_INFO_LEVEL *printer, const char *key, cons
 WERROR _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u);
 WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u);
 void spoolss_notify_server_name(int snum,
-				       SPOOL_NOTIFY_INFO_DATA *data,
+				       struct spoolss_Notify *data,
 				       print_queue_struct *queue,
 				       NT_PRINTER_INFO_LEVEL *printer,
 				       TALLOC_CTX *mem_ctx);
 void spoolss_notify_printer_name(int snum,
-					SPOOL_NOTIFY_INFO_DATA *data,
+					struct spoolss_Notify *data,
 					print_queue_struct *queue,
 					NT_PRINTER_INFO_LEVEL *printer,
 					TALLOC_CTX *mem_ctx);
 void spoolss_notify_share_name(int snum,
-				      SPOOL_NOTIFY_INFO_DATA *data,
+				      struct spoolss_Notify *data,
 				      print_queue_struct *queue,
 				      NT_PRINTER_INFO_LEVEL *printer,
 				      TALLOC_CTX *mem_ctx);
 void spoolss_notify_port_name(int snum,
-				     SPOOL_NOTIFY_INFO_DATA *data,
+				     struct spoolss_Notify *data,
 				     print_queue_struct *queue,
 				     NT_PRINTER_INFO_LEVEL *printer,
 				     TALLOC_CTX *mem_ctx);
 void spoolss_notify_driver_name(int snum,
-				       SPOOL_NOTIFY_INFO_DATA *data,
+				       struct spoolss_Notify *data,
 				       print_queue_struct *queue,
 				       NT_PRINTER_INFO_LEVEL *printer,
 				       TALLOC_CTX *mem_ctx);
 void spoolss_notify_comment(int snum,
-				   SPOOL_NOTIFY_INFO_DATA *data,
+				   struct spoolss_Notify *data,
 				   print_queue_struct *queue,
 				   NT_PRINTER_INFO_LEVEL *printer,
 				   TALLOC_CTX *mem_ctx);
 void spoolss_notify_location(int snum,
-				    SPOOL_NOTIFY_INFO_DATA *data,
+				    struct spoolss_Notify *data,
 				    print_queue_struct *queue,
 				    NT_PRINTER_INFO_LEVEL *printer,
 				    TALLOC_CTX *mem_ctx);
 void spoolss_notify_sepfile(int snum,
-				   SPOOL_NOTIFY_INFO_DATA *data,
+				   struct spoolss_Notify *data,
 				   print_queue_struct *queue,
 				   NT_PRINTER_INFO_LEVEL *printer,
 				   TALLOC_CTX *mem_ctx);
 void spoolss_notify_print_processor(int snum,
-					   SPOOL_NOTIFY_INFO_DATA *data,
+					   struct spoolss_Notify *data,
 					   print_queue_struct *queue,
 					   NT_PRINTER_INFO_LEVEL *printer,
 					   TALLOC_CTX *mem_ctx);
 void spoolss_notify_parameters(int snum,
-				      SPOOL_NOTIFY_INFO_DATA *data,
+				      struct spoolss_Notify *data,
 				      print_queue_struct *queue,
 				      NT_PRINTER_INFO_LEVEL *printer,
 				      TALLOC_CTX *mem_ctx);
 void spoolss_notify_datatype(int snum,
-				    SPOOL_NOTIFY_INFO_DATA *data,
+				    struct spoolss_Notify *data,
 				    print_queue_struct *queue,
 				    NT_PRINTER_INFO_LEVEL *printer,
 				    TALLOC_CTX *mem_ctx);
 void spoolss_notify_attributes(int snum,
-				      SPOOL_NOTIFY_INFO_DATA *data,
+				      struct spoolss_Notify *data,
 				      print_queue_struct *queue,
 				      NT_PRINTER_INFO_LEVEL *printer,
 				      TALLOC_CTX *mem_ctx);
 void spoolss_notify_cjobs(int snum,
-				 SPOOL_NOTIFY_INFO_DATA *data,
+				 struct spoolss_Notify *data,
 				 print_queue_struct *queue,
 				 NT_PRINTER_INFO_LEVEL *printer,
 				 TALLOC_CTX *mem_ctx);
-void construct_info_data(SPOOL_NOTIFY_INFO_DATA *info_data, uint16 type, uint16 field, int id);
 WERROR _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCNEX *r_u);
+void construct_info_data(struct spoolss_Notify *info_data,
+			 enum spoolss_NotifyType type,
+			 enum spoolss_Field field,
+			 int id);
 DEVICEMODE *construct_dev_mode(const char *servicename);
 WERROR _spoolss_enumprinters( pipes_struct *p, SPOOL_Q_ENUMPRINTERS *q_u, SPOOL_R_ENUMPRINTERS *r_u);
 WERROR _spoolss_getprinter(pipes_struct *p, SPOOL_Q_GETPRINTER *q_u, SPOOL_R_GETPRINTER *r_u);
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 7bb71ab..ee36f04 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -161,27 +161,7 @@ static bool api_spoolss_deleteprinterdriver(pipes_struct *p)
 
 static bool api_spoolss_rffpcnex(pipes_struct *p)
 {
-	SPOOL_Q_RFFPCNEX q_u;
-	SPOOL_R_RFFPCNEX 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_rffpcnex("", &q_u, data, 0)) {
-		DEBUG(0,("spoolss_io_q_rffpcnex: unable to unmarshall SPOOL_Q_RFFPCNEX.\n"));
-		return False;
-	}
-
-	r_u.status = _spoolss_rffpcnex(p, &q_u, &r_u);
-
-	if (!spoolss_io_r_rffpcnex("", &r_u, rdata, 0)) {
-		DEBUG(0,("spoolss_io_r_rffpcnex: unable to marshall SPOOL_R_RFFPCNEX.\n"));
-		return False;
-	}
-
-	return True;
+	return proxy_spoolss_call(p, NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX);
 }
 
 
@@ -198,30 +178,7 @@ static bool api_spoolss_rffpcnex(pipes_struct *p)
 
 static bool api_spoolss_rfnpcnex(pipes_struct *p)
 {
-	SPOOL_Q_RFNPCNEX q_u;
-	SPOOL_R_RFNPCNEX 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_rfnpcnex("", &q_u, data, 0)) {
-		DEBUG(0,("spoolss_io_q_rfnpcnex: unable to unmarshall SPOOL_Q_RFNPCNEX.\n"));
-		return False;
-	}
-
-	r_u.status = _spoolss_rfnpcnex(p, &q_u, &r_u);
-
-	if (!spoolss_io_r_rfnpcnex("", &r_u, rdata, 0)) {
-		SAFE_FREE(r_u.info.data);
-		DEBUG(0,("spoolss_io_r_rfnpcnex: unable to marshall SPOOL_R_RFNPCNEX.\n"));
-		return False;
-	}
-
-	SAFE_FREE(r_u.info.data);
-
-	return True;
+	return proxy_spoolss_call(p, NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY);
 }
 
 
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 0fe66d9..a4679eb 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -130,19 +130,6 @@ static int nt_printq_status(int v)
 	return 0;
 }
 
-/****************************************************************************
- Functions to handle SPOOL_NOTIFY_OPTION struct stored in Printer_entry.
-****************************************************************************/
-
-static void free_spool_notify_option(SPOOL_NOTIFY_OPTION **pp)
-{
-	if (*pp == NULL)
-		return;
-
-	SAFE_FREE((*pp)->ctr.type);
-	SAFE_FREE(*pp);
-}
-
 /***************************************************************************
  Disconnect from the client
 ****************************************************************************/
@@ -215,8 +202,7 @@ static int printer_entry_destructor(Printer_entry *Printer)
 	Printer->notify.options=0;
 	Printer->notify.localmachine[0]='\0';
 	Printer->notify.printerlocal=0;
-	free_spool_notify_option(&Printer->notify.option);
-	Printer->notify.option=NULL;
+	TALLOC_FREE(Printer->notify.option);
 	Printer->notify.client_connected=False;
 
 	free_nt_devicemode( &Printer->nt_devmode );
@@ -228,35 +214,6 @@ static int printer_entry_destructor(Printer_entry *Printer)
 }
 
 /****************************************************************************
- Functions to duplicate a SPOOL_NOTIFY_OPTION struct stored in Printer_entry.
-****************************************************************************/
-
-static SPOOL_NOTIFY_OPTION *dup_spool_notify_option(SPOOL_NOTIFY_OPTION *sp)
-{
-	SPOOL_NOTIFY_OPTION *new_sp = NULL;
-
-	if (!sp)
-		return NULL;
-
-	new_sp = SMB_MALLOC_P(SPOOL_NOTIFY_OPTION);
-	if (!new_sp)
-		return NULL;
-
-	*new_sp = *sp;
-
-	if (sp->ctr.count) {
-		new_sp->ctr.type = (SPOOL_NOTIFY_OPTION_TYPE *)memdup(sp->ctr.type, sizeof(SPOOL_NOTIFY_OPTION_TYPE) * sp->ctr.count);
-
-		if (!new_sp->ctr.type) {
-			SAFE_FREE(new_sp);
-			return NULL;
-		}
-	}
-
-	return new_sp;
-}
-
-/****************************************************************************
   find printer index by handle
 ****************************************************************************/
 
@@ -633,7 +590,7 @@ static bool is_monitoring_event_flags(uint32 flags, uint16 notify_type,
 static bool is_monitoring_event(Printer_entry *p, uint16 notify_type,
 				uint16 notify_field)
 {
-	SPOOL_NOTIFY_OPTION *option = p->notify.option;
+	struct spoolss_NotifyOption *option = p->notify.option;
 	uint32 i, j;
 
 	/*
@@ -655,13 +612,13 @@ static bool is_monitoring_event(Printer_entry *p, uint16 notify_type,
 
 		/* Check match for notify_type */
 
-		if (option->ctr.type[i].type != notify_type)
+		if (option->types[i].type != notify_type)
 			continue;
 
 		/* Check match for field */
 
-		for (j = 0; j < option->ctr.type[i].count; j++) {
-			if (option->ctr.type[i].fields[j] == notify_field) {
+		for (j = 0; j < option->types[i].count; j++) {
+			if (option->types[i].fields[j] == notify_field) {
 				return True;
 			}
 		}
@@ -673,43 +630,93 @@ static bool is_monitoring_event(Printer_entry *p, uint16 notify_type,
 	return False;
 }
 
-/* Convert a notification message to a SPOOL_NOTIFY_INFO_DATA struct */
+#define SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(_data, _integer) \
+	_data->data.integer[0] = _integer; \
+	_data->data.integer[1] = 0;
+
+
+#define SETUP_SPOOLSS_NOTIFY_DATA_STRING(_data, _p) \
+	_data->data.string.string = talloc_strdup(mem_ctx, _p); \
+	if (!_data->data.string.string) {\
+		_data->data.string.size = 0; \
+	} \
+	_data->data.string.size = strlen_m_term(_p) * 2;
+
+#define SETUP_SPOOLSS_NOTIFY_DATA_DEVMODE(_data, _devmode) \
+	_data->data.devmode.devmode = _devmode;
+
+#define SETUP_SPOOLSS_NOTIFY_DATA_SECDESC(_data, _size, _sd) \
+	_data->data.sd.sd = dup_sec_desc(mem_ctx, _sd); \
+	if (!_data->data.sd.sd) { \
+		_data->data.sd.sd_size = 0; \
+	} \
+	_data->data.sd.sd_size = _size;
+
+static void init_systemtime_buffer(TALLOC_CTX *mem_ctx,
+				   struct tm *t,
+				   const char **pp,
+				   uint32_t *plen)
+{
+	struct spoolss_Time st;
+	uint32_t len = 16;
+	char *p;
+
+	if (!init_systemtime(&st, t)) {
+		return;
+	}
+
+	p = talloc_array(mem_ctx, char, len);
+	if (!p) {
+		return;
+	}
+
+	/*
+	 * Systemtime must be linearized as a set of UINT16's.
+	 * Fix from Benjamin (Bj) Kuit bj at it.uts.edu.au
+	 */
+
+	SSVAL(p, 0, st.year);
+	SSVAL(p, 2, st.month);
+	SSVAL(p, 4, st.day_of_week);
+	SSVAL(p, 6, st.day);
+	SSVAL(p, 8, st.hour);
+	SSVAL(p, 10, st.minute);
+	SSVAL(p, 12, st.second);
+	SSVAL(p, 14, st.millisecond);
+
+	*pp = p;
+	*plen = len;
+}
+
+/* Convert a notification message to a struct spoolss_Notify */
 
 static void notify_one_value(struct spoolss_notify_msg *msg,
-			     SPOOL_NOTIFY_INFO_DATA *data,
+			     struct spoolss_Notify *data,
 			     TALLOC_CTX *mem_ctx)
 {
-	data->notify_data.value[0] = msg->notify.value[0];
-	data->notify_data.value[1] = 0;
+	SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, msg->notify.value[0]);
 }
 
 static void notify_string(struct spoolss_notify_msg *msg,
-			  SPOOL_NOTIFY_INFO_DATA *data,
+			  struct spoolss_Notify *data,
 			  TALLOC_CTX *mem_ctx)
 {
-	UNISTR2 unistr;
-
 	/* The length of the message includes the trailing \0 */
 
-	init_unistr2(&unistr, msg->notify.data, UNI_STR_TERMINATE);
-
-	data->notify_data.data.length = msg->len * 2;
-	data->notify_data.data.string = TALLOC_ARRAY(mem_ctx, uint16, msg->len);
-
-	if (!data->notify_data.data.string) {
-		data->notify_data.data.length = 0;
+	data->data.string.size = msg->len * 2;
+	data->data.string.string = talloc_strdup(mem_ctx, msg->notify.data);
+	if (!data->data.string.string) {
+		data->data.string.size = 0;
 		return;
 	}
-
-	memcpy(data->notify_data.data.string, unistr.buffer, msg->len * 2);
 }
 
 static void notify_system_time(struct spoolss_notify_msg *msg,
-			       SPOOL_NOTIFY_INFO_DATA *data,
+			       struct spoolss_Notify *data,
 			       TALLOC_CTX *mem_ctx)
 {
-	SYSTEMTIME systime;
-	prs_struct ps;
+	data->data.string.string = NULL;
+	data->data.string.size = 0;
 
 	if (msg->len != sizeof(time_t)) {
 		DEBUG(5, ("notify_system_time: received wrong sized message (%d)\n",
@@ -717,42 +724,15 @@ static void notify_system_time(struct spoolss_notify_msg *msg,
 		return;
 	}
 
-	if (!prs_init(&ps, RPC_MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL)) {
-		DEBUG(5, ("notify_system_time: prs_init() failed\n"));
-		return;
-	}
-
-	if (!make_systemtime(&systime, gmtime((time_t *)msg->notify.data))) {
-		DEBUG(5, ("notify_system_time: unable to make systemtime\n"));
-		prs_mem_free(&ps);
-		return;
-	}
-
-	if (!spoolss_io_system_time("", &ps, 0, &systime)) {
-		prs_mem_free(&ps);
-		return;
-	}
-
-	data->notify_data.data.length = prs_offset(&ps);
-	if (prs_offset(&ps)) {
-		data->notify_data.data.string = (uint16 *)
-			TALLOC(mem_ctx, prs_offset(&ps));
-		if (!data->notify_data.data.string) {
-			prs_mem_free(&ps);
-			return;
-		}
-		prs_copy_all_data_out((char *)data->notify_data.data.string, &ps);
-	} else {
-		data->notify_data.data.string = NULL;
-	}
-
-	prs_mem_free(&ps);
+	init_systemtime_buffer(mem_ctx, gmtime((time_t *)msg->notify.data),
+			       &data->data.string.string,
+			       &data->data.string.size);
 }
 
 struct notify2_message_table {
 	const char *name;
 	void (*fn)(struct spoolss_notify_msg *msg,
-		   SPOOL_NOTIFY_INFO_DATA *data, TALLOC_CTX *mem_ctx);
+		   struct spoolss_Notify *data, TALLOC_CTX *mem_ctx);
 };
 
 static struct notify2_message_table printer_notify_table[] = {
@@ -966,9 +946,9 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx )
 	/* loop over all printers */
 
 	for (p = printers_list; p; p = p->next) {
-		SPOOL_NOTIFY_INFO_DATA *data;
-		uint32	data_len = 0;
-		uint32 	id;
+		struct spoolss_Notify *notifies;
+		uint32_t count = 0;
+		uint32_t id;
 		int 	i;
 
 		/* Is there notification on this handle? */
@@ -989,13 +969,11 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx )
 
 		/* allocate the max entries possible */
 
-		data = TALLOC_ARRAY( mem_ctx, SPOOL_NOTIFY_INFO_DATA, msg_group->num_msgs);
-		if (!data) {
+		notifies = TALLOC_ZERO_ARRAY(mem_ctx, struct spoolss_Notify, msg_group->num_msgs);
+		if (!notifies) {
 			return;
 		}
 
-		ZERO_STRUCTP(data);
-
 		/* build the array of change notifications */
 
 		sending_msg_count = 0;
@@ -1044,17 +1022,17 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx )
 				}
 			}
 
-			construct_info_data( &data[data_len], msg->type, msg->field, id );
+			construct_info_data( &notifies[count], msg->type, msg->field, id );
 
 			switch(msg->type) {
 			case PRINTER_NOTIFY_TYPE:
 				if ( printer_notify_table[msg->field].fn )
-					printer_notify_table[msg->field].fn(msg, &data[data_len], mem_ctx);
+					printer_notify_table[msg->field].fn(msg, &notifies[count], mem_ctx);
 				break;
 
 			case JOB_NOTIFY_TYPE:
 				if ( job_notify_table[msg->field].fn )
-					job_notify_table[msg->field].fn(msg, &data[data_len], mem_ctx);
+					job_notify_table[msg->field].fn(msg, &notifies[count], mem_ctx);
 				break;
 
 			default:
@@ -1062,12 +1040,46 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx )
 				goto done;
 			}
 
-			data_len++;
+			count++;
 		}
 
 		if ( sending_msg_count ) {
-			rpccli_spoolss_rrpcn( notify_cli_pipe, mem_ctx, &p->notify.client_hnd,
-					data_len, data, p->notify.change, 0 );
+			NTSTATUS status;
+			WERROR werr;
+			union spoolss_ReplyPrinterInfo info;
+			struct spoolss_NotifyInfo info0;
+			uint32_t reply_result;
+
+			info0.version	= 0x2;
+			info0.flags	= count ? 0x00020000 /* ??? */ : PRINTER_NOTIFY_INFO_DISCARDED;
+			info0.count	= count;
+			info0.notifies	= notifies;
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list