mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
spoolss: rename spoolss_EnumPrintProcDataTypes to spoolss_EnumPrintProcessorDataTypes
This change makes automatic mapping for PAR->RPRN opcodes easier. Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
0ec01826d3
commit
23f404b7f5
@ -2425,7 +2425,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[default];
|
||||
} spoolss_PrintProcDataTypesInfo;
|
||||
|
||||
[public,noopnum,noprint] WERROR _spoolss_EnumPrintProcDataTypes(
|
||||
[public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessorDataTypes(
|
||||
[in,unique] [string,charset(UTF16)] uint16 *servername,
|
||||
[in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
|
||||
[in] uint32 level,
|
||||
@ -2435,12 +2435,12 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[out,ref] uint32 *needed,
|
||||
[out,ref] uint32 *count
|
||||
);
|
||||
[public,noopnum,noprint] void __spoolss_EnumPrintProcDataTypes(
|
||||
[public,noopnum,noprint] void __spoolss_EnumPrintProcessorDataTypes(
|
||||
[in] uint32 level,
|
||||
[in] uint32 count,
|
||||
[out,switch_is(level)] spoolss_PrintProcDataTypesInfo info[count]
|
||||
);
|
||||
[nopull,nopush] WERROR spoolss_EnumPrintProcDataTypes(
|
||||
[nopull,nopush] WERROR spoolss_EnumPrintProcessorDataTypes(
|
||||
[in,unique] [string,charset(UTF16)] uint16 *servername,
|
||||
[in,unique] [string,charset(UTF16)] uint16 *print_processor_name,
|
||||
[in] uint32 level,
|
||||
|
@ -424,9 +424,9 @@ uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx,
|
||||
/*
|
||||
spoolss_EnumPrintProcessors
|
||||
*/
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r)
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcessorDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessorDataTypes *r)
|
||||
{
|
||||
NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrintProcDataTypes,{
|
||||
NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrintProcessorDataTypes,{
|
||||
_r.in.servername = r->in.servername;
|
||||
_r.in.print_processor_name = r->in.print_processor_name;
|
||||
},{
|
||||
@ -436,9 +436,9 @@ enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr,
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r)
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessorDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessorDataTypes *r)
|
||||
{
|
||||
NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPrintProcDataTypes,{
|
||||
NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPrintProcessorDataTypes,{
|
||||
r->in.servername = _r.in.servername;
|
||||
r->in.print_processor_name = _r.in.print_processor_name;
|
||||
},{
|
||||
@ -448,10 +448,10 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr,
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessorDataTypes_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcDataTypes);
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessorDataTypes);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -55,11 +55,11 @@ enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags,
|
||||
uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessors *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessors *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx,
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcessorDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessorDataTypes *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessorDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessorDataTypes *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessorDataTypes_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r);
|
||||
|
@ -490,7 +490,7 @@ WERROR rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client *cli,
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
convencience wrapper around rpccli_spoolss_EnumPrintProcDataTypes
|
||||
convencience wrapper around rpccli_spoolss_EnumPrintProcessorDataTypes
|
||||
**********************************************************************/
|
||||
|
||||
WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli,
|
||||
@ -513,16 +513,16 @@ WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli,
|
||||
W_ERROR_HAVE_NO_MEMORY(buffer.data);
|
||||
}
|
||||
|
||||
status = dcerpc_spoolss_EnumPrintProcDataTypes(b, mem_ctx,
|
||||
servername,
|
||||
print_processor_name,
|
||||
level,
|
||||
(offered > 0) ? &buffer : NULL,
|
||||
offered,
|
||||
count,
|
||||
info,
|
||||
&needed,
|
||||
&werror);
|
||||
status = dcerpc_spoolss_EnumPrintProcessorDataTypes(b, mem_ctx,
|
||||
servername,
|
||||
print_processor_name,
|
||||
level,
|
||||
(offered > 0) ? &buffer : NULL,
|
||||
offered,
|
||||
count,
|
||||
info,
|
||||
&needed,
|
||||
&werror);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return ntstatus_to_werror(status);
|
||||
}
|
||||
@ -532,16 +532,16 @@ WERROR rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client *cli,
|
||||
buffer = data_blob_talloc_zero(mem_ctx, needed);
|
||||
W_ERROR_HAVE_NO_MEMORY(buffer.data);
|
||||
|
||||
status = dcerpc_spoolss_EnumPrintProcDataTypes(b, mem_ctx,
|
||||
servername,
|
||||
print_processor_name,
|
||||
level,
|
||||
(offered > 0) ? &buffer : NULL,
|
||||
offered,
|
||||
count,
|
||||
info,
|
||||
&needed,
|
||||
&werror);
|
||||
status = dcerpc_spoolss_EnumPrintProcessorDataTypes(b, mem_ctx,
|
||||
servername,
|
||||
print_processor_name,
|
||||
level,
|
||||
(offered > 0) ? &buffer : NULL,
|
||||
offered,
|
||||
count,
|
||||
info,
|
||||
&needed,
|
||||
&werror);
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return ntstatus_to_werror(status);
|
||||
|
@ -9256,11 +9256,11 @@ static WERROR enumprintprocdatatypes_level_1(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
_spoolss_EnumPrintProcDataTypes
|
||||
_spoolss_EnumPrintProcessorDataTypes
|
||||
****************************************************************/
|
||||
|
||||
WERROR _spoolss_EnumPrintProcDataTypes(struct pipes_struct *p,
|
||||
struct spoolss_EnumPrintProcDataTypes *r)
|
||||
WERROR _spoolss_EnumPrintProcessorDataTypes(struct pipes_struct *p,
|
||||
struct spoolss_EnumPrintProcessorDataTypes *r)
|
||||
{
|
||||
WERROR result;
|
||||
|
||||
@ -9270,7 +9270,7 @@ WERROR _spoolss_EnumPrintProcDataTypes(struct pipes_struct *p,
|
||||
return WERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
DEBUG(5,("_spoolss_EnumPrintProcDataTypes\n"));
|
||||
DEBUG(5,("_spoolss_EnumPrintProcessorDataTypes\n"));
|
||||
|
||||
*r->out.count = 0;
|
||||
*r->out.needed = 0;
|
||||
@ -9295,7 +9295,7 @@ WERROR _spoolss_EnumPrintProcDataTypes(struct pipes_struct *p,
|
||||
}
|
||||
|
||||
*r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(p->mem_ctx,
|
||||
spoolss_EnumPrintProcDataTypes,
|
||||
spoolss_EnumPrintProcessorDataTypes,
|
||||
*r->out.info, r->in.level,
|
||||
*r->out.count);
|
||||
*r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL);
|
||||
|
@ -951,15 +951,15 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_EnumPrintProcDataTypes_level(struct torture_context *tctx,
|
||||
struct dcerpc_binding_handle *b,
|
||||
const char *print_processor_name,
|
||||
uint32_t level,
|
||||
uint32_t *count_p,
|
||||
union spoolss_PrintProcDataTypesInfo **info_p,
|
||||
WERROR expected_result)
|
||||
static bool test_EnumPrintProcessorDataTypes_level(struct torture_context *tctx,
|
||||
struct dcerpc_binding_handle *b,
|
||||
const char *print_processor_name,
|
||||
uint32_t level,
|
||||
uint32_t *count_p,
|
||||
union spoolss_PrintProcDataTypesInfo **info_p,
|
||||
WERROR expected_result)
|
||||
{
|
||||
struct spoolss_EnumPrintProcDataTypes r;
|
||||
struct spoolss_EnumPrintProcessorDataTypes r;
|
||||
DATA_BLOB blob;
|
||||
uint32_t needed;
|
||||
uint32_t count;
|
||||
@ -974,24 +974,24 @@ static bool test_EnumPrintProcDataTypes_level(struct torture_context *tctx,
|
||||
r.out.count = &count;
|
||||
r.out.info = &info;
|
||||
|
||||
torture_comment(tctx, "Testing EnumPrintProcDataTypes(%s) level %u\n",
|
||||
torture_comment(tctx, "Testing EnumPrintProcessorDataTypes(%s) level %u\n",
|
||||
r.in.print_processor_name, r.in.level);
|
||||
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_spoolss_EnumPrintProcDataTypes_r(b, tctx, &r),
|
||||
"EnumPrintProcDataTypes failed");
|
||||
dcerpc_spoolss_EnumPrintProcessorDataTypes_r(b, tctx, &r),
|
||||
"EnumPrintProcessorDataTypes failed");
|
||||
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
|
||||
blob = data_blob_talloc_zero(tctx, needed);
|
||||
r.in.buffer = &blob;
|
||||
r.in.offered = needed;
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_spoolss_EnumPrintProcDataTypes_r(b, tctx, &r),
|
||||
"EnumPrintProcDataTypes failed");
|
||||
dcerpc_spoolss_EnumPrintProcessorDataTypes_r(b, tctx, &r),
|
||||
"EnumPrintProcessorDataTypes failed");
|
||||
}
|
||||
torture_assert_werr_equal(tctx, r.out.result, expected_result,
|
||||
"EnumPrintProcDataTypes failed");
|
||||
"EnumPrintProcessorDataTypes failed");
|
||||
|
||||
CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcDataTypes, info, level, count, needed, 4);
|
||||
CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessorDataTypes, info, level, count, needed, 4);
|
||||
|
||||
if (count_p) {
|
||||
*count_p = count;
|
||||
@ -1003,8 +1003,8 @@ static bool test_EnumPrintProcDataTypes_level(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_EnumPrintProcDataTypes(struct torture_context *tctx,
|
||||
void *private_data)
|
||||
static bool test_EnumPrintProcessorDataTypes(struct torture_context *tctx,
|
||||
void *private_data)
|
||||
{
|
||||
struct test_spoolss_context *ctx =
|
||||
talloc_get_type_abort(private_data, struct test_spoolss_context);
|
||||
@ -1016,12 +1016,12 @@ static bool test_EnumPrintProcDataTypes(struct torture_context *tctx,
|
||||
struct dcerpc_binding_handle *b = p->binding_handle;
|
||||
|
||||
torture_assert(tctx,
|
||||
test_EnumPrintProcDataTypes_level(tctx, b, NULL, 1, NULL, NULL, WERR_UNKNOWN_PRINTPROCESSOR),
|
||||
"test_EnumPrintProcDataTypes_level failed");
|
||||
test_EnumPrintProcessorDataTypes_level(tctx, b, NULL, 1, NULL, NULL, WERR_UNKNOWN_PRINTPROCESSOR),
|
||||
"test_EnumPrintProcessorDataTypes_level failed");
|
||||
|
||||
torture_assert(tctx,
|
||||
test_EnumPrintProcDataTypes_level(tctx, b, "nonexisting", 1, NULL, NULL, WERR_UNKNOWN_PRINTPROCESSOR),
|
||||
"test_EnumPrintProcDataTypes_level failed");
|
||||
test_EnumPrintProcessorDataTypes_level(tctx, b, "nonexisting", 1, NULL, NULL, WERR_UNKNOWN_PRINTPROCESSOR),
|
||||
"test_EnumPrintProcessorDataTypes_level failed");
|
||||
|
||||
for (i=0;i<ARRAY_SIZE(levels);i++) {
|
||||
int level = levels[i];
|
||||
@ -1030,8 +1030,8 @@ static bool test_EnumPrintProcDataTypes(struct torture_context *tctx,
|
||||
WERROR expected_result = ok[i] ? WERR_OK : WERR_INVALID_LEVEL;
|
||||
|
||||
torture_assert(tctx,
|
||||
test_EnumPrintProcDataTypes_level(tctx, b, "winprint", level, &count, &info, expected_result),
|
||||
"test_EnumPrintProcDataTypes_level failed");
|
||||
test_EnumPrintProcessorDataTypes_level(tctx, b, "winprint", level, &count, &info, expected_result),
|
||||
"test_EnumPrintProcessorDataTypes_level failed");
|
||||
}
|
||||
|
||||
{
|
||||
@ -1044,8 +1044,8 @@ static bool test_EnumPrintProcDataTypes(struct torture_context *tctx,
|
||||
|
||||
for (i=0; i < count; i++) {
|
||||
torture_assert(tctx,
|
||||
test_EnumPrintProcDataTypes_level(tctx, b, info[i].info1.print_processor_name, 1, NULL, NULL, WERR_OK),
|
||||
"test_EnumPrintProcDataTypes_level failed");
|
||||
test_EnumPrintProcessorDataTypes_level(tctx, b, info[i].info1.print_processor_name, 1, NULL, NULL, WERR_OK),
|
||||
"test_EnumPrintProcessorDataTypes_level failed");
|
||||
}
|
||||
}
|
||||
|
||||
@ -9313,7 +9313,7 @@ struct torture_suite *torture_rpc_spoolss(TALLOC_CTX *mem_ctx)
|
||||
torture_tcase_add_simple_test(tcase, "enum_print_processors", test_EnumPrintProcessors);
|
||||
torture_tcase_add_simple_test(tcase, "print_processors_winreg", test_print_processors_winreg);
|
||||
torture_tcase_add_simple_test(tcase, "add_processor", test_add_print_processor);
|
||||
torture_tcase_add_simple_test(tcase, "enum_printprocdata", test_EnumPrintProcDataTypes);
|
||||
torture_tcase_add_simple_test(tcase, "enum_printprocdata", test_EnumPrintProcessorDataTypes);
|
||||
torture_tcase_add_simple_test(tcase, "enum_printers", test_EnumPrinters);
|
||||
torture_tcase_add_simple_test(tcase, "enum_ports_old", test_EnumPorts_old);
|
||||
torture_tcase_add_simple_test(tcase, "enum_printers_old", test_EnumPrinters_old);
|
||||
|
Loading…
Reference in New Issue
Block a user