[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-801-gce6125e

Günther Deschner gd at samba.org
Wed Feb 11 23:57:54 GMT 2009


The branch, master has been updated
       via  ce6125e9ec2196b7658e4e87eae3b0ae963b6ab5 (commit)
       via  6d3dbdf2fa2f9424b838676a79311d3a575fcaf2 (commit)
       via  3f9a11993592f989766514da5d2622a62319398a (commit)
      from  69b1550f7f898668efd365548bd04503eb175d80 (commit)

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


- Log -----------------------------------------------------------------
commit ce6125e9ec2196b7658e4e87eae3b0ae963b6ab5
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 00:42:59 2009 +0100

    s3-spoolss: remove duplicate PRINTER_NOTIFY_INFO_DISCARDED define.
    
    Guenther

commit 6d3dbdf2fa2f9424b838676a79311d3a575fcaf2
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 12 00:54:40 2009 +0100

    s3: re-run make samba3-idl.
    
    Guenther

commit 3f9a11993592f989766514da5d2622a62319398a
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 11 22:07:26 2009 +0100

    spoolss: fill in spoolss_RouterReplyPrinterEx.
    
    Guenther

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

Summary of changes:
 librpc/gen_ndr/cli_spoolss.c  |   12 +++
 librpc/gen_ndr/cli_spoolss.h  |    6 ++
 librpc/gen_ndr/ndr_spoolss.c  |  169 +++++++++++++++++++++++++++++++++++++++++
 librpc/gen_ndr/ndr_spoolss.h  |    2 +
 librpc/gen_ndr/spoolss.h      |   18 +++++
 librpc/gen_ndr/srv_spoolss.c  |   13 +++
 librpc/idl/spoolss.idl        |   21 +++++-
 source3/include/rpc_spoolss.h |    2 -
 8 files changed, 239 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index a9d401b..2f15cb3 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -3109,12 +3109,23 @@ NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_cli
 
 NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
 					     TALLOC_CTX *mem_ctx,
+					     struct policy_handle *handle /* [in] [ref] */,
+					     uint32_t color /* [in]  */,
+					     uint32_t flags /* [in]  */,
+					     uint32_t *reply_result /* [out] [ref] */,
+					     uint32_t reply_type /* [in]  */,
+					     union spoolss_ReplyPrinterInfo info /* [in] [switch_is(reply_type)] */,
 					     WERROR *werror)
 {
 	struct spoolss_RouterReplyPrinterEx r;
 	NTSTATUS status;
 
 	/* In parameters */
+	r.in.handle = handle;
+	r.in.color = color;
+	r.in.flags = flags;
+	r.in.reply_type = reply_type;
+	r.in.info = info;
 
 	if (DEBUGLEVEL >= 10) {
 		NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, &r);
@@ -3139,6 +3150,7 @@ NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
+	*reply_result = *r.out.reply_result;
 
 	/* Return result */
 	if (werror) {
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index 4f04b93..6903aa6 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -384,6 +384,12 @@ NTSTATUS rpccli_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct rpc_pipe_cli
 							     WERROR *werror);
 NTSTATUS rpccli_spoolss_RouterReplyPrinterEx(struct rpc_pipe_client *cli,
 					     TALLOC_CTX *mem_ctx,
+					     struct policy_handle *handle /* [in] [ref] */,
+					     uint32_t color /* [in]  */,
+					     uint32_t flags /* [in]  */,
+					     uint32_t *reply_result /* [out] [ref] */,
+					     uint32_t reply_type /* [in]  */,
+					     union spoolss_ReplyPrinterInfo info /* [in] [switch_is(reply_type)] */,
 					     WERROR *werror);
 NTSTATUS rpccli_spoolss_RouterRefreshPrinterChangeNotify(struct rpc_pipe_client *cli,
 							 TALLOC_CTX *mem_ctx,
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c
index 47b61e5..5525ad4 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -10602,6 +10602,124 @@ _PUBLIC_ void ndr_print_spoolss_NotifyInfo(struct ndr_print *ndr, const char *na
 	ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_spoolss_ReplyPrinterInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_ReplyPrinterInfo *r)
+{
+	if (ndr_flags & NDR_SCALARS) {
+		int level = ndr_push_get_switch_value(ndr, r);
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
+		switch (level) {
+			case 0: {
+				NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0));
+			break; }
+
+			default:
+				return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+		}
+	}
+	if (ndr_flags & NDR_BUFFERS) {
+		int level = ndr_push_get_switch_value(ndr, r);
+		switch (level) {
+			case 0:
+				if (r->info0) {
+					NDR_CHECK(ndr_push_spoolss_NotifyInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
+				}
+			break;
+
+			default:
+				return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+		}
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_spoolss_ReplyPrinterInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_ReplyPrinterInfo *r)
+{
+	int level;
+	uint32_t _level;
+	TALLOC_CTX *_mem_save_info0_0;
+	level = ndr_pull_get_switch_value(ndr, r);
+	if (ndr_flags & NDR_SCALARS) {
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
+		if (_level != level) {
+			return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+		}
+		switch (level) {
+			case 0: {
+				uint32_t _ptr_info0;
+				NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0));
+				if (_ptr_info0) {
+					NDR_PULL_ALLOC(ndr, r->info0);
+				} else {
+					r->info0 = NULL;
+				}
+			break; }
+
+			default:
+				return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+		}
+	}
+	if (ndr_flags & NDR_BUFFERS) {
+		switch (level) {
+			case 0:
+				if (r->info0) {
+					_mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr);
+					NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0);
+					NDR_CHECK(ndr_pull_spoolss_NotifyInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
+					NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0);
+				}
+			break;
+
+			default:
+				return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+		}
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_ReplyPrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_ReplyPrinterInfo *r)
+{
+	int level;
+	level = ndr_print_get_switch_value(ndr, r);
+	ndr_print_union(ndr, name, level, "spoolss_ReplyPrinterInfo");
+	switch (level) {
+		case 0:
+			ndr_print_ptr(ndr, "info0", r->info0);
+			ndr->depth++;
+			if (r->info0) {
+				ndr_print_spoolss_NotifyInfo(ndr, "info0", r->info0);
+			}
+			ndr->depth--;
+		break;
+
+		default:
+			ndr_print_bad_level(ndr, name, level);
+	}
+}
+
+static enum ndr_err_code ndr_push_spoolss_PrinterNotifyFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+	NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+	return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_spoolss_PrinterNotifyFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+	uint32_t v;
+	NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+	*r = v;
+	return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_PrinterNotifyFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+	ndr_print_uint32(ndr, name, r);
+	ndr->depth++;
+	ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_NOTIFY_INFO_DISCARDED", PRINTER_NOTIFY_INFO_DISCARDED, r);
+	ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_NOTIFY_INFO_DISCARDNOTED", PRINTER_NOTIFY_INFO_DISCARDNOTED, r);
+	ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_NOTIFY_INFO_COLOR_MISMATCH", PRINTER_NOTIFY_INFO_COLOR_MISMATCH, r);
+	ndr->depth--;
+}
+
 static enum ndr_err_code ndr_push_spoolss_UserLevel1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_UserLevel1 *r)
 {
 	if (ndr_flags & NDR_SCALARS) {
@@ -16670,8 +16788,21 @@ _PUBLIC_ void ndr_print_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct ndr_
 static enum ndr_err_code ndr_push_spoolss_RouterReplyPrinterEx(struct ndr_push *ndr, int flags, const struct spoolss_RouterReplyPrinterEx *r)
 {
 	if (flags & NDR_IN) {
+		if (r->in.handle == NULL) {
+			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+		}
+		NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.color));
+		NDR_CHECK(ndr_push_spoolss_PrinterChangeFlags(ndr, NDR_SCALARS, r->in.flags));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reply_type));
+		NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.reply_type));
+		NDR_CHECK(ndr_push_spoolss_ReplyPrinterInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info));
 	}
 	if (flags & NDR_OUT) {
+		if (r->out.reply_result == NULL) {
+			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+		}
+		NDR_CHECK(ndr_push_spoolss_PrinterNotifyFlags(ndr, NDR_SCALARS, *r->out.reply_result));
 		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 	}
 	return NDR_ERR_SUCCESS;
