mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
s3-spoolss: add rpccli_spoolss_addprinterex convenience wrapper.
Guenther
This commit is contained in:
parent
24a63add2d
commit
9d165fa5c6
@ -5476,6 +5476,9 @@ WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli,
|
||||
union spoolss_DriverInfo *info,
|
||||
uint32_t *server_major_version,
|
||||
uint32_t *server_minor_version);
|
||||
WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct spoolss_SetPrinterInfoCtr *info_ctr);
|
||||
WERROR rpccli_spoolss_enum_printers(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
|
||||
char *name, uint32 flags, uint32 level,
|
||||
uint32 *num_printers, PRINTER_INFO_CTR *ctr);
|
||||
|
@ -137,6 +137,48 @@ WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli,
|
||||
return werror;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
convencience wrapper around rpccli_spoolss_AddPrinterEx
|
||||
**********************************************************************/
|
||||
|
||||
WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct spoolss_SetPrinterInfoCtr *info_ctr)
|
||||
{
|
||||
WERROR result;
|
||||
NTSTATUS status;
|
||||
struct spoolss_DevmodeContainer devmode_ctr;
|
||||
struct sec_desc_buf secdesc_ctr;
|
||||
struct spoolss_UserLevelCtr userlevel_ctr;
|
||||
struct spoolss_UserLevel1 level1;
|
||||
struct policy_handle handle;
|
||||
|
||||
ZERO_STRUCT(devmode_ctr);
|
||||
ZERO_STRUCT(secdesc_ctr);
|
||||
|
||||
level1.size = 28;
|
||||
level1.build = 1381;
|
||||
level1.major = 2;
|
||||
level1.minor = 0;
|
||||
level1.processor = 0;
|
||||
level1.client = talloc_asprintf(mem_ctx, "\\\\%s", global_myname());
|
||||
W_ERROR_HAVE_NO_MEMORY(level1.client);
|
||||
level1.user = cli->auth->user_name;
|
||||
|
||||
userlevel_ctr.level = 1;
|
||||
userlevel_ctr.user_info.level1 = &level1;
|
||||
|
||||
status = rpccli_spoolss_AddPrinterEx(cli, mem_ctx,
|
||||
cli->srv_name_slash,
|
||||
info_ctr,
|
||||
&devmode_ctr,
|
||||
&secdesc_ctr,
|
||||
&userlevel_ctr,
|
||||
&handle,
|
||||
&result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
Decode various spoolss rpc's and info levels
|
||||
********************************************************************/
|
||||
|
Loading…
x
Reference in New Issue
Block a user