1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r5611: Add EnumPrinterDataEx-test (for now just for PrinterDriverData, we need

to enumerate (recursively!) over all keys with EnumPrinterKey later on.

Guenther
(This used to be commit 46ae4010f2)
This commit is contained in:
Günther Deschner 2005-03-02 00:15:06 +00:00 committed by Gerald (Jerry) Carter
parent 70ae0bb382
commit 0dcd79b92a

View File

@ -571,7 +571,7 @@ static BOOL test_GetPrinterDataEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
static BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
struct policy_handle *handle)
{
NTSTATUS status;
struct spoolss_EnumPrinterData r;
@ -618,6 +618,38 @@ static BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
static BOOL test_EnumPrinterDataEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
{
NTSTATUS status;
struct spoolss_EnumPrinterDataEx r;
r.in.handle = handle;
r.in.key_name = "PrinterDriverData";
r.in.buf_size = 0;
printf("Testing EnumPrinterDataEx\n");
status = dcerpc_spoolss_EnumPrinterDataEx(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("EnumPrinterDataEx failed - %s\n", nt_errstr(status));
return False;
}
r.in.buf_size = r.out.buf_size;
status = dcerpc_spoolss_EnumPrinterDataEx(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("EnumPrinterDataEx failed - %s\n", nt_errstr(status));
return False;
}
return True;
}
static BOOL test_DeletePrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
const char *value_name)
@ -907,6 +939,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
if (!test_EnumPrinterDataEx(p, mem_ctx, &handle)) {
ret = False;
}
if (!test_EnumJobs(p, mem_ctx, &handle)) {
ret = False;
}