static void send_notify_field_values(struct tevent_context *ev,
				     struct messaging_context *msg_ctx,
				     const char *sharename, uint32 type,
				     uint32 field, uint32 id, uint32 value1, 
				     uint32 value2, uint32 flags)
{
	struct spoolss_notify_msg *msg;

	if (lp_disable_spoolss())
		return;

	if (!create_send_ctx())
		return;

	msg = talloc(send_ctx, struct spoolss_notify_msg);
	if (!msg)
		return;

	ZERO_STRUCTP(msg);

	fstrcpy(msg->printer, sharename);
	msg->type = type;
	msg->field = field;
	msg->id = id;
	msg->notify.value[0] = value1;
	msg->notify.value[1] = value2;
	msg->flags = flags;

	send_spoolss_notify2_msg(ev, msg_ctx, msg);
}
Beispiel #2
0
static void send_notify_field_buffer(struct tevent_context *ev,
				     struct messaging_context *msg_ctx,
				     const char *sharename, uint32_t type,
				     uint32_t field, uint32_t id, uint32_t len,
				     const char *buffer)
{
	struct spoolss_notify_msg *msg;

	if (lp_disable_spoolss())
		return;

	if (!create_send_ctx())
		return;

	msg = talloc_zero(send_ctx, struct spoolss_notify_msg);
	if (!msg)
		return;

	fstrcpy(msg->printer, sharename);
	msg->type = type;
	msg->field = field;
	msg->id = id;
	msg->len = len;
	msg->notify.data = discard_const_p(char, buffer);

	send_spoolss_notify2_msg(ev, msg_ctx, msg);
}