Line data Source code
1 : /* autogenerated by pidl */
2 : #include "includes.h"
3 : #include "bin/default/source4/lib/registry/tdr_regf.h"
4 :
5 :
6 :
7 :
8 0 : static NTSTATUS tdr_pull_regf_version (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct regf_version *v)
9 : {
10 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->major));
11 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->minor));
12 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->release));
13 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->build));
14 0 : return NT_STATUS_OK;
15 : }
16 :
17 0 : static NTSTATUS tdr_push_regf_version (struct tdr_push *tdr, struct regf_version *v)
18 : {
19 0 : v->major = 1;
20 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->major));
21 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->minor));
22 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->release));
23 0 : v->build = 1;
24 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->build));
25 0 : return NT_STATUS_OK;
26 : }
27 :
28 0 : NTSTATUS tdr_pull_regf_hdr (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct regf_hdr *v)
29 : {
30 : int i;
31 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->REGF_ID, 4, sizeof(uint8_t), CH_DOS));
32 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->update_counter1));
33 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->update_counter2));
34 0 : TDR_CHECK(tdr_pull_NTTIME(tdr, mem_ctx, &v->modtime));
35 0 : TDR_CHECK(tdr_pull_regf_version(tdr, mem_ctx, &v->version));
36 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->data_offset));
37 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->last_block));
38 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->uk7));
39 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->description, 0x20, sizeof(uint16_t), CH_UTF16));
40 0 : for (i = 0; i < 99; i++) {
41 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->padding[i]));
42 : }
43 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->chksum));
44 0 : return NT_STATUS_OK;
45 : }
46 :
47 0 : NTSTATUS tdr_push_regf_hdr (struct tdr_push *tdr, struct regf_hdr *v)
48 : {
49 : int i;
50 0 : TDR_CHECK(tdr_push_charset(tdr, &v->REGF_ID, 4, sizeof(uint8_t), CH_DOS));
51 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->update_counter1));
52 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->update_counter2));
53 0 : TDR_CHECK(tdr_push_NTTIME(tdr, &v->modtime));
54 0 : TDR_CHECK(tdr_push_regf_version(tdr, &v->version));
55 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->data_offset));
56 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->last_block));
57 0 : v->uk7 = 1;
58 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->uk7));
59 0 : TDR_CHECK(tdr_push_charset(tdr, &v->description, 0x20, sizeof(uint16_t), CH_UTF16));
60 0 : for (i = 0; i < 99; i++) {
61 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->padding[i]));
62 : }
63 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->chksum));
64 0 : return NT_STATUS_OK;
65 : }
66 :
67 0 : NTSTATUS tdr_pull_hbin_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct hbin_block *v)
68 : {
69 : int i;
70 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->HBIN_ID, 4, sizeof(uint8_t), CH_DOS));
71 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->offset_from_first));
72 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->offset_to_next));
73 0 : for (i = 0; i < 2; i++) {
74 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->unknown[i]));
75 : }
76 0 : TDR_CHECK(tdr_pull_NTTIME(tdr, mem_ctx, &v->last_change));
77 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->block_size));
78 0 : TDR_ALLOC(mem_ctx, v->data, v->offset_to_next - 0x20);
79 0 : for (i = 0; i < v->offset_to_next - 0x20; i++) {
80 0 : TDR_CHECK(tdr_pull_uint8(tdr, v->data, &v->data[i]));
81 : }
82 0 : return NT_STATUS_OK;
83 : }
84 :
85 0 : NTSTATUS tdr_push_hbin_block (struct tdr_push *tdr, struct hbin_block *v)
86 : {
87 : int i;
88 0 : TDR_CHECK(tdr_push_charset(tdr, &v->HBIN_ID, 4, sizeof(uint8_t), CH_DOS));
89 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->offset_from_first));
90 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->offset_to_next));
91 0 : for (i = 0; i < 2; i++) {
92 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->unknown[i]));
93 : }
94 0 : TDR_CHECK(tdr_push_NTTIME(tdr, &v->last_change));
95 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->block_size));
96 0 : for (i = 0; i < v->offset_to_next - 0x20; i++) {
97 0 : TDR_CHECK(tdr_push_uint8(tdr, &v->data[i]));
98 : }
99 0 : return NT_STATUS_OK;
100 : }
101 :
102 0 : static NTSTATUS tdr_pull_reg_key_type (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, enum reg_key_type *v)
103 : {
104 : uint16_t r;
105 0 : TDR_CHECK(tdr_pull_uint1632(tdr, mem_ctx, &r));
106 0 : *v = r;
107 0 : return NT_STATUS_OK;
108 : }
109 :
110 0 : static NTSTATUS tdr_push_reg_key_type (struct tdr_push *tdr, enum reg_key_type *v)
111 : {
112 0 : TDR_CHECK(tdr_push_uint1632(tdr, (uint16_t *)v));
113 0 : return NT_STATUS_OK;
114 : }
115 :
116 0 : NTSTATUS tdr_pull_nk_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct nk_block *v)
117 : {
118 : int i;
119 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
120 0 : TDR_CHECK(tdr_pull_reg_key_type(tdr, mem_ctx, &v->type));
121 0 : TDR_CHECK(tdr_pull_NTTIME(tdr, mem_ctx, &v->last_change));
122 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->uk1));
123 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->parent_offset));
124 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->num_subkeys));
125 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->uk2));
126 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->subkeys_offset));
127 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->unknown_offset));
128 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->num_values));
129 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->values_offset));
130 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->sk_offset));
131 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->clsname_offset));
132 0 : for (i = 0; i < 5; i++) {
133 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->unk3[i]));
134 : }
135 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->name_length));
136 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->clsname_length));
137 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->key_name, v->name_length, sizeof(uint8_t), CH_DOS));
138 0 : return NT_STATUS_OK;
139 : }
140 :
141 0 : NTSTATUS tdr_push_nk_block (struct tdr_push *tdr, struct nk_block *v)
142 : {
143 : int i;
144 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
145 0 : TDR_CHECK(tdr_push_reg_key_type(tdr, &v->type));
146 0 : TDR_CHECK(tdr_push_NTTIME(tdr, &v->last_change));
147 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->uk1));
148 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->parent_offset));
149 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->num_subkeys));
150 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->uk2));
151 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->subkeys_offset));
152 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->unknown_offset));
153 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->num_values));
154 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->values_offset));
155 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->sk_offset));
156 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->clsname_offset));
157 0 : for (i = 0; i < 5; i++) {
158 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->unk3[i]));
159 : }
160 0 : v->name_length = strlen(v->key_name);
161 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->name_length));
162 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->clsname_length));
163 0 : TDR_CHECK(tdr_push_charset(tdr, &v->key_name, v->name_length, sizeof(uint8_t), CH_DOS));
164 0 : return NT_STATUS_OK;
165 : }
166 :
167 0 : NTSTATUS tdr_pull_sk_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct sk_block *v)
168 : {
169 : int i;
170 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
171 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->tag));
172 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->prev_offset));
173 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->next_offset));
174 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->ref_cnt));
175 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->rec_size));
176 0 : TDR_ALLOC(mem_ctx, v->sec_desc, v->rec_size);
177 0 : for (i = 0; i < v->rec_size; i++) {
178 0 : TDR_CHECK(tdr_pull_uint8(tdr, v->sec_desc, &v->sec_desc[i]));
179 : }
180 0 : return NT_STATUS_OK;
181 : }
182 :
183 0 : NTSTATUS tdr_push_sk_block (struct tdr_push *tdr, struct sk_block *v)
184 : {
185 : int i;
186 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
187 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->tag));
188 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->prev_offset));
189 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->next_offset));
190 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->ref_cnt));
191 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->rec_size));
192 0 : for (i = 0; i < v->rec_size; i++) {
193 0 : TDR_CHECK(tdr_push_uint8(tdr, &v->sec_desc[i]));
194 : }
195 0 : return NT_STATUS_OK;
196 : }
197 :
198 0 : static NTSTATUS tdr_pull_lh_hash (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct lh_hash *v)
199 : {
200 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->nk_offset));
201 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->base37));
202 0 : return NT_STATUS_OK;
203 : }
204 :
205 0 : static NTSTATUS tdr_push_lh_hash (struct tdr_push *tdr, struct lh_hash *v)
206 : {
207 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->nk_offset));
208 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->base37));
209 0 : return NT_STATUS_OK;
210 : }
211 :
212 0 : NTSTATUS tdr_pull_lh_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct lh_block *v)
213 : {
214 : int i;
215 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
216 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->key_count));
217 0 : TDR_ALLOC(mem_ctx, v->hr, v->key_count);
218 0 : for (i = 0; i < v->key_count; i++) {
219 0 : TDR_CHECK(tdr_pull_lh_hash(tdr, v->hr, &v->hr[i]));
220 : }
221 0 : return NT_STATUS_OK;
222 : }
223 :
224 0 : NTSTATUS tdr_push_lh_block (struct tdr_push *tdr, struct lh_block *v)
225 : {
226 : int i;
227 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
228 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->key_count));
229 0 : for (i = 0; i < v->key_count; i++) {
230 0 : TDR_CHECK(tdr_push_lh_hash(tdr, &v->hr[i]));
231 : }
232 0 : return NT_STATUS_OK;
233 : }
234 :
235 0 : NTSTATUS tdr_pull_li_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct li_block *v)
236 : {
237 : int i;
238 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
239 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->key_count));
240 0 : TDR_ALLOC(mem_ctx, v->nk_offset, v->key_count);
241 0 : for (i = 0; i < v->key_count; i++) {
242 0 : TDR_CHECK(tdr_pull_uint32(tdr, v->nk_offset, &v->nk_offset[i]));
243 : }
244 0 : return NT_STATUS_OK;
245 : }
246 :
247 0 : NTSTATUS tdr_push_li_block (struct tdr_push *tdr, struct li_block *v)
248 : {
249 : int i;
250 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
251 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->key_count));
252 0 : for (i = 0; i < v->key_count; i++) {
253 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->nk_offset[i]));
254 : }
255 0 : return NT_STATUS_OK;
256 : }
257 :
258 0 : NTSTATUS tdr_pull_ri_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct ri_block *v)
259 : {
260 : int i;
261 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
262 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->key_count));
263 0 : TDR_ALLOC(mem_ctx, v->offset, v->key_count);
264 0 : for (i = 0; i < v->key_count; i++) {
265 0 : TDR_CHECK(tdr_pull_uint32(tdr, v->offset, &v->offset[i]));
266 : }
267 0 : return NT_STATUS_OK;
268 : }
269 :
270 0 : NTSTATUS tdr_push_ri_block (struct tdr_push *tdr, struct ri_block *v)
271 : {
272 : int i;
273 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
274 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->key_count));
275 0 : for (i = 0; i < v->key_count; i++) {
276 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->offset[i]));
277 : }
278 0 : return NT_STATUS_OK;
279 : }
280 :
281 0 : NTSTATUS tdr_pull_vk_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct vk_block *v)
282 : {
283 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
284 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->name_length));
285 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->data_length));
286 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->data_offset));
287 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->data_type));
288 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->flag));
289 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->unk1));
290 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->data_name, v->name_length, sizeof(uint8_t), CH_DOS));
291 0 : return NT_STATUS_OK;
292 : }
293 :
294 0 : NTSTATUS tdr_push_vk_block (struct tdr_push *tdr, struct vk_block *v)
295 : {
296 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
297 0 : v->name_length = strlen(v->data_name);
298 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->name_length));
299 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->data_length));
300 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->data_offset));
301 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->data_type));
302 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->flag));
303 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->unk1));
304 0 : TDR_CHECK(tdr_push_charset(tdr, &v->data_name, v->name_length, sizeof(uint8_t), CH_DOS));
305 0 : return NT_STATUS_OK;
306 : }
307 :
308 0 : static NTSTATUS tdr_pull_hash_record (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct hash_record *v)
309 : {
310 0 : TDR_CHECK(tdr_pull_uint32(tdr, mem_ctx, &v->nk_offset));
311 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->hash, 4, sizeof(uint8_t), CH_DOS));
312 0 : return NT_STATUS_OK;
313 : }
314 :
315 0 : static NTSTATUS tdr_push_hash_record (struct tdr_push *tdr, struct hash_record *v)
316 : {
317 0 : TDR_CHECK(tdr_push_uint32(tdr, &v->nk_offset));
318 0 : TDR_CHECK(tdr_push_charset(tdr, &v->hash, 4, sizeof(uint8_t), CH_DOS));
319 0 : return NT_STATUS_OK;
320 : }
321 :
322 0 : NTSTATUS tdr_pull_lf_block (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct lf_block *v)
323 : {
324 : int i;
325 0 : TDR_CHECK(tdr_pull_charset(tdr, mem_ctx, &v->header, 2, sizeof(uint8_t), CH_DOS));
326 0 : TDR_CHECK(tdr_pull_uint16(tdr, mem_ctx, &v->key_count));
327 0 : TDR_ALLOC(mem_ctx, v->hr, v->key_count);
328 0 : for (i = 0; i < v->key_count; i++) {
329 0 : TDR_CHECK(tdr_pull_hash_record(tdr, v->hr, &v->hr[i]));
330 : }
331 0 : return NT_STATUS_OK;
332 : }
333 :
334 0 : NTSTATUS tdr_push_lf_block (struct tdr_push *tdr, struct lf_block *v)
335 : {
336 : int i;
337 0 : TDR_CHECK(tdr_push_charset(tdr, &v->header, 2, sizeof(uint8_t), CH_DOS));
338 0 : TDR_CHECK(tdr_push_uint16(tdr, &v->key_count));
339 0 : for (i = 0; i < v->key_count; i++) {
340 0 : TDR_CHECK(tdr_push_hash_record(tdr, &v->hr[i]));
341 : }
342 0 : return NT_STATUS_OK;
343 : }
344 :
|