diff options
author | Günther Deschner <gd@samba.org> | 2009-12-02 14:22:52 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-12-02 14:37:02 +0100 |
commit | 292af4fc046ff39ebd3ec853c402dc267a863fa6 (patch) | |
tree | a7462db0aea19585783d613b7d11675d24a5a0ca | |
parent | 91bb0659776d397bc4b8ca7a534f6f2327e2e6fe (diff) | |
download | samba-292af4fc046ff39ebd3ec853c402dc267a863fa6.tar.gz samba-292af4fc046ff39ebd3ec853c402dc267a863fa6.tar.bz2 samba-292af4fc046ff39ebd3ec853c402dc267a863fa6.zip |
spoolss: add spoolss_StringArray2.
The difference to spoolss_StringArray is that in spoolss_StringArray2 the string
array is put into a subcontext of _ndr_size.
Guenther
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 55 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.h | 3 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 5 | ||||
-rw-r--r-- | librpc/idl/spoolss.idl | 5 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.c | 9 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.h | 1 |
6 files changed, 78 insertions, 0 deletions
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index 2bde1cad10..44b3188fb8 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -8125,6 +8125,61 @@ _PUBLIC_ void ndr_print_spoolss_StringArray(struct ndr_print *ndr, const char *n ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_StringArray2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_StringArray2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (ndr_size_spoolss_StringArray2(r, ndr->iconv_convenience, ndr->flags) - 4) / 2)); + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + { + struct ndr_push *_ndr_string; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_string, 0, (ndr_size_spoolss_StringArray2(r, ndr->iconv_convenience, ndr->flags) - 4) / 2 * 2)); + NDR_CHECK(ndr_push_string_array(_ndr_string, NDR_SCALARS, r->string)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_string, 0, (ndr_size_spoolss_StringArray2(r, ndr->iconv_convenience, ndr->flags) - 4) / 2 * 2)); + } + ndr->flags = _flags_save_string_array; + } + NDR_CHECK(ndr_push_trailer_align(ndr, 4)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_StringArray2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_StringArray2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size)); + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + { + struct ndr_pull *_ndr_string; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_string, 0, r->_ndr_size * 2)); + NDR_CHECK(ndr_pull_string_array(_ndr_string, NDR_SCALARS, &r->string)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_string, 0, r->_ndr_size * 2)); + } + ndr->flags = _flags_save_string_array; + } + NDR_CHECK(ndr_pull_trailer_align(ndr, 4)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_StringArray2(struct ndr_print *ndr, const char *name, const struct spoolss_StringArray2 *r) +{ + ndr_print_struct(ndr, name, "spoolss_StringArray2"); + ndr->depth++; + ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(ndr_size_spoolss_StringArray2(r, ndr->iconv_convenience, ndr->flags) - 4) / 2:r->_ndr_size); + ndr_print_string_array(ndr, "string", r->string); + ndr->depth--; +} + static enum ndr_err_code ndr_push_spoolss_AddDriverInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo1 *r) { if (ndr_flags & NDR_SCALARS) { diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index 185f8254bd..895e1e9a37 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -345,6 +345,9 @@ void ndr_print_spoolss_SetPrinterInfoCtr(struct ndr_print *ndr, const char *name enum ndr_err_code ndr_push_spoolss_StringArray(struct ndr_push *ndr, int ndr_flags, const struct spoolss_StringArray *r); enum ndr_err_code ndr_pull_spoolss_StringArray(struct ndr_pull *ndr, int ndr_flags, struct spoolss_StringArray *r); void ndr_print_spoolss_StringArray(struct ndr_print *ndr, const char *name, const struct spoolss_StringArray *r); +enum ndr_err_code ndr_push_spoolss_StringArray2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_StringArray2 *r); +enum ndr_err_code ndr_pull_spoolss_StringArray2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_StringArray2 *r); +void ndr_print_spoolss_StringArray2(struct ndr_print *ndr, const char *name, const struct spoolss_StringArray2 *r); void ndr_print_spoolss_AddDriverInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo1 *r); enum ndr_err_code ndr_push_spoolss_DriverOSVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverOSVersion r); enum ndr_err_code ndr_pull_spoolss_DriverOSVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverOSVersion *r); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index 3153672194..8327f8ff49 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -1206,6 +1206,11 @@ struct spoolss_StringArray { const char ** string;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ }/* [public] */; +struct spoolss_StringArray2 { + uint32_t _ndr_size;/* [value((ndr_size_spoolss_StringArray2(r,ndr->iconv_convenience,ndr->flags)-4)/2)] */ + const char ** string;/* [subcontext_size(_ndr_size*2),subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */ +}/* [public] */; + struct spoolss_AddDriverInfo1 { const char *driver_name;/* [unique,charset(UTF16)] */ }; diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index 0e71e1a6bc..84373aacb9 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -980,6 +980,11 @@ import "misc.idl", "security.idl", "winreg.idl"; /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string; } spoolss_StringArray; + typedef [public] struct { + [value((ndr_size_spoolss_StringArray2(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size; + [subcontext(0),subcontext_size(_ndr_size*2)] nstring_array string; + } spoolss_StringArray2; + typedef struct { [string,charset(UTF16)] uint16 *driver_name; } spoolss_AddDriverInfo1; diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index 0acae3dedb..9968e90c6a 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -708,6 +708,15 @@ _PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray, ic); } +_PUBLIC_ size_t ndr_size_spoolss_StringArray2(const struct spoolss_StringArray2 *r, struct smb_iconv_convenience *ic, int flags) +{ + if (!r) { + return 4; + } + + return ndr_size_struct((const struct spoolss_StringArray *)r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray, ic); +} + /* hand marshall as pidl cannot (yet) generate a relative pointer to a fixed array of * structs */ diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h index aa6e277c5f..9a76f824f0 100644 --- a/librpc/ndr/ndr_spoolss_buf.h +++ b/librpc/ndr/ndr_spoolss_buf.h @@ -47,6 +47,7 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r); uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags); size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic, int flags); +size_t ndr_size_spoolss_StringArray2(const struct spoolss_StringArray2 *r, struct smb_iconv_convenience *ic, int flags); _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r); _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r); void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r); |