mirror of
https://github.com/samba-team/samba.git
synced 2025-02-09 09:57:48 +03:00
Add DeleteForm, start cleaning up tests.
This commit is contained in:
parent
e3d40e3da6
commit
10b31623fd
@ -329,7 +329,9 @@
|
|||||||
|
|
||||||
/******************/
|
/******************/
|
||||||
/* Function: 0x1f */
|
/* Function: 0x1f */
|
||||||
WERROR spoolss_1f(
|
WERROR spoolss_DeleteForm(
|
||||||
|
[in,ref] policy_handle *handle,
|
||||||
|
[in] unistr formname
|
||||||
);
|
);
|
||||||
|
|
||||||
/******************/
|
/******************/
|
||||||
|
@ -122,26 +122,6 @@ BOOL test_GetForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
|||||||
printf("No form info returned");
|
printf("No form info returned");
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
struct spoolss_AddForm af;
|
|
||||||
struct spoolss_AddFormInfo1 form;
|
|
||||||
|
|
||||||
af.in.handle = handle;
|
|
||||||
af.in.level = 1;
|
|
||||||
form.flags = 2;
|
|
||||||
form.name = "testform3";
|
|
||||||
form.width = r.out.info->info1.width;
|
|
||||||
form.length = r.out.info->info1.length;
|
|
||||||
form.left = r.out.info->info1.left;
|
|
||||||
form.top = r.out.info->info1.top;
|
|
||||||
form.right = r.out.info->info1.right;
|
|
||||||
form.bottom = r.out.info->info1.bottom;
|
|
||||||
af.in.info.info1 = &form;
|
|
||||||
|
|
||||||
status = dcerpc_spoolss_AddForm(
|
|
||||||
p, mem_ctx, &af);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
@ -209,6 +189,66 @@ BOOL test_EnumForms(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL test_DeleteForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||||
|
struct policy_handle *handle, char *formname)
|
||||||
|
{
|
||||||
|
NTSTATUS status;
|
||||||
|
struct spoolss_DeleteForm r;
|
||||||
|
|
||||||
|
r.in.handle = handle;
|
||||||
|
r.in.formname = formname;
|
||||||
|
|
||||||
|
status = dcerpc_spoolss_DeleteForm(p, mem_ctx, &r);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
|
||||||
|
printf("DeleteForm failed - %s/%s\n",
|
||||||
|
nt_errstr(status), win_errstr(r.out.result));
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||||
|
struct policy_handle *handle)
|
||||||
|
{
|
||||||
|
struct spoolss_AddForm r;
|
||||||
|
struct spoolss_AddFormInfo1 form;
|
||||||
|
NTSTATUS status;
|
||||||
|
char *formname = "testform3";
|
||||||
|
|
||||||
|
r.in.handle = handle;
|
||||||
|
r.in.level = 1;
|
||||||
|
form.flags = 2; /* User form */
|
||||||
|
form.name = formname;
|
||||||
|
form.width = 1;
|
||||||
|
form.length = 2;
|
||||||
|
form.left = 3;
|
||||||
|
form.top = 4;
|
||||||
|
form.right = 5;
|
||||||
|
form.bottom = 6;
|
||||||
|
r.in.info.info1 = &form;
|
||||||
|
|
||||||
|
status = dcerpc_spoolss_AddForm(p, mem_ctx, &r);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("AddForm failed - %s\n", nt_errstr(status));
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!W_ERROR_IS_OK(r.out.result)) {
|
||||||
|
printf("AddForm failed - %s\n", nt_errstr(status));
|
||||||
|
/* Fall through to delete form */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!test_DeleteForm(p, mem_ctx, handle, formname)) {
|
||||||
|
printf("DeleteForm failed\n");
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||||
struct policy_handle *handle)
|
struct policy_handle *handle)
|
||||||
{
|
{
|
||||||
@ -338,6 +378,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
|||||||
ret = False;
|
ret = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!test_AddForm(p, mem_ctx, &handle)) {
|
||||||
|
ret = False;
|
||||||
|
}
|
||||||
|
|
||||||
if (!test_EnumPrinterData(p, mem_ctx, &handle)) {
|
if (!test_EnumPrinterData(p, mem_ctx, &handle)) {
|
||||||
ret = False;
|
ret = False;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user