@@ -16679,9 +16810,34 @@ static enum ndr_err_code ndr_push_spoolss_RouterReplyPrinterEx(struct ndr_push *
 
 static enum ndr_err_code ndr_pull_spoolss_RouterReplyPrinterEx(struct ndr_pull *ndr, int flags, struct spoolss_RouterReplyPrinterEx *r)
 {
+	TALLOC_CTX *_mem_save_handle_0;
+	TALLOC_CTX *_mem_save_reply_result_0;
 	if (flags & NDR_IN) {
+		ZERO_STRUCT(r->out);
+
+		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+			NDR_PULL_ALLOC(ndr, r->in.handle);
+		}
+		_mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+		NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+		NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.color));
+		NDR_CHECK(ndr_pull_spoolss_PrinterChangeFlags(ndr, NDR_SCALARS, &r->in.flags));
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reply_type));
+		NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.reply_type));
+		NDR_CHECK(ndr_pull_spoolss_ReplyPrinterInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info));
+		NDR_PULL_ALLOC(ndr, r->out.reply_result);
+		ZERO_STRUCTP(r->out.reply_result);
 	}
 	if (flags & NDR_OUT) {
+		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+			NDR_PULL_ALLOC(ndr, r->out.reply_result);
+		}
+		_mem_save_reply_result_0 = NDR_PULL_GET_MEM_CTX(ndr);
+		NDR_PULL_SET_MEM_CTX(ndr, r->out.reply_result, LIBNDR_FLAG_REF_ALLOC);
+		NDR_CHECK(ndr_pull_spoolss_PrinterNotifyFlags(ndr, NDR_SCALARS, r->out.reply_result));
+		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reply_result_0, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 	}
 	return NDR_ERR_SUCCESS;
