summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-11 01:44:21 +0100
committerGünther Deschner <gd@samba.org>2009-03-13 09:25:19 +0100
commit8d6c719a4b032cad746028338f3f263af819b8dd (patch)
tree6a3c77de6c40db0f8b85f9fe4905b8e5097a7dde /source3/rpc_server
parentc6e9dc11e5085baaf7365f72bc06684aeb8d89db (diff)
downloadsamba-8d6c719a4b032cad746028338f3f263af819b8dd.tar.gz
samba-8d6c719a4b032cad746028338f3f263af819b8dd.tar.bz2
samba-8d6c719a4b032cad746028338f3f263af819b8dd.zip
s3-spoolss: use macros for _spoolss_EnumPrintProcDataTypes.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 67ee91e108..b46591be8b 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8854,8 +8854,6 @@ static WERROR fill_printprocdatatype1(TALLOC_CTX *mem_ctx,
static WERROR enumprintprocdatatypes_level_1(TALLOC_CTX *mem_ctx,
union spoolss_PrintProcDataTypesInfo **info_p,
- uint32_t offered,
- uint32_t *needed,
uint32_t *count)
{
WERROR result;
@@ -8871,13 +8869,6 @@ static WERROR enumprintprocdatatypes_level_1(TALLOC_CTX *mem_ctx,
goto out;
}
- *needed += ndr_size_spoolss_PrintProcDataTypesInfo1(&info[0].info1, NULL, 0);
-
- if (*needed > offered) {
- result = WERR_INSUFFICIENT_BUFFER;
- goto out;
- }
-
out:
if (!W_ERROR_IS_OK(result)) {
TALLOC_FREE(info);
@@ -8897,6 +8888,8 @@ static WERROR enumprintprocdatatypes_level_1(TALLOC_CTX *mem_ctx,
WERROR _spoolss_EnumPrintProcDataTypes(pipes_struct *p,
struct spoolss_EnumPrintProcDataTypes *r)
{
+ WERROR result;
+
/* that's an [in out] buffer */
if (!r->in.buffer && (r->in.offered != 0)) {
@@ -8911,12 +8904,21 @@ WERROR _spoolss_EnumPrintProcDataTypes(pipes_struct *p,
switch (r->in.level) {
case 1:
- return enumprintprocdatatypes_level_1(p->mem_ctx, r->out.info,
- r->in.offered, r->out.needed,
- r->out.count);
+ result = enumprintprocdatatypes_level_1(p->mem_ctx, r->out.info,
+ r->out.count);
+ break;
default:
return WERR_UNKNOWN_LEVEL;
}
+
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(p->mem_ctx,
+ spoolss_EnumPrintProcDataTypes, NULL,
+ *r->out.info, r->in.level,
+ *r->out.count);
+ *r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL);
+ *r->out.count = SPOOLSS_BUFFER_OK(*r->out.count, 0);
+
+ return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
}
/****************************************************************************