mirror of
https://github.com/samba-team/samba.git
synced 2024-12-28 07:21:54 +03:00
s3-spoolss: use macros for _spoolss_GetPrinterDriverDirectory.
Guenther
This commit is contained in:
parent
dfe71b05a7
commit
75d88f460f
@ -8105,9 +8105,7 @@ static WERROR compose_spoolss_server_path(TALLOC_CTX *mem_ctx,
|
|||||||
static WERROR getprinterdriverdir_level_1(TALLOC_CTX *mem_ctx,
|
static WERROR getprinterdriverdir_level_1(TALLOC_CTX *mem_ctx,
|
||||||
const char *servername,
|
const char *servername,
|
||||||
const char *environment,
|
const char *environment,
|
||||||
struct spoolss_DriverDirectoryInfo1 *r,
|
struct spoolss_DriverDirectoryInfo1 *r)
|
||||||
uint32_t offered,
|
|
||||||
uint32_t *needed)
|
|
||||||
{
|
{
|
||||||
WERROR werr;
|
WERROR werr;
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
@ -8125,13 +8123,6 @@ static WERROR getprinterdriverdir_level_1(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
r->directory_name = path;
|
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;
|
return WERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8160,14 +8151,17 @@ WERROR _spoolss_GetPrinterDriverDirectory(pipes_struct *p,
|
|||||||
werror = getprinterdriverdir_level_1(p->mem_ctx,
|
werror = getprinterdriverdir_level_1(p->mem_ctx,
|
||||||
r->in.server,
|
r->in.server,
|
||||||
r->in.environment,
|
r->in.environment,
|
||||||
&r->out.info->info1,
|
&r->out.info->info1);
|
||||||
r->in.offered,
|
|
||||||
r->out.needed);
|
|
||||||
if (!W_ERROR_IS_OK(werror)) {
|
if (!W_ERROR_IS_OK(werror)) {
|
||||||
TALLOC_FREE(r->out.info);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user