2 Unix SMB/CIFS implementation.
4 iremotewinspool rpc test operations
6 Copyright (C) 2018 Justin Stephenson
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "torture/rpc/torture_rpc.h"
24 #define REG_DRIVER_CONTROL_KEY "SYSTEM\\CurrentControlSet\\Control\\Print"
26 struct test_driver_info
{
27 struct smbcli_state
*cli
;
28 struct spoolss_AddDriverInfo8
*info
;
29 const char *local_driver_path
;
30 size_t driver_path_len
;
33 char *print_upload_guid_dir
;
35 const char *uploaded_inf_path
;
36 const char *driver_name
;
37 const char *driver_arch
;
38 const char *core_driver_inf
;
41 struct test_iremotewinspool_context
{
42 struct GUID object_uuid
;
43 struct dcerpc_pipe
*iremotewinspool_pipe
;
44 struct policy_handle server_handle
;
45 struct test_driver_info
*dinfo
;
46 const char *environment
;
49 enum client_os_version
62 void init_winreg_String(struct winreg_String
*name
, const char *s
);
64 struct spoolss_UserLevel1
test_get_client_info(struct torture_context
*tctx
,
65 enum client_os_version os
,
66 enum spoolss_MajorVersion major_number
,
67 enum spoolss_MinorVersion minor_number
,
71 bool test_AsyncOpenPrinter_byprinter(struct torture_context
*tctx
,
72 struct test_iremotewinspool_context
*ctx
,
73 struct dcerpc_pipe
*p
,
74 const char *printer_name
,
75 struct spoolss_UserLevel1 cinfo
,
76 struct policy_handle
*handle
);
77 bool test_AsyncOpenPrinter_byprinter_expect(struct torture_context
*tctx
,
78 struct test_iremotewinspool_context
*ctx
,
79 struct dcerpc_pipe
*p
,
80 const char *printer_name
,
82 struct spoolss_UserLevel1 cinfo
,
83 NTSTATUS exected_status
,
84 WERROR exected_result
,
85 struct policy_handle
*handle
);
86 bool test_get_environment(struct torture_context
*tctx
,
87 struct dcerpc_binding_handle
*b
,
88 struct policy_handle
*handle
,
89 const char **architecture
);
91 bool test_AsyncClosePrinter_byhandle(struct torture_context
*tctx
,
92 struct test_iremotewinspool_context
*ctx
,
93 struct dcerpc_pipe
*p
,
94 struct policy_handle
*handle
);
96 bool test_AsyncGetPrinterData_args(struct torture_context
*tctx
,
97 struct dcerpc_binding_handle
*b
,
98 struct policy_handle
*handle
,
99 const char *value_name
,
100 enum winreg_Type
*type_p
,
104 bool parse_inf_driver(struct torture_context
*tctx
,
105 const char *driver_name
,
106 const char *abs_inf_path
,
107 const char *driver_arch
,
108 const char *core_driver_inf
,
109 struct spoolss_AddDriverInfo8
**_parsed_dinfo
);