1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r5553: Add idl and test for spoolss_AddPort(). It always seems to return

WERR_NOT_SUPPORTED though.
This commit is contained in:
Tim Potter 2005-02-25 06:16:13 +00:00 committed by Gerald (Jerry) Carter
parent 0e83a306b0
commit ba4730a378
2 changed files with 40 additions and 2 deletions

View File

@ -712,6 +712,9 @@
/******************/
/* Function: 0x25 */
WERROR spoolss_AddPort(
[in] unistr *server_name,
[in] uint32 unknown,
[in] unistr monitor_name
);
/******************/

View File

@ -303,7 +303,7 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("EnumPorts failed -- %s\n", nt_errstr(status));
printf("EnumPorts failed - %s\n", nt_errstr(status));
return False;
}
@ -316,7 +316,7 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("EnumPorts failed -- %s\n", nt_errstr(status));
printf("EnumPorts failed - %s\n", nt_errstr(status));
return False;
}
@ -329,6 +329,39 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
static BOOL test_AddPort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
struct spoolss_AddPort r;
r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s",
dcerpc_server_name(p));
r.in.unknown = 0;
r.in.monitor_name = "foo";
printf ("Testing AddPort\n");
status = dcerpc_spoolss_AddPort(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("AddPort failed - %s\n", nt_errstr(status));
return False;
}
/* win2k3 returns WERR_NOT_SUPPORTED */
#if 0
if (!W_ERROR_IS_OK(r.out.result)) {
printf("AddPort failed - %s\n", win_errstr(r.out.result));
return False;
}
#endif
return True;
}
static BOOL test_GetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle, uint32_t job_id)
{
@ -1095,6 +1128,8 @@ BOOL torture_rpc_spoolss(void)
ret &= test_OpenPrinter_badnames(p, mem_ctx);
ret &= test_AddPort(p, mem_ctx);
ret &= test_EnumPorts(p, mem_ctx);
ret &= test_EnumPrinters(p, mem_ctx);