[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-510-g18a93e3

Günther Deschner gd at samba.org
Wed Mar 18 00:29:12 GMT 2009


The branch, master has been updated
       via  18a93e3e62f29448f34f9af84aba54eedb26fe21 (commit)
       via  b1d4523f73afd83e0170bac653814b59c4d68b6e (commit)
       via  19ea2a54865f953663e30b7561b47f0a18e79faf (commit)
      from  2dae07a3ca62670d384937df2e4e9d6f54c99619 (commit)

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


- Log -----------------------------------------------------------------
commit 18a93e3e62f29448f34f9af84aba54eedb26fe21
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 18 00:35:44 2009 +0100

    spoolss: add ndr_push/pull_spoolss_EnumPrinterDataEx helper.
    
    Guenther

commit b1d4523f73afd83e0170bac653814b59c4d68b6e
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 18 01:08:38 2009 +0100

    s3: re-run make samba3-idl.
    
    Guenther

commit 19ea2a54865f953663e30b7561b47f0a18e79faf
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 18 00:36:31 2009 +0100

    spoolss: add spoolss_EnumPrinterDataEx triple call.
    
    Guenther

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

Summary of changes:
 librpc/gen_ndr/cli_spoolss.c |    8 ++--
 librpc/gen_ndr/cli_spoolss.h |    4 +-
 librpc/gen_ndr/ndr_spoolss.c |   87 +++++++++++++++++++++++++++++----------
 librpc/gen_ndr/ndr_spoolss.h |    6 +++
 librpc/gen_ndr/spoolss.h     |   33 ++++++++++++++-
 librpc/gen_ndr/srv_spoolss.c |   24 +++++-----
 librpc/idl/spoolss.idl       |   18 +++++++-
 librpc/ndr/ndr_spoolss_buf.c |   93 ++++++++++++++++++++++++++++++++++++++++++
 librpc/ndr/ndr_spoolss_buf.h |    3 +-
 9 files changed, 230 insertions(+), 46 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index a774d21..1e94a2a 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -3758,10 +3758,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
 					  TALLOC_CTX *mem_ctx,
 					  struct policy_handle *handle /* [in] [ref] */,
 					  const char *key_name /* [in] [charset(UTF16)] */,
-					  uint8_t *buffer /* [out] [ref,size_is(offered)] */,
 					  uint32_t offered /* [in]  */,
-					  uint32_t *needed /* [out] [ref] */,
 					  uint32_t *count /* [out] [ref] */,
+					  struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */,
+					  uint32_t *needed /* [out] [ref] */,
 					  WERROR *werror)
 {
 	struct spoolss_EnumPrinterDataEx r;
@@ -3795,9 +3795,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
-	*needed = *r.out.needed;
 	*count = *r.out.count;
+	*info = *r.out.info;
+	*needed = *r.out.needed;
 
 	/* Return result */
 	if (werror) {
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index a30b1b1..eb86e8c 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -488,10 +488,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli,
 					  TALLOC_CTX *mem_ctx,
 					  struct policy_handle *handle /* [in] [ref] */,
 					  const char *key_name /* [in] [charset(UTF16)] */,
-					  uint8_t *buffer /* [out] [ref,size_is(offered)] */,
 					  uint32_t offered /* [in]  */,
-					  uint32_t *needed /* [out] [ref] */,
 					  uint32_t *count /* [out] [ref] */,
+					  struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */,
+					  uint32_t *needed /* [out] [ref] */,
 					  WERROR *werror);
 NTSTATUS rpccli_spoolss_EnumPrinterKey(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 f9781bc..d340b81 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -26296,7 +26296,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch
 	ndr->depth--;
 }
 
-_PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r)
+_PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r)
 {
 	if (flags & NDR_IN) {
 		if (r->in.handle == NULL) {
@@ -26310,11 +26310,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n
 		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
 	}
 	if (flags & NDR_OUT) {
-		if (r->out.buffer == NULL) {
-			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-		}
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
-		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
+		NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.info));
 		if (r->out.needed == NULL) {
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
@@ -26328,7 +26324,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n
 	return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r)
+_PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r)
 {
 	TALLOC_CTX *_mem_save_handle_0;
 	TALLOC_CTX *_mem_save_needed_0;
@@ -26351,19 +26347,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n
 		NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t)));
 		NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16));
 		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
