summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-16 20:56:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:11 -0500
commite95942ed84fef4dd34c380d59145d3e182b01702 (patch)
tree8708f2aaf5d7c0c39bd56d93cf28a412b151b65c /source3/printing
parent9b48f7d76d1700f3be951b0322a7184bd192004f (diff)
downloadsamba-e95942ed84fef4dd34c380d59145d3e182b01702.tar.gz
samba-e95942ed84fef4dd34c380d59145d3e182b01702.tar.bz2
samba-e95942ed84fef4dd34c380d59145d3e182b01702.zip
r22954: More messaging_register
(This used to be commit 9b8df24107ffe3016031e5257c5680689f061886)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c9
-rw-r--r--source3/printing/printing.c18
2 files changed, 15 insertions, 12 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 965793b3cf..84dba9d55a 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -542,7 +542,7 @@ static BOOL upgrade_to_version_5(void)
Open the NT printing tdbs. Done once before fork().
****************************************************************************/
-BOOL nt_printing_init(void)
+BOOL nt_printing_init(struct messaging_context *msg_ctx)
{
const char *vstring = "INFO/version";
WERROR win_rc;
@@ -631,15 +631,16 @@ BOOL nt_printing_init(void)
* drivers are installed
*/
- message_register(MSG_PRINTER_DRVUPGRADE, do_drv_upgrade_printer, NULL);
+ messaging_register(msg_ctx, NULL, MSG_PRINTER_DRVUPGRADE,
+ do_drv_upgrade_printer);
/*
* register callback to handle updating printer data
* when a driver is initialized
*/
- message_register(MSG_PRINTERDATA_INIT_RESET, reset_all_printerdata,
- NULL);
+ messaging_register(msg_ctx, NULL, MSG_PRINTERDATA_INIT_RESET,
+ reset_all_printerdata);
/* of course, none of the message callbacks matter if you don't
tell messages.c that you interested in receiving PRINT_GENERAL
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 9bae768c19..6717f473cc 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -178,7 +178,7 @@ static int get_queue_status(const char* sharename, print_status_struct *);
Initialise the printing backend. Called once at startup before the fork().
****************************************************************************/
-BOOL print_backend_init(void)
+BOOL print_backend_init(struct messaging_context *msg_ctx)
{
const char *sversion = "INFO/version";
pstring printing_path;
@@ -215,7 +215,7 @@ BOOL print_backend_init(void)
close_all_print_db(); /* Don't leave any open. */
/* do NT print initialization... */
- return nt_printing_init();
+ return nt_printing_init(msg_ctx);
}
/****************************************************************************
@@ -1348,16 +1348,18 @@ static void print_queue_update_with_lock( const char *sharename,
/****************************************************************************
this is the receive function of the background lpq updater
****************************************************************************/
-static void print_queue_receive(int msg_type, struct server_id src,
- void *buf, size_t msglen,
- void *private_data)
+static void print_queue_receive(struct messaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ DATA_BLOB *data)
{
fstring sharename;
pstring lpqcommand, lprmcommand;
int printing_type;
size_t len;
- len = tdb_unpack( (uint8 *)buf, msglen, "fdPP",
+ len = tdb_unpack( (uint8 *)data->data, data->length, "fdPP",
sharename,
&printing_type,
lpqcommand,
@@ -1401,8 +1403,8 @@ void start_background_queue(void)
exit(1);
}
- message_register(MSG_PRINTER_UPDATE, print_queue_receive,
- NULL);
+ messaging_register(smbd_messaging_context(), NULL,
+ MSG_PRINTER_UPDATE, print_queue_receive);
DEBUG(5,("start_background_queue: background LPQ thread waiting for messages\n"));
while (1) {