summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-06 17:11:15 +0100
committerGünther Deschner <gd@samba.org>2009-02-06 17:36:16 +0100
commitab6d6c7c131d6bf23251fe3fe84765cbe73934f7 (patch)
tree2bcb467cc340c4de19d4f63ee17a8cf894e20a23
parentafe300cb527c19cffa8667db4772d0d5812c342b (diff)
downloadsamba-ab6d6c7c131d6bf23251fe3fe84765cbe73934f7.tar.gz
samba-ab6d6c7c131d6bf23251fe3fe84765cbe73934f7.tar.bz2
samba-ab6d6c7c131d6bf23251fe3fe84765cbe73934f7.zip
s4-spoolss: fix spoolss server w.r.t. needed out pointers (+ remove tmp macro).
Guenther
-rw-r--r--source4/rpc_server/spoolss/dcesrv_spoolss.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/source4/rpc_server/spoolss/dcesrv_spoolss.c b/source4/rpc_server/spoolss/dcesrv_spoolss.c
index 4520e33437..21f9cfbc10 100644
--- a/source4/rpc_server/spoolss/dcesrv_spoolss.c
+++ b/source4/rpc_server/spoolss/dcesrv_spoolss.c
@@ -41,9 +41,7 @@ enum spoolss_handle {
#define SPOOLSS_BUFFER_UNION_ARRAY(fn,ic,info,level,count) \
((info)?ndr_size_##fn##_info(dce_call, ic, level, count, info):0)
-#define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >= r->out.needed)?val_true:val_false)
-/* FIXME: temporary macro, will be removed soon - gd */
-#define SPOOLSS_BUFFER_OK_P(val_true,val_false) ((r->in.offered >= *r->out.needed)?val_true:val_false)
+#define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >= *r->out.needed)?val_true:val_false)
static WERROR dcesrv_spoolss_parse_printer_name(TALLOC_CTX *mem_ctx, const char *name,
const char **_server_name,
@@ -245,7 +243,7 @@ static WERROR dcesrv_spoolss_EnumPrinters(struct dcesrv_call_state *dce_call, TA
status = ntptr_EnumPrinters(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinters, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinters, ic, 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);
@@ -381,7 +379,7 @@ static WERROR dcesrv_spoolss_EnumPrinterDrivers(struct dcesrv_call_state *dce_ca
status = ntptr_EnumPrinterDrivers(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinterDrivers, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinterDrivers, ic, 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);
@@ -415,8 +413,8 @@ static WERROR dcesrv_spoolss_GetPrinterDriverDirectory(struct dcesrv_call_state
W_ERROR_NOT_OK_RETURN(status);
*r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_DriverDirectoryInfo, ic, r->out.info, r->in.level);
- r->out.info = SPOOLSS_BUFFER_OK_P(r->out.info, NULL);
- return SPOOLSS_BUFFER_OK_P(WERR_OK, WERR_INSUFFICIENT_BUFFER);
+ r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
+ return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
}
@@ -577,7 +575,7 @@ static WERROR dcesrv_spoolss_GetPrinterData(struct dcesrv_call_state *dce_call,
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = ndr_size_spoolss_PrinterData(&r->out.data, r->out.type, ic, 0);
+ *r->out.needed = ndr_size_spoolss_PrinterData(&r->out.data, r->out.type, ic, 0);
r->out.type = SPOOLSS_BUFFER_OK(r->out.type, SPOOLSS_PRINTER_DATA_TYPE_NULL);
r->out.data = SPOOLSS_BUFFER_OK(r->out.data, r->out.data);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_MORE_DATA);
@@ -719,8 +717,8 @@ static WERROR dcesrv_spoolss_GetForm(struct dcesrv_call_state *dce_call, TALLOC_
}
*r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_FormInfo, ic, r->out.info, r->in.level);
- r->out.info = SPOOLSS_BUFFER_OK_P(r->out.info, NULL);
- return SPOOLSS_BUFFER_OK_P(WERR_OK, WERR_INSUFFICIENT_BUFFER);
+ r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
+ return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
}
@@ -785,7 +783,7 @@ static WERROR dcesrv_spoolss_EnumForms(struct dcesrv_call_state *dce_call, TALLO
return WERR_FOOBAR;
}
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumForms, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumForms, ic, 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);
@@ -808,7 +806,7 @@ static WERROR dcesrv_spoolss_EnumPorts(struct dcesrv_call_state *dce_call, TALLO
status = ntptr_EnumPorts(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPorts, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPorts, ic, 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);
@@ -831,7 +829,7 @@ static WERROR dcesrv_spoolss_EnumMonitors(struct dcesrv_call_state *dce_call, TA
status = ntptr_EnumMonitors(ntptr, mem_ctx, r);
W_ERROR_NOT_OK_RETURN(status);
- r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumMonitors, ic, r->out.info, r->in.level, r->out.count);
+ *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumMonitors, ic, 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);