torture: Add ntprinting latin1 test.
[mat/samba.git] / source4 / torture / ndr / ntprinting.c
1 /*
2    Unix SMB/CIFS implementation.
3    test suite for ntprinting ndr operations
4
5    Copyright (C) Guenther Deschner 2012
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "includes.h"
22 #include "torture/ndr/ndr.h"
23 #include "librpc/gen_ndr/ndr_ntprinting.h"
24 #include "torture/ndr/proto.h"
25 #include "param/param.h"
26
27 static const uint8_t ntprinting_printer_data[] = {
28         0x48, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
29         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30         0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x0e, 0x03, 0x09,
31         0x00, 0x00, 0x00, 0x00, 0x24, 0x13, 0xb8, 0x4e, 0x00, 0x4b, 0x79, 0x6f,
32         0x63, 0x65, 0x72, 0x61, 0x2d, 0x35, 0x30, 0x30, 0x00, 0x6b, 0x79, 0x6f,
33         0x63, 0x65, 0x72, 0x61, 0x2d, 0x35, 0x30, 0x30, 0x00, 0x53, 0x61, 0x6d,
34         0x62, 0x61, 0x20, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x50,
35         0x6f, 0x72, 0x74, 0x00, 0x6b, 0x79, 0x6f, 0x63, 0x65, 0x72, 0x61, 0x2d,
36         0x35, 0x30, 0x30, 0x00, 0x4b, 0x79, 0x6f, 0x63, 0x65, 0x72, 0x61, 0x20,
37         0x54, 0x61, 0x73, 0x6b, 0x41, 0x6c, 0x66, 0x61, 0x20, 0x35, 0x30, 0x30,
38         0x63, 0x69, 0x00, 0x62, 0x75, 0x6c, 0x6c, 0x70, 0x65, 0x6e, 0x00, 0x00,
39         0x77, 0x69, 0x6e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00, 0x52, 0x41, 0x57,
40         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x5c, 0x69, 0x72, 0x6f, 0x62,
41         0x6f, 0x74, 0x5c, 0x4b, 0x79, 0x6f, 0x63, 0x65, 0x72, 0x61, 0x2d, 0x35,
42         0x30, 0x30, 0x00, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x00, 0x01, 0x04,
43         0x00, 0x06, 0xdc, 0x00, 0x60, 0x08, 0x01, 0x00, 0x01, 0x00, 0xea, 0x0a,
44         0x6f, 0x08, 0x64, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x58, 0x02, 0x02, 0x00,
45         0x01, 0x00, 0x58, 0x02, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x53, 0xff,
46         0x81, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
47         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
48         0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
49         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x60, 0x08,
51         0x00, 0x00, 0x50, 0x52, 0x49, 0x56, 0xe2, 0x30, 0x00, 0x00, 0x00, 0x00,
52         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
54         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
56         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
59         0x10, 0x27, 0x10, 0x27, 0x10, 0x27, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00,
60         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x54, 0x06, 0x00, 0x00,
61         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00,
62         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
63         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x10, 0x00, 0x5c, 0x4b,
64         0x03, 0x00, 0x68, 0x43, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65         0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x75,
67         0xbf, 0xbb, 0x29, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
68         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71         0x0e, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
72         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73         0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
74         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
81         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
82         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
83         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
87         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
90         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
91         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
92         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
95         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
105         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
106         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x53, 0x4d,
112         0x54, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x70, 0x03, 0x6b, 0x00,
113         0x79, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x65, 0x00, 0x72, 0x00, 0x61, 0x00,
114         0x2d, 0x00, 0x35, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x4a, 0x43,
115         0x4c, 0x54, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x00, 0x4d, 0x65,
116         0x64, 0x69, 0x75, 0x6d, 0x00, 0x4a, 0x43, 0x4c, 0x48, 0x61, 0x6c, 0x66,
117         0x74, 0x6f, 0x6e, 0x65, 0x00, 0x47, 0x72, 0x61, 0x64, 0x61, 0x74, 0x69,
118         0x6f, 0x6e, 0x00, 0x4a, 0x43, 0x4c, 0x52, 0x65, 0x64, 0x4c, 0x65, 0x76,
119         0x65, 0x6c, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x47,
120         0x72, 0x65, 0x65, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x00, 0x4e, 0x6f,
121         0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x42, 0x6c, 0x75, 0x65, 0x4c, 0x65,
122         0x76, 0x65, 0x6c, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c,
123         0x48, 0x75, 0x65, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x00, 0x4e, 0x6f,
124         0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x48, 0x75, 0x65, 0x52, 0x65, 0x64,
125         0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x48, 0x75, 0x65,
126         0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00,
127         0x4a, 0x43, 0x4c, 0x48, 0x75, 0x65, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x00,
128         0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x48, 0x75, 0x65, 0x43,
129         0x79, 0x61, 0x6e, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c,
130         0x48, 0x75, 0x65, 0x42, 0x6c, 0x75, 0x65, 0x00, 0x4e, 0x6f, 0x6e, 0x65,
131         0x00, 0x4a, 0x43, 0x4c, 0x48, 0x75, 0x65, 0x4d, 0x61, 0x67, 0x65, 0x6e,
132         0x74, 0x61, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x4c,
133         0x69, 0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x47, 0x61, 0x6d, 0x6d,
134         0x61, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c, 0x4c, 0x69,
135         0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72,
136         0x61, 0x73, 0x74, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4a, 0x43, 0x4c,
137         0x53, 0x61, 0x74, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x4e,
138         0x6f, 0x6e, 0x65, 0x00, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69,
139         0x6f, 0x6e, 0x00, 0x36, 0x30, 0x30, 0x64, 0x70, 0x69, 0x00, 0x4b, 0x43,
140         0x45, 0x63, 0x6f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00, 0x4f, 0x66, 0x66,
141         0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x00,
142         0x43, 0x4d, 0x59, 0x4b, 0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x72, 0x65,
143         0x70, 0x72, 0x6f, 0x64, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72,
144         0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x00, 0x43, 0x49, 0x45,
145         0x00, 0x50, 0x72, 0x6e, 0x44, 0x65, 0x66, 0x00, 0x50, 0x61, 0x67, 0x65,
146         0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x00, 0x4f, 0x6e, 0x00, 0x50, 0x61,
147         0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x4c, 0x65, 0x74, 0x74, 0x65,
148         0x72, 0x00, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e,
149         0x00, 0x00, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x64, 0x67,
150         0x65, 0x00, 0x00, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x6c, 0x6f, 0x74,
151         0x00, 0x2a, 0x55, 0x73, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x54, 0x72, 0x61,
152         0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x4d, 0x65, 0x64, 0x69, 0x61,
153         0x54, 0x79, 0x70, 0x65, 0x00, 0x41, 0x75, 0x74, 0x6f, 0x00, 0x4f, 0x75,
154         0x74, 0x70, 0x75, 0x74, 0x42, 0x69, 0x6e, 0x00, 0x4e, 0x6f, 0x6e, 0x65,
155         0x00, 0x4b, 0x43, 0x53, 0x74, 0x61, 0x70, 0x6c, 0x65, 0x00, 0x4e, 0x6f,
156         0x6e, 0x65, 0x00, 0x53, 0x74, 0x61, 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75,
157         0x6e, 0x74, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4b, 0x43, 0x50, 0x75,
158         0x6e, 0x63, 0x68, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4b, 0x43, 0x42,
159         0x6f, 0x6f, 0x6b, 0x6c, 0x65, 0x74, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00,
160         0x4b, 0x43, 0x46, 0x6f, 0x6c, 0x64, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00,
161         0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x00, 0x46, 0x61, 0x6c, 0x73, 0x65,
162         0x00, 0x4a, 0x6f, 0x67, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x44, 0x75,
163         0x70, 0x6c, 0x65, 0x78, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4b, 0x43,
164         0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x00, 0x50, 0x72, 0x6e, 0x44,
165         0x65, 0x66, 0x00, 0x4b, 0x6d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x6d, 0x65,
166         0x6e, 0x74, 0x00, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x4b,
167         0x43, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x44, 0x65, 0x66,
168         0x61, 0x75, 0x6c, 0x74, 0x00, 0x63, 0x75, 0x70, 0x73, 0x4a, 0x6f, 0x62,
169         0x48, 0x6f, 0x6c, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x00, 0x6e, 0x6f,
170         0x2d, 0x68, 0x6f, 0x6c, 0x64, 0x00, 0x63, 0x75, 0x70, 0x73, 0x4a, 0x6f,
171         0x62, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74,
172         0x00, 0x6e, 0x6f, 0x6e, 0x65, 0x00, 0x63, 0x75, 0x70, 0x73, 0x4a, 0x6f,
173         0x62, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x64, 0x00, 0x6e,
174         0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
175         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
176         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
177         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
178         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
179         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
180         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
181         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
182         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
183         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
184         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
185         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
186         0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x53, 0x50, 0x55, 0x43, 0x00, 0x06,
187         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
188         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
189         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
190         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
191         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
192         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
193         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
194         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
195         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
196         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
197         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
198         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
199         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
200         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
201         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
202         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
203         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
204         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
205         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
206         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
207         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
208         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
209         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
210         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
211         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
212         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
213         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
214         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
215         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
216         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
217         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
218         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
219         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
221         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
222         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
223         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
224         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
225         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
226         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
227         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
228         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
229         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
230         0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x44, 0x72, 0x69,
231         0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00,
232         0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e,
233         0x74, 0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74,
234         0x61, 0x5c, 0x54, 0x72, 0x61, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x69,
235         0x7a, 0x65, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xce,
236         0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74,
237         0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61,
238         0x5c, 0x54, 0x72, 0x61, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x54, 0x61, 0x62,
239         0x6c, 0x65, 0x00, 0x03, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xce,
240         0x00, 0x43, 0x00, 0x61, 0x00, 0x73, 0x00, 0x73, 0x00, 0x65, 0x00, 0x74,
241         0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x31, 0x00, 0x00, 0x00, 0x4c,
242         0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00,
243         0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x61, 0x00, 0x73, 0x00, 0x73,
244         0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x32,
245         0x00, 0x00, 0x00, 0x4c, 0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00, 0x65,
246         0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x61,
247         0x00, 0x73, 0x00, 0x73, 0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00, 0x65,
248         0x00, 0x20, 0x00, 0x33, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x65, 0x00, 0x74,
249         0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
250         0x00, 0x43, 0x00, 0x61, 0x00, 0x73, 0x00, 0x73, 0x00, 0x65, 0x00, 0x74,
251         0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x34, 0x00, 0x00, 0x00, 0x4c,
252         0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00,
253         0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x79, 0x00, 0x70, 0x00, 0x61,
254         0x00, 0x73, 0x00, 0x73, 0x00, 0x20, 0x00, 0x54, 0x00, 0x72, 0x00, 0x61,
255         0x00, 0x79, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x65, 0x00, 0x74, 0x00, 0x74,
256         0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
257         0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72,
258         0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x5c, 0x54,
259         0x72, 0x61, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x70, 0x53, 0x69,
260         0x7a, 0x65, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x39,
261         0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74,
262         0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61,
263         0x5c, 0x54, 0x72, 0x61, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x70,
264         0x00, 0x03, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x50, 0x46, 0x37,
265         0x30, 0x30, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x46, 0x37, 0x30,
266         0x30, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x46, 0x37, 0x30, 0x30,
267         0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x46, 0x37, 0x30, 0x30, 0x44,
268         0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x46, 0x31, 0x00, 0x00, 0x00, 0x00,
269         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72,
270         0x69, 0x6e, 0x74, 0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44,
271         0x61, 0x74, 0x61, 0x5c, 0x54, 0x72, 0x61, 0x79, 0x46, 0x6f, 0x72, 0x6d,
272         0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x00,
273         0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
274         0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x44,
275         0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x5c, 0x54, 0x72,
276         0x61, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72,
277         0x64, 0x00, 0x03, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x50, 0x46,
278         0x37, 0x30, 0x30, 0x41, 0x00, 0x00, 0x50, 0x46, 0x37, 0x30, 0x30, 0x42,
279         0x00, 0x00, 0x50, 0x46, 0x37, 0x30, 0x30, 0x43, 0x00, 0x00, 0x50, 0x46,
280         0x37, 0x30, 0x30, 0x44, 0x00, 0x00, 0x4d, 0x46, 0x31, 0x00, 0x00, 0x00,
281         0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c, 0x65,
282         0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
283         0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c,
284         0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01,
285         0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x49, 0x00, 0x52, 0x00, 0x4f,
286         0x00, 0x42, 0x00, 0x4f, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
287         0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x73,
288         0x68, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61,
289         0x6d, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x49,
290         0x00, 0x52, 0x00, 0x4f, 0x00, 0x42, 0x00, 0x4f, 0x00, 0x54, 0x00, 0x00,
291         0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c,
292         0x65, 0x72, 0x5c, 0x75, 0x4e, 0x43, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01,
293         0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x5c, 0x00, 0x49,
294         0x00, 0x52, 0x00, 0x4f, 0x00, 0x42, 0x00, 0x4f, 0x00, 0x54, 0x00, 0x5c,
295         0x00, 0x6b, 0x00, 0x79, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x65, 0x00, 0x72,
296         0x00, 0x61, 0x00, 0x2d, 0x00, 0x35, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00,
297         0x00, 0x00, 0x00, 0x00, 0x00
298 };
299
300 static const uint8_t ntprinting_printer_data_latin1[] = {
301         0x48, 0x1a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
302         0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
303         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
304         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
305         0x94, 0x46, 0x50, 0x0e, 0x00, 0x00, 0x00, 0x00,
306         0x94, 0xee, 0xb9, 0x50, 0x00, 0x53, 0x30, 0x42,
307         0x43, 0x00, 0x53, 0x30, 0x42, 0x43, 0x00, 0x53,
308         0x61, 0x6d, 0x62, 0x61, 0x20, 0x50, 0x72, 0x69,
309         0x6e, 0x74, 0x65, 0x72, 0x20, 0x50, 0x6f, 0x72,
310         0x74, 0x00, 0x48, 0x50, 0x20, 0x44, 0x65, 0x73,
311         0x69, 0x67, 0x6e, 0x6a, 0x65, 0x74, 0x20, 0x38,
312         0x30, 0x30, 0x50, 0x53, 0x20, 0x34, 0x32, 0x20,
313         0x62, 0x79, 0x20, 0x48, 0x50, 0x00, 0x22, 0x20,
314         0x53, 0x41, 0x4c, 0x41, 0x20, 0x44, 0x41, 0x20,
315         0x52, 0x45, 0x43, 0x45, 0x50, 0xc7, 0xc3, 0x4f,
316         0x20, 0x44, 0x41, 0x20, 0x43, 0x4f, 0x4e, 0x53,
317         0x54, 0x52, 0x55, 0xc7, 0xc3, 0x4f, 0x20, 0x2d,
318         0x20, 0x52, 0x41, 0x4e, 0x44, 0x30, 0x20, 0x4c,
319         0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x00, 0x55,
320         0x54, 0x47, 0x43, 0x41, 0x20, 0x00, 0x00, 0x77,
321         0x69, 0x6e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00,
322         0x52, 0x41, 0x57, 0x00, 0x00, 0x01, 0x00, 0x00,
323         0x00, 0x5c, 0x5c, 0x4c, 0x4f, 0x43, 0x41, 0x4c,
324         0x48, 0x4f, 0x53, 0x54, 0x5c, 0x53, 0x30, 0x42,
325         0x43, 0x00, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72,
326         0x00, 0x01, 0x04, 0x00, 0x04, 0xdc, 0x00, 0x00,
327         0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
328         0x00, 0x64, 0x00, 0x01, 0x00, 0x0f, 0x00, 0xfc,
329         0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
330         0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x47, 0x01,
331         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
332         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
333         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
334         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
335         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
336         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
337         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
338         0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69,
339         0x6e, 0x74, 0x65, 0x72, 0x44, 0x72, 0x69, 0x76,
340         0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00,
341         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
342         0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74,
343         0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
344         0x44, 0x61, 0x74, 0x61, 0x5c, 0x44, 0x72, 0x76,
345         0x50, 0x61, 0x70, 0x65, 0x72, 0x53, 0x74, 0x61,
346         0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x00, 0x04,
347         0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x61,
348         0xc2, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x50,
349         0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x44, 0x72,
350         0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61,
351         0x5c, 0x44, 0x72, 0x76, 0x44, 0x65, 0x76, 0x4d,
352         0x6f, 0x64, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00,
353         0x42, 0x02, 0x00, 0x00, 0x31, 0x00, 0x3b, 0x00,
354         0x31, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x36, 0x00,
355         0x36, 0x00, 0x3b, 0x00, 0x2d, 0x00, 0x33, 0x00,
356         0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x31, 0x00,
357         0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
358         0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
359         0x31, 0x00, 0x30, 0x00, 0x37, 0x00, 0x33, 0x00,
360         0x37, 0x00, 0x34, 0x00, 0x31, 0x00, 0x39, 0x00,
361         0x30, 0x00, 0x35, 0x00, 0x3b, 0x00, 0x30, 0x00,
362         0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x30, 0x00,
363         0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x35, 0x00,
364         0x30, 0x00, 0x3b, 0x00, 0x34, 0x00, 0x3b, 0x00,
365         0x35, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
366         0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3b, 0x00,
367         0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
368         0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
369         0x32, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x3b, 0x00,
370         0x32, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
371         0x31, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
372         0x30, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x36, 0x00,
373         0x32, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x30, 0x00,
374         0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x36, 0x00,
375         0x37, 0x00, 0x37, 0x00, 0x37, 0x00, 0x32, 0x00,
376         0x31, 0x00, 0x36, 0x00, 0x3b, 0x00, 0x30, 0x00,
377         0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x30, 0x00,
378         0x3b, 0x00, 0x31, 0x00, 0x36, 0x00, 0x3b, 0x00,
379         0x32, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x32, 0x00,
380         0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
381         0x31, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
382         0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
383         0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
384         0x31, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
385         0x34, 0x00, 0x3b, 0x00, 0x36, 0x00, 0x35, 0x00,
386         0x35, 0x00, 0x33, 0x00, 0x35, 0x00, 0x3b, 0x00,
387         0x32, 0x00, 0x36, 0x00, 0x33, 0x00, 0x31, 0x00,
388         0x37, 0x00, 0x32, 0x00, 0x3b, 0x00, 0x30, 0x00,
389         0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x31, 0x00,
390         0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x37, 0x00,
391         0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x32, 0x00,
392         0x37, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
393         0x30, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x3b, 0x00,
394         0x31, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
395         0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
396         0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
397         0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
398         0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
399         0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
400         0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
401         0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
402         0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
403         0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
404         0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
405         0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
406         0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
407         0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
408         0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
409         0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
410         0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
411         0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
412         0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
413         0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
414         0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
415         0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
416         0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
417         0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
418         0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
419         0x34, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
420         0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00,
421         0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
422         0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
423         0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
424         0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x30, 0x00,
425         0x3b, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x01, 0x00,
426         0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65,
427         0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44,
428         0x61, 0x74, 0x61, 0x5c, 0x44, 0x72, 0x76, 0x45,
429         0x57, 0x53, 0x49, 0x50, 0x00, 0x01, 0x00, 0x00,
430         0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
431         0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f,
432         0x6f, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00,
433         0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
434         0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c,
435         0x65, 0x72, 0x5c, 0x70, 0x72, 0x69, 0x6e, 0x74,
436         0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01,
437         0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x53,
438         0x00, 0x30, 0x00, 0x42, 0x00, 0x43, 0x00, 0x00,
439         0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53,
440         0x70, 0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x73,
441         0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d,
442         0x65, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00,
443         0x00, 0x00, 0x53, 0x00, 0x36, 0x00, 0x30, 0x00,
444         0x32, 0x00, 0x30, 0x00, 0x50, 0x00, 0x53, 0x00,
445         0x36, 0x00, 0x36, 0x00, 0x00, 0x00, 0x01, 0x00,
446         0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f,
447         0x6c, 0x65, 0x72, 0x5c, 0x73, 0x68, 0x6f, 0x72,
448         0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e,
449         0x61, 0x6d, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00,
450         0x14, 0x00, 0x00, 0x00, 0x53, 0x00, 0x36, 0x00,
451         0x30, 0x00, 0x32, 0x00, 0x30, 0x00, 0x50, 0x00,
452         0x53, 0x00, 0x36, 0x00, 0x36, 0x00, 0x00, 0x00,
453         0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70,
454         0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x75, 0x4e,
455         0x43, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01, 0x00,
456         0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5c, 0x00,
457         0x5c, 0x00, 0x53, 0x00, 0x36, 0x00, 0x30, 0x00,
458         0x32, 0x00, 0x30, 0x00, 0x50, 0x00, 0x53, 0x00,
459         0x36, 0x00, 0x36, 0x00, 0x5c, 0x00, 0x53, 0x00,
460         0x30, 0x00, 0x42, 0x00, 0x43, 0x00, 0x00, 0x00,
461         0x00, 0x00, 0x00, 0x00
462 };
463
464 static bool ntprinting_printer_check(struct torture_context *tctx,
465                                      struct ntprinting_printer *r)
466 {
467         torture_assert_int_equal(tctx, r->info.attributes, 0x00081048, "attributes");
468         torture_assert_int_equal(tctx, r->info.priority, 1, "priority");
469         torture_assert_int_equal(tctx, r->info.default_priority, 1, "default_priority");
470         torture_assert_int_equal(tctx, r->info.starttime, 0, "startime");
471         torture_assert_int_equal(tctx, r->info.untiltime, 0, "untiltime");
472         torture_assert_int_equal(tctx, r->info.status, 0, "status");
473         torture_assert_int_equal(tctx, r->info.cjobs, 5, "cjobs");
474         torture_assert_int_equal(tctx, r->info.averageppm, 0, "averageppm");
475         torture_assert_int_equal(tctx, r->info.changeid, 0x09030e9d, "changeid");
476         torture_assert_int_equal(tctx, r->info.c_setprinter, 0, "c_setprinter");
477         torture_assert_int_equal(tctx, r->info.setuptime, 0x4eb81324, "setuptime");
478         torture_assert_str_equal(tctx, r->info.servername, "", "servername");
479         torture_assert_str_equal(tctx, r->info.printername, "Kyocera-500", "printername");
480         torture_assert_str_equal(tctx, r->info.sharename, "kyocera-500", "sharename");
481         torture_assert_str_equal(tctx, r->info.portname, "Samba Printer Port", "portname");
482         torture_assert_str_equal(tctx, r->info.drivername, "kyocera-500", "drivername");
483         torture_assert_str_equal(tctx, r->info.comment, "Kyocera TaskAlfa 500ci", "comment");
484         torture_assert_str_equal(tctx, r->info.location, "bullpen", "comment");
485         torture_assert_str_equal(tctx, r->info.sepfile, "", "sepfile");
486         torture_assert_str_equal(tctx, r->info.printprocessor, "winprint", "printprocessor");
487         torture_assert_str_equal(tctx, r->info.datatype, "RAW", "datatype");
488         torture_assert_str_equal(tctx, r->info.parameters, "", "parameters");
489
490         torture_assert(tctx, r->devmode, "devmode");
491         torture_assert_str_equal(tctx, r->devmode->devicename, "\\\\irobot\\Kyocera-500", "devicename");
492         torture_assert_str_equal(tctx, r->devmode->formname, "Letter", "formname");
493         torture_assert_int_equal(tctx, r->devmode->specversion, 0x0401, "specversion");
494         torture_assert_int_equal(tctx, r->devmode->driverversion, 0x0600, "driverversion");
495         torture_assert_int_equal(tctx, r->devmode->size, 0x00dc, "size");
496         torture_assert_int_equal(tctx, r->devmode->driverextra, 0x0860, "driverextra");
497         torture_assert_int_equal(tctx, r->devmode->orientation, 1, "orientation");
498         torture_assert_int_equal(tctx, r->devmode->papersize, 1, "papersize");
499         torture_assert_int_equal(tctx, r->devmode->paperlength, 0x0aea, "paperlength");
500         torture_assert_int_equal(tctx, r->devmode->paperwidth, 0x086f, "paperwidth");
501         torture_assert_int_equal(tctx, r->devmode->scale, 0x0064, "scale");
502         torture_assert_int_equal(tctx, r->devmode->copies, 1, "copies");
503         torture_assert_int_equal(tctx, r->devmode->defaultsource, 0x000f, "defaultsource");
504         torture_assert_int_equal(tctx, r->devmode->printquality, 0x0258, "printquality");
505         torture_assert_int_equal(tctx, r->devmode->color, 2, "color");
506         torture_assert_int_equal(tctx, r->devmode->duplex, 1, "duplex");
507         torture_assert_int_equal(tctx, r->devmode->yresolution, 0x0258, "yresolution");
508         torture_assert_int_equal(tctx, r->devmode->ttoption, 2, "ttoption");
509         torture_assert_int_equal(tctx, r->devmode->collate, 1, "collate");
510         torture_assert_int_equal(tctx, r->devmode->logpixels, 0, "logpixels");
511         torture_assert_int_equal(tctx, r->devmode->fields, 0x0381ff53, "fields");
512         torture_assert_int_equal(tctx, r->devmode->bitsperpel, 0, "bitsperpel");
513         torture_assert_int_equal(tctx, r->devmode->pelswidth, 0, "pelswidth");
514         torture_assert_int_equal(tctx, r->devmode->pelsheight, 0, "pelsheight");
515         torture_assert_int_equal(tctx, r->devmode->displayflags, 1, "displayflags");
516         torture_assert_int_equal(tctx, r->devmode->displayfrequency, 0, "displayfrequency");
517         torture_assert_int_equal(tctx, r->devmode->icmmethod, 1, "icmmethod");
518         torture_assert_int_equal(tctx, r->devmode->icmintent, 2, "icmintent");
519         torture_assert_int_equal(tctx, r->devmode->mediatype, 0x00000101, "mediatype");
520         torture_assert_int_equal(tctx, r->devmode->dithertype, 0, "dithertype");
521         torture_assert_int_equal(tctx, r->devmode->reserved1, 0, "reserved1");
522         torture_assert_int_equal(tctx, r->devmode->reserved2, 0, "reserved2");
523         torture_assert_int_equal(tctx, r->devmode->panningwidth, 0, "panningwidth");
524         torture_assert_int_equal(tctx, r->devmode->panningheight, 0, "panningheight");
525
526         torture_assert(tctx, r->devmode->nt_dev_private, "nt_dev_private");
527         torture_assert_int_equal(tctx, r->devmode->nt_dev_private->length, 2144, "nt_dev_private->length");
528
529         torture_assert_int_equal(tctx, r->count, 11, "count");
530
531         torture_assert_int_equal(tctx, r->printer_data[0].ptr, 1, "ptr");
532         torture_assert_str_equal(tctx, r->printer_data[0].name, "PrinterDriverData", "name");
533         torture_assert_int_equal(tctx, r->printer_data[0].type, 0, "type");
534         torture_assert_int_equal(tctx, r->printer_data[0].data.length, 0, "data.length");
535
536         torture_assert_int_equal(tctx, r->printer_data[1].ptr, 1, "ptr");
537         torture_assert_str_equal(tctx, r->printer_data[1].name, "PrinterDriverData\\TrayFormSize", "name");
538         torture_assert_int_equal(tctx, r->printer_data[1].type, 4, "type");
539         torture_assert_int_equal(tctx, r->printer_data[1].data.length, 4, "data.length");
540
541         torture_assert_int_equal(tctx, r->printer_data[2].ptr, 1, "ptr");
542         torture_assert_str_equal(tctx, r->printer_data[2].name, "PrinterDriverData\\TrayFormTable", "name");
543         torture_assert_int_equal(tctx, r->printer_data[2].type, 3, "type");
544         torture_assert_int_equal(tctx, r->printer_data[2].data.length, 206, "data.length");
545
546         torture_assert_int_equal(tctx, r->printer_data[3].ptr, 1, "ptr");
547         torture_assert_str_equal(tctx, r->printer_data[3].name, "PrinterDriverData\\TrayFormMapSize", "name");
548         torture_assert_int_equal(tctx, r->printer_data[3].type, 4, "type");
549         torture_assert_int_equal(tctx, r->printer_data[3].data.length, 4, "data.length");
550
551         torture_assert_int_equal(tctx, r->printer_data[4].ptr, 1, "ptr");
552         torture_assert_str_equal(tctx, r->printer_data[4].name, "PrinterDriverData\\TrayFormMap", "name");
553         torture_assert_int_equal(tctx, r->printer_data[4].type, 3, "type");
554         torture_assert_int_equal(tctx, r->printer_data[4].data.length, 57, "data.length");
555
556         torture_assert_int_equal(tctx, r->printer_data[5].ptr, 1, "ptr");
557         torture_assert_str_equal(tctx, r->printer_data[5].name, "PrinterDriverData\\TrayFormKeywordSize", "name");
558         torture_assert_int_equal(tctx, r->printer_data[5].type, 4, "type");
559         torture_assert_int_equal(tctx, r->printer_data[5].data.length, 4, "data.length");
560
561         torture_assert_int_equal(tctx, r->printer_data[6].ptr, 1, "ptr");
562         torture_assert_str_equal(tctx, r->printer_data[6].name, "PrinterDriverData\\TrayFormKeyword", "name");
563         torture_assert_int_equal(tctx, r->printer_data[6].type, 3, "type");
564         torture_assert_int_equal(tctx, r->printer_data[6].data.length, 38, "data.length");
565
566         torture_assert_int_equal(tctx, r->printer_data[7].ptr, 1, "ptr");
567         torture_assert_str_equal(tctx, r->printer_data[7].name, "DsSpooler", "name");
568         torture_assert_int_equal(tctx, r->printer_data[7].type, 0, "type");
569         torture_assert_int_equal(tctx, r->printer_data[7].data.length, 0, "data.length");
570
571         torture_assert_int_equal(tctx, r->printer_data[8].ptr, 1, "ptr");
572         torture_assert_str_equal(tctx, r->printer_data[8].name, "DsSpooler\\serverName", "name");
573         torture_assert_int_equal(tctx, r->printer_data[8].type, 1, "type");
574         torture_assert_int_equal(tctx, r->printer_data[8].data.length, 14, "data.length");
575
576         torture_assert_int_equal(tctx, r->printer_data[9].ptr, 1, "ptr");
577         torture_assert_str_equal(tctx, r->printer_data[9].name, "DsSpooler\\shortServerName", "name");
578         torture_assert_int_equal(tctx, r->printer_data[9].type, 1, "type");
579         torture_assert_int_equal(tctx, r->printer_data[9].data.length, 14, "data.length");
580
581         torture_assert_int_equal(tctx, r->printer_data[10].ptr, 1, "ptr");
582         torture_assert_str_equal(tctx, r->printer_data[10].name, "DsSpooler\\uNCName", "name");
583         torture_assert_int_equal(tctx, r->printer_data[10].type, 1, "type");
584         torture_assert_int_equal(tctx, r->printer_data[10].data.length, 42, "data.length");
585
586         return true;
587 }
588
589 static bool ntprinting_printer_latin1_check(struct torture_context *tctx)
590 {
591         enum ndr_err_code ndr_err;
592         struct ntprinting_printer r;
593         DATA_BLOB blob;
594         bool ok;
595
596         ok = lpcfg_do_global_parameter(tctx->lp_ctx, "dos charset", "CP1252");
597         if (!ok) {
598                 torture_comment(tctx, "Could not set 'dos charset' option.\n");
599                 return false;
600         }
601         reload_charcnv(tctx->lp_ctx);
602
603         ZERO_STRUCT(r);
604         r.info.string_flags = LIBNDR_FLAG_STR_ASCII;
605
606         blob = data_blob_const(ntprinting_printer_data_latin1,
607                                sizeof(ntprinting_printer_data_latin1));
608
609         ndr_err = ndr_pull_struct_blob(&blob, tctx, &r,
610                    (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer);
611
612         torture_assert_ndr_success(tctx,
613                                    ndr_err,
614                                    "ndr_pull_ntprinting_printer");
615 #if 0
616         ndr_print_debug((ndr_print_fn_t) ndr_print_ntprinting_printer,
617                         "ntprinter",
618                         &r);
619 #endif
620         torture_assert_str_equal(tctx,
621                                  r.info.printername,
622                                  "S0BC",
623                                  "printername");
624         /* latin1 encoding check */
625         torture_assert_str_equal(tctx,
626                                  r.info.comment,
627                                  "\" SALA DA RECEPÇÃO DA CONSTRUÇÃO - RAND0 LOCATIO",
628                                  "comment");
629         torture_assert_str_equal(tctx,
630                                  r.info.location,
631                                  "UTGCA ",
632                                  "location");
633
634         return true;
635 }
636
637 struct torture_suite *ndr_ntprinting_suite(TALLOC_CTX *ctx)
638 {
639         struct torture_suite *suite = torture_suite_create(ctx, "ntprinting");
640
641         torture_suite_add_simple_test(suite,
642                                       "ntprinting latin1 check",
643                                       ntprinting_printer_latin1_check);
644
645         torture_suite_add_ndr_pull_test(suite,
646                                         ntprinting_printer,
647                                         ntprinting_printer_data,
648                                         ntprinting_printer_check);
649
650         /* pullpush not working atm.
651         torture_suite_add_ndr_pullpush_test(suite,
652                                             ntprinting_printer,
653                                             data_blob_const(ntprinting_printer_data, sizeof(ntprinting_printer_data)),
654                                             ntprinting_printer_check);
655         */
656         return suite;
657 }