-		NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
-		memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer));
 		NDR_PULL_ALLOC(ndr, r->out.needed);
 		ZERO_STRUCTP(r->out.needed);
 		NDR_PULL_ALLOC(ndr, r->out.count);
 		ZERO_STRUCTP(r->out.count);
 	}
 	if (flags & NDR_OUT) {
-		NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
-		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-			NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
-		}
-		NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
+		NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.info));
 		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 			NDR_PULL_ALLOC(ndr, r->out.needed);
 		}
@@ -26379,15 +26369,54 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n
 		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
-		if (r->out.buffer) {
-			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push___spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrinterDataEx *r)
+{
+	uint32_t cntr_info_0;
+	if (flags & NDR_IN) {
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count));
+	}
+	if (flags & NDR_OUT) {
+		for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) {
+			NDR_CHECK(ndr_push_spoolss_PrinterEnumValues(ndr, NDR_SCALARS, &r->out.info[cntr_info_0]));
+		}
+		for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) {
+			NDR_CHECK(ndr_push_spoolss_PrinterEnumValues(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0]));
+		}
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrinterDataEx *r)
+{
+	uint32_t cntr_info_0;
+	TALLOC_CTX *_mem_save_info_0;
+	if (flags & NDR_IN) {
+		ZERO_STRUCT(r->out);
+
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count));
+	}
+	if (flags & NDR_OUT) {
+		NDR_PULL_ALLOC_N(ndr, r->out.info, r->in.count);
+		_mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+		NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
+		for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) {
+			NDR_CHECK(ndr_pull_spoolss_PrinterEnumValues(ndr, NDR_SCALARS, &r->out.info[cntr_info_0]));
+		}
+		for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) {
+			NDR_CHECK(ndr_pull_spoolss_PrinterEnumValues(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0]));
 		}
+		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
 	}
 	return NDR_ERR_SUCCESS;
 }
 
 _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDataEx *r)
 {
+	uint32_t cntr_info_2;
 	ndr_print_struct(ndr, name, "spoolss_EnumPrinterDataEx");
 	ndr->depth++;
 	if (flags & NDR_SET_VALUES) {
@@ -26407,17 +26436,31 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c
 	if (flags & NDR_OUT) {
 		ndr_print_struct(ndr, "out", "spoolss_EnumPrinterDataEx");
 		ndr->depth++;
-		ndr_print_ptr(ndr, "buffer", r->out.buffer);
+		ndr_print_ptr(ndr, "count", r->out.count);
 		ndr->depth++;
-		ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
+		ndr_print_uint32(ndr, "count", *r->out.count);
 		ndr->depth--;
-		ndr_print_ptr(ndr, "needed", r->out.needed);
+		ndr_print_ptr(ndr, "info", r->out.info);
 		ndr->depth++;
-		ndr_print_uint32(ndr, "needed", *r->out.needed);
+		ndr_print_ptr(ndr, "info", *r->out.info);
+		ndr->depth++;
+		if (*r->out.info) {
+			ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count);
+			ndr->depth++;
+			for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) {
+				char *idx_2=NULL;
+				if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) {
+					ndr_print_spoolss_PrinterEnumValues(ndr, "info", &(*r->out.info)[cntr_info_2]);
+					free(idx_2);
+				}
+			}
+			ndr->depth--;
+		}
 		ndr->depth--;
-		ndr_print_ptr(ndr, "count", r->out.count);
+		ndr->depth--;
+		ndr_print_ptr(ndr, "needed", r->out.needed);
 		ndr->depth++;
-		ndr_print_uint32(ndr, "count", *r->out.count);
+		ndr_print_uint32(ndr, "needed", *r->out.needed);
 		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 77852e0..df0f20f 100644
--- a/librpc/gen_ndr/ndr_spoolss.h
+++ b/librpc/gen_ndr/ndr_spoolss.h
@@ -665,6 +665,12 @@ void ndr_print_spoolss_4b(struct ndr_print *ndr, const char *name, int flags, co
 void ndr_print_spoolss_4c(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_4c *r);
 void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_SetPrinterDataEx *r);
 void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_GetPrinterDataEx *r);
+enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r);
+enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r);
+void ndr_print__spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_EnumPrinterDataEx *r);
+enum ndr_err_code ndr_push___spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrinterDataEx *r);
+enum ndr_err_code ndr_pull___spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrinterDataEx *r);
+void ndr_print___spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_EnumPrinterDataEx *r);
 enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r);
 enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r);
 void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDataEx *r);
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index c703c87..65655e9 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -2900,7 +2900,7 @@ struct spoolss_GetPrinterDataEx {
 };
 
 
