first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[samba.git] / source3 / rpc_parse / parse_reg.c
1 /* 
2  *  Unix SMB/Netbios implementation.
3  *  Version 1.9.
4  *  RPC Pipe client / server routines
5  *  Copyright (C) Andrew Tridgell              1992-1997,
6  *  Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
7  *  Copyright (C) Paul Ashton                       1997.
8  *  
9  *  This program is free software; you can redistribute it and/or modify
10  *  it under the terms of the GNU General Public License as published by
11  *  the Free Software Foundation; either version 2 of the License, or
12  *  (at your option) any later version.
13  *  
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  *  
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, write to the Free Software
21  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  */
23
24
25 #include "includes.h"
26
27 extern int DEBUGLEVEL;
28
29
30 /*******************************************************************
31  Inits a structure.
32 ********************************************************************/
33
34 void init_reg_q_open_hklm(REG_Q_OPEN_HKLM *q_o,
35                                 uint16 unknown_0, uint32 level)
36 {
37         q_o->ptr = 1;
38         q_o->unknown_0 = unknown_0;
39         q_o->unknown_1 = 0x0; /* random - changes */
40         q_o->level = level;
41 }
42
43 /*******************************************************************
44 reads or writes a structure.
45 ********************************************************************/
46
47 BOOL reg_io_q_open_hklm(char *desc,  REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int depth)
48 {
49         if (r_q == NULL)
50                 return False;
51
52         prs_debug(ps, depth, desc, "reg_io_q_open_hklm");
53         depth++;
54
55         if(prs_align(ps))
56                 return False;
57         
58         if(!prs_uint32("ptr      ", ps, depth, &r_q->ptr))
59                 return False;
60
61         if (r_q->ptr != 0) {
62                 if(!prs_uint16("unknown_0", ps, depth, &r_q->unknown_0))
63                         return False;
64                 if(!prs_uint16("unknown_1", ps, depth, &r_q->unknown_1))
65                         return False;
66                 if(!prs_uint32("level    ", ps, depth, &r_q->level))
67                         return False;
68         }
69
70         return True;
71 }
72
73
74 /*******************************************************************
75 reads or writes a structure.
76 ********************************************************************/
77
78 BOOL reg_io_r_open_hklm(char *desc,  REG_R_OPEN_HKLM *r_r, prs_struct *ps, int depth)
79 {
80         if (r_r == NULL)
81                 return False;
82
83         prs_debug(ps, depth, desc, "reg_io_r_open_hklm");
84         depth++;
85
86         if(prs_align(ps))
87                 return False;
88         
89         if(!smb_io_pol_hnd("", &r_r->pol, ps, depth))
90                 return False;
91
92         if(!prs_uint32("status", ps, depth, &r_r->status))
93                 return False;
94
95         return True;
96 }
97
98
99 /*******************************************************************
100  Inits a structure.
101 ********************************************************************/
102
103 void init_reg_q_flush_key(REG_Q_FLUSH_KEY *q_u, POLICY_HND *pol)
104 {
105         memcpy(&q_u->pol, pol, sizeof(q_u->pol));
106 }
107
108 /*******************************************************************
109 reads or writes a structure.
110 ********************************************************************/
111
112 BOOL reg_io_q_flush_key(char *desc,  REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int depth)
113 {
114         if (r_q == NULL)
115                 return False;
116
117         prs_debug(ps, depth, desc, "reg_io_q_flush_key");
118         depth++;
119
120         if(prs_align(ps))
121                 return False;
122         
123         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
124                 return False;
125
126         return True;
127 }
128
129 /*******************************************************************
130 reads or writes a structure.
131 ********************************************************************/
132
133 BOOL reg_io_r_flush_key(char *desc,  REG_R_FLUSH_KEY *r_r, prs_struct *ps, int depth)
134 {
135         if (r_r == NULL)
136                 return False;
137
138         prs_debug(ps, depth, desc, "reg_io_r_flush_key");
139         depth++;
140
141         if(prs_align(ps))
142                 return False;
143         
144         if(!prs_uint32("status", ps, depth, &r_r->status))
145                 return False;
146
147         return True;
148 }
149
150 /*******************************************************************
151 reads or writes SEC_DESC_BUF and SEC_DATA structures.
152 ********************************************************************/
153
154 static BOOL reg_io_hdrbuf_sec(uint32 ptr, uint32 *ptr3, BUFHDR *hdr_sec, SEC_DESC_BUF *data, prs_struct *ps, int depth)
155 {
156         if (ptr != 0) {
157                 uint32 hdr_offset;
158                 uint32 old_offset;
159                 if(!smb_io_hdrbuf_pre("hdr_sec", hdr_sec, ps, depth, &hdr_offset))
160                         return False;
161
162                 old_offset = prs_offset(ps);
163
164                 if (ptr3 != NULL) {
165                         if(!prs_uint32("ptr3", ps, depth, ptr3))
166                                 return False;
167                 }
168
169                 if (ptr3 == NULL || *ptr3 != 0) {
170                         if(!sec_io_desc_buf("data   ", &data, ps, depth)) /* JRA - this line is probably wrong... */
171                                 return False;
172                 }
173
174                 if(!smb_io_hdrbuf_post("hdr_sec", hdr_sec, ps, depth, hdr_offset,
175                                    data->max_len, data->len))
176                                 return False;
177                 if(!prs_set_offset(ps, old_offset + data->len + sizeof(uint32) * ((ptr3 != NULL) ? 5 : 3)))
178                         return False;
179
180                 if(prs_align(ps))
181                         return False;
182         }
183
184         return True;
185 }
186
187 /*******************************************************************
188  Inits a structure.
189 ********************************************************************/
190
191 void init_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd,
192                                 char *name, char *class, SEC_ACCESS *sam_access,
193                                 SEC_DESC_BUF *sec_buf)
194 {
195         int len_name  = name  != NULL ? strlen(name ) + 1: 0;
196         int len_class = class != NULL ? strlen(class) + 1: 0;
197
198         ZERO_STRUCTP(q_c);
199
200         memcpy(&q_c->pnt_pol, hnd, sizeof(q_c->pnt_pol));
201
202         init_uni_hdr(&q_c->hdr_name, len_name);
203         init_unistr2(&q_c->uni_name, name, len_name);
204
205         init_uni_hdr(&q_c->hdr_class, len_class);
206         init_unistr2(&q_c->uni_class, class, len_class);
207
208         q_c->reserved = 0x00000000;
209         memcpy(&q_c->sam_access, sam_access, sizeof(q_c->sam_access));
210
211         q_c->ptr1 = 1;
212         q_c->sec_info = DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;
213
214         q_c->data = sec_buf;
215         q_c->ptr2 = 1;
216         init_buf_hdr(&q_c->hdr_sec, sec_buf->len, sec_buf->len);
217         q_c->ptr3 = 1;
218         q_c->unknown_2 = 0x00000000;
219 }
220
221 /*******************************************************************
222 reads or writes a structure.
223 ********************************************************************/
224
225 BOOL reg_io_q_create_key(char *desc,  REG_Q_CREATE_KEY *r_q, prs_struct *ps, int depth)
226 {
227         if (r_q == NULL)
228                 return False;
229
230         prs_debug(ps, depth, desc, "reg_io_q_create_key");
231         depth++;
232
233         if(prs_align(ps))
234                 return False;
235         
236         if(!smb_io_pol_hnd("", &r_q->pnt_pol, ps, depth))
237                 return False;
238
239         if(!smb_io_unihdr ("", &r_q->hdr_name, ps, depth))
240                 return False;
241         if(!smb_io_unistr2("", &r_q->uni_name, r_q->hdr_name.buffer, ps, depth))
242                 return False;
243         if(prs_align(ps))
244                 return False;
245
246         if(!smb_io_unihdr ("", &r_q->hdr_class, ps, depth))
247                 return False;
248         if(!smb_io_unistr2("", &r_q->uni_class, r_q->hdr_class.buffer, ps, depth))
249                 return False;
250         if(prs_align(ps))
251                 return False;
252
253         if(!prs_uint32("reserved", ps, depth, &r_q->reserved))
254                 return False;
255         if(!sec_io_access("sam_access", &r_q->sam_access, ps, depth))
256                 return False;
257
258         if(!prs_uint32("ptr1", ps, depth, &r_q->ptr1))
259                 return False;
260
261         if (r_q->ptr1 != 0) {
262                 if(!prs_uint32("sec_info", ps, depth, &r_q->sec_info))
263                         return False;
264         }
265
266         if(!prs_uint32("ptr2", ps, depth, &r_q->ptr2))
267                 return False;
268         if(!reg_io_hdrbuf_sec(r_q->ptr2, &r_q->ptr3, &r_q->hdr_sec, r_q->data, ps, depth))
269                 return False;
270
271         if(!prs_uint32("unknown_2", ps, depth, &r_q->unknown_2))
272                 return False;
273
274         return True;
275 }
276
277 /*******************************************************************
278 reads or writes a structure.
279 ********************************************************************/
280
281 BOOL reg_io_r_create_key(char *desc,  REG_R_CREATE_KEY *r_r, prs_struct *ps, int depth)
282 {
283         if (r_r == NULL)
284                 return False;
285
286         prs_debug(ps, depth, desc, "reg_io_r_create_key");
287         depth++;
288
289         if(prs_align(ps))
290                 return False;
291         
292         if(!smb_io_pol_hnd("", &r_r->key_pol, ps, depth))
293                 return False;
294         if(!prs_uint32("unknown", ps, depth, &r_r->unknown))
295                 return False;
296
297         if(!prs_uint32("status", ps, depth, &r_r->status))
298                 return False;
299
300         return True;
301 }
302
303
304 /*******************************************************************
305  Inits a structure.
306 ********************************************************************/
307
308 void init_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd,
309                                 char *name)
310 {
311         int len_name  = name  != NULL ? strlen(name ) + 1: 0;
312         ZERO_STRUCTP(q_c);
313
314         memcpy(&q_c->pnt_pol, hnd, sizeof(q_c->pnt_pol));
315
316         init_uni_hdr(&q_c->hdr_name, len_name);
317         init_unistr2(&q_c->uni_name, name, len_name);
318 }
319
320 /*******************************************************************
321 reads or writes a structure.
322 ********************************************************************/
323
324 BOOL reg_io_q_delete_val(char *desc,  REG_Q_DELETE_VALUE *r_q, prs_struct *ps, int depth)
325 {
326         if (r_q == NULL)
327                 return False;
328
329         prs_debug(ps, depth, desc, "reg_io_q_delete_val");
330         depth++;
331
332         if(prs_align(ps))
333                 return False;
334         
335         if(!smb_io_pol_hnd("", &r_q->pnt_pol, ps, depth))
336                 return False;
337
338         if(!smb_io_unihdr ("", &r_q->hdr_name, ps, depth))
339                 return False;
340         if(!smb_io_unistr2("", &r_q->uni_name, r_q->hdr_name.buffer, ps, depth))
341                 return False;
342         if(prs_align(ps))
343                 return False;
344
345         return True;
346 }
347
348
349 /*******************************************************************
350 reads or writes a structure.
351 ********************************************************************/
352
353 BOOL reg_io_r_delete_val(char *desc,  REG_R_DELETE_VALUE *r_r, prs_struct *ps, int depth)
354 {
355         if (r_r == NULL)
356                 return False;
357
358         prs_debug(ps, depth, desc, "reg_io_r_delete_val");
359         depth++;
360
361         if(prs_align(ps))
362                 return False;
363         
364         if(!prs_uint32("status", ps, depth, &r_r->status))
365                 return False;
366
367         return True;
368 }
369
370 /*******************************************************************
371  Inits a structure.
372 ********************************************************************/
373
374 void init_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd,
375                                 char *name)
376 {
377         int len_name  = name  != NULL ? strlen(name ) + 1: 0;
378         ZERO_STRUCTP(q_c);
379
380         memcpy(&q_c->pnt_pol, hnd, sizeof(q_c->pnt_pol));
381
382         init_uni_hdr(&q_c->hdr_name, len_name);
383         init_unistr2(&q_c->uni_name, name, len_name);
384 }
385
386 /*******************************************************************
387 reads or writes a structure.
388 ********************************************************************/
389
390 BOOL reg_io_q_delete_key(char *desc,  REG_Q_DELETE_KEY *r_q, prs_struct *ps, int depth)
391 {
392         if (r_q == NULL)
393                 return False;
394
395         prs_debug(ps, depth, desc, "reg_io_q_delete_key");
396         depth++;
397
398         if(prs_align(ps))
399                 return False;
400         
401         if(!smb_io_pol_hnd("", &r_q->pnt_pol, ps, depth))
402                 return False;
403
404         if(!smb_io_unihdr ("", &r_q->hdr_name, ps, depth))
405                 return False;
406         if(!smb_io_unistr2("", &r_q->uni_name, r_q->hdr_name.buffer, ps, depth))
407                 return False;
408         if(prs_align(ps))
409                 return False;
410
411         return True;
412 }
413
414 /*******************************************************************
415 reads or writes a structure.
416 ********************************************************************/
417
418 BOOL reg_io_r_delete_key(char *desc,  REG_R_DELETE_KEY *r_r, prs_struct *ps, int depth)
419 {
420         if (r_r == NULL)
421                 return False;
422
423         prs_debug(ps, depth, desc, "reg_io_r_delete_key");
424         depth++;
425
426         if(prs_align(ps))
427                 return False;
428         
429         if(!prs_uint32("status", ps, depth, &r_r->status))
430                 return False;
431
432         return True;
433 }
434
435 /*******************************************************************
436  Inits a structure.
437 ********************************************************************/
438
439 void init_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd,
440                                 uint32 max_class_len)
441 {
442         ZERO_STRUCTP(q_o);
443
444         memcpy(&q_o->pol, hnd, sizeof(q_o->pol));
445         init_uni_hdr(&q_o->hdr_class, max_class_len);
446         q_o->uni_class.uni_max_len = max_class_len;
447 }
448
449 /*******************************************************************
450 reads or writes a structure.
451 ********************************************************************/
452
453 BOOL reg_io_q_query_key(char *desc,  REG_Q_QUERY_KEY *r_q, prs_struct *ps, int depth)
454 {
455         if (r_q == NULL)
456                 return False;
457
458         prs_debug(ps, depth, desc, "reg_io_q_query_key");
459         depth++;
460
461         if(prs_align(ps))
462                 return False;
463         
464         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
465                 return False;
466         if(!smb_io_unihdr ("", &r_q->hdr_class, ps, depth))
467                 return False;
468         if(!smb_io_unistr2("", &r_q->uni_class, r_q->hdr_class.buffer, ps, depth))
469                 return False;
470
471         if(prs_align(ps))
472                 return False;
473
474         return True;
475 }
476
477
478 /*******************************************************************
479 reads or writes a structure.
480 ********************************************************************/
481
482 BOOL reg_io_r_query_key(char *desc,  REG_R_QUERY_KEY *r_r, prs_struct *ps, int depth)
483 {
484         if (r_r == NULL)
485                 return False;
486
487         prs_debug(ps, depth, desc, "reg_io_r_query_key");
488         depth++;
489
490         if(prs_align(ps))
491                 return False;
492         
493         if(!smb_io_unihdr ("", &r_r->hdr_class, ps, depth))
494                 return False;
495         if(!smb_io_unistr2("", &r_r->uni_class, r_r->hdr_class.buffer, ps, depth))
496                 return False;
497
498         if(prs_align(ps))
499                 return False;
500
501         if(!prs_uint32("num_subkeys   ", ps, depth, &r_r->num_subkeys))
502                 return False;
503         if(!prs_uint32("max_subkeylen ", ps, depth, &r_r->max_subkeylen))
504                 return False;
505         if(!prs_uint32("mak_subkeysize", ps, depth, &r_r->max_subkeysize))
506                 return False;
507         if(!prs_uint32("num_values    ", ps, depth, &r_r->num_values))
508                 return False;
509         if(!prs_uint32("max_valnamelen", ps, depth, &r_r->max_valnamelen))
510                 return False;
511         if(!prs_uint32("max_valbufsize", ps, depth, &r_r->max_valbufsize))
512                 return False;
513         if(!prs_uint32("sec_desc      ", ps, depth, &r_r->sec_desc))
514                 return False;
515         if(!smb_io_time("mod_time     ", &r_r->mod_time, ps, depth))
516                 return False;
517         
518         if(!prs_uint32("status", ps, depth, &r_r->status))
519                 return False;
520
521         return True;
522 }
523
524 /*******************************************************************
525  Inits a structure.
526 ********************************************************************/
527
528 void init_reg_q_unk_1a(REG_Q_UNK_1A *q_o, POLICY_HND *hnd)
529 {
530         memcpy(&q_o->pol, hnd, sizeof(q_o->pol));
531 }
532
533 /*******************************************************************
534 reads or writes a structure.
535 ********************************************************************/
536
537 BOOL reg_io_q_unk_1a(char *desc,  REG_Q_UNK_1A *r_q, prs_struct *ps, int depth)
538 {
539         if (r_q == NULL)
540                 return False;
541
542         prs_debug(ps, depth, desc, "reg_io_q_unk_1a");
543         depth++;
544
545         if(prs_align(ps))
546                 return False;
547         
548         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
549                 return False;
550
551         return True;
552 }
553
554 /*******************************************************************
555 reads or writes a structure.
556 ********************************************************************/
557
558 BOOL reg_io_r_unk_1a(char *desc,  REG_R_UNK_1A *r_r, prs_struct *ps, int depth)
559 {
560         if (r_r == NULL)
561                 return False;
562
563         prs_debug(ps, depth, desc, "reg_io_r_unk_1a");
564         depth++;
565
566         if(prs_align(ps))
567                 return False;
568         
569         if(!prs_uint32("unknown", ps, depth, &r_r->unknown))
570                 return False;
571         if(!prs_uint32("status" , ps, depth, &r_r->status))
572                 return False;
573
574         return True;
575 }
576
577 /*******************************************************************
578  Inits a structure.
579 ********************************************************************/
580
581 void init_reg_q_open_hku(REG_Q_OPEN_HKU *q_o,
582                                 uint16 unknown_0, uint32 level)
583 {
584         q_o->ptr = 1;
585         q_o->unknown_0 = unknown_0;
586         q_o->unknown_1 = 0x0; /* random - changes */
587         q_o->level = level;
588 }
589
590 /*******************************************************************
591 reads or writes a structure.
592 ********************************************************************/
593
594 BOOL reg_io_q_open_hku(char *desc,  REG_Q_OPEN_HKU *r_q, prs_struct *ps, int depth)
595 {
596         if (r_q == NULL)
597                 return False;
598
599         prs_debug(ps, depth, desc, "reg_io_q_open_hku");
600         depth++;
601
602         if(prs_align(ps))
603                 return False;
604         
605         if(!prs_uint32("ptr      ", ps, depth, &r_q->ptr))
606                 return False;
607         if (r_q->ptr != 0) {
608                 if(!prs_uint16("unknown_0", ps, depth, &r_q->unknown_0))
609                         return False;
610                 if(!prs_uint16("unknown_1", ps, depth, &r_q->unknown_1))
611                         return False;
612                 if(!prs_uint32("level    ", ps, depth, &r_q->level))
613                         return False;
614         }
615
616         return True;
617 }
618
619 /*******************************************************************
620 reads or writes a structure.
621 ********************************************************************/
622
623 BOOL reg_io_r_open_hku(char *desc,  REG_R_OPEN_HKU *r_r, prs_struct *ps, int depth)
624 {
625         if (r_r == NULL)
626                 return False;
627
628         prs_debug(ps, depth, desc, "reg_io_r_open_hku");
629         depth++;
630
631         if(prs_align(ps))
632                 return False;
633         
634         if(!smb_io_pol_hnd("", &r_r->pol, ps, depth))
635                 return False;
636
637         if(!prs_uint32("status", ps, depth, &r_r->status))
638                 return False;
639
640         return True;
641 }
642
643 /*******************************************************************
644  Inits an REG_Q_CLOSE structure.
645 ********************************************************************/
646
647 void init_reg_q_close(REG_Q_CLOSE *q_c, POLICY_HND *hnd)
648 {
649         DEBUG(5,("init_reg_q_close\n"));
650
651         memcpy(&q_c->pol, hnd, sizeof(q_c->pol));
652 }
653
654 /*******************************************************************
655 reads or writes a structure.
656 ********************************************************************/
657
658 BOOL reg_io_q_close(char *desc,  REG_Q_CLOSE *q_u, prs_struct *ps, int depth)
659 {
660         if (q_u == NULL)
661                 return False;
662
663         prs_debug(ps, depth, desc, "reg_io_q_unknown_1");
664         depth++;
665
666         if(prs_align(ps))
667                 return False;
668
669         if(!smb_io_pol_hnd("", &q_u->pol, ps, depth))
670                 return False;
671         if(prs_align(ps))
672                 return False;
673
674         return True;
675 }
676
677 /*******************************************************************
678 reads or writes a structure.
679 ********************************************************************/
680
681 BOOL reg_io_r_close(char *desc,  REG_R_CLOSE *r_u, prs_struct *ps, int depth)
682 {
683         if (r_u == NULL)
684                 return False;
685
686         prs_debug(ps, depth, desc, "reg_io_r_unknown_1");
687         depth++;
688
689         if(prs_align(ps))
690                 return False;
691
692         if(!smb_io_pol_hnd("", &r_u->pol, ps, depth))
693                 return False;
694         if(prs_align(ps))
695                 return False;
696
697         if(!prs_uint32("status", ps, depth, &r_u->status))
698                 return False;
699
700         return True;
701 }
702
703 /*******************************************************************
704 makes a structure.
705 ********************************************************************/
706
707 void init_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol, SEC_DESC_BUF *sec_desc_buf)
708 {
709         memcpy(&q_i->pol, pol, sizeof(q_i->pol));
710
711         q_i->sec_info = DACL_SECURITY_INFORMATION;
712
713         q_i->ptr = 1;
714         init_buf_hdr(&q_i->hdr_sec, sec_desc_buf->len, sec_desc_buf->len);
715         q_i->data = sec_desc_buf;
716 }
717
718 /*******************************************************************
719 reads or writes a structure.
720 ********************************************************************/
721
722 BOOL reg_io_q_set_key_sec(char *desc,  REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, int depth)
723 {
724         if (r_q == NULL)
725                 return False;
726
727         prs_debug(ps, depth, desc, "reg_io_q_set_key_sec");
728         depth++;
729
730         if(prs_align(ps))
731                 return False;
732         
733         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
734                 return False;
735
736         if(!prs_uint32("sec_info", ps, depth, &r_q->sec_info))
737                 return False;
738         if(!prs_uint32("ptr    ", ps, depth, &r_q->ptr))
739                 return False;
740
741         if(!reg_io_hdrbuf_sec(r_q->ptr, NULL, &r_q->hdr_sec, r_q->data, ps, depth))
742                 return False;
743
744         return True;
745 }
746
747 /*******************************************************************
748 reads or writes a structure.
749 ********************************************************************/
750
751 BOOL reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, int depth)
752 {
753         if (r_q == NULL)
754                 return False;
755
756         prs_debug(ps, depth, desc, "reg_io_r_set_key_sec");
757         depth++;
758
759         if(prs_align(ps))
760                 return False;
761         
762         if(!prs_uint32("status", ps, depth, &r_q->status))
763                 return False;
764
765         return True;
766 }
767
768
769 /*******************************************************************
770 makes a structure.
771 ********************************************************************/
772
773 void init_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol, 
774                                 uint32 sec_buf_size, SEC_DESC_BUF *psdb)
775 {
776         memcpy(&q_i->pol, pol, sizeof(q_i->pol));
777
778         q_i->sec_info = OWNER_SECURITY_INFORMATION |
779                         GROUP_SECURITY_INFORMATION |
780                         DACL_SECURITY_INFORMATION;
781
782         q_i->ptr = psdb != NULL ? 1 : 0;
783         q_i->data = psdb;
784
785         init_buf_hdr(&q_i->hdr_sec, sec_buf_size, 0);
786 }
787
788 /*******************************************************************
789 reads or writes a structure.
790 ********************************************************************/
791
792 BOOL reg_io_q_get_key_sec(char *desc,  REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, int depth)
793 {
794         if (r_q == NULL)
795                 return False;
796
797         prs_debug(ps, depth, desc, "reg_io_q_get_key_sec");
798         depth++;
799
800         if(prs_align(ps))
801                 return False;
802         
803         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
804                 return False;
805
806         if(!prs_uint32("sec_info", ps, depth, &r_q->sec_info))
807                 return False;
808         if(!prs_uint32("ptr     ", ps, depth, &r_q->ptr))
809                 return False;
810
811         if(!reg_io_hdrbuf_sec(r_q->ptr, NULL, &r_q->hdr_sec, r_q->data, ps, depth))
812                 return False;
813
814         return True;
815 }
816
817 #if 0
818 /*******************************************************************
819 makes a structure.
820 ********************************************************************/
821  void init_reg_r_get_key_sec(REG_R_GET_KEY_SEC *r_i, POLICY_HND *pol, 
822                                 uint32 buf_len, uint8 *buf,
823                                 uint32 status)
824 {
825         r_i->ptr = 1;
826         init_buf_hdr(&r_i->hdr_sec, buf_len, buf_len);
827         init_sec_desc_buf(r_i->data, buf_len, 1);
828
829         r_i->status = status; /* 0x0000 0000 or 0x0000 007a */
830 }
831 #endif 
832
833 /*******************************************************************
834 reads or writes a structure.
835 ********************************************************************/
836
837 BOOL reg_io_r_get_key_sec(char *desc,  REG_R_GET_KEY_SEC *r_q, prs_struct *ps, int depth)
838 {
839         if (r_q == NULL)
840                 return False;
841
842         prs_debug(ps, depth, desc, "reg_io_r_get_key_sec");
843         depth++;
844
845         if(prs_align(ps))
846                 return False;
847         
848         if(!prs_uint32("ptr      ", ps, depth, &r_q->ptr))
849                 return False;
850
851         if (r_q->ptr != 0) {
852                 if(!smb_io_hdrbuf("", &r_q->hdr_sec, ps, depth))
853                         return False;
854                 if(!sec_io_desc_buf("", &r_q->data, ps, depth))
855                         return False;
856                 if(prs_align(ps))
857                         return False;
858         }
859
860         if(!prs_uint32("status", ps, depth, &r_q->status))
861                 return False;
862
863         return True;
864 }
865
866 /*******************************************************************
867 makes a structure.
868 ********************************************************************/
869
870 void init_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char *product_type,
871                                 time_t unix_time, uint8 major, uint8 minor)
872 {
873         int len_type  = strlen(product_type);
874
875         memcpy(&q_i->pol, pol, sizeof(q_i->pol));
876
877         init_uni_hdr(&q_i->hdr_type, len_type);
878         init_unistr2(&q_i->uni_type, product_type, len_type);
879
880         q_i->ptr1 = 1;
881         unix_to_nt_time(&q_i->time, unix_time);
882         q_i->major_version1 = major;
883         q_i->minor_version1 = minor;
884         memset(q_i->pad1, 0, sizeof(q_i->pad1));
885
886         q_i->ptr2 = 1;
887         q_i->major_version2 = major;
888         q_i->minor_version2 = minor;
889         memset(q_i->pad2, 0, sizeof(q_i->pad2));
890
891         q_i->ptr3 = 1;
892         q_i->unknown = 0x00000000;
893 }
894
895 /*******************************************************************
896 reads or writes a structure.
897 ********************************************************************/
898
899 BOOL reg_io_q_info(char *desc,  REG_Q_INFO *r_q, prs_struct *ps, int depth)
900 {
901         if (r_q == NULL)
902                 return False;
903
904         prs_debug(ps, depth, desc, "reg_io_q_info");
905         depth++;
906
907         if(prs_align(ps))
908                 return False;
909         
910         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
911                 return False;
912         if(!smb_io_unihdr ("", &r_q->hdr_type, ps, depth))
913                 return False;
914         if(!smb_io_unistr2("", &r_q->uni_type, r_q->hdr_type.buffer, ps, depth))
915                 return False;
916
917         if(prs_align(ps))
918                 return False;
919         
920         if(!prs_uint32("ptr1", ps, depth, &r_q->ptr1))
921                 return False;
922
923         if (r_q->ptr1 != 0) {
924                 if(!smb_io_time("", &r_q->time, ps, depth))
925                         return False;
926                 if(!prs_uint8 ("major_version1", ps, depth, &r_q->major_version1))
927                         return False;
928                 if(!prs_uint8 ("minor_version1", ps, depth, &r_q->minor_version1))
929                         return False;
930                 if(!prs_uint8s(False, "pad1", ps, depth, r_q->pad1, sizeof(r_q->pad1)))
931                         return False;
932         }
933
934         if(!prs_uint32("ptr2", ps, depth, &r_q->ptr2))
935                 return False;
936
937         if (r_q->ptr2 != 0) {
938                 if(!prs_uint8 ("major_version2", ps, depth, &r_q->major_version2))
939                         return False;
940                 if(!prs_uint8 ("minor_version2", ps, depth, &r_q->minor_version2))
941                         return False;
942                 if(!prs_uint8s(False, "pad2", ps, depth, r_q->pad2, sizeof(r_q->pad2)))
943                         return False;
944         }
945
946         if(!prs_uint32("ptr3", ps, depth, &r_q->ptr3))
947                 return False;
948
949         if (r_q->ptr3 != 0) {
950                 if(!prs_uint32("unknown", ps, depth, &r_q->unknown))
951                         return False;
952         }
953
954         return True;
955 }
956
957 /*******************************************************************
958  Inits a structure.
959 ********************************************************************/
960
961 void init_reg_r_info(REG_R_INFO *r_r,
962                                 uint32 level, char *os_type,
963                                 uint32 unknown_0, uint32 unknown_1,
964                                 uint32 status)
965 {
966         uint8 buf[512];
967         int len = dos_struni2((char *)buf, os_type, sizeof(buf));
968
969         r_r->ptr1 = 1;
970         r_r->level = level;
971
972         r_r->ptr_type = 1;
973         init_buffer2(&r_r->uni_type, buf, len*2);
974
975         r_r->ptr2 = 1;
976         r_r->unknown_0 = unknown_0;
977
978         r_r->ptr3 = 1;
979         r_r->unknown_1 = unknown_1;
980
981         r_r->status = status;
982 }
983
984 /*******************************************************************
985 reads or writes a structure.
986 ********************************************************************/
987
988 BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth)
989 {
990         if (r_r == NULL)
991                 return False;
992
993         prs_debug(ps, depth, desc, "reg_io_r_info");
994         depth++;
995
996         if(prs_align(ps))
997                 return False;
998         
999         if(!prs_uint32("ptr1", ps, depth, &r_r->ptr1))
1000                 return False;
1001
1002         if (r_r->ptr1 != 0) {
1003                 if(!prs_uint32("level", ps, depth, &r_r->level))
1004                         return False;
1005                 if(!prs_uint32("ptr_type", ps, depth, &r_r->ptr_type))
1006                         return False;
1007
1008                 if(!smb_io_buffer2("uni_type", &r_r->uni_type, r_r->ptr_type, ps, depth))
1009                         return False;
1010                 if(prs_align(ps))
1011                         return False;
1012
1013                 if(!prs_uint32("ptr2", ps, depth, &r_r->ptr2))
1014                         return False;
1015
1016                 if (r_r->ptr2 != 0) {
1017                         if(!prs_uint32("unknown_0", ps, depth, &r_r->unknown_0))
1018                                 return False;
1019                 }
1020
1021                 if(!prs_uint32("ptr3", ps, depth, &r_r->ptr3))
1022                         return False;
1023
1024                 if (r_r->ptr3 != 0) {
1025                         if(!prs_uint32("unknown_1", ps, depth, &r_r->unknown_1))
1026                                 return False;
1027                 }
1028
1029         }
1030         if(!prs_uint32("status", ps, depth, &r_r->status))
1031                 return False;
1032
1033         return True;
1034 }
1035
1036 /*******************************************************************
1037 makes a structure.
1038 ********************************************************************/
1039
1040 void init_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol,
1041                                 uint32 val_idx, uint32 max_val_len,
1042                                 uint32 max_buf_len)
1043 {
1044         ZERO_STRUCTP(q_i);
1045
1046         memcpy(&q_i->pol, pol, sizeof(q_i->pol));
1047
1048         q_i->val_index = val_idx;
1049         init_uni_hdr(&q_i->hdr_name, max_val_len);
1050         q_i->uni_name.uni_max_len = max_val_len;
1051         
1052         q_i->ptr_type = 1;
1053         q_i->type = 0x0;
1054
1055         q_i->ptr_value = 1;
1056         q_i->buf_value.buf_max_len = max_buf_len;
1057
1058         q_i->ptr1 = 1;
1059         q_i->len_value1 = max_buf_len;
1060
1061         q_i->ptr2 = 1;
1062         q_i->len_value2 = 0;
1063 }
1064
1065 /*******************************************************************
1066 reads or writes a structure.
1067 ********************************************************************/
1068
1069 BOOL reg_io_q_enum_val(char *desc,  REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int depth)
1070 {
1071         if (q_q == NULL)
1072                 return False;
1073
1074         prs_debug(ps, depth, desc, "reg_io_q_enum_val");
1075         depth++;
1076
1077         if(prs_align(ps))
1078                 return False;
1079         
1080         if(!smb_io_pol_hnd("", &q_q->pol, ps, depth))
1081                 return False;
1082         
1083         if(!prs_uint32("val_index", ps, depth, &q_q->val_index))
1084                 return False;
1085         if(!smb_io_unihdr ("hdr_name", &q_q->hdr_name, ps, depth))
1086                 return False;
1087         if(!smb_io_unistr2("uni_name", &q_q->uni_name, q_q->hdr_name.buffer, ps, depth))
1088                 return False;
1089         if(prs_align(ps))
1090                 return False;
1091
1092         if(!prs_uint32("ptr_type", ps, depth, &q_q->ptr_type))
1093                 return False;
1094
1095         if (q_q->ptr_type != 0) {
1096                 if(!prs_uint32("type", ps, depth, &q_q->type))
1097                         return False;
1098         }
1099
1100         if(!prs_uint32("ptr_value", ps, depth, &q_q->ptr_value))
1101                 return False;
1102         if(!smb_io_buffer2("buf_value", &q_q->buf_value, q_q->ptr_value, ps, depth))
1103                 return False;
1104         if(prs_align(ps))
1105                 return False;
1106
1107         if(!prs_uint32("ptr1", ps, depth, &q_q->ptr1))
1108                 return False;
1109         if (q_q->ptr1 != 0) {
1110                 if(!prs_uint32("len_value1", ps, depth, &q_q->len_value1))
1111                         return False;
1112         }
1113         if(!prs_uint32("ptr2", ps, depth, &q_q->ptr2))
1114                 return False;
1115         if (q_q->ptr2 != 0) {
1116                 if(!prs_uint32("len_value2", ps, depth, &q_q->len_value2))
1117                         return False;
1118         }
1119
1120         return True;
1121 }
1122
1123 /*******************************************************************
1124 reads or writes a structure.
1125 ********************************************************************/
1126
1127 BOOL reg_io_r_enum_val(char *desc,  REG_R_ENUM_VALUE *r_q, prs_struct *ps, int depth)
1128 {
1129         if (r_q == NULL)
1130                 return False;
1131
1132         prs_debug(ps, depth, desc, "reg_io_r_enum_val");
1133         depth++;
1134
1135         if(prs_align(ps))
1136                 return False;
1137         
1138         if(!smb_io_unihdr ("hdr_name", &r_q->hdr_name, ps, depth))
1139                 return False;
1140         if(!smb_io_unistr2("uni_name", &r_q->uni_name, r_q->hdr_name.buffer, ps, depth))
1141                 return False;
1142         if(prs_align(ps))
1143                 return False;
1144
1145         if(!prs_uint32("ptr_type", ps, depth, &r_q->ptr_type))
1146                 return False;
1147
1148         if (r_q->ptr_type != 0) {
1149                 if(!prs_uint32("type", ps, depth, &r_q->type))
1150                         return False;
1151         }
1152
1153         if(!prs_uint32("ptr_value", ps, depth, &r_q->ptr_value))
1154                 return False;
1155         if(!smb_io_buffer2("buf_value", r_q->buf_value, r_q->ptr_value, ps, depth))
1156                 return False;
1157         if(prs_align(ps))
1158                 return False;
1159
1160         if(!prs_uint32("ptr1", ps, depth, &r_q->ptr1))
1161                 return False;
1162         if (r_q->ptr1 != 0) {
1163                 if(!prs_uint32("len_value1", ps, depth, &r_q->len_value1))
1164                         return False;
1165         }
1166
1167         if(!prs_uint32("ptr2", ps, depth, &r_q->ptr2))
1168                 return False;
1169         if (r_q->ptr2 != 0) {
1170                 if(!prs_uint32("len_value2", ps, depth, &r_q->len_value2))
1171                         return False;
1172         }
1173
1174         if(!prs_uint32("status", ps, depth, &r_q->status))
1175                 return False;
1176
1177         return True;
1178 }
1179
1180 /*******************************************************************
1181 makes a structure.
1182 ********************************************************************/
1183
1184 void init_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol,
1185                                 char *val_name, uint32 type,
1186                                 BUFFER3 *val)
1187 {
1188         int val_len = strlen(val_name) + 1;
1189
1190         ZERO_STRUCTP(q_i);
1191
1192         memcpy(&q_i->pol, pol, sizeof(q_i->pol));
1193
1194         init_uni_hdr(&q_i->hdr_name, val_len);
1195         init_unistr2(&q_i->uni_name, val_name, val_len);
1196         
1197         q_i->type      = type;
1198         q_i->buf_value = val;
1199 }
1200
1201 /*******************************************************************
1202 reads or writes a structure.
1203 ********************************************************************/
1204
1205 BOOL reg_io_q_create_val(char *desc,  REG_Q_CREATE_VALUE *q_q, prs_struct *ps, int depth)
1206 {
1207         if (q_q == NULL)
1208                 return False;
1209
1210         prs_debug(ps, depth, desc, "reg_io_q_create_val");
1211         depth++;
1212
1213         if(prs_align(ps))
1214                 return False;
1215         
1216         if(!smb_io_pol_hnd("", &q_q->pol, ps, depth))
1217                 return False;
1218         
1219         if(!smb_io_unihdr ("hdr_name", &q_q->hdr_name, ps, depth))
1220                 return False;
1221         if(!smb_io_unistr2("uni_name", &q_q->uni_name, q_q->hdr_name.buffer, ps, depth))
1222                 return False;
1223         if(prs_align(ps))
1224                 return False;
1225
1226         if(!prs_uint32("type", ps, depth, &q_q->type))
1227                 return False;
1228         if(!smb_io_buffer3("buf_value", q_q->buf_value, ps, depth))
1229                 return False;
1230         if(prs_align(ps))
1231                 return False;
1232
1233         return True;
1234 }
1235
1236 /*******************************************************************
1237 reads or writes a structure.
1238 ********************************************************************/
1239
1240 BOOL reg_io_r_create_val(char *desc,  REG_R_CREATE_VALUE *r_q, prs_struct *ps, int depth)
1241 {
1242         if (r_q == NULL)
1243                 return False;
1244
1245         prs_debug(ps, depth, desc, "reg_io_r_create_val");
1246         depth++;
1247
1248         if(prs_align(ps))
1249                 return False;
1250         
1251         if(!prs_uint32("status", ps, depth, &r_q->status))
1252                 return False;
1253
1254         return True;
1255 }
1256
1257 /*******************************************************************
1258 makes a structure.
1259 ********************************************************************/
1260
1261 void init_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx)
1262 {
1263         memcpy(&q_i->pol, pol, sizeof(q_i->pol));
1264
1265         q_i->key_index = key_idx;
1266         q_i->key_name_len = 0;
1267         q_i->unknown_1 = 0x0414;
1268
1269         q_i->ptr1 = 1;
1270         q_i->unknown_2 = 0x0000020A;
1271         memset(q_i->pad1, 0, sizeof(q_i->pad1));
1272
1273         q_i->ptr2 = 1;
1274         memset(q_i->pad2, 0, sizeof(q_i->pad2));
1275
1276         q_i->ptr3 = 1;
1277         unix_to_nt_time(&q_i->time, 0);            /* current time? */
1278 }
1279
1280 /*******************************************************************
1281 reads or writes a structure.
1282 ********************************************************************/
1283
1284 BOOL reg_io_q_enum_key(char *desc,  REG_Q_ENUM_KEY *q_q, prs_struct *ps, int depth)
1285 {
1286         if (q_q == NULL)
1287                 return False;
1288
1289         prs_debug(ps, depth, desc, "reg_io_q_enum_key");
1290         depth++;
1291
1292         if(prs_align(ps))
1293                 return False;
1294         
1295         if(!smb_io_pol_hnd("", &q_q->pol, ps, depth))
1296                 return False;
1297         
1298         if(!prs_uint32("key_index", ps, depth, &q_q->key_index))
1299                 return False;
1300         if(!prs_uint16("key_name_len", ps, depth, &q_q->key_name_len))
1301                 return False;
1302         if(!prs_uint16("unknown_1", ps, depth, &q_q->unknown_1))
1303                 return False;
1304
1305         if(!prs_uint32("ptr1", ps, depth, &q_q->ptr1))
1306                 return False;
1307
1308         if (q_q->ptr1 != 0) {
1309                 if(!prs_uint32("unknown_2", ps, depth, &q_q->unknown_2))
1310                         return False;
1311                 if(!prs_uint8s(False, "pad1", ps, depth, q_q->pad1, sizeof(q_q->pad1)))
1312                         return False;
1313         }
1314
1315         if(!prs_uint32("ptr2", ps, depth, &q_q->ptr2))
1316                 return False;
1317
1318         if (q_q->ptr2 != 0) {
1319                 if(!prs_uint8s(False, "pad2", ps, depth, q_q->pad2, sizeof(q_q->pad2)))
1320                         return False;
1321         }
1322
1323         if(!prs_uint32("ptr3", ps, depth, &q_q->ptr3))
1324                 return False;
1325
1326         if (q_q->ptr3 != 0) {
1327                 if(!smb_io_time("", &q_q->time, ps, depth))
1328                         return False;
1329         }
1330
1331         return True;
1332 }
1333
1334 /*******************************************************************
1335 reads or writes a structure.
1336 ********************************************************************/
1337
1338 BOOL reg_io_r_enum_key(char *desc,  REG_R_ENUM_KEY *r_q, prs_struct *ps, int depth)
1339 {
1340         if (r_q == NULL)
1341                 return False;
1342
1343         prs_debug(ps, depth, desc, "reg_io_r_enum_key");
1344         depth++;
1345
1346         if(prs_align(ps))
1347                 return False;
1348         
1349         if(!prs_uint16("key_name_len", ps, depth, &r_q->key_name_len))
1350                 return False;
1351         if(!prs_uint16("unknown_1", ps, depth, &r_q->unknown_1))
1352                 return False;
1353
1354         if(!prs_uint32("ptr1", ps, depth, &r_q->ptr1))
1355                 return False;
1356
1357         if (r_q->ptr1 != 0) {
1358                 if(!prs_uint32("unknown_2", ps, depth, &r_q->unknown_2))
1359                         return False;
1360                 if(!prs_uint32("unknown_3", ps, depth, &r_q->unknown_3))
1361                         return False;
1362                 if(!smb_io_unistr3("key_name", &r_q->key_name, ps, depth))
1363                         return False;
1364                 if(prs_align(ps))
1365                         return False;
1366         }
1367
1368         if(!prs_uint32("ptr2", ps, depth, &r_q->ptr2))
1369                 return False;
1370
1371         if (r_q->ptr2 != 0) {
1372                 if(!prs_uint8s(False, "pad2", ps, depth, r_q->pad2, sizeof(r_q->pad2)))
1373                         return False;
1374         }
1375
1376         if(!prs_uint32("ptr3", ps, depth, &r_q->ptr3))
1377                 return False;
1378
1379         if (r_q->ptr3 != 0) {
1380                 if(!smb_io_time("", &r_q->time, ps, depth))
1381                         return False;
1382         }
1383
1384         if(!prs_uint32("status", ps, depth, &r_q->status))
1385                 return False;
1386
1387         return True;
1388 }
1389
1390 /*******************************************************************
1391 makes a structure.
1392 ********************************************************************/
1393
1394 void init_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol,
1395                                 char *key_name, uint32 unk)
1396 {
1397         int len_name = strlen(key_name)+1;
1398
1399         memcpy(&r_q->pol, pol, sizeof(r_q->pol));
1400
1401         init_uni_hdr(&r_q->hdr_name, len_name);
1402         init_unistr2(&r_q->uni_name, key_name, len_name);
1403
1404         r_q->unknown_0 = 0x00000000;
1405         r_q->unknown_1 = unk;
1406 }
1407
1408 /*******************************************************************
1409 reads or writes a structure.
1410 ********************************************************************/
1411
1412 BOOL reg_io_q_open_entry(char *desc,  REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth)
1413 {
1414         if (r_q == NULL)
1415                 return False;
1416
1417         prs_debug(ps, depth, desc, "reg_io_q_entry");
1418         depth++;
1419
1420         if(prs_align(ps))
1421                 return False;
1422         
1423         if(!smb_io_pol_hnd("", &r_q->pol, ps, depth))
1424                 return False;
1425         if(!smb_io_unihdr ("", &r_q->hdr_name, ps, depth))
1426                 return False;
1427         if(!smb_io_unistr2("", &r_q->uni_name, r_q->hdr_name.buffer, ps, depth))
1428                 return False;
1429
1430         if(prs_align(ps))
1431                 return False;
1432         
1433         if(!prs_uint32("unknown_0", ps, depth, &r_q->unknown_0))
1434                 return False;
1435         if(!prs_uint32("unknown_1", ps, depth, &r_q->unknown_1))
1436                 return False;
1437
1438         return True;
1439 }
1440
1441 /*******************************************************************
1442  Inits a structure.
1443 ********************************************************************/
1444
1445 void init_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r,
1446                                 POLICY_HND *pol, uint32 status)
1447 {
1448         memcpy(&r_r->pol, pol, sizeof(r_r->pol));
1449         r_r->status = status;
1450 }
1451
1452 /*******************************************************************
1453 reads or writes a structure.
1454 ********************************************************************/
1455
1456 BOOL reg_io_r_open_entry(char *desc,  REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth)
1457 {
1458         if (r_r == NULL)
1459                 return False;
1460
1461         prs_debug(ps, depth, desc, "reg_io_r_open_entry");
1462         depth++;
1463
1464         if(prs_align(ps))
1465                 return False;
1466         
1467         if(!smb_io_pol_hnd("", &r_r->pol, ps, depth))
1468                 return False;
1469
1470         if(!prs_uint32("status", ps, depth, &r_r->status))
1471                 return False;
1472
1473         return True;
1474 }