@@ -16697,11 +16853,24 @@ _PUBLIC_ void ndr_print_spoolss_RouterReplyPrinterEx(struct ndr_print *ndr, cons
 	if (flags & NDR_IN) {
 		ndr_print_struct(ndr, "in", "spoolss_RouterReplyPrinterEx");
 		ndr->depth++;
+		ndr_print_ptr(ndr, "handle", r->in.handle);
+		ndr->depth++;
+		ndr_print_policy_handle(ndr, "handle", r->in.handle);
+		ndr->depth--;
+		ndr_print_uint32(ndr, "color", r->in.color);
+		ndr_print_spoolss_PrinterChangeFlags(ndr, "flags", r->in.flags);
+		ndr_print_uint32(ndr, "reply_type", r->in.reply_type);
+		ndr_print_set_switch_value(ndr, &r->in.info, r->in.reply_type);
+		ndr_print_spoolss_ReplyPrinterInfo(ndr, "info", &r->in.info);
 		ndr->depth--;
 	}
 	if (flags & NDR_OUT) {
 		ndr_print_struct(ndr, "out", "spoolss_RouterReplyPrinterEx");
 		ndr->depth++;
+		ndr_print_ptr(ndr, "reply_result", r->out.reply_result);
+		ndr->depth++;
+		ndr_print_spoolss_PrinterNotifyFlags(ndr, "reply_result", *r->out.reply_result);
+		ndr->depth--;
 		ndr_print_WERROR(ndr, "result", r->out.result);
 		ndr->depth--;
 	}
diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h
index 609c3bf..ef97a01 100644
--- a/librpc/gen_ndr/ndr_spoolss.h
+++ b/librpc/gen_ndr/ndr_spoolss.h
@@ -315,6 +315,8 @@ void ndr_print_spoolss_NotifyBlob(struct ndr_print *ndr, const char *name, const
 void ndr_print_spoolss_NotifyData(struct ndr_print *ndr, const char *name, const union spoolss_NotifyData *r);
 void ndr_print_spoolss_Notify(struct ndr_print *ndr, const char *name, const struct spoolss_Notify *r);
 void ndr_print_spoolss_NotifyInfo(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyInfo *r);
+void ndr_print_spoolss_ReplyPrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_ReplyPrinterInfo *r);
+void ndr_print_spoolss_PrinterNotifyFlags(struct ndr_print *ndr, const char *name, uint32_t r);
 void ndr_print_spoolss_UserLevel1(struct ndr_print *ndr, const char *name, const struct spoolss_UserLevel1 *r);
 void ndr_print_spoolss_UserLevel(struct ndr_print *ndr, const char *name, const union spoolss_UserLevel *r);
 enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r);
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index ce5d6d9..3554d37 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -877,6 +877,15 @@ struct spoolss_NotifyInfo {
 	struct spoolss_Notify *notifies;/* [size_is(count)] */
 };
 
