summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
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 873088efc0..c4355b6f58 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -9804,9 +9804,7 @@ done:
static WERROR getprintprocessordirectory_level_1(TALLOC_CTX *mem_ctx,
const char *servername,
const char *environment,
- struct spoolss_PrintProcessorDirectoryInfo1 *r,
- uint32_t offered,
- uint32_t *needed)
+ struct spoolss_PrintProcessorDirectoryInfo1 *r)
{
WERROR werr;
char *path = NULL;
@@ -9824,13 +9822,6 @@ static WERROR getprintprocessordirectory_level_1(TALLOC_CTX *mem_ctx,
r->directory_name = path;
- *needed += ndr_size_spoolss_PrintProcessorDirectoryInfo1(r, NULL, 0);
-
- if (*needed > offered) {
- talloc_free(path);
- return WERR_INSUFFICIENT_BUFFER;
- }
-
return WERR_OK;
}
@@ -9859,14 +9850,17 @@ WERROR _spoolss_GetPrintProcessorDirectory(pipes_struct *p,
result = getprintprocessordirectory_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(result)) {
TALLOC_FREE(r->out.info);
+ return result;
}
- return result;
+ *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_PrintProcessorDirectoryInfo, 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);
}
/*******************************************************************