LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_preg.c (source / functions) Hit Total Coverage
Test: coverage report for vadcx-master-patch-75612 fe003de8 Lines: 99 164 60.4 %
Date: 2024-02-29 22:57:05 Functions: 4 10 40.0 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_preg.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_misc.h"
       7        6948 : _PUBLIC_ enum ndr_err_code ndr_push_preg_entry(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct preg_entry *r)
       8             : {
       9             :         {
      10        6948 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
      11        6948 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      12        6948 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      13        6948 :                 if (ndr_flags & NDR_SCALARS) {
      14        6948 :                         NDR_CHECK(ndr_push_align(ndr, 8));
      15        6948 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "[", 2, sizeof(uint8_t), CH_DOS));
      16             :                         {
      17        6948 :                                 libndr_flags _flags_save_string = ndr->flags;
      18        6948 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      19        6948 :                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->keyname));
      20        6948 :                                 ndr->flags = _flags_save_string;
      21             :                         }
      22        6948 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      23             :                         {
      24        6948 :                                 libndr_flags _flags_save_string = ndr->flags;
      25        6948 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      26        6948 :                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->valuename));
      27        6948 :                                 ndr->flags = _flags_save_string;
      28             :                         }
      29        6948 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      30        6948 :                         NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type));
      31        6948 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      32        6948 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags)));
      33        6948 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      34             :                         {
      35        6948 :                                 libndr_flags _flags_save_winreg_Data_GPO = ndr->flags;
      36        6948 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
      37             :                                 {
      38           0 :                                         struct ndr_push *_ndr_data;
      39        6948 :                                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_data, 0, ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags)));
      40        6948 :                                         NDR_CHECK(ndr_push_set_switch_value(_ndr_data, &r->data, r->type));
      41        6948 :                                         NDR_CHECK(ndr_push_winreg_Data_GPO(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->data));
      42        6948 :                                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_data, 0, ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags)));
      43             :                                 }
      44        6948 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
      45             :                         }
      46        6948 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "]", 2, sizeof(uint8_t), CH_DOS));
      47        6948 :                         NDR_CHECK(ndr_push_trailer_align(ndr, 8));
      48             :                 }
      49        6948 :                 if (ndr_flags & NDR_BUFFERS) {
      50             :                         {
      51           0 :                                 libndr_flags _flags_save_winreg_Data_GPO = ndr->flags;
      52           0 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
      53           0 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
      54             :                         }
      55             :                 }
      56        6948 :                 ndr->flags = _flags_save_STRUCT;
      57             :         }
      58        6948 :         return NDR_ERR_SUCCESS;
      59             : }
      60             : 
      61       30022 : _PUBLIC_ enum ndr_err_code ndr_pull_preg_entry(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct preg_entry *r)
      62             : {
      63       30022 :         uint32_t size__opening_bracket_0 = 0;
      64       30022 :         uint32_t size__sep1_0 = 0;
      65       30022 :         uint32_t size__sep2_0 = 0;
      66       30022 :         uint32_t size__sep3_0 = 0;
      67       30022 :         uint32_t size__sep4_0 = 0;
      68       30022 :         uint32_t size__closing_bracket_0 = 0;
      69             :         {
      70       30022 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
      71       30022 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      72       30022 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      73       30022 :                 if (ndr_flags & NDR_SCALARS) {
      74       30022 :                         NDR_CHECK(ndr_pull_align(ndr, 8));
      75       30022 :                         size__opening_bracket_0 = 2;
      76       30022 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_opening_bracket, size__opening_bracket_0, sizeof(uint8_t), CH_DOS));
      77             :                         {
      78       30022 :                                 libndr_flags _flags_save_string = ndr->flags;
      79       30022 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      80       30022 :                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->keyname));
      81       30022 :                                 ndr->flags = _flags_save_string;
      82             :                         }
      83       30022 :                         size__sep1_0 = 2;
      84       30022 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep1, size__sep1_0, sizeof(uint8_t), CH_DOS));
      85             :                         {
      86       30022 :                                 libndr_flags _flags_save_string = ndr->flags;
      87       30022 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      88       30022 :                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->valuename));
      89       30022 :                                 ndr->flags = _flags_save_string;
      90             :                         }
      91       30022 :                         size__sep2_0 = 2;
      92       30022 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep2, size__sep2_0, sizeof(uint8_t), CH_DOS));
      93       30022 :                         NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type));
      94       30022 :                         size__sep3_0 = 2;
      95       30022 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep3, size__sep3_0, sizeof(uint8_t), CH_DOS));
      96       30022 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
      97       30022 :                         size__sep4_0 = 2;
      98       30022 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep4, size__sep4_0, sizeof(uint8_t), CH_DOS));
      99             :                         {
     100       30022 :                                 libndr_flags _flags_save_winreg_Data_GPO = ndr->flags;
     101       30022 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     102             :                                 {
     103           0 :                                         struct ndr_pull *_ndr_data;
     104       30022 :                                         ssize_t sub_size = r->size;
     105       30022 :                                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 0, sub_size));
     106       30022 :                                         NDR_CHECK(ndr_pull_set_switch_value(_ndr_data, &r->data, r->type));
     107       30022 :                                         NDR_CHECK(ndr_pull_winreg_Data_GPO(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->data));
     108       30022 :                                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 0, sub_size));
     109             :                                 }
     110       30022 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
     111             :                         }
     112       30022 :                         size__closing_bracket_0 = 2;
     113       30022 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_closing_bracket, size__closing_bracket_0, sizeof(uint8_t), CH_DOS));
     114       30022 :                         NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     115             :                 }
     116       30022 :                 if (ndr_flags & NDR_BUFFERS) {
     117             :                         {
     118           0 :                                 libndr_flags _flags_save_winreg_Data_GPO = ndr->flags;
     119           0 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     120           0 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
     121             :                         }
     122             :                 }
     123       30022 :                 ndr->flags = _flags_save_STRUCT;
     124             :         }
     125       30022 :         return NDR_ERR_SUCCESS;
     126             : }
     127             : 
     128           0 : static void ndr_print_flags_preg_entry(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct preg_entry *r)
     129             : {
     130           0 :         ndr_print_preg_entry(ndr, name, r);
     131           0 : }
     132             : 
     133           0 : _PUBLIC_ void ndr_print_preg_entry(struct ndr_print *ndr, const char *name, const struct preg_entry *r)
     134             : {
     135           0 :         ndr_print_struct(ndr, name, "preg_entry");
     136           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     137             :         {
     138           0 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     139           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
     140           0 :                 ndr->depth++;
     141             :                 {
     142           0 :                         libndr_flags _flags_save_string = ndr->flags;
     143           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     144           0 :                         ndr_print_string(ndr, "keyname", r->keyname);
     145           0 :                         ndr->flags = _flags_save_string;
     146             :                 }
     147             :                 {
     148           0 :                         libndr_flags _flags_save_string = ndr->flags;
     149           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     150           0 :                         ndr_print_string(ndr, "valuename", r->valuename);
     151           0 :                         ndr->flags = _flags_save_string;
     152             :                 }
     153           0 :                 ndr_print_winreg_Type(ndr, "type", r->type);
     154           0 :                 ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags):r->size);
     155             :                 {
     156           0 :                         libndr_flags _flags_save_winreg_Data_GPO = ndr->flags;
     157           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     158           0 :                         ndr_print_set_switch_value(ndr, &r->data, r->type);
     159           0 :                         ndr_print_winreg_Data_GPO(ndr, "data", &r->data);
     160           0 :                         ndr->flags = _flags_save_winreg_Data_GPO;
     161             :                 }
     162           0 :                 ndr->depth--;
     163           0 :                 ndr->flags = _flags_save_STRUCT;
     164             :         }
     165             : }
     166             : 
     167         204 : _PUBLIC_ enum ndr_err_code ndr_push_preg_header(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct preg_header *r)
     168             : {
     169         204 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     170         204 :         if (ndr_flags & NDR_SCALARS) {
     171         204 :                 NDR_CHECK(ndr_push_align(ndr, 4));
     172         204 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "PReg", 4, sizeof(uint8_t), CH_DOS));
     173         204 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
     174         204 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     175             :         }
     176         204 :         if (ndr_flags & NDR_BUFFERS) {
     177           0 :         }
     178         204 :         return NDR_ERR_SUCCESS;
     179             : }
     180             : 
     181        2124 : _PUBLIC_ enum ndr_err_code ndr_pull_preg_header(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct preg_header *r)
     182             : {
     183        2124 :         uint32_t size_signature_0 = 0;
     184        2124 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     185        2124 :         if (ndr_flags & NDR_SCALARS) {
     186        2124 :                 NDR_CHECK(ndr_pull_align(ndr, 4));
     187        2124 :                 size_signature_0 = 4;
     188        2124 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->signature, size_signature_0, sizeof(uint8_t), CH_DOS));
     189        2124 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
     190        2124 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     191             :         }
     192        2124 :         if (ndr_flags & NDR_BUFFERS) {
     193           0 :         }
     194        2124 :         return NDR_ERR_SUCCESS;
     195             : }
     196             : 
     197           0 : static void ndr_print_flags_preg_header(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct preg_header *r)
     198             : {
     199           0 :         ndr_print_preg_header(ndr, name, r);
     200           0 : }
     201             : 
     202           0 : _PUBLIC_ void ndr_print_preg_header(struct ndr_print *ndr, const char *name, const struct preg_header *r)
     203             : {
     204           0 :         ndr_print_struct(ndr, name, "preg_header");
     205           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     206           0 :         ndr->depth++;
     207           0 :         ndr_print_string(ndr, "signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"PReg":r->signature);
     208           0 :         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
     209           0 :         ndr->depth--;
     210             : }
     211             : 
     212           0 : static void ndr_print_flags_preg_file(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct preg_file *r)
     213             : {
     214           0 :         ndr_print_preg_file(ndr, name, r);
     215           0 : }
     216             : 
     217           0 : _PUBLIC_ void ndr_print_preg_file(struct ndr_print *ndr, const char *name, const struct preg_file *r)
     218             : {
     219           0 :         uint32_t cntr_entries_0;
     220           0 :         ndr_print_struct(ndr, name, "preg_file");
     221           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     222             :         {
     223           0 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     224           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
     225           0 :                 ndr->depth++;
     226           0 :                 ndr_print_preg_header(ndr, "header", &r->header);
     227           0 :                 ndr_print_uint32(ndr, "num_entries", r->num_entries);
     228           0 :                 ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "entries", (uint32_t)(r->num_entries));
     229           0 :                 ndr->depth++;
     230           0 :                 for (cntr_entries_0 = 0; cntr_entries_0 < (r->num_entries); cntr_entries_0++) {
     231           0 :                         ndr_print_preg_entry(ndr, "entries", &r->entries[cntr_entries_0]);
     232             :                 }
     233           0 :                 ndr->depth--;
     234           0 :                 ndr->depth--;
     235           0 :                 ndr->flags = _flags_save_STRUCT;
     236             :         }
     237             : }
     238             : 
     239             : #ifndef SKIP_NDR_TABLE_preg
     240             : static const struct ndr_interface_public_struct preg_public_structs[] = {
     241             :         {
     242             :                 .name = "preg_entry",
     243             :                 .struct_size = sizeof(struct preg_entry ),
     244             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_preg_entry,
     245             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_preg_entry,
     246             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_preg_entry,
     247             :         },
     248             :         {
     249             :                 .name = "preg_header",
     250             :                 .struct_size = sizeof(struct preg_header ),
     251             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_preg_header,
     252             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_preg_header,
     253             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_preg_header,
     254             :         },
     255             :         {
     256             :                 .name = "preg_file",
     257             :                 .struct_size = sizeof(struct preg_file ),
     258             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_preg_file,
     259             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_preg_file,
     260             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_preg_file,
     261             :         },
     262             :         { .name = NULL }
     263             : };
     264             : 
     265             : static const struct ndr_interface_call preg_calls[] = {
     266             :         { .name = NULL }
     267             : };
     268             : 
     269             : static const char * const preg_endpoint_strings[] = {
     270             :         "ncacn_np:[\\pipe\\preg]", 
     271             : };
     272             : 
     273             : static const struct ndr_interface_string_array preg_endpoints = {
     274             :         .count  = 1,
     275             :         .names  = preg_endpoint_strings
     276             : };
     277             : 
     278             : static const char * const preg_authservice_strings[] = {
     279             :         "host", 
     280             : };
     281             : 
     282             : static const struct ndr_interface_string_array preg_authservices = {
     283             :         .count  = 1,
     284             :         .names  = preg_authservice_strings
     285             : };
     286             : 
     287             : 
     288             : const struct ndr_interface_table ndr_table_preg = {
     289             :         .name           = "preg",
     290             :         .syntax_id      = {
     291             :                 {0x67655250,0x0000,0x0000,{0x00,0x00},{0x00,0x00,0x00,0x00}},
     292             :                 NDR_PREG_VERSION
     293             :         },
     294             :         .helpstring     = NDR_PREG_HELPSTRING,
     295             :         .num_calls      = 0,
     296             :         .calls          = preg_calls,
     297             :         .num_public_structs     = 3,
     298             :         .public_structs         = preg_public_structs,
     299             :         .endpoints      = &preg_endpoints,
     300             :         .authservices   = &preg_authservices
     301             : };
     302             : 
     303             : #endif /* SKIP_NDR_TABLE_preg */

Generated by: LCOV version 1.14