summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-11 02:30:12 +0100
committerGünther Deschner <gd@samba.org>2009-03-13 09:25:19 +0100
commit75d88f460fa9d3a15cc6b31a1c6fe3872512ce54 (patch)
tree696e5b12b0cf03a8ea204b32ca56e252985988a1 /source3
parentdfe71b05a7e4bd7de99b2e887b588875286ce245 (diff)
downloadsamba-75d88f460fa9d3a15cc6b31a1c6fe3872512ce54.tar.gz
samba-75d88f460fa9d3a15cc6b31a1c6fe3872512ce54.tar.bz2
samba-75d88f460fa9d3a15cc6b31a1c6fe3872512ce54.zip
s3-spoolss: use macros for _spoolss_GetPrinterDriverDirectory.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 89208c3694..873088efc0 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8105,9 +8105,7 @@ static WERROR compose_spoolss_server_path(TALLOC_CTX *mem_ctx,
static WERROR getprinterdriverdir_level_1(TALLOC_CTX *mem_ctx,
const char *servername,
const char *environment,
- struct spoolss_DriverDirectoryInfo1 *r,
- uint32_t offered,
- uint32_t *needed)
+ struct spoolss_DriverDirectoryInfo1 *r)
{
WERROR werr;
char *path = NULL;
@@ -8125,13 +8123,6 @@ static WERROR getprinterdriverdir_level_1(TALLOC_CTX *mem_ctx,
r->directory_name = path;
- *needed += ndr_size_spoolss_DriverDirectoryInfo1(r, NULL, 0);
-
- if (*needed > offered) {
- talloc_free(path);
- return WERR_INSUFFICIENT_BUFFER;
- }
-
return WERR_OK;
}
@@ -8160,14 +8151,17 @@ WERROR _spoolss_GetPrinterDriverDirectory(pipes_struct *p,
werror = getprinterdriverdir_level_1(p->mem_ctx,
r->in.server,
r->in.environment,
- &r->out.info->info1,
- r->in.offered,
- r->out.needed);
+ &r->out.info->info1);
if (!W_ERROR_IS_OK(werror)) {
TALLOC_FREE(r->out.info);
+ return werror;
}
- return werror;
+ *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_DriverDirectoryInfo, NULL,
+ r->out.info, r->in.level);
+ r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
+
+ return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
}
/****************************************************************************