+union spoolss_ReplyPrinterInfo {
+	struct spoolss_NotifyInfo *info0;/* [unique,case(0)] */
+}/* [switch_type(uint32)] */;
+
+/* bitmap spoolss_PrinterNotifyFlags */
+#define PRINTER_NOTIFY_INFO_DISCARDED ( 0x00000001 )
+#define PRINTER_NOTIFY_INFO_DISCARDNOTED ( 0x00010000 )
+#define PRINTER_NOTIFY_INFO_COLOR_MISMATCH ( 0x00080000 )
+
 struct spoolss_UserLevel1 {
 	uint32_t size;
 	const char *client;/* [unique,charset(UTF16)] */
@@ -2029,6 +2038,15 @@ struct spoolss_RemoteFindFirstPrinterChangeNotifyEx {
 
 struct spoolss_RouterReplyPrinterEx {
 	struct {
+		struct policy_handle *handle;/* [ref] */
+		uint32_t color;
+		uint32_t flags;
+		uint32_t reply_type;
+		union spoolss_ReplyPrinterInfo info;/* [switch_is(reply_type)] */
+	} in;
+
+	struct {
+		uint32_t *reply_result;/* [ref] */
 		WERROR result;
 	} out;
 
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index 60dc2f0..1f8c89a 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -5096,6 +5096,13 @@ static bool api_spoolss_RouterReplyPrinterEx(pipes_struct *p)
 		NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, r);
 	}
 
+	ZERO_STRUCT(r->out);
+	r->out.reply_result = talloc_zero(r, uint32_t);
+	if (r->out.reply_result == NULL) {
+		talloc_free(r);
+		return false;
+	}
+
 	r->out.result = _spoolss_RouterReplyPrinterEx(p, r);
 
 	if (p->rng_fault_state) {
@@ -8071,6 +8078,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
 		case NDR_SPOOLSS_ROUTERREPLYPRINTEREX: {
 			struct spoolss_RouterReplyPrinterEx *r = (struct spoolss_RouterReplyPrinterEx *)_r;
+			ZERO_STRUCT(r->out);
+			r->out.reply_result = talloc_zero(mem_ctx, uint32_t);
+			if (r->out.reply_result == NULL) {
+			return NT_STATUS_NO_MEMORY;
+			}
+
 			r->out.result = _spoolss_RouterReplyPrinterEx(cli->pipes_struct, r);
 			return NT_STATUS_OK;
 		}
diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl
index 0a7d46d..3e1d662 100644
--- a/librpc/idl/spoolss.idl
+++ b/librpc/idl/spoolss.idl
@@ -1442,8 +1442,6 @@ import "misc.idl", "security.idl", "winreg.idl";
 
 	/******************/
 	/* Function: 0x42 */
-	[todo] WERROR spoolss_RouterReplyPrinterEx(
-	);
 
 	typedef struct {
 		uint32 size;
@@ -1487,6 +1485,25 @@ import "misc.idl", "security.idl", "winreg.idl";
 		[size_is(count)] spoolss_Notify notifies[];
 	} spoolss_NotifyInfo;
 
+	typedef [switch_type(uint32)] union {
+		[case(0)] spoolss_NotifyInfo *info0;
+	} spoolss_ReplyPrinterInfo;
+
+	typedef [bitmap32bit] bitmap {
+		PRINTER_NOTIFY_INFO_DISCARDED		= 0x00000001,
+		PRINTER_NOTIFY_INFO_DISCARDNOTED	= 0x00010000,
+		PRINTER_NOTIFY_INFO_COLOR_MISMATCH	= 0x00080000
+	} spoolss_PrinterNotifyFlags;
+
+	WERROR spoolss_RouterReplyPrinterEx(
+		[in,ref] policy_handle *handle,
+		[in] uint32 color,
+		[in] spoolss_PrinterChangeFlags flags,
+		[out,ref] spoolss_PrinterNotifyFlags *reply_result,
+		[in] uint32 reply_type,
+		[in,switch_is(reply_type)] spoolss_ReplyPrinterInfo info
+	);
+
 	/******************/
 	/* Function: 0x43 */
 	[public] WERROR spoolss_RouterRefreshPrinterChangeNotify(
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 76f72f0..472ce45 100644
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -211,8 +211,6 @@
 
 #define PRINTER_NOTIFY_OPTIONS_REFRESH  	0x01
 
-#define PRINTER_NOTIFY_INFO_DISCARDED	0x1
-
 /*
  * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
  * when sending messages to other smbd's


-- 
Samba Shared Repository


More information about the samba-cvs mailing list