-struct spoolss_EnumPrinterDataEx {
+struct _spoolss_EnumPrinterDataEx {
 	struct {
 		struct policy_handle *handle;/* [ref] */
 		const char *key_name;/* [charset(UTF16)] */
@@ -2908,7 +2908,7 @@ struct spoolss_EnumPrinterDataEx {
 	} in;
 
 	struct {
-		uint8_t *buffer;/* [ref,size_is(offered)] */
+		DATA_BLOB info;
 		uint32_t *needed;/* [ref] */
 		uint32_t *count;/* [ref] */
 		WERROR result;
@@ -2917,6 +2917,35 @@ struct spoolss_EnumPrinterDataEx {
 };
 
 
+struct __spoolss_EnumPrinterDataEx {
+	struct {
+		uint32_t count;
+	} in;
+
+	struct {
+		struct spoolss_PrinterEnumValues *info;
+	} out;
+
+};
+
+
+struct spoolss_EnumPrinterDataEx {
+	struct {
+		struct policy_handle *handle;/* [ref] */
+		const char *key_name;/* [charset(UTF16)] */
+		uint32_t offered;
+	} in;
+
+	struct {
+		uint32_t *count;/* [ref] */
+		struct spoolss_PrinterEnumValues **info;/* [ref,size_is(,*count)] */
+		uint32_t *needed;/* [ref] */
+		WERROR result;
+	} out;
+
+};
+
+
 struct spoolss_EnumPrinterKey {
 	struct {
 		struct policy_handle *handle;/* [ref] */
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index 74ab6ba..79efbb5 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -6204,20 +6204,20 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p)
 	}
 
 	ZERO_STRUCT(r->out);
-	r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
-	if (r->out.buffer == NULL) {
+	r->out.count = talloc_zero(r, uint32_t);
+	if (r->out.count == NULL) {
 		talloc_free(r);
 		return false;
 	}
 
-	r->out.needed = talloc_zero(r, uint32_t);
-	if (r->out.needed == NULL) {
+	r->out.info = talloc_zero(r, struct spoolss_PrinterEnumValues *);
+	if (r->out.info == NULL) {
 		talloc_free(r);
 		return false;
 	}
 
-	r->out.count = talloc_zero(r, uint32_t);
-	if (r->out.count == NULL) {
+	r->out.needed = talloc_zero(r, uint32_t);
+	if (r->out.needed == NULL) {
 		talloc_free(r);
 		return false;
 	}
@@ -8377,18 +8377,18 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 		case NDR_SPOOLSS_ENUMPRINTERDATAEX: {
 			struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r;
 			ZERO_STRUCT(r->out);
-			r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
-			if (r->out.buffer == NULL) {
+			r->out.count = talloc_zero(mem_ctx, uint32_t);
+			if (r->out.count == NULL) {
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.needed = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.needed == NULL) {
+			r->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterEnumValues *);
+			if (r->out.info == NULL) {
 			return NT_STATUS_NO_MEMORY;
 			}
 
-			r->out.count = talloc_zero(mem_ctx, uint32_t);
-			if (r->out.count == NULL) {
+			r->out.needed = talloc_zero(mem_ctx, uint32_t);
+			if (r->out.needed == NULL) {
 			return NT_STATUS_NO_MEMORY;
 			}
 
diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl
index 59d90ec..2406394 100644
--- a/librpc/idl/spoolss.idl
+++ b/librpc/idl/spoolss.idl
@@ -2227,14 +2227,26 @@ import "misc.idl", "security.idl", "winreg.idl";
 		[value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length;
 	} spoolss_PrinterEnumValues;
 
-	[public] WERROR spoolss_EnumPrinterDataEx(
+	[public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx(
 		[in,ref] policy_handle *handle,
 		[in] 	 [string,charset(UTF16)] uint16 key_name[],
-		[out,ref] [size_is(offered)] uint8 *buffer,
-		[in] 	 uint32 offered,
+		[out] DATA_BLOB info,
+		[in] uint32 offered,
 		[out,ref] uint32 *needed,
 		[out,ref] uint32 *count
 	);
+	[public,noopnum,noprint] void __spoolss_EnumPrinterDataEx(
+		[in] uint32 count,
+		[out] spoolss_PrinterEnumValues info[count]
+	);
+	[nopull,nopush] WERROR spoolss_EnumPrinterDataEx(
+		[in,ref] policy_handle *handle,
+		[in] 	 [string,charset(UTF16)] uint16 key_name[],
+		[in] uint32 offered,
+		[out,ref] uint32 *count,
+		[out,ref,size_is(,*count)] spoolss_PrinterEnumValues **info,
+		[out,ref] uint32 *needed
+	);
 
 	/******************/
 	/* Function: 0x50 */
diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c
index 8b41a4c..16a9b1b 100644
--- a/librpc/ndr/ndr_spoolss_buf.c
+++ b/librpc/ndr/ndr_spoolss_buf.c
@@ -438,6 +438,99 @@ uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struc
 }
 
 /*
+  spoolss_EnumPrinterDataEx
+*/
+
+enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r)
+{
+	struct _spoolss_EnumPrinterDataEx _r;
+	if (flags & NDR_IN) {
+		_r.in.handle	= r->in.handle;
+		_r.in.key_name	= r->in.key_name;
+		_r.in.offered	= r->in.offered;
+		NDR_CHECK(ndr_push__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
+	}
+	if (flags & NDR_OUT) {
+		struct ndr_push *_ndr_info;
+		_r.in.handle	= r->in.handle;
+		_r.in.key_name	= r->in.key_name;
+		_r.in.offered	= r->in.offered;
+		_r.out.count	= r->out.count;
+		_r.out.needed	= r->out.needed;
+		_r.out.result	= r->out.result;
+		if (r->in.offered >= *r->out.needed) {
+			struct __spoolss_EnumPrinterDataEx __r;
+			_ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
+			NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
+			_ndr_info->flags= ndr->flags;
+			__r.in.count	= *r->out.count;
+			__r.out.info	= *r->out.info;
+			NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r));
+			if (r->in.offered > _ndr_info->offset) {
+				uint32_t _padding_len = r->in.offered - _ndr_info->offset;
+				NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len));
+			}
+			_r.out.info = ndr_push_blob(_ndr_info);
+		}
+		NDR_CHECK(ndr_push__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r)
+{
+	struct _spoolss_EnumPrinterDataEx _r;
+	if (flags & NDR_IN) {
+		_r.in.handle	= r->in.handle;
+		_r.in.key_name	= r->in.key_name;
+		ZERO_STRUCT(r->out);
+		NDR_CHECK(ndr_pull__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
+		r->in.handle	= _r.in.handle;
+		r->in.key_name	= _r.in.key_name;
+		r->in.offered	= _r.in.offered;
+		r->out.needed	= _r.out.needed;
+		r->out.count	= _r.out.count;
+		NDR_PULL_ALLOC(ndr, r->out.info);
+		ZERO_STRUCTP(r->out.info);
+	}
+	if (flags & NDR_OUT) {
+		_r.in.handle	= r->in.handle;
+		_r.in.key_name	= r->in.key_name;
+		_r.in.offered	= r->in.offered;
+		_r.out.count	= r->out.count;
+		_r.out.needed	= r->out.needed;
+		NDR_CHECK(ndr_pull__spoolss_EnumPrinterDataEx(ndr, flags, &_r));
+		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+			NDR_PULL_ALLOC(ndr, r->out.info);
+		}
+		*r->out.info	= NULL;
+		r->out.needed	= _r.out.needed;
+		r->out.count	= _r.out.count;
+		r->out.result	= _r.out.result;
+		if (_r.out.info.length) {
+			struct ndr_pull *_ndr_info;
+			NDR_PULL_ALLOC(ndr, *r->out.info);
+			_ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info, ndr->iconv_convenience);
+			NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
+			_ndr_info->flags= ndr->flags;
+			if (r->in.offered != _ndr_info->data_size) {
+				return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,
+					"SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]",
+					(unsigned)r->in.offered, (unsigned)_ndr_info->data_size);
+			}
+			if (*r->out.needed <= _ndr_info->data_size) {
+				struct __spoolss_EnumPrinterDataEx __r;
+				__r.in.count	= *r->out.count;
+				__r.out.info	= NULL;
+				NDR_CHECK(ndr_pull___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r));
+				*r->out.info	= __r.out.info;
+			}
+		}
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+/*
   spoolss_GetPrinterData
 */
 enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r)
diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h
index 04a84bf..ae3bf86 100644
--- a/librpc/ndr/ndr_spoolss_buf.h
+++ b/librpc/ndr/ndr_spoolss_buf.h
@@ -38,7 +38,8 @@ enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr,
 enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r);
 uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
 						      uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info);
-
+enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r);
+enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r);
 enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r);
 enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterData *r);
 enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list