return true;
}
+static bool test_one_printer(struct torture_context *tctx,
+ struct dcerpc_pipe *p,
+ struct policy_handle *handle,
+ const char *name)
+{
+ bool ret = true;
+
+ if (!test_printer_info(tctx, p, handle)) {
+ ret = false;
+ }
+
+ if (!test_PrinterInfo_SD(tctx, p, handle)) {
+ ret = false;
+ }
+
+ if (!test_PrinterInfo_DevMode(tctx, p, handle, name)) {
+ ret = false;
+ }
+
+ if (!test_printer_keys(tctx, p, handle)) {
+ ret = false;
+ }
+
+ return ret;
+}
+
static bool test_printer(struct torture_context *tctx,
struct dcerpc_pipe *p)
{
return false;
}
- if (!test_printer_info(tctx, p, &handle[0])) {
- ret = false;
- }
-
- if (!test_PrinterInfo_SD(tctx, p, &handle[0])) {
- ret = false;
- }
-
- if (!test_PrinterInfo_DevMode(tctx, p, &handle[0], TORTURE_PRINTER)) {
- ret = false;
- }
-
- if (!test_printer_keys(tctx, p, &handle[0])) {
+ if (!test_one_printer(tctx, p, &handle[0], TORTURE_PRINTER)) {
ret = false;
}
return false;
}
- if (!test_printer_info(tctx, p, &handle[1])) {
- ret = false;
- }
-
- if (!test_printer_keys(tctx, p, &handle[1])) {
+ if (!test_one_printer(tctx, p, &handle[1], TORTURE_PRINTER_EX)) {
ret = false;
}